Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-25 08:29:59

0001 // Created on: 1995-07-11
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1995-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_SplitShape_HeaderFile
0018 #define _LocOpe_SplitShape_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopoDS_Shape.hxx>
0024 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0025 #include <TopTools_MapOfShape.hxx>
0026 #include <TopTools_ListOfShape.hxx>
0027 class TopoDS_Edge;
0028 class TopoDS_Vertex;
0029 class TopoDS_Wire;
0030 class TopoDS_Face;
0031 
0032 //! Provides a tool to cut  :
0033 //! - edges with a vertices,
0034 //! - faces with wires,
0035 //! and  rebuilds  the shape containing the edges and
0036 //! the faces.
0037 class LocOpe_SplitShape
0038 {
0039 public:
0040   DEFINE_STANDARD_ALLOC
0041 
0042   //! Empty constructor.
0043   LocOpe_SplitShape();
0044 
0045   //! Creates the process  with the shape <S>.
0046   LocOpe_SplitShape(const TopoDS_Shape& S);
0047 
0048   //! Initializes the process on the shape <S>.
0049   Standard_EXPORT void Init(const TopoDS_Shape& S);
0050 
0051   //! Tests if it is possible to split the edge <E>.
0052   Standard_EXPORT Standard_Boolean CanSplit(const TopoDS_Edge& E) const;
0053 
0054   //! Adds the vertex <V> on the edge <E>, at parameter <P>.
0055   Standard_EXPORT void Add(const TopoDS_Vertex& V, const Standard_Real P, const TopoDS_Edge& E);
0056 
0057   //! Adds the wire <W> on the face <F>.
0058   Standard_EXPORT Standard_Boolean Add(const TopoDS_Wire& W, const TopoDS_Face& F);
0059 
0060   //! Adds the list of wires <Lwires> on the face <F>.
0061   Standard_EXPORT Standard_Boolean Add(const TopTools_ListOfShape& Lwires, const TopoDS_Face& F);
0062 
0063   //! Returns the "original" shape.
0064   const TopoDS_Shape& Shape() const;
0065 
0066   //! Returns the list of descendant shapes of <S>.
0067   Standard_EXPORT const TopTools_ListOfShape& DescendantShapes(const TopoDS_Shape& S);
0068 
0069   //! Returns the "left" part defined by the wire <W> on
0070   //! the face <F>.   The  returned list of shape  is in
0071   //! fact  a list of faces. The  face <F> is considered
0072   //! with its topological  orientation  in the original
0073   //! shape.  <W> is considered with its orientation.
0074   Standard_EXPORT const TopTools_ListOfShape& LeftOf(const TopoDS_Wire& W, const TopoDS_Face& F);
0075 
0076 protected:
0077 private:
0078   Standard_EXPORT Standard_Boolean AddOpenWire(const TopoDS_Wire& W, const TopoDS_Face& F);
0079 
0080   Standard_EXPORT Standard_Boolean AddClosedWire(const TopoDS_Wire& W, const TopoDS_Face& F);
0081 
0082   Standard_EXPORT void Put(const TopoDS_Shape& S);
0083 
0084   Standard_EXPORT Standard_Boolean Rebuild(const TopoDS_Shape& S);
0085 
0086   Standard_Boolean                   myDone;
0087   TopoDS_Shape                       myShape;
0088   TopTools_DataMapOfShapeListOfShape myMap;
0089   TopTools_MapOfShape                myDblE;
0090   TopTools_ListOfShape               myLeft;
0091 };
0092 
0093 #include <LocOpe_SplitShape.lxx>
0094 
0095 #endif // _LocOpe_SplitShape_HeaderFile