0024646: Wrong result done by Boolean Operation algorithm
[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     Pnt2d from gp,
30     Pnt   from gp, 
31     State from TopAbs,  
32     Curve from Geom,   
33     ProjectPointOnCurve from GeomAPI, 
34     ProjectPointOnSurf  from GeomAPI,
35     Vertex from TopoDS, 
36     Face   from TopoDS,
37     Edge   from TopoDS, 
38     Solid  from TopoDS, 
39     SolidClassifier from BRepClass3d, 
40     FClass2d from IntTools,
41     Curve    from IntTools, 
42     BaseAllocator from BOPCol,
43     DataMapOfShapeAddress from BOPCol, 
44     DataMapOfTransientAddress from BOPCol, 
45     Hatcher from Geom2dHatch, 
46     SurfaceRangeLocalizeData from IntTools
47
48 --raises
49
50 is 
51     Create   
52
53     returns Context from IntTools;
54     ---C++: alias "Standard_EXPORT virtual  ~IntTools_Context();"         
55     Create (theAllocator: BaseAllocator from BOPCol) 
56
57     returns Context from IntTools;
58      
59     FClass2d(me:mutable; 
60         aF: Face from TopoDS) 
61     returns FClass2d from IntTools; 
62     ---C++: return & 
63     ---Purpose:
64     --- Returns a reference to point classifier
65     --- for given face
66     ---
67
68     ProjPS (me:mutable; 
69         aF: Face from TopoDS) 
70     returns ProjectPointOnSurf from GeomAPI;
71     ---C++: return &   
72     ---Purpose:
73     --- Returns a reference to point projector
74     --- for given face
75     ---
76
77     ProjPC (me:mutable; 
78         aE: Edge from TopoDS) 
79     returns ProjectPointOnCurve from GeomAPI;
80     ---C++: return &
81     ---Purpose:
82     --- Returns a reference to point projector
83     --- for given edge
84     ---
85
86     ProjPT (me:mutable; 
87         aC: Curve from Geom) 
88     returns ProjectPointOnCurve from GeomAPI;
89     ---C++: return &
90     ---Purpose:
91     --- Returns a reference to point projector
92     --- for given curve
93     ---
94
95     SurfaceData(me: mutable; 
96         aF: Face from TopoDS)
97     returns SurfaceRangeLocalizeData from IntTools;
98     ---C++: return &
99     ---Purpose:
100     --- Returns a reference to surface localization data
101     --- for given face 
102     
103     SolidClassifier(me:mutable;  
104         aSolid: Solid from TopoDS) 
105     returns SolidClassifier from BRepClass3d; 
106     ---C++: return &    
107     ---Purpose:
108     --- Returns a reference to solid classifier
109     --- for given solid
110     ---
111  
112     Hatcher(me: mutable;  
113         aF: Face from TopoDS) 
114     returns Hatcher from Geom2dHatch;
115     ---C++: return &  
116     ---Purpose:
117     --- Returns a reference to 2D hatcher
118     --- for given face
119     --- 
120
121     ComputePE  (me:mutable;  
122        theP   : Pnt from gp; 
123        theTolP: Real from Standard; 
124        theE   : Edge   from  TopoDS; 
125        theT   :out Real from Standard) 
126     returns Integer from Standard;  
127     ---Purpose:
128     --- Computes parameter of the Point theP on
129     --- the edge aE.
130     --- Returns zero if the distance between point
131     --- and edge is less than sum of tolerance value of edge and theTopP,
132     --- otherwise and for following conditions returns
133     --- negative value
134     --- 1. the edge is degenerated (-1)
135     --- 2. the edge does not contain 3d curve and pcurves (-2)
136     --- 3. projection algorithm failed (-3)
137     ---
138
139     ComputeVE  (me:mutable;  
140        aV   : Vertex from  TopoDS; 
141        aE   : Edge   from  TopoDS; 
142        aT   :out Real from Standard) 
143     returns Integer from Standard;
144     ---Purpose: 
145     --- Computes parameter of the vertex aV on
146     --- the edge aE.
147     --- Returns zero if the distance between vertex
148     --- and edge is less than sum of tolerances,
149     --- otherwise and for following conditions returns
150     --- negative value
151     --- 1. the edge is degenerated (-1)
152     --- 2. the edge does not contain 3d curve and pcurves (-2)
153     --- 3. projection algorithm failed (-3)
154     ---
155          
156     ComputeVF  (me:mutable;  
157        aV  :     Vertex from  TopoDS; 
158        aF  :     Face   from  TopoDS; 
159        U   : out Real from Standard; 
160        V   : out Real from Standard) 
161     returns Integer from Standard;
162     ---Purpose:
163     --- Computes UV parameters of the vertex aV on face aF
164     --- Returns zero if the distance between vertex and face is
165     --- less than or equal the sum of tolerances and the projection 
166     --- point lays inside boundaries of the face.
167     --- For following conditions returns negative value
168     --- 1. projection algorithm failed (-1)
169     --- 2. distance is more than sum of tolerances (-2)
170     --- 3. projection point out or on the boundaries of face (-3)
171     --- 
172     
173     StatePointFace(me:mutable;    
174        aF   :  Face   from  TopoDS;
175        aP2D :  Pnt2d  from  gp) 
176     returns State from TopAbs;  
177     ---Purpose:
178     --- Returns the state of the point aP2D
179     --- relative to face aF
180     ---
181          
182     IsPointInFace(me:mutable;    
183        aF   :  Face   from  TopoDS;
184        aP2D :  Pnt2d  from  gp) 
185     returns Boolean from Standard; 
186     ---Purpose:
187     --- Returns true if the point aP2D is
188     --- inside the boundaries of the face aF,
189     --- otherwise returns false
190     ---
191  
192     IsPointInFace(me:mutable;    
193        aP3D :  Pnt   from  gp; 
194        aF   :  Face  from TopoDS; 
195        aTol :  Real from Standard) 
196     returns Boolean from Standard; 
197     ---Purpose:
198     --- Returns true if the point aP2D is
199     --- inside the boundaries of the face aF,
200     --- otherwise returns false
201     ---
202     
203     IsPointInOnFace(me:mutable;     
204        aF   :  Face   from  TopoDS;
205        aP2D :  Pnt2d  from  gp) 
206     returns Boolean from Standard;
207     ---Purpose:
208     --- Returns true if the point aP2D is
209     --- inside or on the boundaries of aF
210     ---
211          
212     IsValidPointForFace(me:mutable;
213        aP3D :  Pnt   from  gp; 
214        aF   :  Face  from TopoDS; 
215        aTol :  Real from Standard) 
216     returns Boolean from Standard;
217     ---Purpose:
218     --- Returns true if the distance between point aP3D
219     --- and face aF is less or equal to tolerance aTol
220     --- and projection point is inside or on the boundaries
221     --- of the face aF
222     ---
223
224     IsValidPointForFaces(me:mutable;
225        aP3D :  Pnt   from  gp; 
226        aF1  :  Face  from TopoDS; 
227        aF2  :  Face  from TopoDS;
228        aTol :  Real from Standard)   
229     returns Boolean from Standard; 
230     ---Purpose:
231     --- Returns true if IsValidPointForFace returns true
232     --- for both face aF1 and aF2
233     ---
234          
235     IsValidBlockForFace (me:mutable;  
236        aT1  :  Real  from Standard;      
237        aT2  :  Real  from Standard;      
238        aIC  :  Curve from IntTools; 
239        aF   :  Face  from TopoDS; 
240        aTol :  Real from Standard) 
241     returns Boolean from Standard; 
242     ---Purpose:
243     --- Returns true if IsValidPointForFace returns true
244     --- for some 3d point that lay on the curve aIC bounded by
245     --- parameters aT1 and aT2
246     ---
247
248     IsValidBlockForFaces (me:mutable;  
249        aT1  :  Real  from Standard;      
250        aT2  :  Real  from Standard;      
251        aIC  :  Curve from IntTools; 
252        aF1  :  Face  from TopoDS; 
253        aF2  :  Face  from TopoDS; 
254        aTol :  Real from Standard) 
255     returns Boolean from Standard;
256     ---Purpose:
257     --- Returns true if IsValidBlockForFace returns true
258     --- for both faces aF1 and aF2
259     ---
260          
261     IsVertexOnLine(me:mutable;  
262        aV   :  Vertex from  TopoDS;  
263        aIC  :  Curve from IntTools;  
264        aTolC:  Real  from Standard; 
265        aT   :out  Real  from Standard)   
266     returns Boolean from Standard; 
267     ---Purpose:
268     --- Computes parameter of the vertex aV on
269     --- the curve aIC.
270     --- Returns true if the distance between vertex and
271     --- curve is less than sum of tolerance of aV and aTolC,
272     --- otherwise or if projection algorithm failed
273     --- returns false (in this case aT isn't significant)
274     --- 
275         
276     IsVertexOnLine(me:mutable;  
277        aV   :  Vertex from  TopoDS; 
278        aTolV:  Real  from Standard;  
279        aIC  :  Curve from IntTools;  
280        aTolC:  Real  from Standard; 
281        aT   :out  Real  from Standard)   
282     returns Boolean from Standard;
283     ---Purpose:
284     --- Computes parameter of the vertex aV on
285     --- the curve aIC.
286     --- Returns true if the distance between vertex and
287     --- curve is less than sum of tolerance of aV and aTolC,
288     --- otherwise or if projection algorithm failed
289     --- returns false (in this case aT isn't significant)
290     --- 
291
292     ProjectPointOnEdge (me:mutable;  
293        aP   : Pnt  from  gp;       
294        aE   : Edge from  TopoDS;                    
295        aT   :out Real from  Standard) 
296     returns Boolean from Standard; 
297     ---Purpose:
298     --- Computes parameter of the point aP on
299     --- the edge aE.
300     --- Returns false if projection algorithm failed
301     --- other wiese returns true.
302     ---
303      
304 fields 
305     myAllocator  : BaseAllocator from BOPCol is protected;
306     myFClass2dMap:DataMapOfShapeAddress from BOPCol is protected; 
307     myProjPSMap  :DataMapOfShapeAddress from BOPCol is protected; 
308     myProjPCMap  :DataMapOfShapeAddress from BOPCol is protected;    
309     mySClassMap  :DataMapOfShapeAddress from BOPCol is protected;
310     myProjPTMap  :DataMapOfTransientAddress from BOPCol is protected;    
311     myHatcherMap :DataMapOfShapeAddress from BOPCol is protected; 
312     myProjSDataMap:DataMapOfShapeAddress from BOPCol is protected; 
313     myCreateFlag :Integer from Standard is protected; 
314      
315 end Context;
316