1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2012 OPEN CASCADE SAS
4 // The content of this file is subject to the Open CASCADE Technology Public
5 // License Version 6.5 (the "License"). You may not use the content of this file
6 // except in compliance with the License. Please obtain a copy of the License
7 // at http://www.opencascade.org and read it completely before using this file.
9 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 // The Original Code and all software distributed under the License is
13 // distributed on an "AS IS" basis, without warranty of any kind, and the
14 // Initial Developer hereby disclaims all such warranties, including without
15 // limitation, any warranties of merchantability, fitness for a particular
16 // purpose or non-infringement. Please see the License for the specific terms
17 // and conditions governing the rights and limitations under the License.
21 #define No_Standard_RangeError
22 #define No_Standard_OutOfRange
26 void IntWalk_IWalking::AddPointInCurrentLine
27 (const Standard_Integer N,
28 const ThePointOfPath& PathPnt,
29 const Handle(IntWalk_TheIWLine)& CurrentLine) const {
33 Psol.SetValue(ThePointOfPathTool::Value3d(PathPnt),
34 reversed,ustart1(N),vstart1(N));
35 CurrentLine->AddPoint(Psol);
39 void IntWalk_IWalking::MakeWalkingPoint
40 (const Standard_Integer Case,
41 const Standard_Real U,
42 const Standard_Real V,
44 IntSurf_PntOn2S& Psol )
48 // Case == 1 : make a WalkinkPoint.
49 // Case == 2 : make a WalkinkPoint.
50 // The computation of the tangency on is done
51 // Case == 10 + i : make a WalkinkPoint according to i.
52 // but F is updated according to U and V
53 // Case == other : the exception Standard_Failure is raised.
56 Psol.SetValue(sp.Point(),reversed, U, V);
58 Psol.SetValue(sp.Point(),reversed, U, V);
60 else if (Case == 11 || Case == 12 ) {
61 static math_Vector UV(1, 2);
62 static math_Vector FF(1, 1);
63 static math_Matrix DD(1, 1, 1, 2);
66 sp.Values(UV, FF, DD);
67 MakeWalkingPoint(Case - 10, U, V, sp, Psol);
70 Standard_ConstructionError::Raise();
78 void IntWalk_IWalking::OpenLine(const Standard_Integer N,
79 const IntSurf_PntOn2S& Psol,
80 const ThePOPIterator& Pnts1,
82 const Handle(IntWalk_TheIWLine)& Line )
83 // **************** ouverture de la ligne et repartir dans l autre sens********
86 ThePointOfPath PathPnt;
88 static math_Vector UV(1, 2);
89 static math_Vector FF(1, 1);
90 static math_Matrix DD(1, 1, 1, 2);
92 previousPoint = Line->Value(1);
94 previousPoint.ParametersOnS2(UV(1),UV(2));
97 previousPoint.ParametersOnS1(UV(1),UV(2));
99 sp.Values(UV, FF, DD);
100 previousd3d = sp.Direction3d();
101 previousd2d = sp.Direction2d();
103 if (N>0) { //point de depart donne en entree
104 PathPnt = Pnts1.Value(N);
105 //marque la ligne comme ouverte avec point d arret donne
106 Line->AddStatusFirst(Standard_False,Standard_True,N,PathPnt);
109 AddPointInCurrentLine(N,PathPnt,Line);
113 if (N <0) Line->AddPoint(Psol);
114 Line->AddStatusFirst(Standard_False,Standard_False);
115 //marque la ligne comme ouverte sans point d arret donne
117 Line->Reverse(); //inverser la ligne
118 Line->SetTangentVector(previousd3d.Reversed(),Line->NbPoints());