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 Standard_Boolean IntWalk_PWalking::IsDone() const {
0019   return done; 
0020 }
0021 
0022 inline Standard_Integer IntWalk_PWalking::NbPoints() const {
0023   if(!done) throw StdFail_NotDone();
0024   return line->NbPoints();
0025 }
0026 
0027 inline const IntSurf_PntOn2S& IntWalk_PWalking::Value
0028   (const Standard_Integer Index) const
0029 {
0030   if (!done) throw StdFail_NotDone();
0031   return line->Value(Index);
0032 }
0033 
0034 
0035 inline const Handle(IntSurf_LineOn2S)& IntWalk_PWalking::Line () const {
0036 
0037   if (!done) throw StdFail_NotDone();
0038   return line;
0039 }
0040 
0041 
0042 inline Standard_Boolean IntWalk_PWalking::TangentAtFirst() const{ 
0043   if(!done) throw StdFail_NotDone();
0044   return tgfirst;
0045 }
0046 
0047 inline Standard_Boolean IntWalk_PWalking::TangentAtLast() const{ 
0048   if(!done) throw StdFail_NotDone();
0049   return tglast;
0050 }
0051 
0052 inline Standard_Boolean IntWalk_PWalking::IsClosed() const{ 
0053   if(!done) throw StdFail_NotDone();
0054   return close;
0055 }
0056 
0057 inline const gp_Dir& IntWalk_PWalking::TangentAtLine(Standard_Integer& theIndex) const
0058 {
0059   if(!done) throw StdFail_NotDone();
0060   theIndex = myTangentIdx;
0061   return tgdir;
0062 }
0063 
0064 #define REGLAGE 0
0065 
0066 inline void IntWalk_PWalking::AddAPoint(const IntSurf_PntOn2S& POn2S) { 
0067 #if REGLAGE
0068   Standard_Integer n=line->NbPoints()+1;
0069   if (n == 1)
0070   {
0071     std::cout << "Dump of WL" << std::endl;
0072   }
0073 
0074   if(n) { 
0075     Standard_Real u1,v1,u2,v2;
0076     POn2S.Parameters(u1,v1,u2,v2);
0077     printf("point p%d  %+10.20f %+10.20f %+10.20f\n",
0078            n, POn2S.Value().X(), POn2S.Value().Y(), POn2S.Value().Z());
0079     fflush(stdout);
0080   }
0081 #endif
0082   line->Add(POn2S);
0083   myTangentIdx = Max(myTangentIdx, 1);
0084 }
0085 
0086