1 -- Created by: Peter KURNEV
2 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
4 -- This file is part of Open CASCADE Technology software library.
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.
12 -- Alternatively, this file may be used under the terms of Open CASCADE
13 -- commercial license or contractual agreement.
16 class Context from IntTools
17 inherits TShared from MMgt
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.
34 ProjectPointOnCurve from GeomAPI,
35 ProjectPointOnSurf from GeomAPI,
41 SolidClassifier from BRepClass3d,
42 FClass2d from IntTools,
44 BaseAllocator from BOPCol,
45 DataMapOfShapeAddress from BOPCol,
46 DataMapOfTransientAddress from BOPCol,
47 Hatcher from Geom2dHatch,
48 SurfaceRangeLocalizeData from IntTools
55 returns Context from IntTools;
56 ---C++: alias "Standard_EXPORT virtual ~IntTools_Context();"
57 Create (theAllocator: BaseAllocator from BOPCol)
59 returns Context from IntTools;
63 returns FClass2d from IntTools;
66 --- Returns a reference to point classifier
72 returns ProjectPointOnSurf from GeomAPI;
75 --- Returns a reference to point projector
81 returns ProjectPointOnCurve from GeomAPI;
84 --- Returns a reference to point projector
90 returns ProjectPointOnCurve from GeomAPI;
93 --- Returns a reference to point projector
97 SurfaceData(me: mutable;
99 returns SurfaceRangeLocalizeData from IntTools;
102 --- Returns a reference to surface localization data
105 SolidClassifier(me:mutable;
106 aSolid: Solid from TopoDS)
107 returns SolidClassifier from BRepClass3d;
110 --- Returns a reference to solid classifier
115 aF: Face from TopoDS)
116 returns Hatcher from Geom2dHatch;
119 --- Returns a reference to 2D hatcher
123 ComputePE (me:mutable;
125 theTolP: Real from Standard;
126 theE : Edge from TopoDS;
127 theT :out Real from Standard)
128 returns Integer from Standard;
130 --- Computes parameter of the Point theP on
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
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)
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;
147 --- Computes parameter of the vertex aV on
149 --- Returns zero if the distance between vertex
150 --- and edge is less than sum of tolerances,
151 --- otherwise and for following conditions returns
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)
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;
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)
175 StatePointFace(me:mutable;
176 aF : Face from TopoDS;
177 aP2D : Pnt2d from gp)
178 returns State from TopAbs;
180 --- Returns the state of the point aP2D
181 --- relative to face aF
184 IsPointInFace(me:mutable;
185 aF : Face from TopoDS;
186 aP2D : Pnt2d from gp)
187 returns Boolean from Standard;
189 --- Returns true if the point aP2D is
190 --- inside the boundaries of the face aF,
191 --- otherwise returns false
194 IsPointInFace(me:mutable;
196 aF : Face from TopoDS;
197 aTol : Real from Standard)
198 returns Boolean from Standard;
200 --- Returns true if the point aP2D is
201 --- inside the boundaries of the face aF,
202 --- otherwise returns false
205 IsPointInOnFace(me:mutable;
206 aF : Face from TopoDS;
207 aP2D : Pnt2d from gp)
208 returns Boolean from Standard;
210 --- Returns true if the point aP2D is
211 --- inside or on the boundaries of aF
214 IsValidPointForFace(me:mutable;
216 aF : Face from TopoDS;
217 aTol : Real from Standard)
218 returns Boolean from Standard;
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
226 IsValidPointForFaces(me:mutable;
228 aF1 : Face from TopoDS;
229 aF2 : Face from TopoDS;
230 aTol : Real from Standard)
231 returns Boolean from Standard;
233 --- Returns true if IsValidPointForFace returns true
234 --- for both face aF1 and aF2
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;
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
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;
259 --- Returns true if IsValidBlockForFace returns true
260 --- for both faces aF1 and aF2
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;
270 --- Computes parameter of the vertex aV on
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)
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;
286 --- Computes parameter of the vertex aV on
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)
294 ProjectPointOnEdge (me:mutable;
296 aE : Edge from TopoDS;
297 aT :out Real from Standard)
298 returns Boolean from Standard;
300 --- Computes parameter of the point aP on
302 --- Returns false if projection algorithm failed
303 --- other wiese returns true.
306 theS:Shape from TopoDS)
307 returns Box from Bnd;
309 --- Returns a reference to boundong box
310 --- for given shape <theS>
312 IsInfiniteFace(me:mutable;
313 theFace:Face from TopoDS)
314 returns Boolean from Standard;
315 ---Purpose: Returns true if the solid <theFace> has
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
323 clearCachedPOnSProjectors(me: mutable)
325 ---Purpose: Clears map of already cached projectors.
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;