b311480e |
1 | -- Created on: 1997-02-27 |
2 | -- Created by: Odile Olivier |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
b311480e |
16 | |
7fd59977 |
17 | -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead |
18 | -- the restricted NameOfColor. |
19 | -- GG : BUC60915 05/06/01 Enable to compute the requested arrow size if any |
20 | -- in all dimensions, add a field myArrowSizeIsDefined. |
7fd59977 |
21 | |
22 | deferred class Relation from AIS inherits InteractiveObject from AIS |
23 | |
24 | ---Purpose: One of the four types of interactive object in |
25 | -- AIS,comprising dimensions and constraints. Serves |
26 | -- as the abstract class for the seven relation classes as |
27 | -- well as the seven dimension classes. |
28 | -- The statuses available for relations between shapes are as follows: |
29 | -- - 0 - there is no connection to a shape; |
30 | -- - 1 - there is a connection to the first shape; |
31 | -- - 2 - there is a connection to the second shape. |
32 | -- The connection takes the form of an edge between the two shapes. |
33 | |
34 | uses |
35 | TypeOfPresentation3d from PrsMgr, |
36 | Shape from TopoDS, |
37 | Edge from TopoDS, |
38 | Vertex from TopoDS, |
39 | Pnt from gp, |
40 | ExtendedString from TCollection, |
41 | Plane from Geom, |
42 | ArrowSide from DsgPrs, |
43 | KindOfDimension from AIS, |
44 | Presentation from Prs3d, |
45 | Curve from Geom, |
46 | NameOfColor from Quantity, |
a6eb515f |
47 | Color from Quantity, |
7fd59977 |
48 | TypeOfLine from Aspect, |
49 | TypeOfMarker from Aspect, |
50 | KindOfInteractive from AIS, |
51 | |
52 | Pln from gp, |
53 | Surface from Geom, |
54 | KindOfSurface from AIS, |
55 | Box from Bnd |
56 | is |
57 | Initialize(aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView) ; |
58 | |
59 | SetColor(me :mutable; aColor : NameOfColor from Quantity) |
60 | is redefined static; |
61 | ---Purpose: Allows you to provide settings for the color aColor |
62 | -- of the lines representing the relation between the two shapes. |
63 | |
64 | SetColor(me :mutable; aColor : Color from Quantity) |
65 | is redefined static; |
66 | |
67 | UnsetColor(me:mutable) |
68 | is redefined static; |
69 | ---Purpose: Allows you to remove settings for the color of the |
70 | -- lines representing the relation between the two shapes. |
71 | |
72 | Type(me) returns KindOfInteractive from AIS is redefined; |
73 | ---C++: inline |
74 | |
75 | KindOfDimension(me) returns KindOfDimension from AIS is virtual; |
76 | ---Purpose: Indicates that the type of dimension is unknown. |
77 | |
78 | IsMovable(me) returns Boolean from Standard is virtual; |
79 | ---Purpose: Returns true if the interactive object is movable. |
80 | |
81 | FirstShape(me) returns Shape from TopoDS |
82 | is static; |
83 | ---C++: return const & |
84 | ---C++: inline |
85 | |
86 | SetFirstShape(me: mutable;aFShape : Shape from TopoDS) |
87 | is virtual; |
88 | |
89 | SecondShape(me) returns Shape from TopoDS |
90 | is static; |
91 | ---Purpose: Returns the second shape. |
92 | ---C++: inline |
93 | ---C++: return const & |
94 | |
95 | SetSecondShape(me: mutable;aSShape : Shape from TopoDS) |
96 | is virtual; |
97 | --- Purpose: Allows you to identify the second shape aSShape |
98 | -- relative to the first. |
99 | |
100 | SetBndBox( me: mutable; Xmin, Ymin, Zmin, Xmax, Ymax, Zmax : Real from Standard ); |
101 | ---C++: inline |
102 | |
103 | UnsetBndBox( me: mutable ); |
104 | ---C++: inline |
105 | |
106 | Plane(me) returns any Plane from Geom |
107 | is static; |
108 | ---Purpose: Returns the plane. |
109 | ---C++: inline |
110 | ---C++: return const & |
111 | |
112 | SetPlane(me: mutable;aPlane : Plane from Geom) |
113 | is static; |
114 | ---Purpose: |
115 | -- Allows you to set the plane aPlane. This is used to |
116 | -- define relations and dimensions in several daughter classes. |
117 | ---C++: inline |
118 | |
119 | Value(me) returns Real from Standard |
120 | is static; |
121 | ---Purpose: Returns the value of each object in the relation. |
122 | ---C++: inline |
123 | |
124 | SetValue(me: mutable;aVal : Real from Standard) |
125 | is static; |
126 | ---Purpose: Allows you to provide settings for the value aVal for |
127 | -- each object in the relation. |
128 | ---C++: inline |
129 | |
130 | Position(me) returns Pnt from gp |
131 | is static; |
132 | ---Purpose: Returns the position set using SetPosition. |
133 | ---C++: inline |
134 | ---C++: return const & |
135 | |
136 | SetPosition(me: mutable;aPosition: Pnt from gp) |
137 | is static; |
138 | ---Purpose: |
139 | -- Allows you to provide the objects in the relation with |
140 | -- settings for a non-default position. |
141 | ---C++: inline |
142 | |
143 | Text(me) returns ExtendedString from TCollection |
144 | is static; |
145 | ---Purpose: Returns settings for text aspect. |
146 | ---C++: inline |
147 | ---C++: return const & |
148 | |
149 | SetText(me: mutable;aText:ExtendedString from TCollection) |
150 | is static; |
151 | ---Purpose: Allows you to provide the settings aText for text aspect. |
152 | ---C++: inline |
153 | |
154 | ArrowSize (me) returns Real from Standard |
155 | is static; |
156 | ---Purpose: |
157 | -- Returns the value for the size of the arrow identifying |
158 | -- the relation between the two shapes. |
159 | ---C++: inline |
160 | |
161 | SetArrowSize(me: mutable;anArrowSize: Real from Standard) |
162 | is static; |
163 | ---C++: inline |
164 | ---Purpose: |
165 | -- Allows you to provide settings for the size of the |
166 | -- arrow anArrowsize identifying the relation between the two shapes. |
167 | |
168 | SymbolPrs (me) returns ArrowSide from DsgPrs |
169 | is static; |
170 | ---C++: inline |
171 | ---Purpose: |
172 | -- Returns the value of the symbol presentation. This will be one of: |
173 | -- - AS_NONE - none |
174 | -- - AS_FIRSTAR - first arrow |
175 | -- - AS_LASTAR - last arrow |
176 | -- - AS_BOTHAR - both arrows |
177 | -- - AS_FIRSTPT - first point |
178 | -- - AS_LASTPT - last point |
179 | -- - AS_BOTHPT - both points |
180 | -- - AS_FIRSTAR_LASTPT - first arrow, last point |
181 | -- - AS_FIRSTPT_LASTAR - first point, last arrow |
182 | |
183 | SetSymbolPrs(me: mutable;aSymbolPrs: ArrowSide from DsgPrs) |
184 | is static; |
185 | ---C++: inline |
186 | ---Purpose: |
187 | -- Allows you to provide settings for the symbol presentation. |
188 | |
189 | SetExtShape(me:mutable; aIndex : Integer from Standard); |
190 | ---C++: inline |
191 | ---Purpose: |
192 | -- Allows you to set the status of the extension shape by |
193 | -- the index aIndex. |
194 | -- The status will be one of the following: |
195 | -- - 0 - there is no connection to a shape; |
196 | -- - 1 - there is a connection to the first shape; |
197 | -- - 2 - there is a connection to the second shape. |
198 | |
199 | ExtShape(me) |
200 | returns Integer from Standard; |
201 | ---Purpose: |
202 | -- Returns the status index of the extension shape. |
203 | ---C++: inline |
204 | |
205 | AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined virtual; |
206 | ---Purpose: |
207 | -- Returns true if the display mode aMode is accepted |
208 | -- for the Interactive Objects in the relation. |
209 | -- ComputeProjPresentation(me; |
210 | -- aPres : mutable Presentation from Prs3d; |
211 | -- Curve1 : Curve from Geom; |
212 | -- Curve2 : Curve from Geom; |
213 | -- FirstP1 : Pnt from gp; |
214 | -- LastP1 : Pnt from gp; |
215 | -- FirstP2 : Pnt from gp; |
216 | -- LastP2 : Pnt from gp; |
217 | -- aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE; |
218 | -- aWidth : Real from Standard = 2; |
219 | -- aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH; |
220 | -- aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT) |
221 | --is protected; |
222 | |
223 | ComputeProjEdgePresentation(me; |
224 | aPres : mutable Presentation from Prs3d; |
225 | anEdge : Edge from TopoDS; |
226 | ProjCurve: Curve from Geom; |
227 | FirstP : Pnt from gp; |
228 | LastP : Pnt from gp; |
229 | aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE; |
230 | aWidth : Real from Standard = 2; |
231 | aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH; |
232 | aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT) |
233 | is protected; |
234 | ---Purpose: Calculates the presentation aPres of the the edge |
235 | -- anEdge and the curve it defines, ProjCurve. The later |
236 | -- is also specified by the first point FirstP and the last point LastP. |
237 | -- The presentation includes settings for color aColor, |
238 | -- type - aProjTOL and aCallTOL - and width of line, aWidth. |
239 | |
240 | ComputeProjVertexPresentation(me; |
241 | aPres : mutable Presentation from Prs3d; |
242 | aVertex : Vertex from TopoDS; |
243 | ProjPoint: Pnt from gp; |
244 | aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE; |
245 | aWidth : Real from Standard = 2; |
246 | aProjTOM : TypeOfMarker from Aspect = Aspect_TOM_PLUS; |
247 | aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT) |
248 | is protected; |
249 | |
250 | ---Purpose: Calculates the presentation aPres of the the vertex |
251 | -- aVertex and the point it defines, ProjPoint. |
252 | -- The presentation includes settings for color aColor, |
253 | -- type - aProjTOM and aCallTOL - and width of line, aWidth. |
254 | |
255 | SetAutomaticPosition ( me : mutable ; aStatus : Boolean from Standard ); |
256 | ---C++: inline |
257 | |
258 | AutomaticPosition ( me ) |
259 | returns Boolean from Standard ; |
260 | ---C++: inline |
261 | |
262 | fields |
263 | |
264 | myFShape : Shape from TopoDS is protected; |
265 | mySShape : Shape from TopoDS is protected; |
266 | myPlane : Plane from Geom is protected; |
267 | myVal : Real from Standard is protected; |
268 | myPosition : Pnt from gp is protected; |
269 | myText : ExtendedString from TCollection is protected; |
270 | myArrowSize: Real from Standard is protected; |
271 | myAutomaticPosition : Boolean from Standard is protected; |
272 | mySymbolPrs: ArrowSide from DsgPrs is protected; |
273 | myExtShape : Integer from Standard is protected; |
274 | ---purpose: (0 no attachment,1 attachment with first shape, 2 attachment with second shape) |
275 | |
276 | myFirstPlane : Pln from gp is protected; |
277 | mySecondPlane : Pln from gp is protected; |
278 | myFirstBasisSurf : Surface from Geom is protected; |
279 | mySecondBasisSurf : Surface from Geom is protected; |
280 | |
281 | myFirstSurfType : KindOfSurface from AIS is protected; |
282 | mySecondSurfType : KindOfSurface from AIS is protected; |
283 | |
284 | myFirstOffset : Real from Standard is protected; |
285 | mySecondOffset : Real from Standard is protected; |
286 | |
287 | myBndBox : Box from Bnd is protected; |
288 | myIsSetBndBox : Boolean from Standard is protected; |
289 | myArrowSizeIsDefined: Boolean from Standard is protected; |
290 | |
291 | end Relation; |