42cf5bc1 |
1 | // Created on: 1993-12-06 |
2 | // Created by: Jacques GOUSSARD |
3 | // Copyright (c) 1993-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 _BRepBlend_Walking_HeaderFile |
18 | #define _BRepBlend_Walking_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Blend_Point.hxx> |
25 | #include <math_Vector.hxx> |
26 | #include <Blend_SequenceOfPoint.hxx> |
27 | #include <Standard_Boolean.hxx> |
28 | #include <Standard_Real.hxx> |
29 | #include <Standard_Integer.hxx> |
30 | #include <BRepBlend_SequenceOfPointOnRst.hxx> |
31 | #include <TopAbs_State.hxx> |
32 | #include <Blend_Status.hxx> |
33 | class BRepBlend_Line; |
34 | class Adaptor3d_HSurface; |
35 | class Adaptor3d_TopolTool; |
36 | class ChFiDS_HElSpine; |
37 | class StdFail_NotDone; |
38 | class Adaptor3d_HVertex; |
39 | class Adaptor2d_HCurve2d; |
40 | class Adaptor3d_HCurve; |
41 | class BRepBlend_HCurve2dTool; |
42 | class Adaptor3d_HSurfaceTool; |
43 | class BRepBlend_HCurveTool; |
44 | class BRepBlend_BlendTool; |
45 | class BRepBlend_PointOnRst; |
46 | class BRepBlend_Extremity; |
47 | class Blend_Point; |
48 | class Blend_Function; |
49 | class Blend_FuncInv; |
50 | class gp_Pnt; |
51 | class gp_Pnt2d; |
52 | class IntSurf_Transition; |
53 | |
54 | |
55 | |
56 | class BRepBlend_Walking |
57 | { |
58 | public: |
59 | |
60 | DEFINE_STANDARD_ALLOC |
61 | |
62 | |
63 | Standard_EXPORT BRepBlend_Walking(const Handle(Adaptor3d_HSurface)& Surf1, const Handle(Adaptor3d_HSurface)& Surf2, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_TopolTool)& Domain2, const Handle(ChFiDS_HElSpine)& HGuide); |
64 | |
36b9ff75 |
65 | //! To define different domains for control and clipping. |
42cf5bc1 |
66 | Standard_EXPORT void SetDomainsToRecadre (const Handle(Adaptor3d_TopolTool)& RecDomain1, const Handle(Adaptor3d_TopolTool)& RecDomain2); |
67 | |
36b9ff75 |
68 | //! To define singular points computed before walking. |
42cf5bc1 |
69 | Standard_EXPORT void AddSingularPoint (const Blend_Point& P); |
70 | |
71 | Standard_EXPORT void Perform (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False); |
72 | |
73 | Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, const Standard_Real Pdep, math_Vector& ParDep, const Standard_Real Tolesp, const Standard_Real TolGuide, TopAbs_State& Pos1, TopAbs_State& Pos2); |
74 | |
75 | Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& ParDep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, Standard_Real& Psol, math_Vector& ParSol); |
76 | |
77 | Standard_EXPORT Standard_Boolean Continu (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real P); |
78 | |
79 | Standard_EXPORT Standard_Boolean Continu (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real P, const Standard_Boolean OnS1); |
80 | |
81 | Standard_EXPORT Standard_Boolean Complete (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pmin); |
82 | |
83 | Standard_EXPORT void ClassificationOnS1 (const Standard_Boolean C); |
84 | |
85 | Standard_EXPORT void ClassificationOnS2 (const Standard_Boolean C); |
86 | |
87 | Standard_EXPORT void Check2d (const Standard_Boolean C); |
88 | |
89 | Standard_EXPORT void Check (const Standard_Boolean C); |
90 | |
91 | Standard_Boolean TwistOnS1() const; |
92 | |
93 | Standard_Boolean TwistOnS2() const; |
94 | |
95 | Standard_Boolean IsDone() const; |
96 | |
97 | const Handle(BRepBlend_Line)& Line() const; |
98 | |
99 | |
100 | |
101 | |
102 | protected: |
103 | |
104 | |
105 | |
106 | |
107 | |
108 | private: |
109 | |
110 | |
111 | Standard_EXPORT void InternalPerform (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Bound); |
112 | |
113 | Standard_EXPORT Standard_Boolean CorrectExtremityOnOneRst (const Standard_Integer IndexOfRst, const Standard_Real theU, const Standard_Real theV, const Standard_Real theParam, const gp_Pnt& thePntOnRst, Standard_Real& NewU, Standard_Real& NewV, gp_Pnt& NewPoint, Standard_Real& NewParam) const; |
114 | |
115 | Standard_EXPORT Standard_Integer ArcToRecadre (const Standard_Boolean OnFirst, const math_Vector& Sol, const Standard_Integer PrevIndex, gp_Pnt2d& lpt2d, gp_Pnt2d& pt2d, Standard_Real& ponarc); |
116 | |
117 | Standard_EXPORT Standard_Boolean Recadre (Blend_FuncInv& FInv, const Standard_Boolean OnFirst, const math_Vector& Sol, math_Vector& Solrst, Standard_Integer& Indexsol, Standard_Boolean& IsVtx, Handle(Adaptor3d_HVertex)& Vtx, const Standard_Real Extrap = 0.0); |
118 | |
119 | Standard_EXPORT void Transition (const Standard_Boolean OnFirst, const Handle(Adaptor2d_HCurve2d)& A, const Standard_Real Param, IntSurf_Transition& TLine, IntSurf_Transition& TArc); |
120 | |
121 | Standard_EXPORT void MakeExtremity (BRepBlend_Extremity& Extrem, const Standard_Boolean OnFirst, const Standard_Integer Index, const Standard_Real Param, const Standard_Boolean IsVtx, const Handle(Adaptor3d_HVertex)& Vtx); |
122 | |
123 | Standard_EXPORT void MakeSingularExtremity (BRepBlend_Extremity& Extrem, const Standard_Boolean OnFirst, const Handle(Adaptor3d_HVertex)& Vtx); |
124 | |
125 | Standard_EXPORT Blend_Status CheckDeflection (const Standard_Boolean OnFirst, const Blend_Point& CurPoint); |
126 | |
127 | Standard_EXPORT Blend_Status TestArret (Blend_Function& F, const Blend_Status State, const Standard_Boolean TestDeflection = Standard_True, const Standard_Boolean TestSolution = Standard_True, const Standard_Boolean TestLengthStep = Standard_False); |
128 | |
129 | |
130 | Blend_Point previousP; |
131 | Handle(BRepBlend_Line) line; |
132 | math_Vector sol; |
133 | Blend_SequenceOfPoint jalons; |
134 | Handle(Adaptor3d_HSurface) surf1; |
135 | Handle(Adaptor3d_HSurface) surf2; |
136 | Handle(Adaptor3d_TopolTool) domain1; |
137 | Handle(Adaptor3d_TopolTool) domain2; |
138 | Handle(Adaptor3d_TopolTool) recdomain1; |
139 | Handle(Adaptor3d_TopolTool) recdomain2; |
140 | Handle(ChFiDS_HElSpine) hguide; |
141 | Standard_Boolean ToCorrectOnRst1; |
142 | Standard_Boolean ToCorrectOnRst2; |
143 | Standard_Real CorrectedParam; |
144 | Standard_Real tolesp; |
145 | Standard_Real tolgui; |
146 | Standard_Real pasmax; |
147 | Standard_Real fleche; |
148 | Standard_Real param; |
149 | Standard_Real sens; |
150 | Standard_Boolean done; |
151 | Standard_Boolean rebrou; |
152 | Standard_Boolean iscomplete; |
153 | Standard_Boolean comptra; |
154 | Standard_Boolean clasonS1; |
155 | Standard_Boolean clasonS2; |
156 | Standard_Boolean check2d; |
157 | Standard_Boolean check; |
158 | Standard_Boolean twistflag1; |
159 | Standard_Boolean twistflag2; |
160 | |
161 | |
162 | }; |
163 | |
164 | #define TheVertex Handle(Adaptor3d_HVertex) |
165 | #define TheVertex_hxx <Adaptor3d_HVertex.hxx> |
166 | #define TheArc Handle(Adaptor2d_HCurve2d) |
167 | #define TheArc_hxx <Adaptor2d_HCurve2d.hxx> |
168 | #define TheSurface Handle(Adaptor3d_HSurface) |
169 | #define TheSurface_hxx <Adaptor3d_HSurface.hxx> |
170 | #define TheCurve Handle(Adaptor3d_HCurve) |
171 | #define TheCurve_hxx <Adaptor3d_HCurve.hxx> |
172 | #define TheVertexTool Standard_Integer |
173 | #define TheVertexTool_hxx <Standard_Integer.hxx> |
174 | #define TheArcTool BRepBlend_HCurve2dTool |
175 | #define TheArcTool_hxx <BRepBlend_HCurve2dTool.hxx> |
176 | #define TheSurfaceTool Adaptor3d_HSurfaceTool |
177 | #define TheSurfaceTool_hxx <Adaptor3d_HSurfaceTool.hxx> |
178 | #define TheCurveTool BRepBlend_HCurveTool |
179 | #define TheCurveTool_hxx <BRepBlend_HCurveTool.hxx> |
180 | #define Handle_TheTopolTool Handle(Adaptor3d_TopolTool) |
181 | #define TheTopolTool Adaptor3d_TopolTool |
182 | #define TheTopolTool_hxx <Adaptor3d_TopolTool.hxx> |
183 | #define TheBlendTool BRepBlend_BlendTool |
184 | #define TheBlendTool_hxx <BRepBlend_BlendTool.hxx> |
185 | #define ThePointOnRst BRepBlend_PointOnRst |
186 | #define ThePointOnRst_hxx <BRepBlend_PointOnRst.hxx> |
187 | #define TheSeqPointOnRst BRepBlend_SequenceOfPointOnRst |
188 | #define TheSeqPointOnRst_hxx <BRepBlend_SequenceOfPointOnRst.hxx> |
189 | #define TheExtremity BRepBlend_Extremity |
190 | #define TheExtremity_hxx <BRepBlend_Extremity.hxx> |
191 | #define Handle_TheLine Handle(BRepBlend_Line) |
192 | #define TheLine BRepBlend_Line |
193 | #define TheLine_hxx <BRepBlend_Line.hxx> |
194 | #define Blend_Walking BRepBlend_Walking |
195 | #define Blend_Walking_hxx <BRepBlend_Walking.hxx> |
196 | |
197 | #include <Blend_Walking.lxx> |
198 | |
199 | #undef TheVertex |
200 | #undef TheVertex_hxx |
201 | #undef TheArc |
202 | #undef TheArc_hxx |
203 | #undef TheSurface |
204 | #undef TheSurface_hxx |
205 | #undef TheCurve |
206 | #undef TheCurve_hxx |
207 | #undef TheVertexTool |
208 | #undef TheVertexTool_hxx |
209 | #undef TheArcTool |
210 | #undef TheArcTool_hxx |
211 | #undef TheSurfaceTool |
212 | #undef TheSurfaceTool_hxx |
213 | #undef TheCurveTool |
214 | #undef TheCurveTool_hxx |
215 | #undef Handle_TheTopolTool |
216 | #undef TheTopolTool |
217 | #undef TheTopolTool_hxx |
218 | #undef TheBlendTool |
219 | #undef TheBlendTool_hxx |
220 | #undef ThePointOnRst |
221 | #undef ThePointOnRst_hxx |
222 | #undef TheSeqPointOnRst |
223 | #undef TheSeqPointOnRst_hxx |
224 | #undef TheExtremity |
225 | #undef TheExtremity_hxx |
226 | #undef Handle_TheLine |
227 | #undef TheLine |
228 | #undef TheLine_hxx |
229 | #undef Blend_Walking |
230 | #undef Blend_Walking_hxx |
231 | |
232 | |
233 | |
234 | |
235 | #endif // _BRepBlend_Walking_HeaderFile |