1 // Created by: Peter KURNEV
2 // Copyright (c) 2010-2014 OPEN CASCADE SAS
3 // Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 // Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
5 // EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 // This file is part of Open CASCADE Technology software library.
9 // This library is free software; you can redistribute it and/or modify it under
10 // the terms of the GNU Lesser General Public License version 2.1 as published
11 // by the Free Software Foundation, with special exception defined in the file
12 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
13 // distribution for complete text of the license and disclaimer of any warranty.
15 // Alternatively, this file may be used under the terms of Open CASCADE
16 // commercial license or contractual agreement.
18 #ifndef _BOPAlgo_PaveFiller_HeaderFile
19 #define _BOPAlgo_PaveFiller_HeaderFile
21 #include <Standard.hxx>
22 #include <Standard_DefineAlloc.hxx>
23 #include <Standard_Handle.hxx>
25 #include <BOPAlgo_Algo.hxx>
26 #include <BOPAlgo_GlueEnum.hxx>
27 #include <BOPAlgo_SectionAttribute.hxx>
28 #include <BOPDS_DataMapOfPaveBlockListOfPaveBlock.hxx>
29 #include <BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx>
30 #include <BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx>
31 #include <BOPDS_IndexedMapOfPaveBlock.hxx>
32 #include <BOPDS_ListOfPaveBlock.hxx>
33 #include <BOPDS_MapOfPair.hxx>
34 #include <BOPDS_MapOfPaveBlock.hxx>
35 #include <BOPDS_PDS.hxx>
36 #include <BOPDS_PIterator.hxx>
37 #include <BOPDS_VectorOfCurve.hxx>
38 #include <IntSurf_ListOfPntOn2S.hxx>
39 #include <IntTools_ShrunkRange.hxx>
40 #include <NCollection_BaseAllocator.hxx>
41 #include <Standard_Boolean.hxx>
42 #include <Standard_Integer.hxx>
43 #include <Standard_Real.hxx>
44 #include <TColStd_DataMapOfIntegerInteger.hxx>
45 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
46 #include <TColStd_DataMapOfIntegerReal.hxx>
47 #include <TColStd_ListOfInteger.hxx>
48 #include <TColStd_MapOfInteger.hxx>
49 #include <TopAbs_ShapeEnum.hxx>
50 #include <TopTools_DataMapOfShapeInteger.hxx>
51 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
52 #include <TopTools_IndexedMapOfShape.hxx>
53 #include <TopTools_ListOfShape.hxx>
54 class IntTools_Context;
56 class BOPAlgo_SectionAttribute;
57 class BOPDS_PaveBlock;
58 class BOPDS_CommonBlock;
66 //! The class represents the Intersection phase of the
67 //! Boolean Operations algorithm.<br>
68 //! It performs the pairwise intersection of the sub-shapes of
69 //! the arguments in the following order:<br>
70 //! 1. Vertex/Vertex;<br>
71 //! 2. Vertex/Edge;<br>
73 //! 4. Vertex/Face;<br>
77 //! The results of intersection are stored into the Data Structure
78 //! of the algorithm.<br>
80 //! Additionally to the options provided by the parent class,
81 //! the algorithm has the following options:<br>
82 //! - *Section attributes* - allows to customize the intersection of the faces
83 //! (avoid approximation or building 2d curves);<br>
84 //! - *Safe processing mode* - allows to avoid modification of the input
85 //! shapes during the operation (by default it is off);<br>
86 //! - *Gluing options* - allows to speed up the calculation on the special
87 //! cases, in which some sub-shapes are coincide.<br>
89 //! The algorithm returns the following Warning statuses:
90 //! - *BOPAlgo_AlertSelfInterferingShape* - in case some of the argument shapes are self-interfering shapes;
91 //! - *BOPAlgo_AlertTooSmallEdge* - in case some edges of the input shapes have no valid range;
92 //! - *BOPAlgo_AlertNotSplittableEdge* - in case some edges of the input shapes has such a small
93 //! valid range so it cannot be split;
94 //! - *BOPAlgo_AlertBadPositioning* - in case the positioning of the input shapes leads to creation
96 //! - *BOPAlgo_AlertIntersectionOfPairOfShapesFailed* - in case intersection of some of the
97 //! sub-shapes has failed;
98 //! - *BOPAlgo_AlertAcquiredSelfIntersection* - in case some sub-shapes of the argument become connected
99 //! through other shapes;
100 //! - *BOPAlgo_AlertBuildingPCurveFailed* - in case building 2D curve for some of the edges
101 //! on the faces has failed.
103 //! The algorithm returns the following Error alerts:
104 //! - *BOPAlgo_AlertTooFewArguments* - in case there are no enough arguments to
105 //! perform the operation;<br>
106 //! - *BOPAlgo_AlertIntersectionFailed* - in case some unexpected error occurred;<br>
107 //! - *BOPAlgo_AlertNullInputShapes* - in case some of the arguments are null shapes.<br>
109 class BOPAlgo_PaveFiller : public BOPAlgo_Algo
113 DEFINE_STANDARD_ALLOC
116 Standard_EXPORT BOPAlgo_PaveFiller();
118 Standard_EXPORT virtual ~BOPAlgo_PaveFiller();
120 Standard_EXPORT BOPAlgo_PaveFiller(const Handle(NCollection_BaseAllocator)& theAllocator);
122 Standard_EXPORT const BOPDS_DS& DS();
124 Standard_EXPORT BOPDS_PDS PDS();
126 Standard_EXPORT const BOPDS_PIterator& Iterator();
128 Standard_EXPORT void SetArguments (const TopTools_ListOfShape& theLS);
130 Standard_EXPORT const TopTools_ListOfShape& Arguments() const;
132 Standard_EXPORT const Handle(IntTools_Context)& Context();
134 Standard_EXPORT void SetSectionAttribute (const BOPAlgo_SectionAttribute& theSecAttr);
136 //! Sets the flag that defines the mode of treatment.
137 //! In non-destructive mode the argument shapes are not modified. Instead
138 //! a copy of a sub-shape is created in the result if it is needed to be updated.
139 Standard_EXPORT void SetNonDestructive(const Standard_Boolean theFlag);
141 //! Returns the flag that defines the mode of treatment.
142 //! In non-destructive mode the argument shapes are not modified. Instead
143 //! a copy of a sub-shape is created in the result if it is needed to be updated.
144 Standard_EXPORT Standard_Boolean NonDestructive() const;
146 Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
150 //! Sets the glue option for the algorithm
151 Standard_EXPORT void SetGlue(const BOPAlgo_GlueEnum theGlue);
153 //! Returns the glue option of the algorithm
154 Standard_EXPORT BOPAlgo_GlueEnum Glue() const;
156 //! Sets the flag to avoid building of p-curves of edges on faces
157 void SetAvoidBuildPCurve(const Standard_Boolean theValue)
159 myAvoidBuildPCurve = theValue;
162 //! Returns the flag to avoid building of p-curves of edges on faces
163 Standard_Boolean IsAvoidBuildPCurve() const
165 return myAvoidBuildPCurve;
170 typedef NCollection_DataMap
171 <Handle(BOPDS_PaveBlock),
173 TColStd_MapTransientHasher> BOPAlgo_DataMapOfPaveBlockBndBox;
175 typedef NCollection_DataMap
176 <Handle(BOPDS_PaveBlock),
177 TColStd_ListOfInteger,
178 TColStd_MapTransientHasher> BOPAlgo_DataMapOfPaveBlockListOfInteger;
180 typedef NCollection_DataMap
182 BOPDS_MapOfPaveBlock> BOPAlgo_DataMapOfIntegerMapOfPaveBlock;
184 //! Sets non-destructive mode automatically if an argument
185 //! contains a locked sub-shape (see TopoDS_Shape::Locked()).
186 Standard_EXPORT void SetNonDestructive();
188 Standard_EXPORT void SetIsPrimary(const Standard_Boolean theFlag);
190 Standard_EXPORT Standard_Boolean IsPrimary() const;
192 Standard_EXPORT virtual void PerformInternal();
194 Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
196 Standard_EXPORT virtual void Init();
198 Standard_EXPORT void Prepare();
200 Standard_EXPORT virtual void PerformVV();
202 Standard_EXPORT virtual void PerformVE();
204 //! Performs the intersection of the vertices with edges.
205 Standard_EXPORT void IntersectVE(const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theVEPairs,
206 const Standard_Boolean bAddInterfs = Standard_True);
208 //! Splits the Pave Blocks of the given edges with the extra paves.<br>
209 //! The method also builds the shrunk data for the new pave blocks and
210 //! in case there is no valid range on the pave block, the vertices of
211 //! this pave block will be united making SD vertex.<br>
212 //! Parameter <theAddInterfs> defines whether this interference will be added
213 //! into common table of interferences or not.<br>
214 //! If some of the Pave Blocks are forming the Common Blocks, the splits
215 //! of the Pave Blocks will also form a Common Block.
216 Standard_EXPORT void SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges,
217 const Standard_Boolean theAddInterfs);
219 Standard_EXPORT virtual void PerformVF();
221 Standard_EXPORT virtual void PerformEE();
223 Standard_EXPORT virtual void PerformEF();
225 Standard_EXPORT virtual void PerformFF();
227 Standard_EXPORT void TreatVerticesEE();
229 Standard_EXPORT void MakeSDVerticesFF(const TColStd_DataMapOfIntegerListOfInteger& aDMVLV,
230 TColStd_DataMapOfIntegerInteger& theDMNewSD);
232 Standard_EXPORT void MakeSplitEdges();
234 Standard_EXPORT void MakeBlocks();
236 Standard_EXPORT void MakePCurves();
238 Standard_EXPORT Standard_Integer MakeSDVertices(const TColStd_ListOfInteger& theVertIndices,
239 const Standard_Boolean theAddInterfs = 1);
241 Standard_EXPORT void ProcessDE();
243 Standard_EXPORT void FillShrunkData (Handle(BOPDS_PaveBlock)& thePB);
245 Standard_EXPORT void FillShrunkData (const TopAbs_ShapeEnum theType1, const TopAbs_ShapeEnum theType2);
247 //! Analyzes the results of computation of the valid range for the
248 //! pave block and in case of error adds the warning status, otherwise
249 //! saves the valid range in the pave block.
250 Standard_EXPORT void AnalyzeShrunkData(const Handle(BOPDS_PaveBlock)& thePB,
251 const IntTools_ShrunkRange& theSR);
253 //! Performs intersection of new vertices, obtained in E/E and E/F intersections
254 Standard_EXPORT void PerformNewVertices(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
255 const Handle(NCollection_BaseAllocator)& theAllocator,
256 const Standard_Boolean theIsEEIntersection = Standard_True);
258 Standard_EXPORT Standard_Boolean CheckFacePaves (const TopoDS_Vertex& theVnew, const TColStd_MapOfInteger& theMIF);
260 Standard_EXPORT static Standard_Boolean CheckFacePaves (const Standard_Integer theN, const TColStd_MapOfInteger& theMIFOn, const TColStd_MapOfInteger& theMIFIn);
262 Standard_EXPORT Standard_Boolean IsExistingVertex (const gp_Pnt& theP, const Standard_Real theTol, const TColStd_MapOfInteger& theMVOn) const;
265 //! Checks and puts paves from <theMVOnIn> on the curve <theNC>.
266 //! At that, common (from theMVCommon) and not common vertices
267 //! are processed differently.
268 Standard_EXPORT void PutPavesOnCurve(const TColStd_MapOfInteger& theMVOnIn,
269 const TColStd_MapOfInteger& theMVCommon,
271 const TColStd_MapOfInteger& theMI,
272 const TColStd_MapOfInteger& theMVEF,
273 TColStd_DataMapOfIntegerReal& theMVTol,
274 TColStd_DataMapOfIntegerListOfInteger& theDMVLV);
276 Standard_EXPORT void FilterPavesOnCurves(const BOPDS_VectorOfCurve& theVNC,
277 TColStd_DataMapOfIntegerReal& theMVTol);
279 //! Depending on the parameter aType it checks whether
280 //! the vertex nV was created in EE or EF intersections.
281 //! If so, it increases aTolVExt from tolerance value of vertex to
282 //! the max distance from vertex nV to the ends of the range of common part.
283 //! Possible values of aType:
284 //! 1 - checks only EE;
285 //! 2 - checks only EF;
286 //! other - checks both types of intersections.
287 Standard_EXPORT Standard_Boolean ExtendedTolerance (const Standard_Integer nV, const TColStd_MapOfInteger& aMI, Standard_Real& aTolVExt, const Standard_Integer aType = 0);
289 Standard_EXPORT void PutBoundPaveOnCurve(const TopoDS_Face& theF1,
290 const TopoDS_Face& theF2,
292 TColStd_ListOfInteger& theLBV);
294 //! Checks if the given pave block (created on section curve)
295 //! coincides with any of the pave blocks of the faces
296 //! created the section curve.
297 Standard_EXPORT Standard_Boolean IsExistingPaveBlock
298 (const Handle(BOPDS_PaveBlock)& thePB, const BOPDS_Curve& theNC,
299 const Standard_Real theTolR3D, const BOPDS_IndexedMapOfPaveBlock& theMPB,
300 const BOPDS_MapOfPaveBlock& theMPBCommon,
301 Handle(BOPDS_PaveBlock)& thePBOut, Standard_Real& theTolNew);
303 //! Checks if the given pave block (created on section curve)
304 //! coincides with any of the edges shared between the faces
305 //! created the section curve.
306 Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const Handle(BOPDS_PaveBlock)& thePB,
307 const BOPDS_Curve& theNC,
308 const TColStd_ListOfInteger& theLSE,
309 Standard_Integer& theNEOut,
310 Standard_Real& theTolNew);
312 //! Treatment of section edges.
313 Standard_EXPORT void PostTreatFF (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
314 BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDMExEdges,
315 TColStd_DataMapOfIntegerInteger& theDMNewSD,
316 const BOPDS_IndexedMapOfPaveBlock& theMicroPB,
317 const TopTools_IndexedMapOfShape& theVertsOnRejectedPB,
318 const Handle(NCollection_BaseAllocator)& theAllocator);
320 Standard_EXPORT void FindPaveBlocks (const Standard_Integer theV, const Standard_Integer theF, BOPDS_ListOfPaveBlock& theLPB);
322 Standard_EXPORT void FillPaves (const Standard_Integer theV, const Standard_Integer theE, const Standard_Integer theF, const BOPDS_ListOfPaveBlock& theLPB, const Handle(BOPDS_PaveBlock)& thePB);
324 Standard_EXPORT void MakeSplitEdge (const Standard_Integer theV, const Standard_Integer theF);
326 Standard_EXPORT void GetEFPnts (const Standard_Integer nF1, const Standard_Integer nF2, IntSurf_ListOfPntOn2S& aListOfPnts);
329 //! Checks and puts paves created in EF intersections on the curve <theNC>.
330 Standard_EXPORT void PutEFPavesOnCurve (BOPDS_Curve& theNC,
331 const TColStd_MapOfInteger& theMI,
332 const TColStd_MapOfInteger& theMVEF,
333 TColStd_DataMapOfIntegerReal& theMVTol,
334 TColStd_DataMapOfIntegerListOfInteger& aDMVLV);
337 //! Puts stick paves on the curve <theNC>
338 Standard_EXPORT void PutStickPavesOnCurve (const TopoDS_Face& aF1,
339 const TopoDS_Face& aF2,
340 const TColStd_MapOfInteger& theMI,
342 const TColStd_MapOfInteger& theMVStick,
343 TColStd_DataMapOfIntegerReal& theMVTol,
344 TColStd_DataMapOfIntegerListOfInteger& aDMVLV);
347 //! Collects indices of vertices created in all intersections between
348 //! two faces (<nF1> and <nF2>) to the map <theMVStick>.
349 //! Also, it collects indices of EF vertices to the <theMVEF> map
350 //! and indices of all subshapes of these two faces to the <theMI> map.
351 Standard_EXPORT void GetStickVertices (const Standard_Integer nF1, const Standard_Integer nF2, TColStd_MapOfInteger& theMVStick, TColStd_MapOfInteger& theMVEF, TColStd_MapOfInteger& theMI);
354 //! Collects index nF and indices of all subshapes of the shape with index <nF>
355 //! to the map <theMI>.
356 Standard_EXPORT void GetFullShapeMap (const Standard_Integer nF, TColStd_MapOfInteger& theMI);
359 //! Removes indices of vertices that are already on the
360 //! curve <theNC> from the map <theMV>.
361 //! It is used in PutEFPavesOnCurve and PutStickPavesOnCurve methods.
362 Standard_EXPORT void RemoveUsedVertices (const BOPDS_Curve& theNC, TColStd_MapOfInteger& theMV);
365 //! Puts the pave nV on the curve theNC.
366 //! Parameter aType defines whether to check the pave with
367 //! extended tolerance:
368 //! 0 - do not perform the check;
369 //! other - perform the check (aType goes to ExtendedTolerance).
370 Standard_EXPORT void PutPaveOnCurve (const Standard_Integer nV,
371 const Standard_Real theTolR3D,
372 const BOPDS_Curve& theNC,
373 const TColStd_MapOfInteger& theMI,
374 TColStd_DataMapOfIntegerReal& theMVTol,
375 TColStd_DataMapOfIntegerListOfInteger& aDMVLV,
376 const Standard_Integer aType = 0);
379 //! Adds the existing edges from the map <theMPBOnIn> which interfere
380 //! with the vertices from <theMVB> map to the post treatment of section edges.
381 Standard_EXPORT void ProcessExistingPaveBlocks (const Standard_Integer theInt,
382 const Standard_Integer nF1,
383 const Standard_Integer nF2,
384 const BOPDS_IndexedMapOfPaveBlock& theMPBOnIn,
385 const TColStd_DataMapOfIntegerListOfInteger& theDMBV,
386 BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
387 TopTools_DataMapOfShapeInteger& theMVI,
388 BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap,
389 BOPDS_MapOfPaveBlock& theMPB);
392 //! Replaces existing pave block <thePB> with new pave blocks <theLPB>.
393 //! The list <theLPB> contains images of <thePB> which were created in
394 //! the post treatment of section edges.
395 //! Tries to project the new edges on the faces contained in the <thePBFacesMap>.
396 Standard_EXPORT void UpdateExistingPaveBlocks(const Handle(BOPDS_PaveBlock)& thePB,
397 BOPDS_ListOfPaveBlock& theLPB,
398 const BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap);
400 //! Treatment of vertices that were created in EE intersections.
401 Standard_EXPORT void TreatNewVertices(const BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, TopTools_IndexedDataMapOfShapeListOfShape& theImages);
404 //! Put paves on the curve <aBC> in case when <aBC>
405 //! is closed 3D-curve
406 Standard_EXPORT void PutClosingPaveOnCurve (BOPDS_Curve& aNC);
409 //! Keeps data for post treatment
410 Standard_EXPORT void PreparePostTreatFF (const Standard_Integer aInt, const Standard_Integer aCur, const Handle(BOPDS_PaveBlock)& aPB, BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB, TopTools_DataMapOfShapeInteger& aMVI, BOPDS_ListOfPaveBlock& aLPB);
412 //! Updates the information about faces
413 Standard_EXPORT void UpdateFaceInfo(BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDME,
414 const TColStd_DataMapOfIntegerInteger& theDMV,
415 const BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap);
417 //! Updates tolerance of vertex with index <nV>
418 //! to make it interfere with edge.
419 //! Returns TRUE if intersection happened.
420 Standard_EXPORT Standard_Boolean ForceInterfVE(const Standard_Integer nV,
421 Handle(BOPDS_PaveBlock)& aPB,
422 TColStd_MapOfInteger& theMEdges);
424 //! Updates tolerance of vertex with index <nV>
425 //! to make it interfere with face with index <nF>
426 Standard_EXPORT Standard_Boolean ForceInterfVF (const Standard_Integer nV, const Standard_Integer nF);
429 //! Checks if there are any common or intersecting sub shapes
430 //! between two planar faces.
431 Standard_EXPORT Standard_Boolean CheckPlanes (const Standard_Integer nF1, const Standard_Integer nF2) const;
434 //! Creates new edge from the edge nE with vertices nV1 and nV2
435 //! and returns the index of that new edge in the DS.
436 Standard_EXPORT Standard_Integer SplitEdge (const Standard_Integer nE, const Standard_Integer nV1, const Standard_Real aT1, const Standard_Integer nV2, const Standard_Real aT2);
439 //! Updates pave blocks which have the paves with indices contained
440 //! in the map <aDMNewSD>.
441 Standard_EXPORT void UpdatePaveBlocks(const TColStd_DataMapOfIntegerInteger& aDMNewSD);
443 //! Updates tolerance vertex nV due to V/E interference.
444 //! It always creates new vertex if nV is from arguments.
445 //! @return DS index of updated vertex.
446 Standard_EXPORT Standard_Integer UpdateVertex(const Standard_Integer nV,
447 const Standard_Real aTolNew);
449 Standard_EXPORT void UpdatePaveBlocksWithSDVertices();
451 Standard_EXPORT void UpdateCommonBlocksWithSDVertices();
453 Standard_EXPORT void UpdateBlocksWithSharedVertices();
455 Standard_EXPORT void UpdateInterfsWithSDVertices();
457 Standard_EXPORT Standard_Boolean EstimatePaveOnCurve(const Standard_Integer nV,
458 const BOPDS_Curve& theNC,
459 const Standard_Real theTolR3D);
461 Standard_EXPORT void UpdateEdgeTolerance(const Standard_Integer nE,
462 const Standard_Real aTolNew);
464 Standard_EXPORT void RemovePaveBlocks(const TColStd_MapOfInteger theEdges);
466 Standard_EXPORT void CorrectToleranceOfSE();
468 //! Reduce the intersection range using the common ranges of
469 //! Edge/Edge interferences to avoid creation of close
470 //! intersection vertices
471 Standard_EXPORT void ReduceIntersectionRange(const Standard_Integer theV1,
472 const Standard_Integer theV2,
473 const Standard_Integer theE,
474 const Standard_Integer theF,
475 Standard_Real& theTS1,
476 Standard_Real& theTS2);
478 //! Gets the bounding box for the given Pave Block.
479 //! If Pave Block has shrunk data it will be used to get the box,
480 //! and the Shrunk Range (<theSFirst>, <theSLast>).
481 //! Otherwise the box will be computed using BndLib_Add3dCurve method,
482 //! and the Shrunk Range will be equal to the PB's range.
483 //! To avoid re-computation of the bounding box for the same Pave Block
484 //! it will be saved in the map <thePBBox>.
485 //! Returns FALSE in case the PB's range is less than the
486 //! Precision::PConfusion(), otherwise returns TRUE.
487 Standard_EXPORT Standard_Boolean GetPBBox(const TopoDS_Edge& theE,
488 const Handle(BOPDS_PaveBlock)& thePB,
489 BOPAlgo_DataMapOfPaveBlockBndBox& thePBBox,
490 Standard_Real& theFirst,
491 Standard_Real& theLast,
492 Standard_Real& theSFirst,
493 Standard_Real& theSLast,
496 //! Treatment of the possible common zones, not detected by the
497 //! Face/Face intersection algorithm, by intersection of each section edge
498 //! with all faces not participated in creation of that section edge.
499 //! If the intersection says that the section edge is lying on the face
500 //! it will be added into FaceInfo structure of the face as IN edge
501 //! and will be used for splitting.
502 Standard_EXPORT void PutSEInOtherFaces();
504 //! Analyzes the results of interferences of sub-shapes of the shapes
505 //! looking for self-interfering entities by the following rules:<br>
506 //! 1. The Faces of the same shape considered interfering in case they:<br>
507 //! - Interfere with the other shapes in the same place (in the same vertex) or;<br>
508 //! - Included in the same common block.
509 //! 2. The Faces of the same shape considered interfering in case they
510 //! share the IN or SECTION edges.<br>
511 //! In case self-interference is found the warning is added.
512 Standard_EXPORT void CheckSelfInterference();
514 //! Adds the warning about failed intersection of pair of sub-shapes
515 Standard_EXPORT void AddIntersectionFailedWarning(const TopoDS_Shape& theS1, const TopoDS_Shape& theS2);
517 //! Repeat intersection of sub-shapes with increased vertices.
518 Standard_EXPORT void RepeatIntersection();
520 //! Updates vertices of CommonBlocks with real tolerance of CB.
521 Standard_EXPORT void UpdateVerticesOfCB();
523 //! The method looks for the additional common blocks among pairs of edges
524 //! with the same bounding vertices.
525 Standard_EXPORT void ForceInterfEE();
527 //! The method looks for the additional edge/face common blocks
528 //! among pairs of edge/face having the same vertices.
529 Standard_EXPORT void ForceInterfEF();
531 //! Performs intersection of given pave blocks
532 //! with all faces from arguments.
533 Standard_EXPORT void ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB,
534 const Standard_Boolean theAddInterf);
536 //! When all section edges are created and no increase of the tolerance
537 //! of vertices put on the section edges is expected, make sure that
538 //! the created sections have valid range.
539 //! If any of the section edges do not have valid range, remove them
540 //! from Face/Face intersection info and from the input <theMSCPB> map.
541 //! Put such edges into <MicroPB> map for further unification of their
542 //! vertices in the PostTreatFF method.
544 //! All these section edges have already been checked to have valid range.
545 //! Current check is necessary for the edges whose vertices have also
546 //! been put on other section edges with greater tolerance, which has caused
547 //! increase of the tolerance value of the vertices.
548 Standard_EXPORT void RemoveMicroSectionEdges(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
549 BOPDS_IndexedMapOfPaveBlock& theMicroPB);
552 TopTools_ListOfShape myArguments;
554 BOPDS_PIterator myIterator;
555 Handle(IntTools_Context) myContext;
556 BOPAlgo_SectionAttribute mySectionAttribute;
557 Standard_Boolean myNonDestructive;
558 Standard_Boolean myIsPrimary;
559 Standard_Boolean myAvoidBuildPCurve;
560 BOPAlgo_GlueEnum myGlue;
562 BOPAlgo_DataMapOfIntegerMapOfPaveBlock myFPBDone; //!< Fence map of intersected faces and pave blocks
563 TColStd_MapOfInteger myIncreasedSS; //!< Sub-shapes with increased tolerance during the operation
564 TColStd_MapOfInteger myVertsToAvoidExtension; //!< Vertices located close to E/E or E/F intersection points
565 //! which has already been extended to cover the real intersection
566 //! points, and should not be extended any longer to be put
567 //! on a section curve.
571 #endif // _BOPAlgo_PaveFiller_HeaderFile