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 deferred class Relation from AIS inherits InteractiveObject from AIS
19 ---Purpose: One of the four types of interactive object in
20 -- AIS,comprising dimensions and constraints. Serves
21 -- as the abstract class for the seven relation classes as
22 -- well as the seven dimension classes.
23 -- The statuses available for relations between shapes are as follows:
24 -- - 0 - there is no connection to a shape;
25 -- - 1 - there is a connection to the first shape;
26 -- - 2 - there is a connection to the second shape.
27 -- The connection takes the form of an edge between the two shapes.
30 TypeOfPresentation3d from PrsMgr,
35 ExtendedString from TCollection,
37 ArrowSide from DsgPrs,
38 KindOfDimension from AIS,
39 Presentation from Prs3d,
41 NameOfColor from Quantity,
43 TypeOfLine from Aspect,
44 TypeOfMarker from Aspect,
45 KindOfInteractive from AIS,
49 KindOfSurface from AIS,
52 Initialize(aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView) ;
54 SetColor(me :mutable; aColor : NameOfColor from Quantity)
56 ---Purpose: Allows you to provide settings for the color aColor
57 -- of the lines representing the relation between the two shapes.
59 SetColor(me :mutable; aColor : Color from Quantity)
62 UnsetColor(me:mutable)
64 ---Purpose: Allows you to remove settings for the color of the
65 -- lines representing the relation between the two shapes.
67 Type(me) returns KindOfInteractive from AIS is redefined;
70 KindOfDimension(me) returns KindOfDimension from AIS is virtual;
71 ---Purpose: Indicates that the type of dimension is unknown.
73 IsMovable(me) returns Boolean from Standard is virtual;
74 ---Purpose: Returns true if the interactive object is movable.
76 FirstShape(me) returns Shape from TopoDS
78 ---C++: return const &
81 SetFirstShape(me: mutable;aFShape : Shape from TopoDS)
84 SecondShape(me) returns Shape from TopoDS
86 ---Purpose: Returns the second shape.
88 ---C++: return const &
90 SetSecondShape(me: mutable;aSShape : Shape from TopoDS)
92 --- Purpose: Allows you to identify the second shape aSShape
93 -- relative to the first.
95 SetBndBox( me: mutable; Xmin, Ymin, Zmin, Xmax, Ymax, Zmax : Real from Standard );
98 UnsetBndBox( me: mutable );
101 Plane(me) returns any Plane from Geom
103 ---Purpose: Returns the plane.
105 ---C++: return const &
107 SetPlane(me: mutable;aPlane : Plane from Geom)
110 -- Allows you to set the plane aPlane. This is used to
111 -- define relations and dimensions in several daughter classes.
114 Value(me) returns Real from Standard
116 ---Purpose: Returns the value of each object in the relation.
119 SetValue(me: mutable;aVal : Real from Standard)
121 ---Purpose: Allows you to provide settings for the value aVal for
122 -- each object in the relation.
125 Position(me) returns Pnt from gp
127 ---Purpose: Returns the position set using SetPosition.
129 ---C++: return const &
131 SetPosition(me: mutable;aPosition: Pnt from gp)
134 -- Allows you to provide the objects in the relation with
135 -- settings for a non-default position.
138 Text(me) returns ExtendedString from TCollection
140 ---Purpose: Returns settings for text aspect.
142 ---C++: return const &
144 SetText(me: mutable;aText:ExtendedString from TCollection)
146 ---Purpose: Allows you to provide the settings aText for text aspect.
149 ArrowSize (me) returns Real from Standard
152 -- Returns the value for the size of the arrow identifying
153 -- the relation between the two shapes.
156 SetArrowSize(me: mutable;anArrowSize: Real from Standard)
160 -- Allows you to provide settings for the size of the
161 -- arrow anArrowsize identifying the relation between the two shapes.
163 SymbolPrs (me) returns ArrowSide from DsgPrs
167 -- Returns the value of the symbol presentation. This will be one of:
169 -- - AS_FIRSTAR - first arrow
170 -- - AS_LASTAR - last arrow
171 -- - AS_BOTHAR - both arrows
172 -- - AS_FIRSTPT - first point
173 -- - AS_LASTPT - last point
174 -- - AS_BOTHPT - both points
175 -- - AS_FIRSTAR_LASTPT - first arrow, last point
176 -- - AS_FIRSTPT_LASTAR - first point, last arrow
178 SetSymbolPrs(me: mutable;aSymbolPrs: ArrowSide from DsgPrs)
182 -- Allows you to provide settings for the symbol presentation.
184 SetExtShape(me:mutable; aIndex : Integer from Standard);
187 -- Allows you to set the status of the extension shape by
189 -- The status will be one of the following:
190 -- - 0 - there is no connection to a shape;
191 -- - 1 - there is a connection to the first shape;
192 -- - 2 - there is a connection to the second shape.
195 returns Integer from Standard;
197 -- Returns the status index of the extension shape.
200 AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined virtual;
202 -- Returns true if the display mode aMode is accepted
203 -- for the Interactive Objects in the relation.
204 -- ComputeProjPresentation(me;
205 -- aPres : Presentation from Prs3d;
206 -- Curve1 : Curve from Geom;
207 -- Curve2 : Curve from Geom;
208 -- FirstP1 : Pnt from gp;
209 -- LastP1 : Pnt from gp;
210 -- FirstP2 : Pnt from gp;
211 -- LastP2 : Pnt from gp;
212 -- aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
213 -- aWidth : Real from Standard = 2;
214 -- aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH;
215 -- aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
218 ComputeProjEdgePresentation(me;
219 aPres : Presentation from Prs3d;
220 anEdge : Edge from TopoDS;
221 ProjCurve: Curve from Geom;
222 FirstP : Pnt from gp;
224 aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
225 aWidth : Real from Standard = 2;
226 aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH;
227 aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
229 ---Purpose: Calculates the presentation aPres of the the edge
230 -- anEdge and the curve it defines, ProjCurve. The later
231 -- is also specified by the first point FirstP and the last point LastP.
232 -- The presentation includes settings for color aColor,
233 -- type - aProjTOL and aCallTOL - and width of line, aWidth.
235 ComputeProjVertexPresentation(me;
236 aPres : Presentation from Prs3d;
237 aVertex : Vertex from TopoDS;
238 ProjPoint: Pnt from gp;
239 aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
240 aWidth : Real from Standard = 2;
241 aProjTOM : TypeOfMarker from Aspect = Aspect_TOM_PLUS;
242 aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
245 ---Purpose: Calculates the presentation aPres of the the vertex
246 -- aVertex and the point it defines, ProjPoint.
247 -- The presentation includes settings for color aColor,
248 -- type - aProjTOM and aCallTOL - and width of line, aWidth.
250 SetAutomaticPosition ( me : mutable ; aStatus : Boolean from Standard );
253 AutomaticPosition ( me )
254 returns Boolean from Standard ;
259 myFShape : Shape from TopoDS is protected;
260 mySShape : Shape from TopoDS is protected;
261 myPlane : Plane from Geom is protected;
262 myVal : Real from Standard is protected;
263 myPosition : Pnt from gp is protected;
264 myText : ExtendedString from TCollection is protected;
265 myArrowSize: Real from Standard is protected;
266 myAutomaticPosition : Boolean from Standard is protected;
267 mySymbolPrs: ArrowSide from DsgPrs is protected;
268 myExtShape : Integer from Standard is protected;
269 ---purpose: (0 no attachment,1 attachment with first shape, 2 attachment with second shape)
271 myFirstPlane : Pln from gp is protected;
272 mySecondPlane : Pln from gp is protected;
273 myFirstBasisSurf : Surface from Geom is protected;
274 mySecondBasisSurf : Surface from Geom is protected;
276 myFirstSurfType : KindOfSurface from AIS is protected;
277 mySecondSurfType : KindOfSurface from AIS is protected;
279 myFirstOffset : Real from Standard is protected;
280 mySecondOffset : Real from Standard is protected;
282 myBndBox : Box from Bnd is protected;
283 myIsSetBndBox : Boolean from Standard is protected;
284 myArrowSizeIsDefined: Boolean from Standard is protected;