0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / GeomFill / GeomFill_LocationGuide.cdl
1 -- Created on: 1998-07-08
2 -- Created by: Stephanie HUMEAU
3 -- Copyright (c) 1998-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 class  LocationGuide  from  GeomFill   
18 inherits  LocationLaw  from  GeomFill 
19
20 uses 
21     HCurve from  Adaptor3d,
22     Mat  from  gp, 
23     Vec  from  gp,  
24     Pnt  from  gp, 
25     Shape  from  GeomAbs,
26     Array1OfReal   from TColStd,
27     Array1OfVec2d  from TColgp, 
28     Array1OfPnt2d  from TColgp, 
29     HArray1OfPnt2d  from TColgp,  
30     HArray2OfPnt2d  from TColgp,  
31     HArray1OfReal  from TColStd,
32
33     HSurface from  Adaptor3d,
34     Curve  from  Geom, 
35     Curve  from  Adaptor3d, 
36  
37     TrihedronWithGuide  from  GeomFill, 
38     Dir  from  gp, 
39     Line  from  Geom, 
40     TrimmedCurve  from  Geom,  
41     SectionLaw  from  GeomFill, 
42     PipeError  from  GeomFill,    
43     Vector  from  math 
44     
45 raises   
46     NotImplemented,  ConstructionError,  OutOfRange
47
48 is  
49     Create(Triedre  :  TrihedronWithGuide  from  GeomFill) 
50     returns  LocationGuide  from  GeomFill;
51      
52     Set  (me  :  mutable; 
53           Section : SectionLaw  from  GeomFill;
54           rotat  :  Boolean  from  Standard; 
55           SFirst,  SLast  :  Real; 
56           PrecAngle  :  Real; 
57           LastAngle  :  out  Real)
58     is  static; 
59      
60     EraseRotation(me  :  mutable);        
61
62     SetRotation(me  :  mutable; 
63                 PrecAngle  :  Real; 
64                 LastAngle  :  out  Real)   
65     is  private; 
66
67     SetCurve(me : mutable;  C  :  HCurve  from  Adaptor3d) 
68     is  redefined;
69      
70     GetCurve(me)   
71     returns HCurve  from  Adaptor3d  
72     ---C++: return const &      
73     is redefined;  
74     
75     SetTrsf(me  :  mutable;  Transfo  :  Mat  from  gp)
76     is  redefined;
77    
78     Copy(me)   
79     returns  LocationLaw  from  GeomFill          
80     is redefined;
81     
82      
83     D0(me : mutable; 
84       Param: Real;
85       M    : out  Mat  from  gp; 
86       V    : out  Vec  from  gp)
87       ---Purpose: compute Location        
88     returns Boolean  is  redefined; 
89      
90     
91     D0(me : mutable; 
92       Param: Real;
93       M    : out  Mat  from  gp; 
94       V    : out  Vec  from  gp;
95       Poles2d  : out Array1OfPnt2d from TColgp)
96       ---Purpose: compute Location and 2d points        
97     returns Boolean  is  redefined; 
98   
99
100    D1(me : mutable;
101       Param: Real; 
102       M    : out  Mat  from  gp; 
103       V    : out  Vec  from  gp; 
104       DM   : out  Mat  from  gp; 
105       DV   : out  Vec  from  gp;             
106       Poles2d  : out Array1OfPnt2d from TColgp;
107       DPoles2d : out Array1OfVec2d from TColgp)
108       ---Purpose: compute location 2d  points and  associated
109       --          first derivatives.         
110       --  Warning : It used only for C1 or C2 aproximation
111    returns Boolean   
112    is  redefined; 
113    
114    D2(me : mutable;
115       Param: Real;
116       M    : out  Mat  from  gp; 
117       V    : out  Vec  from  gp; 
118       DM   : out  Mat  from  gp; 
119       DV   : out  Vec  from  gp;   
120       D2M  : out  Mat  from  gp; 
121       D2V  : out  Vec  from  gp;  
122       Poles2d   : out Array1OfPnt2d from TColgp;
123       DPoles2d  : out Array1OfVec2d from TColgp;
124       D2Poles2d : out Array1OfVec2d from TColgp)      
125       ---Purpose: compute location 2d  points and associated
126       --          first and seconde  derivatives.
127       --  Warning : It used only for C2 aproximation
128    returns Boolean
129    is  redefined;
130        
131                 
132
133 --   ================== General Information On The Function  ==================    
134 --                                         
135
136    HasFirstRestriction(me) 
137     ---Purpose: Say if the first restriction is defined in this class.
138     --           If it  is true the  first element  of poles array   in
139     --          D0,D1,D2... Correspond to this restriction.
140     --  Returns Standard_False (default implementation) 
141    returns  Boolean 
142    is  redefined;
143     
144    HasLastRestriction(me)  --  A  FAIRE  !!
145     ---Purpose: Say if the last restriction is defined in this class.
146     --           If it is  true the  last element  of poles array in
147     --          D0,D1,D2... Correspond to this restriction.
148     --          Returns Standard_False (default implementation)   
149    returns  Boolean
150    is  redefined;
151     
152    TraceNumber(me) 
153    ---Purpose: Give the number of trace (Curves 2d wich are not restriction)
154    --          Returns 1 (default implementation)   
155    returns  Integer 
156    is  redefined;   
157             
158   ErrorStatus(me)   
159    ---Purpose:Give a status to the Law              
160    --          Returns PipeOk (default implementation) 
161    returns  PipeError  from  GeomFill 
162    is  redefined;      
163
164 --
165 --  =================== Management  of  continuity  ===================
166 --                 
167    NbIntervals(me; S : Shape from GeomAbs) 
168         ---Purpose: Returns  the number  of  intervals for  continuity
169         --          <S>. 
170         --          May be one if Continuity(me) >= <S>
171    returns Integer  is  redefined;
172
173    Intervals(me; T : in out Array1OfReal from TColStd; 
174                  S : Shape from GeomAbs)
175         ---Purpose: Stores in <T> the  parameters bounding the intervals
176         --          of continuity <S>.
177         --          
178         --          The array must provide  enough room to  accomodate
179         --          for the parameters. i.e. T.Length() > NbIntervals()
180     raises
181         OutOfRange from Standard 
182     is redefined;  
183      
184         
185    SetInterval(me: mutable; First, Last: Real from Standard)    
186         ---Purpose: Sets the bounds of the parametric interval on
187         --          the function
188         --          This determines the derivatives in these values if the
189         --          function is not Cn.
190         is redefined; 
191    
192     GetInterval(me; First, Last: out  Real from Standard)    
193         ---Purpose: Gets the bounds of the parametric interval on 
194         --          the function
195         is redefined;  
196          
197     GetDomain(me; First, Last: out  Real from Standard)  
198         ---Purpose: Gets the bounds of the function parametric domain.
199         --  Warning: This domain it is  not modified by the
200         --          SetValue method         
201         is  redefined;
202
203 --  ===================  To help   computation of  Tolerance   ===============
204 --  
205 --  Evaluation of error,  in  2d space,  or  on composed function,  is
206 --  difficult.  The  following methods can  help the  approximation to
207 --  make good evaluation and use good tolerances.
208 --      
209 --      It is not necessary for the following informations to be very
210 --      precise. A fast evaluation is sufficient.
211
212    SetTolerance(me  :  mutable;  Tol3d,  Tol2d  :  Real)       
213          ---Purpose: Is usefull, if (me) have to run numerical
214         --          algorithm to perform D0, D1 or D2        
215         -- The default implementation make nothing.
216       is redefined;       
217
218    Resolution(me;   
219               Index       :  Integer  from  Standard;
220               Tol         : Real from Standard;   
221               TolU,  TolV :  out Real  from Standard)    
222     ---Purpose: Returns the resolutions in the  sub-space 2d <Index>
223     --          This information is usfull to find an good tolerance in
224     --          2d approximation.              
225     --  Warning: Used only if Nb2dCurve > 0          
226   is redefined;      
227           
228    
229   GetMaximalNorm(me  :  mutable)
230     ---Purpose:  Get the maximum Norm  of the matrix-location part.  It
231     --           is usful to find an good Tolerance to approx M(t).  
232   returns Real
233   is  redefined;  
234    
235   GetAverageLaw(me :  mutable;   
236                 AM: out Mat  from  gp;   
237                 AV: out Vec  from  gp) 
238      ---Purpose: Get average value of M(t) and V(t) it is usfull to 
239      --          make fast approximation of rational  surfaces.        
240   is  redefined; 
241   
242 -- 
243 -- To find elementary sweep
244 -- 
245   IsTranslation(me; Error  :  out  Real)  
246   ---Purpose: Say if the Location  Law, is an translation of  Location
247    -- The default implementation is " returns False ". 
248   returns  Boolean
249   is redefined;
250      
251   IsRotation(me; Error  :  out  Real ) 
252    ---Purpose: Say if the Location  Law, is a rotation of Location
253     -- The default implementation is " returns False ". 
254   returns  Boolean 
255   is  redefined;  
256    
257   Rotation(me; Center  :  out  Pnt  from  gp) 
258   is redefined;    
259    
260  
261   Section(me) 
262     returns  Curve  from  Geom; 
263             
264   Guide(me) 
265     returns  HCurve  from  Adaptor3d;     
266    
267   InitX(me; 
268         Param  :  Real  from  Standard) 
269   is  private; 
270    
271   SetOrigine(me  :  mutable; 
272              Param1  :  Real; 
273               Param2  :  Real)  
274   is static;
275  
276   ComputeAutomaticLaw(me; ParAndRad : out HArray1OfPnt2d from TColgp)
277     returns PipeError from GeomFill;
278
279 fields     
280     myLaw   :  TrihedronWithGuide  from  GeomFill; -- loi  de  triedre     
281     mySec   :  SectionLaw  from  GeomFill; --  loi  de  section
282     myCurve  :  HCurve  from  Adaptor3d; --  trajectoire
283     myGuide  :  HCurve  from  Adaptor3d; --  guide
284     myTrimmed  :  HCurve  from  Adaptor3d;  --  trajectoire  trimme 
285
286     myPoles2d : HArray2OfPnt2d from TColgp  is  protected; 
287     
288     myNbPts  :  Integer  from  Standard; 
289     rotation  :  Boolean  from  Standard; --  contact  ou  non
290     OrigParam1  :  Real  from  Standard;  --  pour  ACR
291     OrigParam2  :  Real  from  Standard; 
292     Uf,  Ul     :  Real  from  Standard;      
293     myFirstS    :  Real  from  Standard;  
294     myLastS     :  Real  from  Standard; 
295     ratio       :  Real  from  Standard;    
296     
297     WithTrans:  Boolean  from  Standard; 
298     Trans    :  Mat  from gp;  
299     TolRes   :  Vector  from  math; 
300     Inf,  Sup:  Vector  from  math; 
301     X,  R    :  Vector  from  math; 
302      
303     myStatus :  PipeError  from  GeomFill;
304                             
305 end  LocationGuide;