0024750: Replace instantiations of TCollection generic classes by NCollection templat...
[occt.git] / src / IntTools / IntTools_Context.cdl
1 -- Created by: Peter KURNEV
2 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
3 --
4 -- This file is part of Open CASCADE Technology software library.
5 --
6 -- This library is free software; you can redistribute it and/or modify it under
7 -- the terms of the GNU Lesser General Public License version 2.1 as published
8 -- by the Free Software Foundation, with special exception defined in the file
9 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 -- distribution for complete text of the license and disclaimer of any warranty.
11 --
12 -- Alternatively, this file may be used under the terms of Open CASCADE
13 -- commercial license or contractual agreement.
14
15
16 class Context from IntTools  
17     inherits TShared from MMgt
18
19
20 ---Purpose:  
21         --  The intersection Context contains geometrical  
22         --  and topological toolkit (classifiers, projectors, etc). 
23         --  The intersection Context is for caching the tools  
24         --  to increase the performance.
25
26
27 uses  
28      
29     Box from Bnd,
30     Pnt2d from gp,
31     Pnt   from gp, 
32     State from TopAbs,  
33     Curve from Geom,   
34     ProjectPointOnCurve from GeomAPI, 
35     ProjectPointOnSurf  from GeomAPI,
36     Shape  from TopoDS, 
37     Vertex from TopoDS, 
38     Face   from TopoDS,
39     Edge   from TopoDS, 
40     Solid  from TopoDS, 
41     SolidClassifier from BRepClass3d, 
42     FClass2d from IntTools,
43     Curve    from IntTools, 
44     BaseAllocator from BOPCol,
45     DataMapOfShapeAddress from BOPCol, 
46     DataMapOfTransientAddress from BOPCol, 
47     Hatcher from Geom2dHatch, 
48     SurfaceRangeLocalizeData from IntTools
49
50 --raises
51
52 is 
53     Create   
54
55     returns Context from IntTools;
56     ---C++: alias "Standard_EXPORT virtual  ~IntTools_Context();"         
57     Create (theAllocator: BaseAllocator from BOPCol) 
58
59     returns Context from IntTools;
60      
61     FClass2d(me:mutable; 
62         aF: Face from TopoDS) 
63     returns FClass2d from IntTools; 
64     ---C++: return & 
65     ---Purpose:
66     --- Returns a reference to point classifier
67     --- for given face
68     ---
69
70     ProjPS (me:mutable; 
71         aF: Face from TopoDS) 
72     returns ProjectPointOnSurf from GeomAPI;
73     ---C++: return &   
74     ---Purpose:
75     --- Returns a reference to point projector
76     --- for given face
77     ---
78
79     ProjPC (me:mutable; 
80         aE: Edge from TopoDS) 
81     returns ProjectPointOnCurve from GeomAPI;
82     ---C++: return &
83     ---Purpose:
84     --- Returns a reference to point projector
85     --- for given edge
86     ---
87
88     ProjPT (me:mutable; 
89         aC: Curve from Geom) 
90     returns ProjectPointOnCurve from GeomAPI;
91     ---C++: return &
92     ---Purpose:
93     --- Returns a reference to point projector
94     --- for given curve
95     ---
96
97     SurfaceData(me: mutable; 
98         aF: Face from TopoDS)
99     returns SurfaceRangeLocalizeData from IntTools;
100     ---C++: return &
101     ---Purpose:
102     --- Returns a reference to surface localization data
103     --- for given face 
104     
105     SolidClassifier(me:mutable;  
106         aSolid: Solid from TopoDS) 
107     returns SolidClassifier from BRepClass3d; 
108     ---C++: return &    
109     ---Purpose:
110     --- Returns a reference to solid classifier
111     --- for given solid
112     ---
113  
114     Hatcher(me: mutable;  
115         aF: Face from TopoDS) 
116     returns Hatcher from Geom2dHatch;
117     ---C++: return &  
118     ---Purpose:
119     --- Returns a reference to 2D hatcher
120     --- for given face
121     --- 
122
123     ComputePE  (me:mutable;  
124        theP   : Pnt from gp; 
125        theTolP: Real from Standard; 
126        theE   : Edge   from  TopoDS; 
127        theT   :out Real from Standard) 
128     returns Integer from Standard;  
129     ---Purpose:
130     --- Computes parameter of the Point theP on
131     --- the edge aE.
132     --- Returns zero if the distance between point
133     --- and edge is less than sum of tolerance value of edge and theTopP,
134     --- otherwise and for following conditions returns
135     --- negative value
136     --- 1. the edge is degenerated (-1)
137     --- 2. the edge does not contain 3d curve and pcurves (-2)
138     --- 3. projection algorithm failed (-3)
139     ---
140
141     ComputeVE  (me:mutable;  
142        aV   : Vertex from  TopoDS; 
143        aE   : Edge   from  TopoDS; 
144        aT   :out Real from Standard) 
145     returns Integer from Standard;
146     ---Purpose: 
147     --- Computes parameter of the vertex aV on
148     --- the edge aE.
149     --- Returns zero if the distance between vertex
150     --- and edge is less than sum of tolerances,
151     --- otherwise and for following conditions returns
152     --- negative value
153     --- 1. the edge is degenerated (-1)
154     --- 2. the edge does not contain 3d curve and pcurves (-2)
155     --- 3. projection algorithm failed (-3)
156     ---
157          
158     ComputeVF  (me:mutable;  
159        aV  :     Vertex from  TopoDS; 
160        aF  :     Face   from  TopoDS; 
161        U   : out Real from Standard; 
162        V   : out Real from Standard) 
163     returns Integer from Standard;
164     ---Purpose:
165     --- Computes UV parameters of the vertex aV on face aF
166     --- Returns zero if the distance between vertex and face is
167     --- less than or equal the sum of tolerances and the projection 
168     --- point lays inside boundaries of the face.
169     --- For following conditions returns negative value
170     --- 1. projection algorithm failed (-1)
171     --- 2. distance is more than sum of tolerances (-2)
172     --- 3. projection point out or on the boundaries of face (-3)
173     --- 
174     
175     StatePointFace(me:mutable;    
176        aF   :  Face   from  TopoDS;
177        aP2D :  Pnt2d  from  gp) 
178     returns State from TopAbs;  
179     ---Purpose:
180     --- Returns the state of the point aP2D
181     --- relative to face aF
182     ---
183          
184     IsPointInFace(me:mutable;    
185        aF   :  Face   from  TopoDS;
186        aP2D :  Pnt2d  from  gp) 
187     returns Boolean from Standard; 
188     ---Purpose:
189     --- Returns true if the point aP2D is
190     --- inside the boundaries of the face aF,
191     --- otherwise returns false
192     ---
193  
194     IsPointInFace(me:mutable;    
195        aP3D :  Pnt   from  gp; 
196        aF   :  Face  from TopoDS; 
197        aTol :  Real from Standard) 
198     returns Boolean from Standard; 
199     ---Purpose:
200     --- Returns true if the point aP2D is
201     --- inside the boundaries of the face aF,
202     --- otherwise returns false
203     ---
204     
205     IsPointInOnFace(me:mutable;     
206        aF   :  Face   from  TopoDS;
207        aP2D :  Pnt2d  from  gp) 
208     returns Boolean from Standard;
209     ---Purpose:
210     --- Returns true if the point aP2D is
211     --- inside or on the boundaries of aF
212     ---
213          
214     IsValidPointForFace(me:mutable;
215        aP3D :  Pnt   from  gp; 
216        aF   :  Face  from TopoDS; 
217        aTol :  Real from Standard) 
218     returns Boolean from Standard;
219     ---Purpose:
220     --- Returns true if the distance between point aP3D
221     --- and face aF is less or equal to tolerance aTol
222     --- and projection point is inside or on the boundaries
223     --- of the face aF
224     ---
225
226     IsValidPointForFaces(me:mutable;
227        aP3D :  Pnt   from  gp; 
228        aF1  :  Face  from TopoDS; 
229        aF2  :  Face  from TopoDS;
230        aTol :  Real from Standard)   
231     returns Boolean from Standard; 
232     ---Purpose:
233     --- Returns true if IsValidPointForFace returns true
234     --- for both face aF1 and aF2
235     ---
236          
237     IsValidBlockForFace (me:mutable;  
238        aT1  :  Real  from Standard;      
239        aT2  :  Real  from Standard;      
240        aIC  :  Curve from IntTools; 
241        aF   :  Face  from TopoDS; 
242        aTol :  Real from Standard) 
243     returns Boolean from Standard; 
244     ---Purpose:
245     --- Returns true if IsValidPointForFace returns true
246     --- for some 3d point that lay on the curve aIC bounded by
247     --- parameters aT1 and aT2
248     ---
249
250     IsValidBlockForFaces (me:mutable;  
251        aT1  :  Real  from Standard;      
252        aT2  :  Real  from Standard;      
253        aIC  :  Curve from IntTools; 
254        aF1  :  Face  from TopoDS; 
255        aF2  :  Face  from TopoDS; 
256        aTol :  Real from Standard) 
257     returns Boolean from Standard;
258     ---Purpose:
259     --- Returns true if IsValidBlockForFace returns true
260     --- for both faces aF1 and aF2
261     ---
262          
263     IsVertexOnLine(me:mutable;  
264        aV   :  Vertex from  TopoDS;  
265        aIC  :  Curve from IntTools;  
266        aTolC:  Real  from Standard; 
267        aT   :out  Real  from Standard)   
268     returns Boolean from Standard; 
269     ---Purpose:
270     --- Computes parameter of the vertex aV on
271     --- the curve aIC.
272     --- Returns true if the distance between vertex and
273     --- curve is less than sum of tolerance of aV and aTolC,
274     --- otherwise or if projection algorithm failed
275     --- returns false (in this case aT isn't significant)
276     --- 
277         
278     IsVertexOnLine(me:mutable;  
279        aV   :  Vertex from  TopoDS; 
280        aTolV:  Real  from Standard;  
281        aIC  :  Curve from IntTools;  
282        aTolC:  Real  from Standard; 
283        aT   :out  Real  from Standard)   
284     returns Boolean from Standard;
285     ---Purpose:
286     --- Computes parameter of the vertex aV on
287     --- the curve aIC.
288     --- Returns true if the distance between vertex and
289     --- curve is less than sum of tolerance of aV and aTolC,
290     --- otherwise or if projection algorithm failed
291     --- returns false (in this case aT isn't significant)
292     --- 
293
294     ProjectPointOnEdge (me:mutable;  
295        aP   : Pnt  from  gp;       
296        aE   : Edge from  TopoDS;                    
297        aT   :out Real from  Standard) 
298     returns Boolean from Standard; 
299     ---Purpose:
300     --- Computes parameter of the point aP on
301     --- the edge aE.
302     --- Returns false if projection algorithm failed
303     --- other wiese returns true.
304     ---
305     BndBox(me:mutable; 
306         theS:Shape from TopoDS) 
307     returns Box from Bnd; 
308     ---C++: return &  
309     --- Returns a reference to boundong box 
310     --- for given shape  <theS>
311     ---  
312     IsInfiniteFace(me:mutable;   
313         theFace:Face from TopoDS)  
314     returns Boolean from Standard;  
315     ---Purpose: Returns true if the solid <theFace> has 
316     --          infinite bounds     
317
318     SetPOnSProjectionTolerance(me:mutable; theValue: Real from Standard);
319     ---Purpose: Sets tolerance to be used for projection of point on surface.
320     --          Clears map of already cached projectors in order to maintain 
321     --          correct value for all projectors
322
323     clearCachedPOnSProjectors(me: mutable)
324     is private;
325     ---Purpose: Clears map of already cached projectors.
326  
327 fields 
328     myAllocator  : BaseAllocator from BOPCol is protected;
329     myFClass2dMap:DataMapOfShapeAddress from BOPCol is protected; 
330     myProjPSMap  :DataMapOfShapeAddress from BOPCol is protected; 
331     myProjPCMap  :DataMapOfShapeAddress from BOPCol is protected;    
332     mySClassMap  :DataMapOfShapeAddress from BOPCol is protected;
333     myProjPTMap  :DataMapOfTransientAddress from BOPCol is protected;    
334     myHatcherMap :DataMapOfShapeAddress from BOPCol is protected; 
335     myProjSDataMap:DataMapOfShapeAddress from BOPCol is protected;  
336     myBndBoxDataMap:DataMapOfShapeAddress from BOPCol is protected;  
337     myCreateFlag :Integer from Standard is protected; 
338     myPOnSTolerance :Real from Standard is protected;
339      
340 end Context;
341