Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/IntWalk_PWalking.lxx is written in an unsupported language. File is not indexed.

0001 // Copyright (c) 1995-1999 Matra Datavision
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #include <StdFail_NotDone.hxx>
0016 #include <IntSurf_LineOn2S.hxx>
0017 
0018 inline bool IntWalk_PWalking::IsDone() const
0019 {
0020   return done;
0021 }
0022 
0023 inline int IntWalk_PWalking::NbPoints() const
0024 {
0025   if (!done)
0026     throw StdFail_NotDone();
0027   return line->NbPoints();
0028 }
0029 
0030 inline const IntSurf_PntOn2S& IntWalk_PWalking::Value(const int Index) const
0031 {
0032   if (!done)
0033     throw StdFail_NotDone();
0034   return line->Value(Index);
0035 }
0036 
0037 inline const occ::handle<IntSurf_LineOn2S>& IntWalk_PWalking::Line() const
0038 {
0039 
0040   if (!done)
0041     throw StdFail_NotDone();
0042   return line;
0043 }
0044 
0045 inline bool IntWalk_PWalking::TangentAtFirst() const
0046 {
0047   if (!done)
0048     throw StdFail_NotDone();
0049   return tgfirst;
0050 }
0051 
0052 inline bool IntWalk_PWalking::TangentAtLast() const
0053 {
0054   if (!done)
0055     throw StdFail_NotDone();
0056   return tglast;
0057 }
0058 
0059 inline bool IntWalk_PWalking::IsClosed() const
0060 {
0061   if (!done)
0062     throw StdFail_NotDone();
0063   return close;
0064 }
0065 
0066 inline const gp_Dir& IntWalk_PWalking::TangentAtLine(int& theIndex) const
0067 {
0068   if (!done)
0069     throw StdFail_NotDone();
0070   theIndex = myTangentIdx;
0071   return tgdir;
0072 }
0073 
0074 #define REGLAGE 0
0075 
0076 inline void IntWalk_PWalking::AddAPoint(const IntSurf_PntOn2S& POn2S)
0077 {
0078 #if REGLAGE
0079   int n = line->NbPoints() + 1;
0080   if (n == 1)
0081   {
0082     std::cout << "Dump of WL" << std::endl;
0083   }
0084 
0085   if (n)
0086   {
0087     double u1, v1, u2, v2;
0088     POn2S.Parameters(u1, v1, u2, v2);
0089     printf("point p%d  %+10.20f %+10.20f %+10.20f\n",
0090            n,
0091            POn2S.Value().X(),
0092            POn2S.Value().Y(),
0093            POn2S.Value().Z());
0094     fflush(stdout);
0095   }
0096 #endif
0097   line->Add(POn2S);
0098   myTangentIdx = std::max(myTangentIdx, 1);
0099 }