Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/BOPAlgo_PaveFiller.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created by: Peter KURNEV
0002 // Copyright (c) 2010-2014 OPEN CASCADE SAS
0003 // Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
0004 // Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
0005 //                         EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
0006 //
0007 // This file is part of Open CASCADE Technology software library.
0008 //
0009 // This library is free software; you can redistribute it and/or modify it under
0010 // the terms of the GNU Lesser General Public License version 2.1 as published
0011 // by the Free Software Foundation, with special exception defined in the file
0012 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0013 // distribution for complete text of the license and disclaimer of any warranty.
0014 //
0015 // Alternatively, this file may be used under the terms of Open CASCADE
0016 // commercial license or contractual agreement.
0017 
0018 #ifndef _BOPAlgo_PaveFiller_HeaderFile
0019 #define _BOPAlgo_PaveFiller_HeaderFile
0020 
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 #include <Standard_Handle.hxx>
0024 
0025 #include <BOPAlgo_Algo.hxx>
0026 #include <BOPAlgo_GlueEnum.hxx>
0027 #include <BOPAlgo_SectionAttribute.hxx>
0028 #include <NCollection_DataMap.hxx>
0029 #include <BOPDS_PaveBlock.hxx>
0030 #include <NCollection_IndexedDataMap.hxx>
0031 #include <Standard_Integer.hxx>
0032 #include <NCollection_List.hxx>
0033 #include <BOPDS_CoupleOfPaveBlocks.hxx>
0034 #include <TopTools_ShapeMapHasher.hxx>
0035 #include <NCollection_IndexedMap.hxx>
0036 #include <NCollection_Map.hxx>
0037 #include <BOPDS_Pair.hxx>
0038 #include <BOPDS_PDS.hxx>
0039 #include <BOPDS_PIterator.hxx>
0040 #include <NCollection_DynamicArray.hxx>
0041 #include <BOPDS_Curve.hxx>
0042 #include <BOPTools_BoxTree.hxx>
0043 #include <IntSurf_PntOn2S.hxx>
0044 #include <IntTools_ShrunkRange.hxx>
0045 #include <NCollection_BaseAllocator.hxx>
0046 #include <Standard_Real.hxx>
0047 #include <TopAbs_ShapeEnum.hxx>
0048 #include <TopoDS_Shape.hxx>
0049 
0050 #include <utility>
0051 
0052 class IntTools_Context;
0053 class BOPDS_PaveBlock;
0054 class gp_Pnt;
0055 class BOPDS_Curve;
0056 class TopoDS_Vertex;
0057 class TopoDS_Edge;
0058 class TopoDS_Face;
0059 
0060 //!
0061 //! The class represents the Intersection phase of the
0062 //! Boolean Operations algorithm.
0063 //! It performs the pairwise intersection of the sub-shapes of
0064 //! the arguments in the following order:
0065 //! 1. Vertex/Vertex;
0066 //! 2. Vertex/Edge;
0067 //! 3. Edge/Edge;
0068 //! 4. Vertex/Face;
0069 //! 5. Edge/Face;
0070 //! 6. Face/Face.
0071 //!
0072 //! The results of intersection are stored into the Data Structure
0073 //! of the algorithm.
0074 //!
0075 //! Additionally to the options provided by the parent class,
0076 //! the algorithm has the following options:
0077 //! - *Section attributes* - allows to customize the intersection of the faces
0078 //!                          (avoid approximation or building 2d curves);
0079 //! - *Safe processing mode* - allows to avoid modification of the input
0080 //!                            shapes during the operation (by default it is off);
0081 //! - *Gluing options* - allows to speed up the calculation on the special
0082 //!                      cases, in which some sub-shapes are coincide.
0083 //!
0084 //! The algorithm returns the following Warning statuses:
0085 //! - *BOPAlgo_AlertSelfInterferingShape* - in case some of the argument shapes are self-interfering
0086 //! shapes;
0087 //! - *BOPAlgo_AlertTooSmallEdge* - in case some edges of the input shapes have no valid range;
0088 //! - *BOPAlgo_AlertNotSplittableEdge* - in case some edges of the input shapes has such a small
0089 //!                                      valid range so it cannot be split;
0090 //! - *BOPAlgo_AlertBadPositioning* - in case the positioning of the input shapes leads to creation
0091 //!                                   of small edges;
0092 //! - *BOPAlgo_AlertIntersectionOfPairOfShapesFailed* - in case intersection of some of the
0093 //!                                                     sub-shapes has failed;
0094 //! - *BOPAlgo_AlertAcquiredSelfIntersection* - in case some sub-shapes of the argument become
0095 //! connected
0096 //!                                             through other shapes;
0097 //! - *BOPAlgo_AlertBuildingPCurveFailed* - in case building 2D curve for some of the edges
0098 //!                                         on the faces has failed.
0099 //!
0100 //! The algorithm returns the following Error alerts:
0101 //! - *BOPAlgo_AlertTooFewArguments* - in case there are no enough arguments to
0102 //!                      perform the operation;
0103 //! - *BOPAlgo_AlertIntersectionFailed* - in case some unexpected error occurred;
0104 //! - *BOPAlgo_AlertNullInputShapes* - in case some of the arguments are null shapes.
0105 //!
0106 class BOPAlgo_PaveFiller : public BOPAlgo_Algo
0107 {
0108 public:
0109   DEFINE_STANDARD_ALLOC
0110 
0111   Standard_EXPORT BOPAlgo_PaveFiller();
0112 
0113   Standard_EXPORT ~BOPAlgo_PaveFiller() override;
0114 
0115   Standard_EXPORT BOPAlgo_PaveFiller(const occ::handle<NCollection_BaseAllocator>& theAllocator);
0116 
0117   Standard_EXPORT const BOPDS_DS& DS();
0118 
0119   Standard_EXPORT BOPDS_PDS PDS();
0120 
0121   Standard_EXPORT const BOPDS_PIterator& Iterator();
0122 
0123   //! Sets the arguments for operation
0124   void SetArguments(const NCollection_List<TopoDS_Shape>& theLS) { myArguments = theLS; }
0125 
0126   //! Sets the arguments for operation (move semantics)
0127   void SetArguments(NCollection_List<TopoDS_Shape>&& theLS) { myArguments = std::move(theLS); }
0128 
0129   //! Adds the argument for operation
0130   void AddArgument(const TopoDS_Shape& theShape) { myArguments.Append(theShape); }
0131 
0132   //! Returns the list of arguments
0133   const NCollection_List<TopoDS_Shape>& Arguments() const { return myArguments; }
0134 
0135   Standard_EXPORT const occ::handle<IntTools_Context>& Context();
0136 
0137   Standard_EXPORT void SetSectionAttribute(const BOPAlgo_SectionAttribute& theSecAttr);
0138 
0139   //! Sets the flag that defines the mode of treatment.
0140   //! In non-destructive mode the argument shapes are not modified. Instead
0141   //! a copy of a sub-shape is created in the result if it is needed to be updated.
0142   Standard_EXPORT void SetNonDestructive(const bool theFlag);
0143 
0144   //! Returns the flag that defines the mode of treatment.
0145   //! In non-destructive mode the argument shapes are not modified. Instead
0146   //! a copy of a sub-shape is created in the result if it is needed to be updated.
0147   Standard_EXPORT bool NonDestructive() const;
0148 
0149   Standard_EXPORT void Perform(
0150     const Message_ProgressRange& theRange = Message_ProgressRange()) override;
0151 
0152   //! Sets the glue option for the algorithm
0153   Standard_EXPORT void SetGlue(const BOPAlgo_GlueEnum theGlue);
0154 
0155   //! Returns the glue option of the algorithm
0156   Standard_EXPORT BOPAlgo_GlueEnum Glue() const;
0157 
0158   //! Sets the flag to avoid building of p-curves of edges on faces
0159   void SetAvoidBuildPCurve(const bool theValue) { myAvoidBuildPCurve = theValue; }
0160 
0161   //! Returns the flag to avoid building of p-curves of edges on faces
0162   bool IsAvoidBuildPCurve() const { return myAvoidBuildPCurve; }
0163 
0164 protected:
0165   typedef NCollection_DataMap<occ::handle<BOPDS_PaveBlock>, Bnd_Box>
0166     BOPAlgo_DataMapOfPaveBlockBndBox;
0167 
0168   typedef NCollection_DataMap<occ::handle<BOPDS_PaveBlock>, NCollection_List<int>>
0169     BOPAlgo_DataMapOfPaveBlockListOfInteger;
0170 
0171   typedef NCollection_DataMap<int, NCollection_Map<occ::handle<BOPDS_PaveBlock>>>
0172     BOPAlgo_DataMapOfIntegerMapOfPaveBlock;
0173 
0174   //! Sets non-destructive mode automatically if an argument
0175   //! contains a locked sub-shape (see TopoDS_Shape::Locked()).
0176   Standard_EXPORT void SetNonDestructive();
0177 
0178   Standard_EXPORT void SetIsPrimary(const bool theFlag);
0179 
0180   Standard_EXPORT bool IsPrimary() const;
0181 
0182   Standard_EXPORT virtual void PerformInternal(const Message_ProgressRange& theRange);
0183 
0184   Standard_EXPORT void Clear() override;
0185 
0186   Standard_EXPORT virtual void Init(const Message_ProgressRange& theRange);
0187 
0188   Standard_EXPORT void Prepare(const Message_ProgressRange& theRange);
0189 
0190   Standard_EXPORT virtual void PerformVV(const Message_ProgressRange& theRange);
0191 
0192   Standard_EXPORT virtual void PerformVE(const Message_ProgressRange& theRange);
0193 
0194   //! Performs the intersection of the vertices with edges.
0195   Standard_EXPORT void IntersectVE(
0196     const NCollection_IndexedDataMap<occ::handle<BOPDS_PaveBlock>, NCollection_List<int>>&
0197                                  theVEPairs,
0198     const Message_ProgressRange& theRange,
0199     const bool                   bAddInterfs = true);
0200 
0201   //! Splits the Pave Blocks of the given edges with the extra paves.
0202   //! The method also builds the shrunk data for the new pave blocks and
0203   //! in case there is no valid range on the pave block, the vertices of
0204   //! this pave block will be united making SD vertex.
0205   //! Parameter <theAddInterfs> defines whether this interference will be added
0206   //! into common table of interferences or not.
0207   //! If some of the Pave Blocks are forming the Common Blocks, the splits
0208   //! of the Pave Blocks will also form a Common Block.
0209   Standard_EXPORT void SplitPaveBlocks(const NCollection_Map<int>& theMEdges,
0210                                        const bool                  theAddInterfs);
0211 
0212   Standard_EXPORT virtual void PerformVF(const Message_ProgressRange& theRange);
0213 
0214   Standard_EXPORT virtual void PerformEE(const Message_ProgressRange& theRange);
0215 
0216   Standard_EXPORT virtual void PerformEF(const Message_ProgressRange& theRange);
0217 
0218   Standard_EXPORT virtual void PerformFF(const Message_ProgressRange& theRange);
0219 
0220   Standard_EXPORT void TreatVerticesEE();
0221 
0222   Standard_EXPORT void MakeSDVerticesFF(
0223     const NCollection_DataMap<int, NCollection_List<int>>& aDMVLV,
0224     NCollection_DataMap<int, int>&                         theDMNewSD);
0225 
0226   Standard_EXPORT void MakeSplitEdges(const Message_ProgressRange& theRange);
0227 
0228   Standard_EXPORT void MakeBlocks(const Message_ProgressRange& theRange);
0229 
0230   Standard_EXPORT void MakePCurves(const Message_ProgressRange& theRange);
0231 
0232   Standard_EXPORT int MakeSDVertices(const NCollection_List<int>& theVertIndices,
0233                                      const bool                   theAddInterfs = true);
0234 
0235   Standard_EXPORT void ProcessDE(const Message_ProgressRange& theRange);
0236 
0237   Standard_EXPORT void FillShrunkData(occ::handle<BOPDS_PaveBlock>& thePB);
0238 
0239   Standard_EXPORT void FillShrunkData(const TopAbs_ShapeEnum theType1,
0240                                       const TopAbs_ShapeEnum theType2);
0241 
0242   //! Analyzes the results of computation of the valid range for the
0243   //! pave block and in case of error adds the warning status, otherwise
0244   //! saves the valid range in the pave block.
0245   Standard_EXPORT void AnalyzeShrunkData(const occ::handle<BOPDS_PaveBlock>& thePB,
0246                                          const IntTools_ShrunkRange&         theSR);
0247 
0248   //! Performs intersection of new vertices, obtained in E/E and E/F intersections
0249   Standard_EXPORT void PerformNewVertices(
0250     NCollection_IndexedDataMap<TopoDS_Shape, BOPDS_CoupleOfPaveBlocks, TopTools_ShapeMapHasher>&
0251                                                   theMVCPB,
0252     const occ::handle<NCollection_BaseAllocator>& theAllocator,
0253     const Message_ProgressRange&                  theRange,
0254     const bool                                    theIsEEIntersection = true);
0255 
0256   Standard_EXPORT bool CheckFacePaves(const TopoDS_Vertex&        theVnew,
0257                                       const NCollection_Map<int>& theMIF);
0258 
0259   Standard_EXPORT static bool CheckFacePaves(const int                   theN,
0260                                              const NCollection_Map<int>& theMIFOn,
0261                                              const NCollection_Map<int>& theMIFIn);
0262 
0263   Standard_EXPORT bool IsExistingVertex(const gp_Pnt&               theP,
0264                                         const double                theTol,
0265                                         const NCollection_Map<int>& theMVOn) const;
0266 
0267   //! Checks and puts paves from <theMVOnIn> on the curve <theNC>.
0268   //! At that, common (from theMVCommon) and not common vertices
0269   //! are processed differently.
0270   Standard_EXPORT void PutPavesOnCurve(const NCollection_Map<int>&                      theMVOnIn,
0271                                        const NCollection_Map<int>&                      theMVCommon,
0272                                        BOPDS_Curve&                                     theNC,
0273                                        const NCollection_Map<int>&                      theMI,
0274                                        const NCollection_Map<int>&                      theMVEF,
0275                                        NCollection_DataMap<int, double>&                theMVTol,
0276                                        NCollection_DataMap<int, NCollection_List<int>>& theDMVLV);
0277 
0278   Standard_EXPORT void FilterPavesOnCurves(const NCollection_DynamicArray<BOPDS_Curve>& theVNC,
0279                                            NCollection_DataMap<int, double>&            theMVTol);
0280 
0281   //! Depending on the parameter aType it checks whether
0282   //! the vertex nV was created in EE or EF intersections.
0283   //! If so, it increases aTolVExt from tolerance value of vertex to
0284   //! the max distance from vertex nV to the ends of the range of common part.
0285   //! Possible values of aType:
0286   //! 1 - checks only EE;
0287   //! 2 - checks only EF;
0288   //! other - checks both types of intersections.
0289   Standard_EXPORT bool ExtendedTolerance(const int                   nV,
0290                                          const NCollection_Map<int>& aMI,
0291                                          double&                     aTolVExt,
0292                                          const int                   aType = 0);
0293 
0294   Standard_EXPORT void PutBoundPaveOnCurve(const TopoDS_Face&     theF1,
0295                                            const TopoDS_Face&     theF2,
0296                                            BOPDS_Curve&           theNC,
0297                                            NCollection_List<int>& theLBV);
0298 
0299   //! Checks if the given pave block (created on section curve)
0300   //! coincides with any of the pave blocks of the faces
0301   //! created the section curve.
0302   Standard_EXPORT bool IsExistingPaveBlock(
0303     const occ::handle<BOPDS_PaveBlock>&                         thePB,
0304     const BOPDS_Curve&                                          theNC,
0305     const double                                                theTolR3D,
0306     const NCollection_IndexedMap<occ::handle<BOPDS_PaveBlock>>& theMPB,
0307     BOPTools_BoxTree&                                           thePBTree,
0308     const NCollection_Map<occ::handle<BOPDS_PaveBlock>>&        theMPBCommon,
0309     occ::handle<BOPDS_PaveBlock>&                               thePBOut,
0310     double&                                                     theTolNew);
0311 
0312   //! Checks if the given pave block (created on section curve)
0313   //! coincides with any of the edges shared between the faces
0314   //! created the section curve.
0315   Standard_EXPORT bool IsExistingPaveBlock(const occ::handle<BOPDS_PaveBlock>& thePB,
0316                                            const BOPDS_Curve&                  theNC,
0317                                            const NCollection_List<int>&        theLSE,
0318                                            int&                                theNEOut,
0319                                            double&                             theTolNew);
0320 
0321   //! Treatment of section edges.
0322   Standard_EXPORT void PostTreatFF(
0323     NCollection_IndexedDataMap<TopoDS_Shape, BOPDS_CoupleOfPaveBlocks, TopTools_ShapeMapHasher>&
0324                                                                          theMSCPB,
0325     NCollection_DataMap<occ::handle<BOPDS_PaveBlock>,
0326                         NCollection_List<occ::handle<BOPDS_PaveBlock>>>& theDMExEdges,
0327     NCollection_DataMap<int, int>&                                       theDMNewSD,
0328     const NCollection_IndexedMap<occ::handle<BOPDS_PaveBlock>>&          theMicroPB,
0329     const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& theVertsOnRejectedPB,
0330     const occ::handle<NCollection_BaseAllocator>&                        theAllocator,
0331     const Message_ProgressRange&                                         theRange);
0332 
0333   Standard_EXPORT void FindPaveBlocks(const int                                       theV,
0334                                       const int                                       theF,
0335                                       NCollection_List<occ::handle<BOPDS_PaveBlock>>& theLPB);
0336 
0337   Standard_EXPORT void FillPaves(const int                                             theV,
0338                                  const int                                             theE,
0339                                  const int                                             theF,
0340                                  const NCollection_List<occ::handle<BOPDS_PaveBlock>>& theLPB,
0341                                  const occ::handle<BOPDS_PaveBlock>&                   thePB);
0342 
0343   Standard_EXPORT void MakeSplitEdge(const int theV, const int theF);
0344 
0345   Standard_EXPORT void GetEFPnts(const int                          nF1,
0346                                  const int                          nF2,
0347                                  NCollection_List<IntSurf_PntOn2S>& aListOfPnts);
0348 
0349   //! Checks and puts paves created in EF intersections on the curve <theNC>.
0350   Standard_EXPORT void PutEFPavesOnCurve(const NCollection_DynamicArray<BOPDS_Curve>&     theVC,
0351                                          const int                                        theIndex,
0352                                          const NCollection_Map<int>&                      theMI,
0353                                          const NCollection_Map<int>&                      theMVEF,
0354                                          NCollection_DataMap<int, double>&                theMVTol,
0355                                          NCollection_DataMap<int, NCollection_List<int>>& aDMVLV);
0356 
0357   //! Puts stick paves on the curve <theNC>
0358   Standard_EXPORT void PutStickPavesOnCurve(
0359     const TopoDS_Face&                               aF1,
0360     const TopoDS_Face&                               aF2,
0361     const NCollection_Map<int>&                      theMI,
0362     const NCollection_DynamicArray<BOPDS_Curve>&     theVC,
0363     const int                                        theIndex,
0364     const NCollection_Map<int>&                      theMVStick,
0365     NCollection_DataMap<int, double>&                theMVTol,
0366     NCollection_DataMap<int, NCollection_List<int>>& aDMVLV);
0367 
0368   //! Collects indices of vertices created in all intersections between
0369   //! two faces (<nF1> and <nF2>) to the map <theMVStick>.
0370   //! Also, it collects indices of EF vertices to the <theMVEF> map
0371   //! and indices of all subshapes of these two faces to the <theMI> map.
0372   Standard_EXPORT void GetStickVertices(const int             nF1,
0373                                         const int             nF2,
0374                                         NCollection_Map<int>& theMVStick,
0375                                         NCollection_Map<int>& theMVEF,
0376                                         NCollection_Map<int>& theMI);
0377 
0378   //! Collects index nF and indices of all subshapes of the shape with index <nF>
0379   //! to the map <theMI>.
0380   Standard_EXPORT void GetFullShapeMap(const int nF, NCollection_Map<int>& theMI);
0381 
0382   //! Removes indices of vertices that are already on the
0383   //! curve <theNC> from the map <theMV>.
0384   //! It is used in PutEFPavesOnCurve and PutStickPavesOnCurve methods.
0385   Standard_EXPORT void RemoveUsedVertices(const NCollection_DynamicArray<BOPDS_Curve>& theVC,
0386                                           NCollection_Map<int>&                        theMV);
0387 
0388   //! Puts the pave nV on the curve theNC.
0389   //! Parameter aType defines whether to check the pave with
0390   //! extended tolerance:
0391   //! 0 - do not perform the check;
0392   //! other - perform the check (aType goes to ExtendedTolerance).
0393   Standard_EXPORT void PutPaveOnCurve(const int                                        nV,
0394                                       const double                                     theTolR3D,
0395                                       const BOPDS_Curve&                               theNC,
0396                                       const NCollection_Map<int>&                      theMI,
0397                                       NCollection_DataMap<int, double>&                theMVTol,
0398                                       NCollection_DataMap<int, NCollection_List<int>>& aDMVLV,
0399                                       const int                                        aType = 0);
0400 
0401   //! Adds the existing edges for intersection with section edges
0402   //! by checking the possible intersection with the faces comparing
0403   //! pre-saved E-F distances with new tolerances.
0404   Standard_EXPORT void ProcessExistingPaveBlocks(
0405     const int                                                   theInt,
0406     const int                                                   theCur,
0407     const int                                                   nF1,
0408     const int                                                   nF2,
0409     const TopoDS_Edge&                                          theES,
0410     const NCollection_IndexedMap<occ::handle<BOPDS_PaveBlock>>& theMPBOnIn,
0411     BOPTools_BoxTree&                                           thePBTree,
0412     NCollection_IndexedDataMap<TopoDS_Shape, BOPDS_CoupleOfPaveBlocks, TopTools_ShapeMapHasher>&
0413                                                                      theMSCPB,
0414     NCollection_DataMap<TopoDS_Shape, int, TopTools_ShapeMapHasher>& theMVI,
0415     NCollection_List<occ::handle<BOPDS_PaveBlock>>&                  theLPBC,
0416     BOPAlgo_DataMapOfPaveBlockListOfInteger&                         thePBFacesMap,
0417     NCollection_Map<occ::handle<BOPDS_PaveBlock>>&                   theMPB);
0418 
0419   //! Adds the existing edges from the map <theMPBOnIn> which interfere
0420   //! with the vertices from <theMVB> map to the post treatment of section edges.
0421   Standard_EXPORT void ProcessExistingPaveBlocks(
0422     const int                                                   theInt,
0423     const int                                                   nF1,
0424     const int                                                   nF2,
0425     const NCollection_IndexedMap<occ::handle<BOPDS_PaveBlock>>& theMPBOnIn,
0426     BOPTools_BoxTree&                                           thePBTree,
0427     const NCollection_DataMap<int, NCollection_List<int>>&      theDMBV,
0428     NCollection_IndexedDataMap<TopoDS_Shape, BOPDS_CoupleOfPaveBlocks, TopTools_ShapeMapHasher>&
0429                                                                      theMSCPB,
0430     NCollection_DataMap<TopoDS_Shape, int, TopTools_ShapeMapHasher>& theMVI,
0431     BOPAlgo_DataMapOfPaveBlockListOfInteger&                         thePBFacesMap,
0432     NCollection_Map<occ::handle<BOPDS_PaveBlock>>&                   theMPB);
0433 
0434   //! Replaces existing pave block <thePB> with new pave blocks <theLPB>.
0435   //! The list <theLPB> contains images of <thePB> which were created in
0436   //! the post treatment of section edges.
0437   //! Tries to project the new edges on the faces contained in the <thePBFacesMap>.
0438   Standard_EXPORT void UpdateExistingPaveBlocks(
0439     const occ::handle<BOPDS_PaveBlock>&             thePB,
0440     NCollection_List<occ::handle<BOPDS_PaveBlock>>& theLPB,
0441     const BOPAlgo_DataMapOfPaveBlockListOfInteger&  thePBFacesMap);
0442 
0443   //! Treatment of vertices that were created in EE intersections.
0444   Standard_EXPORT void TreatNewVertices(
0445     const NCollection_IndexedDataMap<TopoDS_Shape,
0446                                      BOPDS_CoupleOfPaveBlocks,
0447                                      TopTools_ShapeMapHasher>& theMVCPB,
0448     NCollection_IndexedDataMap<TopoDS_Shape,
0449                                NCollection_List<TopoDS_Shape>,
0450                                TopTools_ShapeMapHasher>&       theImages);
0451 
0452   //! Put paves on the curve <aBC> in case when <aBC>
0453   //! is closed 3D-curve
0454   Standard_EXPORT void PutClosingPaveOnCurve(BOPDS_Curve& aNC);
0455 
0456   //! Keeps data for post treatment
0457   Standard_EXPORT void PreparePostTreatFF(
0458     const int                           aInt,
0459     const int                           aCur,
0460     const occ::handle<BOPDS_PaveBlock>& aPB,
0461     NCollection_IndexedDataMap<TopoDS_Shape, BOPDS_CoupleOfPaveBlocks, TopTools_ShapeMapHasher>&
0462                                                                      aMSCPB,
0463     NCollection_DataMap<TopoDS_Shape, int, TopTools_ShapeMapHasher>& aMVI,
0464     NCollection_List<occ::handle<BOPDS_PaveBlock>>&                  aLPB);
0465 
0466   //! Updates the information about faces
0467   Standard_EXPORT void UpdateFaceInfo(
0468     NCollection_DataMap<occ::handle<BOPDS_PaveBlock>,
0469                         NCollection_List<occ::handle<BOPDS_PaveBlock>>>& theDME,
0470     const NCollection_DataMap<int, int>&                                 theDMV,
0471     const BOPAlgo_DataMapOfPaveBlockListOfInteger&                       thePBFacesMap);
0472 
0473   //! Updates tolerance of vertex with index <nV>
0474   //! to make it interfere with edge.
0475   //! Returns TRUE if intersection happened.
0476   Standard_EXPORT bool ForceInterfVE(const int                     nV,
0477                                      occ::handle<BOPDS_PaveBlock>& aPB,
0478                                      NCollection_Map<int>&         theMEdges);
0479 
0480   //! Updates tolerance of vertex with index <nV>
0481   //! to make it interfere with face with index <nF>
0482   Standard_EXPORT bool ForceInterfVF(const int nV, const int nF);
0483 
0484   //! Checks if there are any common or intersecting sub shapes
0485   //! between two planar faces.
0486   Standard_EXPORT bool CheckPlanes(const int nF1, const int nF2) const;
0487 
0488   //! Creates new edge from the edge nE with vertices nV1 and nV2
0489   //! and returns the index of that new edge in the DS.
0490   Standard_EXPORT int SplitEdge(const int    nE,
0491                                 const int    nV1,
0492                                 const double aT1,
0493                                 const int    nV2,
0494                                 const double aT2);
0495 
0496   //! Updates pave blocks which have the paves with indices contained
0497   //! in the map <aDMNewSD>.
0498   Standard_EXPORT void UpdatePaveBlocks(const NCollection_DataMap<int, int>& aDMNewSD);
0499 
0500   //! Updates tolerance vertex nV due to V/E interference.
0501   //! It always creates new vertex if nV is from arguments.
0502   //! @return  DS index of updated vertex.
0503   Standard_EXPORT int UpdateVertex(const int nV, const double aTolNew);
0504 
0505   Standard_EXPORT void UpdatePaveBlocksWithSDVertices();
0506 
0507   Standard_EXPORT void UpdateCommonBlocksWithSDVertices();
0508 
0509   Standard_EXPORT void UpdateBlocksWithSharedVertices();
0510 
0511   Standard_EXPORT void UpdateInterfsWithSDVertices();
0512 
0513   Standard_EXPORT bool EstimatePaveOnCurve(const int          nV,
0514                                            const BOPDS_Curve& theNC,
0515                                            const double       theTolR3D);
0516 
0517   Standard_EXPORT void UpdateEdgeTolerance(const int nE, const double aTolNew);
0518 
0519   Standard_EXPORT void RemovePaveBlocks(const NCollection_Map<int>& theEdges);
0520 
0521   Standard_EXPORT void CorrectToleranceOfSE();
0522 
0523   //! Reduce the intersection range using the common ranges of
0524   //! Edge/Edge interferences to avoid creation of close
0525   //! intersection vertices
0526   Standard_EXPORT void ReduceIntersectionRange(const int theV1,
0527                                                const int theV2,
0528                                                const int theE,
0529                                                const int theF,
0530                                                double&   theTS1,
0531                                                double&   theTS2);
0532 
0533   //! Gets the bounding box for the given Pave Block.
0534   //! If Pave Block has shrunk data it will be used to get the box,
0535   //! and the Shrunk Range (<theSFirst>, <theSLast>).
0536   //! Otherwise the box will be computed using BndLib_Add3dCurve method,
0537   //! and the Shrunk Range will be equal to the PB's range.
0538   //! To avoid re-computation of the bounding box for the same Pave Block
0539   //! it will be saved in the map <thePBBox>.
0540   //! Returns FALSE in case the PB's range is less than the
0541   //! Precision::PConfusion(), otherwise returns TRUE.
0542   Standard_EXPORT bool GetPBBox(const TopoDS_Edge&                  theE,
0543                                 const occ::handle<BOPDS_PaveBlock>& thePB,
0544                                 BOPAlgo_DataMapOfPaveBlockBndBox&   thePBBox,
0545                                 double&                             theFirst,
0546                                 double&                             theLast,
0547                                 double&                             theSFirst,
0548                                 double&                             theSLast,
0549                                 Bnd_Box&                            theBox);
0550 
0551   //! Treatment of the possible common zones, not detected by the
0552   //! Face/Face intersection algorithm, by intersection of each section edge
0553   //! with all faces not participated in creation of that section edge.
0554   //! If the intersection says that the section edge is lying on the face
0555   //! it will be added into FaceInfo structure of the face as IN edge
0556   //! and will be used for splitting.
0557   Standard_EXPORT void PutSEInOtherFaces(const Message_ProgressRange& theRange);
0558 
0559   //! Analyzes the results of interferences of sub-shapes of the shapes
0560   //! looking for self-interfering entities by the following rules:
0561   //! 1. The Faces of the same shape considered interfering in case they:
0562   //!    - Interfere with the other shapes in the same place (in the same vertex) or;
0563   //!    - Included in the same common block.
0564   //! 2. The Faces of the same shape considered interfering in case they
0565   //!    share the IN or SECTION edges.
0566   //! In case self-interference is found the warning is added.
0567   Standard_EXPORT void CheckSelfInterference();
0568 
0569   //! Adds the warning about failed intersection of pair of sub-shapes
0570   Standard_EXPORT void AddIntersectionFailedWarning(const TopoDS_Shape& theS1,
0571                                                     const TopoDS_Shape& theS2);
0572 
0573   //! Repeat intersection of sub-shapes with increased vertices.
0574   Standard_EXPORT void RepeatIntersection(const Message_ProgressRange& theRange);
0575 
0576   //! Updates vertices of CommonBlocks with real tolerance of CB.
0577   Standard_EXPORT void UpdateVerticesOfCB();
0578 
0579   //! The method looks for the additional common blocks among pairs of edges
0580   //! with the same bounding vertices.
0581   Standard_EXPORT void ForceInterfEE(const Message_ProgressRange& theRange);
0582 
0583   //! The method looks for the additional edge/face common blocks
0584   //! among pairs of edge/face having the same vertices.
0585   Standard_EXPORT void ForceInterfEF(const Message_ProgressRange& theRange);
0586 
0587   //! Performs intersection of given pave blocks
0588   //! with all faces from arguments.
0589   Standard_EXPORT void ForceInterfEF(
0590     const NCollection_IndexedMap<occ::handle<BOPDS_PaveBlock>>& theMPB,
0591     const Message_ProgressRange&                                theRange,
0592     const bool                                                  theAddInterf);
0593 
0594   //! When all section edges are created and no increase of the tolerance
0595   //! of vertices put on the section edges is expected, make sure that
0596   //! the created sections have valid range.
0597   //! If any of the section edges do not have valid range, remove them
0598   //! from Face/Face intersection info and from the input <theMSCPB> map.
0599   //! Put such edges into <MicroPB> map for further unification of their
0600   //! vertices in the PostTreatFF method.
0601   //!
0602   //! All these section edges have already been checked to have valid range.
0603   //! Current check is necessary for the edges whose vertices have also
0604   //! been put on other section edges with greater tolerance, which has caused
0605   //! increase of the tolerance value of the vertices.
0606   Standard_EXPORT void RemoveMicroSectionEdges(
0607     NCollection_IndexedDataMap<TopoDS_Shape, BOPDS_CoupleOfPaveBlocks, TopTools_ShapeMapHasher>&
0608                                                           theMSCPB,
0609     NCollection_IndexedMap<occ::handle<BOPDS_PaveBlock>>& theMicroPB);
0610 
0611   //! Check all edges on the micro status and remove the positive ones
0612   Standard_EXPORT void RemoveMicroEdges();
0613 
0614   //! Auxiliary structure to hold the edge distance to the face
0615   struct EdgeRangeDistance
0616   {
0617     double First;
0618     double Last;
0619     double Distance;
0620 
0621     EdgeRangeDistance(const double theFirst    = 0.0,
0622                       const double theLast     = 0.0,
0623                       const double theDistance = RealLast())
0624         : First(theFirst),
0625           Last(theLast),
0626           Distance(theDistance)
0627     {
0628     }
0629   };
0630 
0631 protected: //! Analyzing Progress steps
0632   //! Filling steps for constant operations
0633   Standard_EXPORT void fillPIConstants(const double     theWhole,
0634                                        BOPAlgo_PISteps& theSteps) const override;
0635   //! Filling steps for all other operations
0636   Standard_EXPORT void fillPISteps(BOPAlgo_PISteps& theSteps) const override;
0637 
0638 protected: //! Fields
0639   NCollection_List<TopoDS_Shape> myArguments;
0640   BOPDS_PDS                      myDS;
0641   BOPDS_PIterator                myIterator;
0642   occ::handle<IntTools_Context>  myContext;
0643   BOPAlgo_SectionAttribute       mySectionAttribute;
0644   bool                           myNonDestructive;
0645   bool                           myIsPrimary;
0646   bool                           myAvoidBuildPCurve;
0647   BOPAlgo_GlueEnum               myGlue;
0648 
0649   // clang-format off
0650   BOPAlgo_DataMapOfIntegerMapOfPaveBlock myFPBDone; //!< Fence map of intersected faces and pave blocks
0651   NCollection_Map<int> myIncreasedSS; //!< Sub-shapes with increased tolerance during the operation
0652   NCollection_Map<int> myVertsToAvoidExtension; //!< Vertices located close to E/E or E/F intersection points
0653                                                 //! which has already been extended to cover the real intersection
0654                                                 //! points, and should not be extended any longer to be put
0655                                                 //! on a section curve.
0656   
0657   NCollection_DataMap <BOPDS_Pair,
0658                        NCollection_List<EdgeRangeDistance>>
0659                                             myDistances; //!< Map to store minimal distances between shapes
0660                                                          //!  which have no real intersections
0661   // clang-format on
0662 };
0663 
0664 #endif // _BOPAlgo_PaveFiller_HeaderFile