Commit | Line | Data |
---|---|---|
b311480e | 1 | // Copyright (c) 1995-1999 Matra Datavision |
2 | // Copyright (c) 1999-2012 OPEN CASCADE SAS | |
3 | // | |
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. | |
8 | // | |
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. | |
11 | // | |
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. | |
18 | ||
7fd59977 | 19 | |
20 | #ifndef DEB | |
21 | #define No_Standard_RangeError | |
22 | #define No_Standard_OutOfRange | |
23 | #endif | |
24 | ||
25 | ||
26 | void IntWalk_IWalking::AddPointInCurrentLine | |
27 | (const Standard_Integer N, | |
28 | const ThePointOfPath& PathPnt, | |
29 | const Handle(IntWalk_TheIWLine)& CurrentLine) const { | |
30 | ||
31 | ||
32 | IntSurf_PntOn2S Psol; | |
33 | Psol.SetValue(ThePointOfPathTool::Value3d(PathPnt), | |
96a85238 | 34 | reversed,wd1[N].ustart,wd1[N].vstart); |
7fd59977 | 35 | CurrentLine->AddPoint(Psol); |
36 | } | |
37 | ||
38 | ||
39 | void IntWalk_IWalking::MakeWalkingPoint | |
40 | (const Standard_Integer Case, | |
41 | const Standard_Real U, | |
42 | const Standard_Real V, | |
43 | TheIWFunction& sp, | |
44 | IntSurf_PntOn2S& Psol ) | |
45 | ||
46 | { | |
47 | ||
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. | |
54 | ||
55 | if (Case == 1) | |
56 | Psol.SetValue(sp.Point(),reversed, U, V); | |
57 | else if (Case == 2) { | |
7fd59977 | 58 | Psol.SetValue(sp.Point(),reversed, U, V); |
59 | } | |
60 | else if (Case == 11 || Case == 12 ) { | |
1ef32e96 RL |
61 | Standard_Real aUV[2], aFF[1], aDD[1][2]; |
62 | math_Vector UV(aUV,1, 2); | |
63 | math_Vector FF(aFF,1, 1); | |
64 | math_Matrix DD(aDD,1, 1, 1, 2); | |
7fd59977 | 65 | UV(1) = U; |
66 | UV(2) = V; | |
67 | sp.Values(UV, FF, DD); | |
68 | MakeWalkingPoint(Case - 10, U, V, sp, Psol); | |
69 | } | |
70 | else { | |
71 | Standard_ConstructionError::Raise(); | |
72 | } | |
73 | ||
74 | ||
75 | } | |
76 | ||
77 | ||
78 | ||
79 | void IntWalk_IWalking::OpenLine(const Standard_Integer N, | |
80 | const IntSurf_PntOn2S& Psol, | |
81 | const ThePOPIterator& Pnts1, | |
82 | TheIWFunction& sp, | |
83 | const Handle(IntWalk_TheIWLine)& Line ) | |
b1c5c4e6 | 84 | // **************** open the line and restart in the other direction******** |
7fd59977 | 85 | |
86 | { | |
87 | ThePointOfPath PathPnt; | |
88 | ||
1ef32e96 RL |
89 | Standard_Real aUV[2], aFF[1], aDD[1][2]; |
90 | math_Vector UV(aUV,1, 2); | |
91 | math_Vector FF(aFF,1, 1); | |
92 | math_Matrix DD(aDD,1, 1, 1, 2); | |
7fd59977 | 93 | |
94 | previousPoint = Line->Value(1); | |
95 | if (!reversed) { | |
96 | previousPoint.ParametersOnS2(UV(1),UV(2)); | |
97 | } | |
98 | else { | |
99 | previousPoint.ParametersOnS1(UV(1),UV(2)); | |
100 | } | |
101 | sp.Values(UV, FF, DD); | |
102 | previousd3d = sp.Direction3d(); | |
103 | previousd2d = sp.Direction2d(); | |
104 | ||
b1c5c4e6 | 105 | if (N>0) { //departure point given at input |
7fd59977 | 106 | PathPnt = Pnts1.Value(N); |
b1c5c4e6 | 107 | //mark the line as open with a given stop point |
7fd59977 | 108 | Line->AddStatusFirst(Standard_False,Standard_True,N,PathPnt); |
109 | ||
110 | ||
111 | AddPointInCurrentLine(N,PathPnt,Line); | |
112 | ||
113 | } | |
114 | else { | |
115 | if (N <0) Line->AddPoint(Psol); | |
116 | Line->AddStatusFirst(Standard_False,Standard_False); | |
b1c5c4e6 | 117 | //mark the line as open without given stop point |
7fd59977 | 118 | } |
119 | Line->Reverse(); //inverser la ligne | |
120 | Line->SetTangentVector(previousd3d.Reversed(),Line->NbPoints()); | |
121 | } | |
122 | ||
123 | ||
124 | ||
125 | ||
126 | ||
127 | ||
128 | ||
129 |