1 -- Created on: 1997-02-27
2 -- Created by: Odile Olivier
3 -- Copyright (c) 1997-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 -- 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.
22 deferred class Relation from AIS inherits InteractiveObject from AIS
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.
35 TypeOfPresentation3d from PrsMgr,
40 ExtendedString from TCollection,
42 ArrowSide from DsgPrs,
43 KindOfDimension from AIS,
44 Presentation from Prs3d,
46 NameOfColor from Quantity,
48 TypeOfLine from Aspect,
49 TypeOfMarker from Aspect,
50 KindOfInteractive from AIS,
54 KindOfSurface from AIS,
57 Initialize(aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView) ;
59 SetColor(me :mutable; aColor : NameOfColor from Quantity)
61 ---Purpose: Allows you to provide settings for the color aColor
62 -- of the lines representing the relation between the two shapes.
64 SetColor(me :mutable; aColor : Color from Quantity)
67 UnsetColor(me:mutable)
69 ---Purpose: Allows you to remove settings for the color of the
70 -- lines representing the relation between the two shapes.
72 Type(me) returns KindOfInteractive from AIS is redefined;
75 KindOfDimension(me) returns KindOfDimension from AIS is virtual;
76 ---Purpose: Indicates that the type of dimension is unknown.
78 IsMovable(me) returns Boolean from Standard is virtual;
79 ---Purpose: Returns true if the interactive object is movable.
81 FirstShape(me) returns Shape from TopoDS
83 ---C++: return const &
86 SetFirstShape(me: mutable;aFShape : Shape from TopoDS)
89 SecondShape(me) returns Shape from TopoDS
91 ---Purpose: Returns the second shape.
93 ---C++: return const &
95 SetSecondShape(me: mutable;aSShape : Shape from TopoDS)
97 --- Purpose: Allows you to identify the second shape aSShape
98 -- relative to the first.
100 SetBndBox( me: mutable; Xmin, Ymin, Zmin, Xmax, Ymax, Zmax : Real from Standard );
103 UnsetBndBox( me: mutable );
106 Plane(me) returns any Plane from Geom
108 ---Purpose: Returns the plane.
110 ---C++: return const &
112 SetPlane(me: mutable;aPlane : Plane from Geom)
115 -- Allows you to set the plane aPlane. This is used to
116 -- define relations and dimensions in several daughter classes.
119 Value(me) returns Real from Standard
121 ---Purpose: Returns the value of each object in the relation.
124 SetValue(me: mutable;aVal : Real from Standard)
126 ---Purpose: Allows you to provide settings for the value aVal for
127 -- each object in the relation.
130 Position(me) returns Pnt from gp
132 ---Purpose: Returns the position set using SetPosition.
134 ---C++: return const &
136 SetPosition(me: mutable;aPosition: Pnt from gp)
139 -- Allows you to provide the objects in the relation with
140 -- settings for a non-default position.
143 Text(me) returns ExtendedString from TCollection
145 ---Purpose: Returns settings for text aspect.
147 ---C++: return const &
149 SetText(me: mutable;aText:ExtendedString from TCollection)
151 ---Purpose: Allows you to provide the settings aText for text aspect.
154 ArrowSize (me) returns Real from Standard
157 -- Returns the value for the size of the arrow identifying
158 -- the relation between the two shapes.
161 SetArrowSize(me: mutable;anArrowSize: Real from Standard)
165 -- Allows you to provide settings for the size of the
166 -- arrow anArrowsize identifying the relation between the two shapes.
168 SymbolPrs (me) returns ArrowSide from DsgPrs
172 -- Returns the value of the symbol presentation. This will be one of:
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
183 SetSymbolPrs(me: mutable;aSymbolPrs: ArrowSide from DsgPrs)
187 -- Allows you to provide settings for the symbol presentation.
189 SetExtShape(me:mutable; aIndex : Integer from Standard);
192 -- Allows you to set the status of the extension shape by
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.
200 returns Integer from Standard;
202 -- Returns the status index of the extension shape.
205 AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined virtual;
207 -- Returns true if the display mode aMode is accepted
208 -- for the Interactive Objects in the relation.
209 -- ComputeProjPresentation(me;
210 -- aPres : 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)
223 ComputeProjEdgePresentation(me;
224 aPres : Presentation from Prs3d;
225 anEdge : Edge from TopoDS;
226 ProjCurve: Curve from Geom;
227 FirstP : 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)
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.
240 ComputeProjVertexPresentation(me;
241 aPres : 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)
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.
255 SetAutomaticPosition ( me : mutable ; aStatus : Boolean from Standard );
258 AutomaticPosition ( me )
259 returns Boolean from Standard ;
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)
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;
281 myFirstSurfType : KindOfSurface from AIS is protected;
282 mySecondSurfType : KindOfSurface from AIS is protected;
284 myFirstOffset : Real from Standard is protected;
285 mySecondOffset : Real from Standard is protected;
287 myBndBox : Box from Bnd is protected;
288 myIsSetBndBox : Boolean from Standard is protected;
289 myArrowSizeIsDefined: Boolean from Standard is protected;