1 -- Created on: 1998-07-22
2 -- Created by: Philippe MANGIN
3 -- Copyright (c) 1998-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 class PipeShell from BRepFill inherits TShared from MMgt
25 ---Purpose: Perform general sweeping construction
31 ListOfShape from TopTools,
32 HArray2OfShape from TopTools,
36 TransitionStyle from BRepFill,
37 Trihedron from GeomFill,
38 PipeError from GeomFill,
39 LocationLaw from BRepFill,
40 SectionLaw from BRepFill,
41 Section from BRepFill,
43 DataMapOfShapeListOfShape from TopTools,
44 SequenceOfSection from BRepFill
48 DomainError from Standard,
52 Create( Spine : Wire from TopoDS)
54 returns PipeShell from BRepFill;
56 -- =================================
58 -- =================================
59 ---Purpose: Set an sweep's mode
60 -- If no mode are setted, the mode use in MakePipe is used
61 ---See Also: GeomFill_IsCorrectedFrenet
63 Set(me : mutable; Frenet : Boolean = Standard_False);
64 ---Purpose: Set an Frenet or an CorrectedFrenet trihedron
65 -- to perform the sweeping
67 ---See Also:GeomFill_IsCorrectedFrenet
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 : Boolean = Standard_False );
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 -- =================================
110 -- Methodes to define section(s)
111 -- =================================
112 ---Purpose: Give section to sweep.
113 -- Possibilities are :
114 -- - Give one or sevral profile
115 -- - Give one profile and an homotetic law.
116 -- - Automatic compute of correspondance beetween profile, and section
117 -- on the sweeped shape
118 -- - correspondance beetween profile, and section on the sweeped shape
119 -- defined by a vertex of the spine
121 -- -"WithCorrection" The profile is rotated to have a Normal --
122 -- parallel to the trihedron's normal and have tangent
123 -- perpendicular to the trihedron's tangent.
127 Profile : Shape from TopoDS;
128 WithContact : Boolean = Standard_False;
129 WithCorrection : Boolean = Standard_False );
130 ---Purpose: Set an section. The corespondance with the spine, will
131 -- be automaticaly performed.
135 Profile : Shape from TopoDS;
136 Location : Vertex from TopoDS;
137 WithContact : Boolean = Standard_False;
138 WithCorrection : Boolean = Standard_False)
139 ---Purpose: Set an section. The corespondance with the spine, is
140 -- given by <Location>
143 raises DomainError; -- if the <Spine> do not contain <Location>
146 Profile : Shape from TopoDS;
147 L : Function from Law;
148 WithContact : Boolean = Standard_False;
149 WithCorrection : Boolean = Standard_False);
150 ---Purpose: Set an section and an homotetic law.
151 -- The homotetie's centers is given by point on the <Spine>.
156 Profile : Shape from TopoDS;
157 L : Function from Law;
158 Location : Vertex from TopoDS;
159 WithContact : Boolean = Standard_False;
160 WithCorrection : Boolean = Standard_False);
161 ---Purpose: Set an section and an homotetic law.
162 -- The homotetie center is given by point on the <Spine>
166 Delete(me : mutable; Profile : Shape from TopoDS);
167 ---Purpose: Delete an section.
171 -- ========================================
172 -- Methodes to perform and read shape
173 -- ========================================
175 ---Purpose: Say if <me> is ready to build the shape
176 -- return False if <me> do not have section definition
180 ---Purpose: Get a status, when Simulate or Build failed.
181 returns PipeError from GeomFill;
183 SetTolerance(me : mutable;
184 Tol3d : Real = 1.0e-4;
185 BoundTol : Real = 1.0e-4;
186 TolAngular : Real = 1.0e-2);
188 SetTransition(me : mutable;
189 Mode :TransitionStyle from BRepFill
191 Angmin : Real = 1.0e-2;
193 ---Purpose: Set the Transition Mode to manage discontinuities
198 Simulate(me : mutable;
199 NumberOfSection : Integer;
200 Sections : out ListOfShape from TopTools)
201 ---Purpose: Perform simulation of the sweep :
202 -- Somes Section are returned.
204 raises NotDone; -- If <me> it is not Ready
208 ---Purpose: Builds the resulting shape (redefined from MakeShape).
211 raises NotDone -- If <me> it is not Ready
214 MakeSolid(me : mutable)
215 ---Purpose: Transform the sweeping Shell in Solid.
216 -- If the section are not closed returns False
219 raises NotDone; -- If <me> is not Builded;
222 ---Purpose: Returns the result Shape.
223 ---C++: return const &
225 returns Shape from TopoDS
229 ---Purpose: Returns the TopoDS Shape of the bottom of the sweep.
230 ---C++: return const &
232 returns Shape from TopoDS
236 ---Purpose: Returns the TopoDS Shape of the top of the sweep.
237 ---C++: return const &
239 returns Shape from TopoDS
242 Generated (me: mutable;
243 S : Shape from TopoDS;
244 L : out ListOfShape from TopTools)
245 ---Purpose: Returns the list of shapes generated from the
250 Prepare(me: mutable) is private;
253 Sec : Section from BRepFill;
254 W : out Wire from TopoDS;
255 Trsf : out Trsf from gp;
256 param : out Real from Standard) is private;
258 ResetLoc(me : mutable) is private;
260 BuildHistory(me: mutable; theSweep: Sweep from BRepFill)
264 mySpine : Wire from TopoDS;
265 myFirst : Shape from TopoDS;
266 myLast : Shape from TopoDS;
267 myShape : Shape from TopoDS;
268 mySeq : SequenceOfSection from BRepFill;
270 myGenMap : DataMapOfShapeListOfShape from TopTools;
275 angmin, angmax : Real;
277 myLaw : Function from Law;
278 myLocation : LocationLaw from BRepFill;
279 mySection : SectionLaw from BRepFill;
280 myFaces : HArray2OfShape from TopTools;
281 myTrihedron : Trihedron from GeomFill;
282 myTransition : TransitionStyle from BRepFill;
283 myStatus : PipeError from GeomFill;