Back to home page

EIC code displayed by LXR

 
 

    


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

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_ShapeMapHasher.hxx>
0025 #include <NCollection_IndexedMap.hxx>
0026 #include <TopoDS_Shape.hxx>
0027 #include <NCollection_List.hxx>
0028 #include <NCollection_IndexedDataMap.hxx>
0029 #include <Standard_Integer.hxx>
0030 #include <NCollection_DataMap.hxx>
0031 #include <TopOpeBRepBuild_Builder.hxx>
0032 #include <TopAbs_State.hxx>
0033 #include <NCollection_Sequence.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
0045 //! case of SOLID/SOLID Boolean 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 ~TopOpeBRepBuild_Builder1() override;
0054 
0055   //! Removes all splits and merges already performed.
0056   //! Does NOT clear the handled DS (except ShapeWithStatesMaps).
0057   Standard_EXPORT void Clear() override;
0058 
0059   Standard_EXPORT void Perform(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS) override;
0060 
0061   Standard_EXPORT void Perform(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS,
0062                                const TopoDS_Shape&                             S1,
0063                                const TopoDS_Shape&                             S2) override;
0064 
0065   Standard_EXPORT void MergeKPart() override;
0066 
0067   Standard_EXPORT void MergeKPart(const TopAbs_State TB1, const TopAbs_State TB2) override;
0068 
0069   Standard_EXPORT void GFillSolidSFS(const TopoDS_Shape&                   SO1,
0070                                      const NCollection_List<TopoDS_Shape>& LSO2,
0071                                      const TopOpeBRepBuild_GTopo&          G,
0072                                      TopOpeBRepBuild_ShellFaceSet&         SFS) override;
0073 
0074   Standard_EXPORT void GFillShellSFS(const TopoDS_Shape&                   SH1,
0075                                      const NCollection_List<TopoDS_Shape>& LSO2,
0076                                      const TopOpeBRepBuild_GTopo&          G,
0077                                      TopOpeBRepBuild_ShellFaceSet&         SFS) override;
0078 
0079   Standard_EXPORT void GWESMakeFaces(const TopoDS_Shape&             FF,
0080                                      TopOpeBRepBuild_WireEdgeSet&    WES,
0081                                      NCollection_List<TopoDS_Shape>& LOF) override;
0082 
0083   Standard_EXPORT void GFillSplitsPVS(const TopoDS_Shape&          anEdge,
0084                                       const TopOpeBRepBuild_GTopo& G1,
0085                                       TopOpeBRepBuild_PaveSet&     PVS);
0086 
0087   Standard_EXPORT void GFillFaceNotSameDomSFS(const TopoDS_Shape&                   F1,
0088                                               const NCollection_List<TopoDS_Shape>& LSO2,
0089                                               const TopOpeBRepBuild_GTopo&          G,
0090                                               TopOpeBRepBuild_ShellFaceSet&         SFS);
0091 
0092   Standard_EXPORT void GFillFaceNotSameDomWES(const TopoDS_Shape&                   F1,
0093                                               const NCollection_List<TopoDS_Shape>& LSO2,
0094                                               const TopOpeBRepBuild_GTopo&          G,
0095                                               TopOpeBRepBuild_WireEdgeSet&          WES);
0096 
0097   Standard_EXPORT void GFillWireNotSameDomWES(const TopoDS_Shape&                   W1,
0098                                               const NCollection_List<TopoDS_Shape>& LSO2,
0099                                               const TopOpeBRepBuild_GTopo&          G,
0100                                               TopOpeBRepBuild_WireEdgeSet&          WES);
0101 
0102   Standard_EXPORT void GFillEdgeNotSameDomWES(const TopoDS_Shape&                   E1,
0103                                               const NCollection_List<TopoDS_Shape>& LSO2,
0104                                               const TopOpeBRepBuild_GTopo&          G,
0105                                               TopOpeBRepBuild_WireEdgeSet&          WES);
0106 
0107   Standard_EXPORT void GFillFaceSameDomSFS(const TopoDS_Shape&                   F1,
0108                                            const NCollection_List<TopoDS_Shape>& LSO2,
0109                                            const TopOpeBRepBuild_GTopo&          G,
0110                                            TopOpeBRepBuild_ShellFaceSet&         SFS);
0111 
0112   Standard_EXPORT void GFillFaceSameDomWES(const TopoDS_Shape&                   F1,
0113                                            const NCollection_List<TopoDS_Shape>& LSO2,
0114                                            const TopOpeBRepBuild_GTopo&          G,
0115                                            TopOpeBRepBuild_WireEdgeSet&          WES);
0116 
0117   Standard_EXPORT void GFillWireSameDomWES(const TopoDS_Shape&                   W1,
0118                                            const NCollection_List<TopoDS_Shape>& LSO2,
0119                                            const TopOpeBRepBuild_GTopo&          G,
0120                                            TopOpeBRepBuild_WireEdgeSet&          WES);
0121 
0122   Standard_EXPORT void GFillEdgeSameDomWES(const TopoDS_Shape&                   E1,
0123                                            const NCollection_List<TopoDS_Shape>& LSO2,
0124                                            const TopOpeBRepBuild_GTopo&          G,
0125                                            TopOpeBRepBuild_WireEdgeSet&          WES);
0126 
0127   Standard_EXPORT void PerformONParts(
0128     const TopoDS_Shape&                                                  F,
0129     const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& SDfaces,
0130     const TopOpeBRepBuild_GTopo&                                         G,
0131     TopOpeBRepBuild_WireEdgeSet&                                         WES);
0132 
0133   Standard_EXPORT void PerformPieceIn2D(const TopoDS_Edge&           aPieceToPerform,
0134                                         const TopoDS_Edge&           aOriginalEdge,
0135                                         const TopoDS_Face&           edgeFace,
0136                                         const TopoDS_Face&           toFace,
0137                                         const TopOpeBRepBuild_GTopo& G,
0138                                         bool&                        keep);
0139 
0140   Standard_EXPORT int PerformPieceOn2D(const TopoDS_Shape&             aPieceObj,
0141                                        const TopoDS_Shape&             aFaceObj,
0142                                        const TopoDS_Shape&             aEdgeObj,
0143                                        NCollection_List<TopoDS_Shape>& aListOfPieces,
0144                                        NCollection_List<TopoDS_Shape>& aListOfFaces,
0145                                        NCollection_List<TopoDS_Shape>& aListOfPiecesOut2d);
0146 
0147   Standard_EXPORT int TwoPiecesON(const NCollection_Sequence<TopoDS_Shape>& aSeq,
0148                                   NCollection_List<TopoDS_Shape>&           aListOfPieces,
0149                                   NCollection_List<TopoDS_Shape>&           aListOfFaces,
0150                                   NCollection_List<TopoDS_Shape>&           aListOfPiecesOut2d);
0151 
0152   Standard_EXPORT int CorrectResult2d(TopoDS_Shape& aResult);
0153 
0154   friend class TopOpeBRepBuild_HBuilder;
0155 
0156 protected:
0157   Standard_EXPORT void PerformShapeWithStates();
0158 
0159   Standard_EXPORT void PerformShapeWithStates(const TopoDS_Shape& anObj, const TopoDS_Shape& aTool);
0160 
0161   Standard_EXPORT void StatusEdgesToSplit(
0162     const TopoDS_Shape&                                                  anObj,
0163     const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& anEdgesToSplitMap,
0164     const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& anEdgesToRestMap);
0165 
0166   Standard_EXPORT void SplitEdge(
0167     const TopoDS_Shape&                                                       anEdge,
0168     NCollection_List<TopoDS_Shape>&                                           aLNew,
0169     NCollection_DataMap<TopoDS_Shape, TopAbs_State, TopTools_ShapeMapHasher>& aDataMapOfShapeState);
0170 
0171   Standard_EXPORT void PerformFacesWithStates(
0172     const TopoDS_Shape&                                                       anObj,
0173     const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>&      aFaces,
0174     NCollection_DataMap<TopoDS_Shape, TopAbs_State, TopTools_ShapeMapHasher>& aSplF);
0175 
0176   Standard_EXPORT int IsSame2d(const NCollection_Sequence<TopoDS_Shape>& aSeq,
0177                                NCollection_List<TopoDS_Shape>&           aListOfPiecesOut2d);
0178 
0179   Standard_EXPORT void OrientateEdgeOnFace(TopoDS_Edge&                 EdgeToPerform,
0180                                            const TopoDS_Face&           baseFace,
0181                                            const TopoDS_Face&           edgeFace,
0182                                            const TopOpeBRepBuild_GTopo& G1,
0183                                            bool&                        stateOfFaceOri) const;
0184 
0185   NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>
0186     myFSplits;
0187   NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>
0188     myESplits;
0189 
0190 private:
0191   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> mySameDomMap;
0192   TopoDS_Shape                                                  mySDFaceToFill;
0193   TopoDS_Shape                                                  myBaseFaceToFill;
0194   NCollection_IndexedDataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>
0195                                                                 myMapOfEdgeFaces;
0196   NCollection_DataMap<TopoDS_Shape, bool>                       myMapOfEdgeWithFaceState;
0197   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myProcessedPartsOut2d;
0198   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myProcessedPartsON2d;
0199   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> mySplitsONtoKeep;
0200   NCollection_IndexedMap<TopoDS_Shape>                          mySourceShapes;
0201   NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>
0202     myMapOfCorrect2dEdges;
0203 };
0204 
0205 #endif // _TopOpeBRepBuild_Builder1_HeaderFile