6fd41847c29cd08268923610acec7c168476edc3
[occt.git] / src / BRepFill / BRepFill_PipeShell.cdl
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
5 --
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.
10 --
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.
13 --
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.
20
21
22
23 class PipeShell from BRepFill inherits  TShared from MMgt 
24
25         ---Purpose: Perform general sweeping construction
26 uses  
27  Dir  from  gp,
28  Ax2  from  gp,
29  Trsf from  gp,
30  Function from Law,  
31  ListOfShape  from  TopTools, 
32  HArray2OfShape   from  TopTools,
33  Shape from  TopoDS,
34  Wire  from  TopoDS,
35  Vertex  from  TopoDS, 
36  TransitionStyle  from BRepFill, 
37  Trihedron        from  GeomFill,   
38  PipeError        from  GeomFill,  
39  LocationLaw       from  BRepFill, 
40  SectionLaw        from  BRepFill,  
41  Section           from  BRepFill, 
42  Sweep             from BRepFill,
43  DataMapOfShapeListOfShape from TopTools,
44  SequenceOfSection from  BRepFill 
45
46
47 raises
48  DomainError from Standard, 
49  NotDone  from  StdFail
50
51 is    
52     Create( Spine   : Wire  from TopoDS)
53         ---Level: Public
54     returns PipeShell from BRepFill;
55
56 -- =================================
57 --  Methodes Set
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  
62
63     Set(me  :  mutable; Frenet  :  Boolean  =  Standard_False);
64         ---Purpose: Set an Frenet or an CorrectedFrenet trihedron  
65         --          to  perform  the  sweeping
66         ---Level:  Public   
67         ---See Also:GeomFill_IsCorrectedFrenet
68     
69     Set(me  :  mutable;  Axe  :  Ax2  from  gp); 
70         ---Purpose: Set  an  fixed  trihedron  to  perform  the  sweeping 
71          --         all sections will be parallel.
72         ---Level: Public       
73         ---See Also: GeomFill_IsFixed
74
75     Set(me  :  mutable;  BiNormal  :  Dir  from  gp); 
76         ---Purpose: Set an fixed  BiNormal  direction to  perform   
77                 --  the sweeping        
78         ---Level: Public      
79         ---See Also: GeomFill_IsConstantNormal
80
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>         
86         ---Level: Public 
87         ---See Also: GeomFill_IsDarboux
88     returns  Boolean;
89
90     Set(me  :  mutable;   
91         AuxiliarySpine  :  Wire  from  TopoDS; 
92         CurvilinearEquivalence :  Boolean  =  Standard_True; 
93         KeepContact  : Boolean  =  Standard_False );
94
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. 
106
107         ---Level: Public
108
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
120
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.
124     
125
126     Add(me:mutable; 
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.
132         ---Level: Public
133   
134     Add(me:mutable; 
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>
141
142         ---Level: Public
143     raises DomainError;  -- if the <Spine> do not contain <Location>
144
145     SetLaw(me  :mutable; 
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>.
152         ---Level:  Public
153
154
155     SetLaw(me  :mutable; 
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>
163         ---Level:  Public
164
165  
166     Delete(me  :  mutable;  Profile : Shape from TopoDS);  
167         ---Purpose: Delete an section.
168         ---Level: Public    
169     
170      
171 --  ======================================== 
172 --  Methodes  to perform  and  read   shape
173 --  ========================================
174     IsReady(me)
175      ---Purpose: Say if <me> is ready to build the shape
176      --          return False if <me> do not have section definition        
177     returns  Boolean;   
178
179     GetStatus(me) 
180     ---Purpose: Get a status, when Simulate or Build failed.        
181     returns  PipeError  from  GeomFill;
182
183     SetTolerance(me  :  mutable; 
184                  Tol3d  :  Real  =  1.0e-4; 
185                  BoundTol   : Real  =  1.0e-4;
186                  TolAngular : Real  =  1.0e-2); 
187                   
188     SetTransition(me  :  mutable;  
189                   Mode  :TransitionStyle  from  BRepFill   
190                         =  BRepFill_Modified; 
191                   Angmin  :  Real  =  1.0e-2; 
192                   Angmax  :  Real  =  6.0)    
193         ---Purpose: Set the  Transition Mode to manage discontinuities
194         --          on the sweep.
195         ---Level: Public
196     is  static; 
197         
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.
203         ---Level: Public 
204     raises  NotDone;  --  If  <me> it is not Ready
205      
206                                                        
207     Build(me : mutable)
208         ---Purpose: Builds the resulting shape (redefined from MakeShape).
209         ---Level: Public
210     returns Boolean 
211     raises  NotDone  --  If  <me> it is not Ready
212     is static; 
213
214     MakeSolid(me :  mutable) 
215          ---Purpose: Transform the sweeping Shell in Solid. 
216          --          If the section are not closed returns False        
217          ---Level: Public
218     returns  Boolean 
219     raises  NotDone;  --  If  <me> is not Builded;           
220     
221     Shape (me)
222     ---Purpose: Returns the result Shape.
223     ---C++: return const & 
224     ---Level: Public 
225     returns Shape from TopoDS
226     is  static;    
227     
228     FirstShape (me)
229     ---Purpose: Returns the  TopoDS  Shape of the bottom of the sweep.
230     ---C++: return const & 
231     ---Level: Public 
232     returns Shape from TopoDS
233     is  static;
234
235     LastShape (me)
236     ---Purpose: Returns the TopoDS Shape of the top of the sweep.
237     ---C++: return const & 
238     ---Level: Public
239     returns Shape from TopoDS   
240     is  static; 
241      
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
246         --          shape <S>. 
247         ---Level: Public
248     is static;  
249     
250     Prepare(me:  mutable)  is  private; 
251      
252     Place(me : mutable;  
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; 
257            
258     ResetLoc(me  :  mutable)  is  private;
259
260     BuildHistory(me: mutable; theSweep: Sweep from BRepFill)
261         is private;
262           
263 fields      
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; 
269
270   myGenMap      :  DataMapOfShapeListOfShape from TopTools;
271
272   myTol3d       :  Real; 
273   myBoundTol    :  Real;  
274   myTolAngular  :  Real;  
275   angmin,  angmax  :  Real; 
276   
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;
284 end PipeShell;
285
286
287
288
289