Integration of OCCT 6.5.0 from SVN
[occt.git] / src / IntWalk / IntWalk_IWalking_6.gxx
CommitLineData
7fd59977 1//-- File IntWalk_IWalking_6.gxx
2
3#ifndef DEB
4#define No_Standard_RangeError
5#define No_Standard_OutOfRange
6#endif
7
8
9void IntWalk_IWalking::AddPointInCurrentLine
10 (const Standard_Integer N,
11 const ThePointOfPath& PathPnt,
12 const Handle(IntWalk_TheIWLine)& CurrentLine) const {
13
14
15 IntSurf_PntOn2S Psol;
16 Psol.SetValue(ThePointOfPathTool::Value3d(PathPnt),
17 reversed,ustart1(N),vstart1(N));
18 CurrentLine->AddPoint(Psol);
19}
20
21
22void IntWalk_IWalking::MakeWalkingPoint
23 (const Standard_Integer Case,
24 const Standard_Real U,
25 const Standard_Real V,
26 TheIWFunction& sp,
27 IntSurf_PntOn2S& Psol )
28
29{
30
31// Case == 1 : make a WalkinkPoint.
32// Case == 2 : make a WalkinkPoint.
33// The computation of the tangency on is done
34// Case == 10 + i : make a WalkinkPoint according to i.
35// but F is updated according to U and V
36// Case == other : the exception Standard_Failure is raised.
37
38 if (Case == 1)
39 Psol.SetValue(sp.Point(),reversed, U, V);
40 else if (Case == 2) {
41#ifdef DEB
42 Standard_Boolean foo = sp.IsTangent();
43#endif
44 Psol.SetValue(sp.Point(),reversed, U, V);
45 }
46 else if (Case == 11 || Case == 12 ) {
47 static math_Vector UV(1, 2);
48 static math_Vector FF(1, 1);
49 static math_Matrix DD(1, 1, 1, 2);
50 UV(1) = U;
51 UV(2) = V;
52 sp.Values(UV, FF, DD);
53 MakeWalkingPoint(Case - 10, U, V, sp, Psol);
54 }
55 else {
56 Standard_ConstructionError::Raise();
57 }
58
59
60}
61
62
63
64void IntWalk_IWalking::OpenLine(const Standard_Integer N,
65 const IntSurf_PntOn2S& Psol,
66 const ThePOPIterator& Pnts1,
67 TheIWFunction& sp,
68 const Handle(IntWalk_TheIWLine)& Line )
69// **************** ouverture de la ligne et repartir dans l autre sens********
70
71{
72 ThePointOfPath PathPnt;
73
74 static math_Vector UV(1, 2);
75 static math_Vector FF(1, 1);
76 static math_Matrix DD(1, 1, 1, 2);
77
78 previousPoint = Line->Value(1);
79 if (!reversed) {
80 previousPoint.ParametersOnS2(UV(1),UV(2));
81 }
82 else {
83 previousPoint.ParametersOnS1(UV(1),UV(2));
84 }
85 sp.Values(UV, FF, DD);
86 previousd3d = sp.Direction3d();
87 previousd2d = sp.Direction2d();
88
89 if (N>0) { //point de depart donne en entree
90 PathPnt = Pnts1.Value(N);
91 //marque la ligne comme ouverte avec point d arret donne
92 Line->AddStatusFirst(Standard_False,Standard_True,N,PathPnt);
93
94
95 AddPointInCurrentLine(N,PathPnt,Line);
96
97 }
98 else {
99 if (N <0) Line->AddPoint(Psol);
100 Line->AddStatusFirst(Standard_False,Standard_False);
101 //marque la ligne comme ouverte sans point d arret donne
102 }
103 Line->Reverse(); //inverser la ligne
104 Line->SetTangentVector(previousd3d.Reversed(),Line->NbPoints());
105}
106
107
108
109
110
111
112
113