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
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.
20 -- All methods of all classes will be public.
22 ---Purpose: This package gives resources for Topology oriented
23 -- applications such as : Topological Data Structure,
24 -- Topological Algorithms.
28 -- * The ShapeEnum enumeration to describe the
29 -- differents topological shapes.
31 -- * The Orientation enumeration to describe the
32 -- orientation of a topological shape.
34 -- * The State enumeration to describes the
35 -- position of a point relative to a Shape.
37 -- * Methods to manage the enumerations.
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.
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.
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.
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 :
131 -- \ Or2 FORWARD REVERSED INTERNAL EXTERNAL
132 -- Or1 -------------------------------------
133 -- FORWARD | FORWARD REVERSED INTERNAL EXTERNAL
135 -- REVERSED | REVERSED FORWARD INTERNAL EXTERNAL
137 -- INTERNAL | INTERNAL INTERNAL INTERNAL INTERNAL
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.
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:
154 -- Reverse exchange the material sides.
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:
170 -- Complement complements the material side. Inside
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>.
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>.
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>.