Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:23

0001 // Created on: 1990-12-20
0002 // Created by: Remi Lequette
0003 // Copyright (c) 1990-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 _TopExp_HeaderFile
0018 #define _TopExp_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopTools_IndexedMapOfShape.hxx>
0025 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0026 #include <TopTools_MapOfShape.hxx>
0027 #include <TopoDS_Vertex.hxx>
0028 #include <Standard_Boolean.hxx>
0029 
0030 class TopoDS_Shape;
0031 class TopoDS_Edge;
0032 class TopoDS_Wire;
0033 
0034 
0035 //! This package   provides  basic tools  to   explore the
0036 //! topological data structures.
0037 //!
0038 //! * Explorer : A tool to find all sub-shapes of  a given
0039 //! type. e.g. all faces of a solid.
0040 //!
0041 //! * Package methods to map sub-shapes of a shape.
0042 //!
0043 //! Level : Public
0044 //! All methods of all  classes will be public.
0045 class TopExp 
0046 {
0047 public:
0048 
0049   DEFINE_STANDARD_ALLOC
0050 
0051   
0052   //! Tool to explore a topological data structure.
0053   //! Stores in the map <M> all  the sub-shapes of <S>
0054   //! of type <T>.
0055   //!
0056   //! Warning: The map is not cleared at first.
0057   Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, const TopAbs_ShapeEnum T, TopTools_IndexedMapOfShape& M);
0058   
0059   //! Stores in the map <M> all  the sub-shapes of <S>.
0060   //! - If cumOri is true, the function composes all
0061   //! sub-shapes with the orientation of S.
0062   //! - If cumLoc is true, the function multiplies all
0063   //! sub-shapes by the location of S, i.e. it applies to
0064   //! each sub-shape the transformation that is associated with S.
0065   Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, TopTools_IndexedMapOfShape& M,
0066     const Standard_Boolean cumOri = Standard_True, const Standard_Boolean cumLoc = Standard_True);
0067 
0068   //! Stores in the map <M> all  the sub-shapes of <S>.
0069   //! - If cumOri is true, the function composes all
0070   //! sub-shapes with the orientation of S.
0071   //! - If cumLoc is true, the function multiplies all
0072   //! sub-shapes by the location of S, i.e. it applies to
0073   //! each sub-shape the transformation that is associated with S.
0074   Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, TopTools_MapOfShape& M,
0075     const Standard_Boolean cumOri = Standard_True, const Standard_Boolean cumLoc = Standard_True);
0076 
0077   //! Stores in the map <M> all the subshape of <S> of
0078   //! type <TS>  for each one append  to  the list all
0079   //! the ancestors of type <TA>.  For example map all
0080   //! the edges and bind the list of faces.
0081   //! Warning: The map is not cleared at first.
0082   Standard_EXPORT static void MapShapesAndAncestors (const TopoDS_Shape& S, const TopAbs_ShapeEnum TS, const TopAbs_ShapeEnum TA, TopTools_IndexedDataMapOfShapeListOfShape& M);
0083   
0084   //! Stores in the map <M> all the subshape of <S> of
0085   //! type <TS> for each one append to the list all
0086   //! unique ancestors of type <TA>.  For example map all
0087   //! the edges and bind the list of faces.
0088   //! useOrientation = True : taking account the ancestor orientation
0089   //! Warning: The map is not cleared at first.
0090   Standard_EXPORT static void MapShapesAndUniqueAncestors (const TopoDS_Shape& S, const TopAbs_ShapeEnum TS, const TopAbs_ShapeEnum TA, TopTools_IndexedDataMapOfShapeListOfShape& M,
0091                                                            const Standard_Boolean useOrientation = Standard_False);
0092 
0093   //! Returns the Vertex of orientation FORWARD in E. If
0094   //! there is none returns a Null Shape.
0095   //! CumOri = True : taking account the edge orientation
0096   Standard_EXPORT static TopoDS_Vertex FirstVertex (const TopoDS_Edge& E, const Standard_Boolean CumOri = Standard_False);
0097   
0098   //! Returns the Vertex of orientation REVERSED in E. If
0099   //! there is none returns a Null Shape.
0100   //! CumOri = True : taking account the edge orientation
0101   Standard_EXPORT static TopoDS_Vertex LastVertex (const TopoDS_Edge& E, const Standard_Boolean CumOri = Standard_False);
0102   
0103   //! Returns in Vfirst, Vlast the  FORWARD and REVERSED
0104   //! vertices of the edge <E>. May be null shapes.
0105   //! CumOri = True : taking account the edge orientation
0106   Standard_EXPORT static void Vertices (const TopoDS_Edge& E, TopoDS_Vertex& Vfirst, TopoDS_Vertex& Vlast, const Standard_Boolean CumOri = Standard_False);
0107   
0108   //! Returns  in  Vfirst,  Vlast   the first   and last
0109   //! vertices of the open wire <W>. May be null shapes.
0110   //! if   <W>  is closed Vfirst and Vlast  are a same
0111   //! vertex on <W>.
0112   //! if <W> is no manifold. VFirst and VLast are null
0113   //! shapes.
0114   Standard_EXPORT static void Vertices (const TopoDS_Wire& W, TopoDS_Vertex& Vfirst, TopoDS_Vertex& Vlast);
0115   
0116   //! Finds   the  vertex <V> common   to  the two edges
0117   //! <E1,E2>, returns True if this vertex exists.
0118   //!
0119   //! Warning: <V> has sense only if the value <True> is returned
0120   Standard_EXPORT static Standard_Boolean CommonVertex (const TopoDS_Edge& E1, const TopoDS_Edge& E2, TopoDS_Vertex& V);
0121 
0122 };
0123 
0124 #endif // _TopExp_HeaderFile