Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-28 10:22:12

0001 // Created on: 1993-06-23
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1993-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 _TopOpeBRep_DSFiller_HeaderFile
0018 #define _TopOpeBRep_DSFiller_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopOpeBRep_ShapeIntersector.hxx>
0025 #include <TopOpeBRep_ShapeIntersector2d.hxx>
0026 #include <TopOpeBRep_FacesFiller.hxx>
0027 #include <TopOpeBRep_EdgesFiller.hxx>
0028 #include <TopOpeBRep_FaceEdgeFiller.hxx>
0029 #include <TopOpeBRepTool_PShapeClassifier.hxx>
0030 class TopoDS_Shape;
0031 class TopOpeBRepDS_HDataStructure;
0032 class TopoDS_Face;
0033 
0034 //! Provides class methods to fill a datastructure
0035 //! with results of intersections.
0036 //!
0037 //! 1. Use an Intersector to find pairs of
0038 //! intersecting GeomShapes
0039 //!
0040 //! 2. For each pair fill the DataStructure using the
0041 //! appropriate Filler.
0042 //!
0043 //! 3. Complete the DataStructure to record shapes to
0044 //! rebuild (shells, wires)
0045 class TopOpeBRep_DSFiller
0046 {
0047 public:
0048   DEFINE_STANDARD_ALLOC
0049 
0050   Standard_EXPORT TopOpeBRep_DSFiller();
0051 
0052   Standard_EXPORT ~TopOpeBRep_DSFiller();
0053 
0054   //! return field myPShapeClassifier.
0055   //! set field myPShapeClassifier.
0056   Standard_EXPORT TopOpeBRepTool_PShapeClassifier PShapeClassifier() const;
0057 
0058   //! Stores in <DS> the intersections of <S1> and <S2>.
0059   //! if orientFORWARD = True
0060   //! S FORWARD,REVERSED  --> FORWARD
0061   //! S EXTERNAL,INTERNAL --> EXTERNAL,INTERNAL
0062   Standard_EXPORT void Insert(const TopoDS_Shape&                             S1,
0063                               const TopoDS_Shape&                             S2,
0064                               const occ::handle<TopOpeBRepDS_HDataStructure>& HDS,
0065                               const bool                                      orientFORWARD = true);
0066 
0067   //! Stores in <DS> the intersections of <S1> and <S2>.
0068   //! if orientFORWARD = True
0069   //! S FORWAR,REVERSED   --> FORWARD
0070   //! S EXTERNAL,INTERNAL --> EXTERNAL,INTERNAL
0071   Standard_EXPORT void InsertIntersection(const TopoDS_Shape&                             S1,
0072                                           const TopoDS_Shape&                             S2,
0073                                           const occ::handle<TopOpeBRepDS_HDataStructure>& HDS,
0074                                           const bool orientFORWARD = true);
0075 
0076   Standard_EXPORT void Complete(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS);
0077 
0078   //! Stores in <DS> the intersections of <S1> and <S2>.
0079   //! S1 and S2 contain only SameDomain Face
0080   Standard_EXPORT void Insert2d(const TopoDS_Shape&                             S1,
0081                                 const TopoDS_Shape&                             S2,
0082                                 const occ::handle<TopOpeBRepDS_HDataStructure>& HDS);
0083 
0084   //! S1, S2 set of tangent face
0085   //! Launches 2D intersection calculations to correctly
0086   //! code the SameDomain faces.
0087   Standard_EXPORT void InsertIntersection2d(const TopoDS_Shape&                             S1,
0088                                             const TopoDS_Shape&                             S2,
0089                                             const occ::handle<TopOpeBRepDS_HDataStructure>& HDS);
0090 
0091   Standard_EXPORT bool IsMadeOf1d(const TopoDS_Shape& S) const;
0092 
0093   Standard_EXPORT bool IsContext1d(const TopoDS_Shape& S) const;
0094 
0095   //! Stores in <DS> the intersections of <S1> and <S2>.
0096   //! S1 and S2 are edges or wires.
0097   //! S1 edges have a 2d representation in face F1
0098   //! S2 edges have a 2d representation in face F2
0099   //! F1 is the face which surface is taken as reference
0100   //! for 2d description of S1 and S2 edges.
0101   //! if orientFORWARD = True
0102   //! S FORWARD,REVERSED  --> FORWARD
0103   //! S EXTERNAL,INTERNAL --> EXTERNAL,INTERNAL
0104   Standard_EXPORT void Insert1d(const TopoDS_Shape&                             S1,
0105                                 const TopoDS_Shape&                             S2,
0106                                 const TopoDS_Face&                              F1,
0107                                 const TopoDS_Face&                              F2,
0108                                 const occ::handle<TopOpeBRepDS_HDataStructure>& HDS,
0109                                 const bool orientFORWARD = false);
0110 
0111   Standard_EXPORT TopOpeBRep_ShapeIntersector& ChangeShapeIntersector();
0112 
0113   Standard_EXPORT TopOpeBRep_ShapeIntersector2d& ChangeShapeIntersector2d();
0114 
0115   Standard_EXPORT TopOpeBRep_FacesFiller& ChangeFacesFiller();
0116 
0117   Standard_EXPORT TopOpeBRep_EdgesFiller& ChangeEdgesFiller();
0118 
0119   Standard_EXPORT TopOpeBRep_FaceEdgeFiller& ChangeFaceEdgeFiller();
0120 
0121   Standard_EXPORT void GapFiller(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS) const;
0122 
0123   //! Update the data structure with relevant
0124   //! information deduced from the intersections.
0125   //!
0126   //! Shells containing an intersected face.
0127   //! Wires  containing an intersected edge.
0128   Standard_EXPORT void CompleteDS(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS) const;
0129 
0130   Standard_EXPORT void Filter(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS) const;
0131 
0132   Standard_EXPORT void Reducer(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS) const;
0133 
0134   Standard_EXPORT void RemoveUnsharedGeometry(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS);
0135 
0136   Standard_EXPORT void Checker(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS) const;
0137 
0138   //! Update the data structure with relevant
0139   //! information deduced from the intersections 2d.
0140   //!
0141   //! Shells containing an intersected face.
0142   //! Wires  containing an intersected edge.
0143   //!
0144   //! search for interference identity using edge connexity //NYI
0145   Standard_EXPORT void CompleteDS2d(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS) const;
0146 
0147 private:
0148   Standard_EXPORT bool CheckInsert(const TopoDS_Shape& S1, const TopoDS_Shape& S2) const;
0149 
0150   Standard_EXPORT bool ClearShapeSameDomain(const TopoDS_Shape&                             S1,
0151                                             const TopoDS_Shape&                             S2,
0152                                             const occ::handle<TopOpeBRepDS_HDataStructure>& HDS);
0153 
0154   TopOpeBRep_ShapeIntersector     myShapeIntersector;
0155   TopOpeBRep_ShapeIntersector2d   myShapeIntersector2d;
0156   TopOpeBRep_FacesFiller          myFacesFiller;
0157   TopOpeBRep_EdgesFiller          myEdgesFiller;
0158   TopOpeBRep_FaceEdgeFiller       myFaceEdgeFiller;
0159   TopOpeBRepTool_PShapeClassifier myPShapeClassifier;
0160 };
0161 
0162 #endif // _TopOpeBRep_DSFiller_HeaderFile