0026595: Lost some comments in OCCT-code after cdl elimination
[occt.git] / src / IntPatch / IntPatch_TheIWalking.hxx
1 // Created on: 1992-05-06
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _IntPatch_TheIWalking_HeaderFile
18 #define _IntPatch_TheIWalking_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Boolean.hxx>
25 #include <IntSurf_SequenceOfPathPoint.hxx>
26 #include <Standard_Real.hxx>
27 #include <math_Vector.hxx>
28 #include <IntWalk_VectorOfWalkingData.hxx>
29 #include <IntWalk_VectorOfInteger.hxx>
30 #include <IntSurf_PntOn2S.hxx>
31 #include <gp_Vec.hxx>
32 #include <gp_Dir2d.hxx>
33 #include <TColStd_SequenceOfInteger.hxx>
34 #include <IntPatch_SequenceOfIWLineOfTheIWalking.hxx>
35 #include <IntSurf_SequenceOfInteriorPoint.hxx>
36 #include <Standard_Integer.hxx>
37 #include <TColStd_SequenceOfReal.hxx>
38 #include <IntWalk_StatusDeflection.hxx>
39 class StdFail_NotDone;
40 class Standard_OutOfRange;
41 class IntSurf_PathPoint;
42 class IntSurf_PathPointTool;
43 class IntSurf_InteriorPoint;
44 class IntSurf_InteriorPointTool;
45 class Adaptor3d_HSurface;
46 class Adaptor3d_HSurfaceTool;
47 class IntPatch_TheSurfFunction;
48 class IntPatch_TheIWLineOfTheIWalking;
49 class IntPatch_SequenceOfIWLineOfTheIWalking;
50 class IntPatch_SequenceNodeOfSequenceOfIWLineOfTheIWalking;
51 class IntSurf_PntOn2S;
52
53
54
55 class IntPatch_TheIWalking 
56 {
57 public:
58
59   DEFINE_STANDARD_ALLOC
60
61   
62   //! Deflection is the maximum deflection admitted between two
63   //! consecutive points on a resulting polyline.
64   //! Step is the maximum increment admitted between two
65   //! consecutive points (in 2d space).
66   //! Epsilon is the tolerance beyond which 2 points
67   //! are confused.
68   Standard_EXPORT IntPatch_TheIWalking(const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step);
69   
70   //! Deflection is the maximum deflection admitted between two
71   //! consecutive points on a resulting polyline.
72   //! Step is the maximum increment admitted between two
73   //! consecutive points (in 2d space).
74   //! Epsilon is the tolerance beyond which 2 points
75   //! are confused
76     void SetTolerance (const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step);
77   
78   //! Searches a set of polylines starting on a point of Pnts1
79   //! or Pnts2.
80   //! Each point on a resulting polyline verifies F(u,v)=0
81   Standard_EXPORT void Perform (const IntSurf_SequenceOfPathPoint& Pnts1, const IntSurf_SequenceOfInteriorPoint& Pnts2, IntPatch_TheSurfFunction& Func, const Handle(Adaptor3d_HSurface)& S, const Standard_Boolean Reversed = Standard_False);
82   
83   //! Searches a set of polylines starting on a point of Pnts1.
84   //! Each point on a resulting polyline verifies F(u,v)=0
85   Standard_EXPORT void Perform (const IntSurf_SequenceOfPathPoint& Pnts1, IntPatch_TheSurfFunction& Func, const Handle(Adaptor3d_HSurface)& S, const Standard_Boolean Reversed = Standard_False);
86   
87   //! Returns true if the calculus was successful.
88     Standard_Boolean IsDone() const;
89   
90   //! Returns the number of resulting polylines.
91   //! An exception is raised if IsDone returns False.
92     Standard_Integer NbLines() const;
93   
94   //! Returns the polyline of range Index.
95   //! An exception is raised if IsDone is False.
96   //! An exception is raised if Index<=0 or Index>NbLines.
97     const Handle(IntPatch_TheIWLineOfTheIWalking)& Value (const Standard_Integer Index) const;
98   
99   //! Returns the number of points belonging to Pnts on which no
100   //! line starts or ends.
101   //! An exception is raised if IsDone returns False.
102     Standard_Integer NbSinglePnts() const;
103   
104   //! Returns the point of range Index .
105   //! An exception is raised if IsDone returns False.
106   //! An exception is raised if Index<=0 or
107   //! Index > NbSinglePnts.
108     const IntSurf_PathPoint& SinglePnt (const Standard_Integer Index) const;
109
110
111
112
113 protected:
114
115   
116   Standard_EXPORT Standard_Boolean Cadrage (math_Vector& BornInf, math_Vector& BornSup, math_Vector& UVap, Standard_Real& Step, const Standard_Integer StepSign) const;
117   
118   Standard_EXPORT Standard_Boolean TestArretPassage (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, IntPatch_TheSurfFunction& Section, math_Vector& UV, Standard_Integer& Irang);
119   
120   Standard_EXPORT Standard_Boolean TestArretPassage (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const math_Vector& UV, const Standard_Integer Index, Standard_Integer& Irang);
121   
122   Standard_EXPORT Standard_Boolean TestArretAjout (IntPatch_TheSurfFunction& Section, math_Vector& UV, Standard_Integer& Irang, IntSurf_PntOn2S& PSol);
123   
124   Standard_EXPORT void TestArretCadre (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const Handle(IntPatch_TheIWLineOfTheIWalking)& Line, IntPatch_TheSurfFunction& Section, math_Vector& UV, Standard_Integer& Irang);
125   
126   Standard_EXPORT IntWalk_StatusDeflection TestDeflection (IntPatch_TheSurfFunction& Section, const Standard_Boolean Finished, const math_Vector& UV, const IntWalk_StatusDeflection StatusPrecedent, Standard_Integer& NbDivision, Standard_Real& Step, const Standard_Integer StepSign);
127   
128   Standard_EXPORT void ComputeOpenLine (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const IntSurf_SequenceOfPathPoint& Pnts1, IntPatch_TheSurfFunction& Section, Standard_Boolean& Rajout);
129   
130   Standard_EXPORT void OpenLine (const Standard_Integer N, const IntSurf_PntOn2S& Psol, const IntSurf_SequenceOfPathPoint& Pnts1, IntPatch_TheSurfFunction& Section, const Handle(IntPatch_TheIWLineOfTheIWalking)& Line);
131   
132   Standard_EXPORT void ComputeCloseLine (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const IntSurf_SequenceOfPathPoint& Pnts1, const IntSurf_SequenceOfInteriorPoint& Pnts2, IntPatch_TheSurfFunction& Section, Standard_Boolean& Rajout);
133   
134   Standard_EXPORT void AddPointInCurrentLine (const Standard_Integer N, const IntSurf_PathPoint& PathPnt, const Handle(IntPatch_TheIWLineOfTheIWalking)& CurrentLine) const;
135   
136   Standard_EXPORT void MakeWalkingPoint (const Standard_Integer Case, const Standard_Real U, const Standard_Real V, IntPatch_TheSurfFunction& Section, IntSurf_PntOn2S& Psol);
137   
138   //! Clears up internal containers
139   Standard_EXPORT void Clear();
140
141
142
143
144 private:
145
146
147
148   Standard_Boolean done;
149   IntSurf_SequenceOfPathPoint seqSingle;
150   Standard_Real fleche;
151   Standard_Real pas;
152   math_Vector tolerance;
153   Standard_Real epsilon;
154   Standard_Boolean reversed;
155   IntWalk_VectorOfWalkingData wd1;
156   IntWalk_VectorOfWalkingData wd2;
157   IntWalk_VectorOfInteger nbMultiplicities;
158   Standard_Real Um;
159   Standard_Real UM;
160   Standard_Real Vm;
161   Standard_Real VM;
162   IntSurf_PntOn2S previousPoint;
163   gp_Vec previousd3d;
164   gp_Dir2d previousd2d;
165   TColStd_SequenceOfInteger seqAjout;
166   IntPatch_SequenceOfIWLineOfTheIWalking lines;
167
168
169 };
170
171 #define ThePointOfPath IntSurf_PathPoint
172 #define ThePointOfPath_hxx <IntSurf_PathPoint.hxx>
173 #define ThePointOfPathTool IntSurf_PathPointTool
174 #define ThePointOfPathTool_hxx <IntSurf_PathPointTool.hxx>
175 #define ThePOPIterator IntSurf_SequenceOfPathPoint
176 #define ThePOPIterator_hxx <IntSurf_SequenceOfPathPoint.hxx>
177 #define ThePointOfLoop IntSurf_InteriorPoint
178 #define ThePointOfLoop_hxx <IntSurf_InteriorPoint.hxx>
179 #define ThePointOfLoopTool IntSurf_InteriorPointTool
180 #define ThePointOfLoopTool_hxx <IntSurf_InteriorPointTool.hxx>
181 #define ThePOLIterator IntSurf_SequenceOfInteriorPoint
182 #define ThePOLIterator_hxx <IntSurf_SequenceOfInteriorPoint.hxx>
183 #define ThePSurface Handle(Adaptor3d_HSurface)
184 #define ThePSurface_hxx <Adaptor3d_HSurface.hxx>
185 #define ThePSurfaceTool Adaptor3d_HSurfaceTool
186 #define ThePSurfaceTool_hxx <Adaptor3d_HSurfaceTool.hxx>
187 #define TheIWFunction IntPatch_TheSurfFunction
188 #define TheIWFunction_hxx <IntPatch_TheSurfFunction.hxx>
189 #define IntWalk_TheIWLine IntPatch_TheIWLineOfTheIWalking
190 #define IntWalk_TheIWLine_hxx <IntPatch_TheIWLineOfTheIWalking.hxx>
191 #define IntWalk_SequenceOfIWLine IntPatch_SequenceOfIWLineOfTheIWalking
192 #define IntWalk_SequenceOfIWLine_hxx <IntPatch_SequenceOfIWLineOfTheIWalking.hxx>
193 #define IntWalk_SequenceNodeOfSequenceOfIWLine IntPatch_SequenceNodeOfSequenceOfIWLineOfTheIWalking
194 #define IntWalk_SequenceNodeOfSequenceOfIWLine_hxx <IntPatch_SequenceNodeOfSequenceOfIWLineOfTheIWalking.hxx>
195 #define IntWalk_SequenceNodeOfSequenceOfIWLine IntPatch_SequenceNodeOfSequenceOfIWLineOfTheIWalking
196 #define IntWalk_SequenceNodeOfSequenceOfIWLine_hxx <IntPatch_SequenceNodeOfSequenceOfIWLineOfTheIWalking.hxx>
197 #define Handle_IntWalk_TheIWLine Handle(IntPatch_TheIWLineOfTheIWalking)
198 #define Handle_IntWalk_SequenceNodeOfSequenceOfIWLine Handle(IntPatch_SequenceNodeOfSequenceOfIWLineOfTheIWalking)
199 #define Handle_IntWalk_SequenceNodeOfSequenceOfIWLine Handle(IntPatch_SequenceNodeOfSequenceOfIWLineOfTheIWalking)
200 #define IntWalk_IWalking IntPatch_TheIWalking
201 #define IntWalk_IWalking_hxx <IntPatch_TheIWalking.hxx>
202
203 #include <IntWalk_IWalking.lxx>
204
205 #undef ThePointOfPath
206 #undef ThePointOfPath_hxx
207 #undef ThePointOfPathTool
208 #undef ThePointOfPathTool_hxx
209 #undef ThePOPIterator
210 #undef ThePOPIterator_hxx
211 #undef ThePointOfLoop
212 #undef ThePointOfLoop_hxx
213 #undef ThePointOfLoopTool
214 #undef ThePointOfLoopTool_hxx
215 #undef ThePOLIterator
216 #undef ThePOLIterator_hxx
217 #undef ThePSurface
218 #undef ThePSurface_hxx
219 #undef ThePSurfaceTool
220 #undef ThePSurfaceTool_hxx
221 #undef TheIWFunction
222 #undef TheIWFunction_hxx
223 #undef IntWalk_TheIWLine
224 #undef IntWalk_TheIWLine_hxx
225 #undef IntWalk_SequenceOfIWLine
226 #undef IntWalk_SequenceOfIWLine_hxx
227 #undef IntWalk_SequenceNodeOfSequenceOfIWLine
228 #undef IntWalk_SequenceNodeOfSequenceOfIWLine_hxx
229 #undef IntWalk_SequenceNodeOfSequenceOfIWLine
230 #undef IntWalk_SequenceNodeOfSequenceOfIWLine_hxx
231 #undef Handle_IntWalk_TheIWLine
232 #undef Handle_IntWalk_SequenceNodeOfSequenceOfIWLine
233 #undef Handle_IntWalk_SequenceNodeOfSequenceOfIWLine
234 #undef IntWalk_IWalking
235 #undef IntWalk_IWalking_hxx
236
237
238
239
240 #endif // _IntPatch_TheIWalking_HeaderFile