Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:13

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 
0033 //! Provides a tool to cut  :
0034 //! - edges with a vertices,
0035 //! - faces with wires,
0036 //! and  rebuilds  the shape containing the edges and
0037 //! the faces.
0038 class LocOpe_SplitShape 
0039 {
0040 public:
0041 
0042   DEFINE_STANDARD_ALLOC
0043 
0044   
0045   //! Empty constructor.
0046     LocOpe_SplitShape();
0047   
0048   //! Creates the process  with the shape <S>.
0049     LocOpe_SplitShape(const TopoDS_Shape& S);
0050   
0051   //! Initializes the process on the shape <S>.
0052   Standard_EXPORT void Init (const TopoDS_Shape& S);
0053   
0054   //! Tests if it is possible to split the edge <E>.
0055   Standard_EXPORT Standard_Boolean CanSplit (const TopoDS_Edge& E) const;
0056   
0057   //! Adds the vertex <V> on the edge <E>, at parameter <P>.
0058   Standard_EXPORT void Add (const TopoDS_Vertex& V, const Standard_Real P, const TopoDS_Edge& E);
0059   
0060   //! Adds the wire <W> on the face <F>.
0061   Standard_EXPORT Standard_Boolean Add (const TopoDS_Wire& W, const TopoDS_Face& F);
0062   
0063   //! Adds the list of wires <Lwires> on the face <F>.
0064   Standard_EXPORT Standard_Boolean Add (const TopTools_ListOfShape& Lwires, const TopoDS_Face& F);
0065   
0066   //! Returns the "original" shape.
0067     const TopoDS_Shape& Shape() const;
0068   
0069   //! Returns the list of descendant shapes of <S>.
0070   Standard_EXPORT const TopTools_ListOfShape& DescendantShapes (const TopoDS_Shape& S);
0071   
0072   //! Returns the "left" part defined by the wire <W> on
0073   //! the face <F>.   The  returned list of shape  is in
0074   //! fact  a list of faces. The  face <F> is considered
0075   //! with its topological  orientation  in the original
0076   //! shape.  <W> is considered with its orientation.
0077   Standard_EXPORT const TopTools_ListOfShape& LeftOf (const TopoDS_Wire& W, const TopoDS_Face& F);
0078 
0079 
0080 
0081 
0082 protected:
0083 
0084 
0085 
0086 
0087 
0088 private:
0089 
0090   
0091   Standard_EXPORT Standard_Boolean AddOpenWire (const TopoDS_Wire& W, const TopoDS_Face& F);
0092   
0093   Standard_EXPORT Standard_Boolean AddClosedWire (const TopoDS_Wire& W, const TopoDS_Face& F);
0094   
0095   Standard_EXPORT void Put (const TopoDS_Shape& S);
0096   
0097   Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S);
0098 
0099 
0100   Standard_Boolean myDone;
0101   TopoDS_Shape myShape;
0102   TopTools_DataMapOfShapeListOfShape myMap;
0103   TopTools_MapOfShape myDblE;
0104   TopTools_ListOfShape myLeft;
0105 
0106 
0107 };
0108 
0109 
0110 #include <LocOpe_SplitShape.lxx>
0111 
0112 
0113 
0114 
0115 
0116 #endif // _LocOpe_SplitShape_HeaderFile