Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:58:34

0001 // Created on: 1996-01-11
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1996-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 _LocOpe_WiresOnShape_HeaderFile
0018 #define _LocOpe_WiresOnShape_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TopoDS_Shape.hxx>
0024 #include <TopTools_ShapeMapHasher.hxx>
0025 #include <NCollection_IndexedDataMap.hxx>
0026 #include <NCollection_Map.hxx>
0027 #include <NCollection_DataMap.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <Standard_Transient.hxx>
0030 #include <NCollection_Sequence.hxx>
0031 
0032 class TopoDS_Wire;
0033 class TopoDS_Face;
0034 class TopoDS_Compound;
0035 class TopoDS_Edge;
0036 class TopoDS_Vertex;
0037 
0038 class LocOpe_WiresOnShape : public Standard_Transient
0039 {
0040 
0041 public:
0042   Standard_EXPORT LocOpe_WiresOnShape(const TopoDS_Shape& S);
0043 
0044   Standard_EXPORT void Init(const TopoDS_Shape& S);
0045 
0046   //! Add splitting edges or wires for whole initial shape
0047   //! without additional specification edge->face, edge->edge
0048   //! This method puts edge on the corresponding faces from initial shape
0049   Standard_EXPORT bool Add(const NCollection_Sequence<TopoDS_Shape>& theEdges);
0050 
0051   //! Set the flag of check internal intersections
0052   //! default value is True (to check)
0053   void SetCheckInterior(const bool ToCheckInterior);
0054 
0055   Standard_EXPORT void Bind(const TopoDS_Wire& W, const TopoDS_Face& F);
0056 
0057   Standard_EXPORT void Bind(const TopoDS_Compound& Comp, const TopoDS_Face& F);
0058 
0059   Standard_EXPORT void Bind(const TopoDS_Edge& E, const TopoDS_Face& F);
0060 
0061   Standard_EXPORT void Bind(const TopoDS_Edge& EfromW, const TopoDS_Edge& EonFace);
0062 
0063   Standard_EXPORT void BindAll();
0064 
0065   bool IsDone() const;
0066 
0067   Standard_EXPORT void InitEdgeIterator();
0068 
0069   Standard_EXPORT bool MoreEdge();
0070 
0071   Standard_EXPORT TopoDS_Edge Edge();
0072 
0073   //! Returns the face of the shape on which the current
0074   //! edge is projected.
0075   Standard_EXPORT TopoDS_Face OnFace();
0076 
0077   //! If the current edge is projected on an edge,
0078   //! returns <true> and sets the value of <E>.
0079   //! Otherwise, returns <false>.
0080   Standard_EXPORT bool OnEdge(TopoDS_Edge& E);
0081 
0082   Standard_EXPORT void NextEdge();
0083 
0084   Standard_EXPORT bool OnVertex(const TopoDS_Vertex& Vwire, TopoDS_Vertex& Vshape);
0085 
0086   //! If the vertex <V> lies on an edge of the original
0087   //! shape, returns <true> and sets the
0088   //! concerned edge in <E>, and the parameter on the
0089   //! edge in <P>.
0090   //! Else returns <false>.
0091   Standard_EXPORT bool OnEdge(const TopoDS_Vertex& V, TopoDS_Edge& E, double& P);
0092 
0093   //! If the vertex <V> lies on an edge of the original
0094   //! shape, returns <true> and sets the
0095   //! concerned edge in <E>, and the parameter on the
0096   //! edge in <P>.
0097   //! Else returns <false>.
0098   Standard_EXPORT bool OnEdge(const TopoDS_Vertex& V,
0099                               const TopoDS_Edge&   EdgeFrom,
0100                               TopoDS_Edge&         E,
0101                               double&              P);
0102 
0103   //! tells is the face to be split by section or not
0104   bool IsFaceWithSection(const TopoDS_Shape& aFace) const;
0105 
0106   DEFINE_STANDARD_RTTIEXT(LocOpe_WiresOnShape, Standard_Transient)
0107 
0108 private:
0109   TopoDS_Shape                                                                    myShape;
0110   NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> myMapEF;
0111   NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>                   myFacesWithSection;
0112   bool                                                                     myCheckInterior;
0113   NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> myMap;
0114   bool                                                                     myDone;
0115   int                                                                      myIndex;
0116 };
0117 
0118 #include <LocOpe_WiresOnShape.lxx>
0119 
0120 #endif // _LocOpe_WiresOnShape_HeaderFile