0024428: Implementation of LGPL license
[occt.git] / src / TopAbs / TopAbs.cdl
1 -- Created on: 1992-01-24
2 -- Created by: Remi LEQUETTE
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public 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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 package TopAbs 
18
19         ---Level : Public. 
20         --  All methods of all  classes will be public.
21
22         ---Purpose: This package gives resources for Topology oriented
23         --          applications such as : Topological Data Structure,
24         --          Topological Algorithms.
25         --          
26         --          It contains :
27         --          
28         --            * The ShapeEnum   enumeration  to  describe  the
29         --            differents topological shapes.
30         --            
31         --            * The  Orientation  enumeration to  describe the
32         --            orientation of a topological shape.
33         --            
34         --            * The  State    enumeration  to  describes  the
35         --            position of a point relative to a Shape.
36         --            
37         --            * Methods to manage the enumerations.
38
39 is
40
41     enumeration ShapeEnum is 
42     ---Purpose: Identifies various topological shapes. This
43     -- enumeration allows you to use dynamic typing of shapes.
44     -- The values are listed in order of complexity, from the
45     -- most complex to the most simple i.e.
46     -- COMPOUND > COMPSOLID > SOLID > .... > VERTEX > SHAPE.
47     --  Any shape can contain simpler shapes in its definition.
48     -- Abstract topological data structure describes a basic
49     -- entity, the shape (present in this enumeration as the
50     -- SHAPE value), which can be divided into the following
51     -- component topologies:
52     -- - COMPOUND: A group of any of the shapes below.
53     -- - COMPSOLID: A set of solids connected by their
54     --   faces. This expands the notions of WIRE and SHELL to solids.
55     -- - SOLID: A part of 3D space bounded by shells.
56     -- - SHELL: A set of faces connected by some of the
57     --   edges of their wire boundaries. A shell can be open or closed.
58     -- - FACE: Part of a plane (in 2D geometry) or a surface
59     --   (in 3D geometry) bounded by a closed wire. Its
60     --   geometry is constrained (trimmed) by contours.
61     -- - WIRE: A sequence of edges connected by their
62     --  vertices. It can be open or closed depending on
63     --  whether the edges are linked or not.
64     -- - EDGE: A single dimensional shape corresponding
65     --   to a curve, and bound by a vertex at each extremity.
66     -- - VERTEX: A zero-dimensional shape corresponding to a point in geometry.
67         COMPOUND,
68         COMPSOLID,
69         SOLID,
70         SHELL,
71         FACE,
72         WIRE,
73         EDGE,
74         VERTEX,
75         SHAPE
76
77     end ShapeEnum;
78
79     enumeration Orientation is 
80     ---Purpose: Identifies the orientation of a topological shape.
81     -- Orientation can represent a relation between two
82     -- entities, or it can apply to a shape in its own right.
83     -- When used to describe a relation between two
84     -- shapes, orientation allows you to use the underlying
85     -- entity in either direction. For example on a curve
86     -- which is oriented FORWARD (say from left to right)
87     -- you can have both a FORWARD and a REVERSED
88     -- edge. The FORWARD edge will be oriented from
89     -- left to right, and the REVERSED edge from right to
90     -- left. In this way, you share the underlying entity. In
91     -- other words, two faces of a cube can share an
92     -- edge, and can also be used to build compound shapes.
93     -- For each case in which an element is used as the
94     -- boundary of a geometric domain of a higher
95     -- dimension, this element defines two local regions of
96     -- which one is arbitrarily considered as the default
97     -- region. A change in orientation implies a switch of
98     -- default region. This allows you to apply changes of
99     -- orientation to the shape as a whole.
100         FORWARD,
101         REVERSED,
102         INTERNAL,
103         EXTERNAL
104
105     end Orientation;
106
107     enumeration State is 
108     ---Purpose: Identifies the position of a vertex or a set of
109     -- vertices relative to a region of a shape.   
110     -- The figure shown above illustrates the states of
111     -- vertices found in various parts of the edge relative
112     -- to the face which it intersects.
113         IN,
114         OUT,
115         ON,
116         UNKNOWN
117
118     end State;
119     
120    
121     Compose(Or1  : Orientation from TopAbs;
122             Or2  : Orientation from TopAbs)
123     returns Orientation from TopAbs;
124     ---Purpose: Compose  the Orientation    <Or1>  and  <Or2>.    This
125     --          composition is not symmetric (if  you switch <Or1> and
126     --          <Or2> the result  is different). It assumes that <Or1>
127     --          is the Orientation of a Shape S1 containing a Shape S2
128     --          of Orientation   Or2.  The result    is the  cumulated
129     --          orientation of S2 in S1.  The composition law is :
130     --          
131     --             \ Or2     FORWARD  REVERSED INTERNAL EXTERNAL
132     --           Or1       -------------------------------------
133     --           FORWARD   | FORWARD  REVERSED INTERNAL EXTERNAL
134     --                     |
135     --           REVERSED  | REVERSED FORWARD  INTERNAL EXTERNAL
136     --                     |
137     --           INTERNAL  | INTERNAL INTERNAL INTERNAL INTERNAL
138     --                     |
139     --           EXTERNAL  | EXTERNAL EXTERNAL EXTERNAL EXTERNAL
140     --     Note: The top corner in the table is the most important
141     -- for the purposes of Open CASCADE topology and shape sharing.      
142
143     Reverse(Or : Orientation from TopAbs)
144     returns Orientation from TopAbs;
145     ---Purpose: xchanges the interior/exterior status of the two
146     -- sides. This is what happens when the sense of
147     -- direction is reversed. The following rules apply:
148     --          
149     --          FORWARD          REVERSED
150     --          REVERSED         FORWARD
151     --          INTERNAL         INTERNAL
152     --          EXTERNAL         EXTERNAL
153     --          
154     --          Reverse exchange the material sides.
155     --          
156
157     Complement(Or : Orientation from TopAbs)
158     returns Orientation from TopAbs;
159     ---Purpose: Reverses the interior/exterior status of each side of
160     -- the object. So, to take the complement of an object
161     -- means to reverse the interior/exterior status of its
162     -- boundary, i.e. inside becomes outside.
163     -- The method returns the complementary orientation,
164     -- following the rules in the table below:
165     --          FORWARD          REVERSED
166     --          REVERSED         FORWARD
167     --          INTERNAL         EXTERNAL
168     --          EXTERNAL         INTERNAL
169     --          
170     --          Complement  complements   the  material  side.  Inside
171     --          becomes outside.
172     --          
173
174     Print(SE  : ShapeEnum  from TopAbs; S  : in out OStream) returns OStream;
175     ---Purpose: Prints the name  of Shape  <SEq>  as  a String  on the
176     --          Stream <S> and returns <S>.
177     --          
178     ---C++: return &
179
180     Print(Or  : Orientation  from TopAbs; S  : in out OStream) returns OStream;
181     ---Purpose: Prints the name of the Orientation <Or> as a String on
182     --          the Stream <S> and returns <S>.
183     --          
184     ---C++: return &
185
186     Print(St  : State  from TopAbs; S  : in out OStream) returns OStream;
187     ---Purpose: Prints the name of the State <St> as a String on
188     --          the Stream <S> and returns <S>.
189     --          
190     ---C++: return &
191
192 end TopAbs;