Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-24 08:29:54

0001 // Created on: 1999-09-29
0002 // Created by: Maxim ZVEREV
0003 // Copyright (c) 1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _TopOpeBRepBuild_Builder1_HeaderFile
0018 #define _TopOpeBRepBuild_Builder1_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopTools_IndexedMapOfShape.hxx>
0025 #include <TopoDS_Shape.hxx>
0026 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0027 #include <TopTools_DataMapOfOrientedShapeInteger.hxx>
0028 #include <TopOpeBRepBuild_Builder.hxx>
0029 #include <TopAbs_State.hxx>
0030 #include <TopTools_ListOfShape.hxx>
0031 #include <TopOpeBRepDS_DataMapOfShapeState.hxx>
0032 #include <Standard_Integer.hxx>
0033 #include <TopTools_SequenceOfShape.hxx>
0034 class TopOpeBRepDS_BuildTool;
0035 class TopOpeBRepDS_HDataStructure;
0036 class TopOpeBRepBuild_GTopo;
0037 class TopOpeBRepBuild_ShellFaceSet;
0038 class TopOpeBRepBuild_WireEdgeSet;
0039 class TopOpeBRepBuild_PaveSet;
0040 class TopoDS_Edge;
0041 class TopoDS_Face;
0042 
0043 //! extension  of  the  class  TopOpeBRepBuild_Builder  dedicated
0044 //! to  avoid  bugs  in  "Rebuilding Result" algorithm  for  the  case  of  SOLID/SOLID  Boolean
0045 //! Operations
0046 class TopOpeBRepBuild_Builder1 : public TopOpeBRepBuild_Builder
0047 {
0048 public:
0049   DEFINE_STANDARD_ALLOC
0050 
0051   Standard_EXPORT TopOpeBRepBuild_Builder1(const TopOpeBRepDS_BuildTool& BT);
0052 
0053   Standard_EXPORT virtual ~TopOpeBRepBuild_Builder1();
0054 
0055   //! Removes all splits and merges already performed.
0056   //! Does NOT clear the handled DS  (except  ShapeWithStatesMaps).
0057   Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
0058 
0059   Standard_EXPORT virtual void Perform(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
0060     Standard_OVERRIDE;
0061 
0062   Standard_EXPORT virtual void Perform(const Handle(TopOpeBRepDS_HDataStructure)& HDS,
0063                                        const TopoDS_Shape&                        S1,
0064                                        const TopoDS_Shape& S2) Standard_OVERRIDE;
0065 
0066   Standard_EXPORT virtual void MergeKPart() Standard_OVERRIDE;
0067 
0068   Standard_EXPORT virtual void MergeKPart(const TopAbs_State TB1,
0069                                           const TopAbs_State TB2) Standard_OVERRIDE;
0070 
0071   Standard_EXPORT virtual void GFillSolidSFS(const TopoDS_Shape&           SO1,
0072                                              const TopTools_ListOfShape&   LSO2,
0073                                              const TopOpeBRepBuild_GTopo&  G,
0074                                              TopOpeBRepBuild_ShellFaceSet& SFS) Standard_OVERRIDE;
0075 
0076   Standard_EXPORT virtual void GFillShellSFS(const TopoDS_Shape&           SH1,
0077                                              const TopTools_ListOfShape&   LSO2,
0078                                              const TopOpeBRepBuild_GTopo&  G,
0079                                              TopOpeBRepBuild_ShellFaceSet& SFS) Standard_OVERRIDE;
0080 
0081   Standard_EXPORT virtual void GWESMakeFaces(const TopoDS_Shape&          FF,
0082                                              TopOpeBRepBuild_WireEdgeSet& WES,
0083                                              TopTools_ListOfShape&        LOF) Standard_OVERRIDE;
0084 
0085   Standard_EXPORT void GFillSplitsPVS(const TopoDS_Shape&          anEdge,
0086                                       const TopOpeBRepBuild_GTopo& G1,
0087                                       TopOpeBRepBuild_PaveSet&     PVS);
0088 
0089   Standard_EXPORT void GFillFaceNotSameDomSFS(const TopoDS_Shape&           F1,
0090                                               const TopTools_ListOfShape&   LSO2,
0091                                               const TopOpeBRepBuild_GTopo&  G,
0092                                               TopOpeBRepBuild_ShellFaceSet& SFS);
0093 
0094   Standard_EXPORT void GFillFaceNotSameDomWES(const TopoDS_Shape&          F1,
0095                                               const TopTools_ListOfShape&  LSO2,
0096                                               const TopOpeBRepBuild_GTopo& G,
0097                                               TopOpeBRepBuild_WireEdgeSet& WES);
0098 
0099   Standard_EXPORT void GFillWireNotSameDomWES(const TopoDS_Shape&          W1,
0100                                               const TopTools_ListOfShape&  LSO2,
0101                                               const TopOpeBRepBuild_GTopo& G,
0102                                               TopOpeBRepBuild_WireEdgeSet& WES);
0103 
0104   Standard_EXPORT void GFillEdgeNotSameDomWES(const TopoDS_Shape&          E1,
0105                                               const TopTools_ListOfShape&  LSO2,
0106                                               const TopOpeBRepBuild_GTopo& G,
0107                                               TopOpeBRepBuild_WireEdgeSet& WES);
0108 
0109   Standard_EXPORT void GFillFaceSameDomSFS(const TopoDS_Shape&           F1,
0110                                            const TopTools_ListOfShape&   LSO2,
0111                                            const TopOpeBRepBuild_GTopo&  G,
0112                                            TopOpeBRepBuild_ShellFaceSet& SFS);
0113 
0114   Standard_EXPORT void GFillFaceSameDomWES(const TopoDS_Shape&          F1,
0115                                            const TopTools_ListOfShape&  LSO2,
0116                                            const TopOpeBRepBuild_GTopo& G,
0117                                            TopOpeBRepBuild_WireEdgeSet& WES);
0118 
0119   Standard_EXPORT void GFillWireSameDomWES(const TopoDS_Shape&          W1,
0120                                            const TopTools_ListOfShape&  LSO2,
0121                                            const TopOpeBRepBuild_GTopo& G,
0122                                            TopOpeBRepBuild_WireEdgeSet& WES);
0123 
0124   Standard_EXPORT void GFillEdgeSameDomWES(const TopoDS_Shape&          E1,
0125                                            const TopTools_ListOfShape&  LSO2,
0126                                            const TopOpeBRepBuild_GTopo& G,
0127                                            TopOpeBRepBuild_WireEdgeSet& WES);
0128 
0129   Standard_EXPORT void PerformONParts(const TopoDS_Shape&               F,
0130                                       const TopTools_IndexedMapOfShape& SDfaces,
0131                                       const TopOpeBRepBuild_GTopo&      G,
0132                                       TopOpeBRepBuild_WireEdgeSet&      WES);
0133 
0134   Standard_EXPORT void PerformPieceIn2D(const TopoDS_Edge&           aPieceToPerform,
0135                                         const TopoDS_Edge&           aOriginalEdge,
0136                                         const TopoDS_Face&           edgeFace,
0137                                         const TopoDS_Face&           toFace,
0138                                         const TopOpeBRepBuild_GTopo& G,
0139                                         Standard_Boolean&            keep);
0140 
0141   Standard_EXPORT Standard_Integer PerformPieceOn2D(const TopoDS_Shape&   aPieceObj,
0142                                                     const TopoDS_Shape&   aFaceObj,
0143                                                     const TopoDS_Shape&   aEdgeObj,
0144                                                     TopTools_ListOfShape& aListOfPieces,
0145                                                     TopTools_ListOfShape& aListOfFaces,
0146                                                     TopTools_ListOfShape& aListOfPiecesOut2d);
0147 
0148   Standard_EXPORT Standard_Integer TwoPiecesON(const TopTools_SequenceOfShape& aSeq,
0149                                                TopTools_ListOfShape&           aListOfPieces,
0150                                                TopTools_ListOfShape&           aListOfFaces,
0151                                                TopTools_ListOfShape&           aListOfPiecesOut2d);
0152 
0153   Standard_EXPORT Standard_Integer CorrectResult2d(TopoDS_Shape& aResult);
0154 
0155   friend class TopOpeBRepBuild_HBuilder;
0156 
0157 protected:
0158   Standard_EXPORT void PerformShapeWithStates();
0159 
0160   Standard_EXPORT void PerformShapeWithStates(const TopoDS_Shape& anObj, const TopoDS_Shape& aTool);
0161 
0162   Standard_EXPORT void StatusEdgesToSplit(const TopoDS_Shape&               anObj,
0163                                           const TopTools_IndexedMapOfShape& anEdgesToSplitMap,
0164                                           const TopTools_IndexedMapOfShape& anEdgesToRestMap);
0165 
0166   Standard_EXPORT void SplitEdge(const TopoDS_Shape&               anEdge,
0167                                  TopTools_ListOfShape&             aLNew,
0168                                  TopOpeBRepDS_DataMapOfShapeState& aDataMapOfShapeState);
0169 
0170   Standard_EXPORT void PerformFacesWithStates(const TopoDS_Shape&               anObj,
0171                                               const TopTools_IndexedMapOfShape& aFaces,
0172                                               TopOpeBRepDS_DataMapOfShapeState& aSplF);
0173 
0174   Standard_EXPORT Standard_Integer IsSame2d(const TopTools_SequenceOfShape& aSeq,
0175                                             TopTools_ListOfShape&           aListOfPiecesOut2d);
0176 
0177   Standard_EXPORT void OrientateEdgeOnFace(TopoDS_Edge&                 EdgeToPerform,
0178                                            const TopoDS_Face&           baseFace,
0179                                            const TopoDS_Face&           edgeFace,
0180                                            const TopOpeBRepBuild_GTopo& G1,
0181                                            Standard_Boolean&            stateOfFaceOri) const;
0182 
0183   TopTools_DataMapOfShapeListOfShape myFSplits;
0184   TopTools_DataMapOfShapeListOfShape myESplits;
0185 
0186 private:
0187   TopTools_IndexedMapOfShape                          mySameDomMap;
0188   TopoDS_Shape                                        mySDFaceToFill;
0189   TopoDS_Shape                                        myBaseFaceToFill;
0190   TopTools_IndexedDataMapOfShapeListOfShape           myMapOfEdgeFaces;
0191   NCollection_DataMap<TopoDS_Shape, Standard_Boolean> myMapOfEdgeWithFaceState;
0192   TopTools_IndexedMapOfShape                          myProcessedPartsOut2d;
0193   TopTools_IndexedMapOfShape                          myProcessedPartsON2d;
0194   TopTools_IndexedMapOfShape                          mySplitsONtoKeep;
0195   TopTools_IndexedMapOfOrientedShape                  mySourceShapes;
0196   TopTools_IndexedDataMapOfShapeShape                 myMapOfCorrect2dEdges;
0197 };
0198 
0199 #endif // _TopOpeBRepBuild_Builder1_HeaderFile