1 -- Created on: 1998-07-22
2 -- Created by: Philippe MANGIN
3 -- Copyright (c) 1998-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class PipeShell from BRepFill inherits TShared from MMgt
19 ---Purpose: Perform general sweeping construction
25 ListOfShape from TopTools,
26 HArray2OfShape from TopTools,
30 TransitionStyle from BRepFill,
31 Trihedron from GeomFill,
32 PipeError from GeomFill,
33 LocationLaw from BRepFill,
34 SectionLaw from BRepFill,
35 Section from BRepFill,
37 DataMapOfShapeListOfShape from TopTools,
38 SequenceOfSection from BRepFill,
39 TypeOfContact from BRepFill
42 DomainError from Standard,
46 Create( Spine : Wire from TopoDS)
48 returns PipeShell from BRepFill;
50 -- =================================
52 -- =================================
53 ---Purpose: Set an sweep's mode
54 -- If no mode are setted, the mode use in MakePipe is used
55 ---See Also: GeomFill_IsCorrectedFrenet
57 Set(me : mutable; Frenet : Boolean = Standard_False);
58 ---Purpose: Set an Frenet or an CorrectedFrenet trihedron
59 -- to perform the sweeping
61 ---See Also:GeomFill_IsCorrectedFrenet
63 SetDiscrete(me : mutable);
64 ---Purpose: Set a Discrete trihedron
65 -- to perform the sweeping
67 ---See Also:GeomFill_IsDiscreteTrihedron
69 Set(me : mutable; Axe : Ax2 from gp);
70 ---Purpose: Set an fixed trihedron to perform the sweeping
71 -- all sections will be parallel.
73 ---See Also: GeomFill_IsFixed
75 Set(me : mutable; BiNormal : Dir from gp);
76 ---Purpose: Set an fixed BiNormal direction to perform
79 ---See Also: GeomFill_IsConstantNormal
81 Set(me : mutable; SpineSupport : Shape from TopoDS)
82 ---Purpose: Set support to the spine to define the BiNormal
83 -- at the spine, like the normal the surfaces.
84 -- Warning: To be effective, Each edge of the <spine> must
85 -- have an representaion on one face of<SpineSupport>
87 ---See Also: GeomFill_IsDarboux
91 AuxiliarySpine : Wire from TopoDS;
92 CurvilinearEquivalence : Boolean = Standard_True;
93 KeepContact : TypeOfContact from BRepFill = BRepFill_NoContact );
95 ---Purpose: Set an auxiliary spine to define the Normal
96 -- For each Point of the Spine P, an Point Q is evalued
97 -- on <AuxiliarySpine>
98 -- If <CurvilinearEquivalence>
99 -- Q split <AuxiliarySpine> with the same length ratio
100 -- than P split <Spline>.
101 -- Else the plan define by P and the tangent to the <Spine>
102 -- intersect <AuxiliarySpine> in Q.
103 -- If <KeepContact> the Normal is defined to assume like the sweeped
104 -- section is in contact to the <AuxiliarySpine>
105 -- Else the Normal is defined by the vector PQ.
109 SetForceApproxC1(me : mutable;
110 ForceApproxC1 : Boolean from Standard);
111 ---Purpose: Set the flag that indicates attempt to approximate
112 -- a C1-continuous surface if a swept surface proved
116 -- =================================
117 -- Methodes to define section(s)
118 -- =================================
119 ---Purpose: Give section to sweep.
120 -- Possibilities are :
121 -- - Give one or sevral profile
122 -- - Give one profile and an homotetic law.
123 -- - Automatic compute of correspondance beetween profile, and section
124 -- on the sweeped shape
125 -- - correspondance beetween profile, and section on the sweeped shape
126 -- defined by a vertex of the spine
128 -- -"WithCorrection" The profile is rotated to have a Normal --
129 -- parallel to the trihedron's normal and have tangent
130 -- perpendicular to the trihedron's tangent.
134 Profile : Shape from TopoDS;
135 WithContact : Boolean = Standard_False;
136 WithCorrection : Boolean = Standard_False );
137 ---Purpose: Set an section. The corespondance with the spine, will
138 -- be automaticaly performed.
142 Profile : Shape from TopoDS;
143 Location : Vertex from TopoDS;
144 WithContact : Boolean = Standard_False;
145 WithCorrection : Boolean = Standard_False)
146 ---Purpose: Set an section. The corespondance with the spine, is
147 -- given by <Location>
150 raises DomainError; -- if the <Spine> do not contain <Location>
153 Profile : Shape from TopoDS;
154 L : Function from Law;
155 WithContact : Boolean = Standard_False;
156 WithCorrection : Boolean = Standard_False);
157 ---Purpose: Set an section and an homotetic law.
158 -- The homotetie's centers is given by point on the <Spine>.
163 Profile : Shape from TopoDS;
164 L : Function from Law;
165 Location : Vertex from TopoDS;
166 WithContact : Boolean = Standard_False;
167 WithCorrection : Boolean = Standard_False);
168 ---Purpose: Set an section and an homotetic law.
169 -- The homotetie center is given by point on the <Spine>
173 Delete(me : mutable; Profile : Shape from TopoDS);
174 ---Purpose: Delete an section.
178 -- ========================================
179 -- Methodes to perform and read shape
180 -- ========================================
182 ---Purpose: Say if <me> is ready to build the shape
183 -- return False if <me> do not have section definition
187 ---Purpose: Get a status, when Simulate or Build failed.
188 returns PipeError from GeomFill;
190 SetTolerance(me : mutable;
191 Tol3d : Real = 1.0e-4;
192 BoundTol : Real = 1.0e-4;
193 TolAngular : Real = 1.0e-2);
195 SetTransition(me : mutable;
196 Mode :TransitionStyle from BRepFill
198 Angmin : Real = 1.0e-2;
200 ---Purpose: Set the Transition Mode to manage discontinuities
205 Simulate(me : mutable;
206 NumberOfSection : Integer;
207 Sections : out ListOfShape from TopTools)
208 ---Purpose: Perform simulation of the sweep :
209 -- Somes Section are returned.
211 raises NotDone; -- If <me> it is not Ready
215 ---Purpose: Builds the resulting shape (redefined from MakeShape).
218 raises NotDone -- If <me> it is not Ready
221 MakeSolid(me : mutable)
222 ---Purpose: Transform the sweeping Shell in Solid.
223 -- If the section are not closed returns False
226 raises NotDone; -- If <me> is not Builded;
229 ---Purpose: Returns the result Shape.
230 ---C++: return const &
232 returns Shape from TopoDS
236 ---Purpose: Returns the TopoDS Shape of the bottom of the sweep.
237 ---C++: return const &
239 returns Shape from TopoDS
243 ---Purpose: Returns the TopoDS Shape of the top of the sweep.
244 ---C++: return const &
246 returns Shape from TopoDS
249 Generated (me: mutable;
250 S : Shape from TopoDS;
251 L : out ListOfShape from TopTools)
252 ---Purpose: Returns the list of shapes generated from the
257 Prepare(me: mutable) is private;
260 Sec : Section from BRepFill;
261 W : out Wire from TopoDS;
262 Trsf : out Trsf from gp;
263 param : out Real from Standard) is private;
265 ResetLoc(me : mutable) is private;
267 BuildHistory(me: mutable; theSweep: Sweep from BRepFill)
271 mySpine : Wire from TopoDS;
272 myFirst : Shape from TopoDS;
273 myLast : Shape from TopoDS;
274 myShape : Shape from TopoDS;
275 mySeq : SequenceOfSection from BRepFill;
277 myGenMap : DataMapOfShapeListOfShape from TopTools;
282 angmin, angmax : Real;
283 myForceApproxC1 : Boolean;
285 myLaw : Function from Law;
286 myIsAutomaticLaw : Boolean from Standard;
287 myLocation : LocationLaw from BRepFill;
288 mySection : SectionLaw from BRepFill;
289 myFaces : HArray2OfShape from TopTools;
290 myTrihedron : Trihedron from GeomFill;
291 myTransition : TransitionStyle from BRepFill;
292 myStatus : PipeError from GeomFill;