1 // Created on: 1990-12-20
2 // Created by: Remi Lequette
3 // Copyright (c) 1990-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _TopExp_HeaderFile
18 #define _TopExp_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopAbs_ShapeEnum.hxx>
25 #include <TopTools_IndexedMapOfShape.hxx>
26 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
27 #include <TopTools_MapOfShape.hxx>
28 #include <Standard_Boolean.hxx>
33 class TopExp_Explorer;
36 //! This package provides basic tools to explore the
37 //! topological data structures.
39 //! * Explorer : A tool to find all sub-shapes of a given
40 //! type. e.g. all faces of a solid.
42 //! * Package methods to map sub-shapes of a shape.
45 //! All methods of all classes will be public.
53 //! Tool to explore a topological data structure.
54 //! Stores in the map <M> all the sub-shapes of <S>
57 //! Warning: The map is not cleared at first.
58 Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, const TopAbs_ShapeEnum T, TopTools_IndexedMapOfShape& M);
60 //! Stores in the map <M> all the sub-shapes of <S>.
61 Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, TopTools_IndexedMapOfShape& M);
63 //! Stores in the map <M> all the sub-shapes of <S>.
64 Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, TopTools_MapOfShape& M);
66 //! Stores in the map <M> all the subshape of <S> of
67 //! type <TS> for each one append to the list all
68 //! the ancestors of type <TA>. For example map all
69 //! the edges and bind the list of faces.
70 //! Warning: The map is not cleared at first.
71 Standard_EXPORT static void MapShapesAndAncestors (const TopoDS_Shape& S, const TopAbs_ShapeEnum TS, const TopAbs_ShapeEnum TA, TopTools_IndexedDataMapOfShapeListOfShape& M);
73 //! Stores in the map <M> all the subshape of <S> of
74 //! type <TS> for each one append to the list all
75 //! unique ancestors of type <TA>. For example map all
76 //! the edges and bind the list of faces.
77 //! useOrientation = True : taking account the ancestor orientation
78 //! Warning: The map is not cleared at first.
79 Standard_EXPORT static void MapShapesAndUniqueAncestors (const TopoDS_Shape& S, const TopAbs_ShapeEnum TS, const TopAbs_ShapeEnum TA, TopTools_IndexedDataMapOfShapeListOfShape& M,
80 const Standard_Boolean useOrientation = Standard_False);
82 //! Returns the Vertex of orientation FORWARD in E. If
83 //! there is none returns a Null Shape.
84 //! CumOri = True : taking account the edge orientation
85 Standard_EXPORT static TopoDS_Vertex FirstVertex (const TopoDS_Edge& E, const Standard_Boolean CumOri = Standard_False);
87 //! Returns the Vertex of orientation REVERSED in E. If
88 //! there is none returns a Null Shape.
89 //! CumOri = True : taking account the edge orientation
90 Standard_EXPORT static TopoDS_Vertex LastVertex (const TopoDS_Edge& E, const Standard_Boolean CumOri = Standard_False);
92 //! Returns in Vfirst, Vlast the FORWARD and REVERSED
93 //! vertices of the edge <E>. May be null shapes.
94 //! CumOri = True : taking account the edge orientation
95 Standard_EXPORT static void Vertices (const TopoDS_Edge& E, TopoDS_Vertex& Vfirst, TopoDS_Vertex& Vlast, const Standard_Boolean CumOri = Standard_False);
97 //! Returns in Vfirst, Vlast the first and last
98 //! vertices of the open wire <W>. May be null shapes.
99 //! if <W> is closed Vfirst and Vlast are a same
101 //! if <W> is no manifold. VFirst and VLast are null
103 Standard_EXPORT static void Vertices (const TopoDS_Wire& W, TopoDS_Vertex& Vfirst, TopoDS_Vertex& Vlast);
105 //! Finds the vertex <V> common to the two edges
106 //! <E1,E2>, returns True if this vertex exists.
108 //! Warning: <V> has sense only if the value <True> is returned
109 Standard_EXPORT static Standard_Boolean CommonVertex (const TopoDS_Edge& E1, const TopoDS_Edge& E2, TopoDS_Vertex& V);
125 friend class TopExp_Explorer;
135 #endif // _TopExp_HeaderFile