7fd59977 |
1 | -- File: TopExp.cdl |
2 | -- Created: Thu Dec 20 16:28:01 1990 |
3 | -- Author: Remi Lequette |
4 | -- <rle@topsn3> |
5 | ---Copyright: Matra Datavision 1990 |
6 | |
7 | |
8 | package TopExp |
9 | |
10 | ---Purpose: This package provides basic tools to explore the |
11 | -- topological data structures. |
12 | -- |
13 | -- * Explorer : A tool to find all sub-shapes of a given |
14 | -- type. e.g. all faces of a solid. |
15 | -- |
16 | -- * Package methods to map sub-shapes of a shape. |
17 | -- |
18 | -- Level : Public |
19 | -- All methods of all classes will be public. |
20 | |
21 | |
22 | uses |
23 | |
24 | TCollection, |
25 | TopLoc, |
26 | TopAbs, |
27 | TopoDS, |
28 | TopTools |
29 | |
30 | is |
31 | |
32 | private class StackOfIterator instantiates |
33 | Stack from TCollection (Iterator from TopoDS); |
34 | |
35 | pointer Stack to Iterator from TopoDS; |
36 | |
37 | class Explorer; |
38 | ---Purpose: Tool to explore a topological data structure. |
39 | |
40 | -- |
41 | -- Package methods |
42 | -- |
43 | |
44 | |
45 | MapShapes(S : Shape from TopoDS; |
46 | T : ShapeEnum from TopAbs; |
47 | M : in out IndexedMapOfShape from TopTools); |
48 | ---Purpose: Stores in the map <M> all the sub-shapes of <S> |
49 | -- of type <T>. |
50 | -- |
51 | -- Warning: The map is not cleared at first. |
52 | |
53 | MapShapes(S : Shape from TopoDS; |
54 | M : in out IndexedMapOfShape from TopTools); |
55 | ---Purpose: Stores in the map <M> all the sub-shapes of <S>. |
56 | |
57 | MapShapesAndAncestors |
58 | (S : Shape from TopoDS; |
59 | TS : ShapeEnum from TopAbs; |
60 | TA : ShapeEnum from TopAbs; |
61 | M : in out IndexedDataMapOfShapeListOfShape from TopTools); |
62 | ---Purpose: Stores in the map <M> all the subshape of <S> of |
63 | -- type <TS> for each one append to the list all |
64 | -- the ancestors of type <TA>. For example map all |
65 | -- the edges and bind the list of faces. |
66 | -- Warning: The map is not cleared at first. |
67 | |
68 | FirstVertex(E : Edge from TopoDS; |
69 | CumOri : Boolean from Standard = Standard_False) |
70 | returns Vertex from TopoDS; |
71 | ---Purpose: Returns the Vertex of orientation FORWARD in E. If |
72 | -- there is none returns a Null Shape. |
73 | -- CumOri = True : taking account the edge orientation |
74 | |
75 | LastVertex(E : Edge from TopoDS; |
76 | CumOri : Boolean from Standard = Standard_False) |
77 | returns Vertex from TopoDS; |
78 | ---Purpose: Returns the Vertex of orientation REVERSED in E. If |
79 | -- there is none returns a Null Shape. |
80 | -- CumOri = True : taking account the edge orientation |
81 | |
82 | Vertices(E : Edge from TopoDS; Vfirst, Vlast : out Vertex from TopoDS; |
83 | CumOri : Boolean from Standard = Standard_False); |
84 | ---Purpose: Returns in Vfirst, Vlast the FORWARD and REVERSED |
85 | -- vertices of the edge <E>. May be null shapes. |
86 | -- CumOri = True : taking account the edge orientation |
87 | |
88 | Vertices(W : Wire from TopoDS; Vfirst, Vlast : out Vertex from TopoDS); |
89 | ---Purpose: Returns in Vfirst, Vlast the first and last |
90 | -- vertices of the open wire <W>. May be null shapes. |
91 | -- if <W> is closed Vfirst and Vlast are a same |
92 | -- vertex on <W>. |
93 | -- if <W> is no manifold. VFirst and VLast are null |
94 | -- shapes. |
95 | |
96 | CommonVertex( E1, E2 : Edge from TopoDS; |
97 | V : out Vertex from TopoDS) |
98 | returns Boolean; |
99 | ---Purpose: Finds the vertex <V> common to the two edges |
100 | -- <E1,E2>, returns True if this vertex exists. |
101 | -- |
102 | -- Warning: <V> has sense only if the value <True> is returned |
103 | |
104 | end TopExp; |
105 | |
106 | |
107 | |