Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:25

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 
0044 //! extension  of  the  class  TopOpeBRepBuild_Builder  dedicated
0045 //! to  avoid  bugs  in  "Rebuilding Result" algorithm  for  the  case  of  SOLID/SOLID  Boolean  Operations
0046 class TopOpeBRepBuild_Builder1  : public TopOpeBRepBuild_Builder
0047 {
0048 public:
0049 
0050   DEFINE_STANDARD_ALLOC
0051 
0052   
0053   Standard_EXPORT TopOpeBRepBuild_Builder1(const TopOpeBRepDS_BuildTool& BT);
0054   
0055   Standard_EXPORT virtual ~TopOpeBRepBuild_Builder1();
0056   
0057   //! Removes all splits and merges already performed.
0058   //! Does NOT clear the handled DS  (except  ShapeWithStatesMaps).
0059   Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
0060   
0061   Standard_EXPORT virtual void Perform (const Handle(TopOpeBRepDS_HDataStructure)& HDS) Standard_OVERRIDE;
0062   
0063   Standard_EXPORT virtual void Perform (const Handle(TopOpeBRepDS_HDataStructure)& HDS, const TopoDS_Shape& S1, const TopoDS_Shape& S2) Standard_OVERRIDE;
0064   
0065   Standard_EXPORT virtual void MergeKPart() Standard_OVERRIDE;
0066   
0067   Standard_EXPORT virtual void MergeKPart (const TopAbs_State TB1, const TopAbs_State TB2) Standard_OVERRIDE;
0068   
0069   Standard_EXPORT virtual void GFillSolidSFS (const TopoDS_Shape& SO1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS) Standard_OVERRIDE;
0070   
0071   Standard_EXPORT virtual void GFillShellSFS (const TopoDS_Shape& SH1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS) Standard_OVERRIDE;
0072   
0073   Standard_EXPORT virtual void GWESMakeFaces (const TopoDS_Shape& FF, TopOpeBRepBuild_WireEdgeSet& WES, TopTools_ListOfShape& LOF) Standard_OVERRIDE;
0074   
0075   Standard_EXPORT void GFillSplitsPVS (const TopoDS_Shape& anEdge, const TopOpeBRepBuild_GTopo& G1, TopOpeBRepBuild_PaveSet& PVS);
0076   
0077   Standard_EXPORT void GFillFaceNotSameDomSFS (const TopoDS_Shape& F1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS);
0078   
0079   Standard_EXPORT void GFillFaceNotSameDomWES (const TopoDS_Shape& F1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
0080   
0081   Standard_EXPORT void GFillWireNotSameDomWES (const TopoDS_Shape& W1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
0082   
0083   Standard_EXPORT void GFillEdgeNotSameDomWES (const TopoDS_Shape& E1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
0084   
0085   Standard_EXPORT void GFillFaceSameDomSFS (const TopoDS_Shape& F1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_ShellFaceSet& SFS);
0086   
0087   Standard_EXPORT void GFillFaceSameDomWES (const TopoDS_Shape& F1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
0088   
0089   Standard_EXPORT void GFillWireSameDomWES (const TopoDS_Shape& W1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
0090   
0091   Standard_EXPORT void GFillEdgeSameDomWES (const TopoDS_Shape& E1, const TopTools_ListOfShape& LSO2, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
0092   
0093   Standard_EXPORT void PerformONParts (const TopoDS_Shape& F, const TopTools_IndexedMapOfShape& SDfaces, const TopOpeBRepBuild_GTopo& G, TopOpeBRepBuild_WireEdgeSet& WES);
0094   
0095   Standard_EXPORT void PerformPieceIn2D (const TopoDS_Edge& aPieceToPerform, const TopoDS_Edge& aOriginalEdge, const TopoDS_Face& edgeFace, const TopoDS_Face& toFace, const TopOpeBRepBuild_GTopo& G, Standard_Boolean& keep);
0096   
0097   Standard_EXPORT Standard_Integer PerformPieceOn2D (const TopoDS_Shape& aPieceObj, const TopoDS_Shape& aFaceObj, const TopoDS_Shape& aEdgeObj, TopTools_ListOfShape& aListOfPieces, TopTools_ListOfShape& aListOfFaces, TopTools_ListOfShape& aListOfPiecesOut2d);
0098   
0099   Standard_EXPORT Standard_Integer TwoPiecesON (const TopTools_SequenceOfShape& aSeq, TopTools_ListOfShape& aListOfPieces, TopTools_ListOfShape& aListOfFaces, TopTools_ListOfShape& aListOfPiecesOut2d);
0100   
0101   Standard_EXPORT Standard_Integer CorrectResult2d (TopoDS_Shape& aResult);
0102 
0103 
0104 friend class TopOpeBRepBuild_HBuilder;
0105 
0106 
0107 protected:
0108 
0109   
0110   Standard_EXPORT void PerformShapeWithStates();
0111   
0112   Standard_EXPORT void PerformShapeWithStates (const TopoDS_Shape& anObj, const TopoDS_Shape& aTool);
0113   
0114   Standard_EXPORT void StatusEdgesToSplit (const TopoDS_Shape& anObj, const TopTools_IndexedMapOfShape& anEdgesToSplitMap, const TopTools_IndexedMapOfShape& anEdgesToRestMap);
0115   
0116   Standard_EXPORT void SplitEdge (const TopoDS_Shape& anEdge, TopTools_ListOfShape& aLNew, TopOpeBRepDS_DataMapOfShapeState& aDataMapOfShapeState);
0117   
0118   Standard_EXPORT void PerformFacesWithStates (const TopoDS_Shape& anObj, const TopTools_IndexedMapOfShape& aFaces, TopOpeBRepDS_DataMapOfShapeState& aSplF);
0119   
0120   Standard_EXPORT Standard_Integer IsSame2d (const TopTools_SequenceOfShape& aSeq, TopTools_ListOfShape& aListOfPiecesOut2d);
0121   
0122   Standard_EXPORT void OrientateEdgeOnFace (TopoDS_Edge& EdgeToPerform, const TopoDS_Face& baseFace, const TopoDS_Face& edgeFace, const TopOpeBRepBuild_GTopo& G1, Standard_Boolean& stateOfFaceOri) const;
0123 
0124 
0125   TopTools_DataMapOfShapeListOfShape myFSplits;
0126   TopTools_DataMapOfShapeListOfShape myESplits;
0127 
0128 
0129 private:
0130 
0131   TopTools_IndexedMapOfShape mySameDomMap;
0132   TopoDS_Shape mySDFaceToFill;
0133   TopoDS_Shape myBaseFaceToFill;
0134   TopTools_IndexedDataMapOfShapeListOfShape myMapOfEdgeFaces;
0135   NCollection_DataMap<TopoDS_Shape, Standard_Boolean> myMapOfEdgeWithFaceState;
0136   TopTools_IndexedMapOfShape myProcessedPartsOut2d;
0137   TopTools_IndexedMapOfShape myProcessedPartsON2d;
0138   TopTools_IndexedMapOfShape mySplitsONtoKeep;
0139   TopTools_IndexedMapOfOrientedShape mySourceShapes;
0140   TopTools_IndexedDataMapOfShapeShape myMapOfCorrect2dEdges;
0141 
0142 };
0143 
0144 #endif // _TopOpeBRepBuild_Builder1_HeaderFile