1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
16 #define No_Standard_RangeError
17 #define No_Standard_OutOfRange
21 void IntWalk_IWalking::AddPointInCurrentLine
22 (const Standard_Integer N,
23 const ThePointOfPath& PathPnt,
24 const Handle(IntWalk_TheIWLine)& CurrentLine) const {
28 Psol.SetValue(ThePointOfPathTool::Value3d(PathPnt),
29 reversed,wd1[N].ustart,wd1[N].vstart);
30 CurrentLine->AddPoint(Psol);
34 void IntWalk_IWalking::MakeWalkingPoint
35 (const Standard_Integer Case,
36 const Standard_Real U,
37 const Standard_Real V,
39 IntSurf_PntOn2S& Psol )
43 // Case == 1 : make a WalkinkPoint.
44 // Case == 2 : make a WalkinkPoint.
45 // The computation of the tangency on is done
46 // Case == 10 + i : make a WalkinkPoint according to i.
47 // but F is updated according to U and V
48 // Case == other : the exception Standard_Failure is raised.
51 Psol.SetValue(sp.Point(),reversed, U, V);
53 Psol.SetValue(sp.Point(),reversed, U, V);
55 else if (Case == 11 || Case == 12 ) {
56 Standard_Real aUV[2], aFF[1], aDD[1][2];
57 math_Vector UV(aUV,1, 2);
58 math_Vector FF(aFF,1, 1);
59 math_Matrix DD(aDD,1, 1, 1, 2);
62 sp.Values(UV, FF, DD);
63 MakeWalkingPoint(Case - 10, U, V, sp, Psol);
66 Standard_ConstructionError::Raise();
74 void IntWalk_IWalking::OpenLine(const Standard_Integer N,
75 const IntSurf_PntOn2S& Psol,
76 const ThePOPIterator& Pnts1,
78 const Handle(IntWalk_TheIWLine)& Line )
79 // **************** open the line and restart in the other direction********
82 ThePointOfPath PathPnt;
84 Standard_Real aUV[2], aFF[1], aDD[1][2];
85 math_Vector UV(aUV,1, 2);
86 math_Vector FF(aFF,1, 1);
87 math_Matrix DD(aDD,1, 1, 1, 2);
89 previousPoint = Line->Value(1);
91 previousPoint.ParametersOnS2(UV(1),UV(2));
94 previousPoint.ParametersOnS1(UV(1),UV(2));
96 sp.Values(UV, FF, DD);
97 previousd3d = sp.Direction3d();
98 previousd2d = sp.Direction2d();
100 if (N>0) { //departure point given at input
101 PathPnt = Pnts1.Value(N);
102 //mark the line as open with a given stop point
103 Line->AddStatusFirst(Standard_False,Standard_True,N,PathPnt);
106 AddPointInCurrentLine(N,PathPnt,Line);
110 if (N <0) Line->AddPoint(Psol);
111 Line->AddStatusFirst(Standard_False,Standard_False);
112 //mark the line as open without given stop point
114 Line->Reverse(); //inverser la ligne
115 Line->SetTangentVector(previousd3d.Reversed(),Line->NbPoints());