0024023: Revamp the OCCT Handle -- downcast (automatic)
[occt.git] / src / GeomFill / GeomFill_Sweep.cdl
1 -- Created on: 1997-11-20
2 -- Created by: Philippe MANGIN
3 -- Copyright (c) 1997-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 Sweep from GeomFill 
18
19         ---Purpose: Geometrical Sweep Algorithm
20         ---Level: Advanced
21
22 uses 
23    SectionLaw   from  GeomFill, 
24    LocationLaw  from  GeomFill, 
25    ApproxStyle  from  GeomFill, 
26    Shape        from  GeomAbs,    
27  
28    Surface      from  Geom,  
29    Curve        from  Geom2d,    
30    HArray1OfCurve  from  TColGeom2d,  
31    HArray2OfReal  from  TColStd
32    
33 raises
34     NotDone,   
35     OutOfRange,   
36     ConstructionError 
37     
38 is 
39    Create(Location :  LocationLaw  from  GeomFill; 
40           WithKpart  :  Boolean  =  Standard_True)  
41    returns Sweep  from  GeomFill;
42      
43    SetDomain(me : in  out;  First,  Last :  Real; 
44                             SectionFirst,  SectionLast  :  Real); 
45     ---Purpose: Set parametric information          
46     --          [<First>, <Last>] Sets the parametric bound of the
47     --                  sweeping surface to build.  
48     --           <SectionFirst>, <SectionLast> gives coresponding
49     --           bounds parameter on the section law of <First> and <Last>
50     --          
51     --           V-Iso on Sweeping Surface S(u,v) is defined by 
52     --           Location(v) and Section(w) where 
53     --           w = SectionFirst + (v - First) / (Last-First) 
54     --             * (SectionLast - SectionFirst)
55     --
56     --           By default w = v, and First and Last are given by 
57     --           First and Last parameter stored in LocationLaw.
58
59    SetTolerance(me  :  in  out;   
60                 Tol3d  :  Real; 
61                 BoundTol   : Real  =  1.0; 
62                 Tol2d      : Real  =  1.0e-5;   
63                 TolAngular : Real  =  1.0); 
64    ---Purpose: Set Approximation Tolerance
65            --    Tol3d : Tolerance to surface approximation
66            --    Tol2d : Tolerance used to perform curve approximation
67            --            Normaly the 2d curve are approximated with a 
68            --            tolerance given by the resolution method define in 
69            --            <LocationLaw> but if this tolerance is too large Tol2d 
70            --            is used.
71            --    TolAngular : Tolerance (in radian) to control the angle 
72            --                 beetween tangents on the section law and
73            --                 tangent of iso-v on approximed surface
74
75    SetForceApproxC1(me  :  in  out;
76                     ForceApproxC1 : Boolean from Standard);
77    ---Purpose: Set the flag that indicates attempt to approximate
78    --          a C1-continuous surface if a swept surface proved
79    --          to be C0.
80                                                  
81     ExchangeUV(me)
82         ---Purpose: returns true if sections are U-Iso
83          -- This can be produce in some cases when <WithKpart> is True.
84     returns Boolean from Standard
85     is static;   
86                       
87    UReversed(me)         
88     ---Purpose: returns true if Parametrisation sens in U is inverse of
89     --          parametrisation sens of section (or of path if ExchangeUV)
90     returns Boolean from Standard
91     is static;         
92
93    VReversed(me)         
94     ---Purpose: returns true if Parametrisation sens in V is inverse of
95     --          parametrisation sens of path (or of section if ExchangeUV)
96     returns Boolean from Standard
97     is static;
98
99
100    Build(me  :  in  out; 
101          Section  :  SectionLaw  from  GeomFill;            
102          Methode    : ApproxStyle = GeomFill_Location; 
103          Continuity : Shape = GeomAbs_C2;
104          Degmax     : Integer = 10;
105          Segmax     : Integer = 30)  
106    ---Purpose: Build the Sweeep  Surface
107    --    ApproxStyle defines Approximation Strategy
108    --    - GeomFill_Section : The composed Function : Location X Section
109    --                         is directly approximed.
110    --    - GeomFill_Location : The location law is approximed, and the
111    --                          SweepSurface is build algebric composition
112    --                          of approximed location law and section law
113    --                          This option is Ok, if Section.Surface() methode
114    --                          is effective.
115    --    Continuity : The continuity in v waiting on the surface 
116    --    Degmax     : The maximum degree in v requiered on the surface 
117    --    Segmax     : The maximum number of span in v requiered on 
118    --                 the surface
119    --  
120    --      raise If Domain are infinite or Profile not Setted.
121    raises  ConstructionError; 
122     
123    Build2d(me:in  out; 
124            Continuity : Shape;
125            Degmax     : Integer;
126            Segmax     : Integer) 
127    returns  Boolean 
128    is  private; 
129     
130    BuildAll(me:in  out; 
131             Continuity : Shape;
132             Degmax     : Integer;
133             Segmax     : Integer) 
134    returns  Boolean 
135    is  private;  
136     
137    BuildProduct(me:in  out; 
138                 Continuity : Shape;
139                 Degmax     : Integer;
140                 Segmax     : Integer) 
141    returns  Boolean 
142    is  private;  
143     
144    BuildKPart(me:in  out) 
145    returns  Boolean 
146    is  private; 
147     
148    IsDone(me) 
149     ---Purpose: Tells if the Surface is Buildt.          
150    returns  Boolean;  
151     
152    ErrorOnSurface(me) 
153     ---Purpose: Gets the Approximation  error.       
154    returns  Real; 
155     
156    ErrorOnRestriction(me; IsFirst : Boolean; 
157                       UError, VError : out Real)
158     ---Purpose: Gets the Approximation  error. 
159    raises  NotDone;
160       
161    ErrorOnTrace(me; IndexOfTrace  : Integer; 
162                     UError, VError : out Real) 
163     ---Purpose: Gets the Approximation error. 
164     raises NotDone,  OutOfRange; 
165         
166    Surface(me)  
167     returns Surface  from  Geom 
168     raises  NotDone; 
169      
170    Restriction(me;  IsFirst :  Boolean)  
171     returns Curve  from  Geom2d 
172     raises  NotDone; 
173       
174    NumberOfTrace(me)   
175    returns  Integer; 
176    
177    Trace(me;  IndexOfTrace  :  Integer)  
178     returns Curve  from  Geom2d
179     raises  NotDone,  OutOfRange;  
180
181
182 fields   
183     First,  Last  :  Real;
184     SFirst,  SLast:  Real;  
185     Tol3d,  BoundTol,  Tol2d,  TolAngular  :  Real;     
186     SError        :  Real;
187     myForceApproxC1  :  Boolean;
188          
189     myLoc      :  LocationLaw  from GeomFill;
190     mySec      :  SectionLaw   from GeomFill;
191     mySurface  :  Surface from Geom;
192     myCurve2d  :  HArray1OfCurve  from TColGeom2d; 
193     CError     :  HArray2OfReal  from  TColStd;      
194
195     done         :  Boolean;
196     myExchUV     :  Boolean from Standard; 
197     isUReversed  :  Boolean;
198     isVReversed  :  Boolean;
199     myKPart      :  Boolean from Standard;
200 end Sweep;