1 -- File: AIS_Relation.cdl<2>
2 -- Created: Thu Feb 27 09:50:48 1997
3 -- Author: Odile Olivier
4 -- <odl@sacadox.paris1.matra-dtv.fr>
5 -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
6 -- the restricted NameOfColor.
7 -- GG : BUC60915 05/06/01 Enable to compute the requested arrow size if any
8 -- in all dimensions, add a field myArrowSizeIsDefined.
9 ---Copyright: Matra Datavision 1997
11 deferred class Relation from AIS inherits InteractiveObject from AIS
13 ---Purpose: One of the four types of interactive object in
14 -- AIS,comprising dimensions and constraints. Serves
15 -- as the abstract class for the seven relation classes as
16 -- well as the seven dimension classes.
17 -- The statuses available for relations between shapes are as follows:
18 -- - 0 - there is no connection to a shape;
19 -- - 1 - there is a connection to the first shape;
20 -- - 2 - there is a connection to the second shape.
21 -- The connection takes the form of an edge between the two shapes.
24 TypeOfPresentation3d from PrsMgr,
29 ExtendedString from TCollection,
31 ArrowSide from DsgPrs,
32 KindOfDimension from AIS,
33 Presentation from Prs3d,
35 NameOfColor from Quantity,
37 TypeOfLine from Aspect,
38 TypeOfMarker from Aspect,
39 KindOfInteractive from AIS,
43 KindOfSurface from AIS,
46 Initialize(aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView) ;
48 SetColor(me :mutable; aColor : NameOfColor from Quantity)
50 ---Purpose: Allows you to provide settings for the color aColor
51 -- of the lines representing the relation between the two shapes.
53 SetColor(me :mutable; aColor : Color from Quantity)
56 UnsetColor(me:mutable)
58 ---Purpose: Allows you to remove settings for the color of the
59 -- lines representing the relation between the two shapes.
61 Type(me) returns KindOfInteractive from AIS is redefined;
64 KindOfDimension(me) returns KindOfDimension from AIS is virtual;
65 ---Purpose: Indicates that the type of dimension is unknown.
67 IsMovable(me) returns Boolean from Standard is virtual;
68 ---Purpose: Returns true if the interactive object is movable.
70 FirstShape(me) returns Shape from TopoDS
72 ---C++: return const &
75 SetFirstShape(me: mutable;aFShape : Shape from TopoDS)
78 SecondShape(me) returns Shape from TopoDS
80 ---Purpose: Returns the second shape.
82 ---C++: return const &
84 SetSecondShape(me: mutable;aSShape : Shape from TopoDS)
86 --- Purpose: Allows you to identify the second shape aSShape
87 -- relative to the first.
89 SetBndBox( me: mutable; Xmin, Ymin, Zmin, Xmax, Ymax, Zmax : Real from Standard );
92 UnsetBndBox( me: mutable );
95 Plane(me) returns any Plane from Geom
97 ---Purpose: Returns the plane.
99 ---C++: return const &
101 SetPlane(me: mutable;aPlane : Plane from Geom)
104 -- Allows you to set the plane aPlane. This is used to
105 -- define relations and dimensions in several daughter classes.
108 Value(me) returns Real from Standard
110 ---Purpose: Returns the value of each object in the relation.
113 SetValue(me: mutable;aVal : Real from Standard)
115 ---Purpose: Allows you to provide settings for the value aVal for
116 -- each object in the relation.
119 Position(me) returns Pnt from gp
121 ---Purpose: Returns the position set using SetPosition.
123 ---C++: return const &
125 SetPosition(me: mutable;aPosition: Pnt from gp)
128 -- Allows you to provide the objects in the relation with
129 -- settings for a non-default position.
132 Text(me) returns ExtendedString from TCollection
134 ---Purpose: Returns settings for text aspect.
136 ---C++: return const &
138 SetText(me: mutable;aText:ExtendedString from TCollection)
140 ---Purpose: Allows you to provide the settings aText for text aspect.
143 ArrowSize (me) returns Real from Standard
146 -- Returns the value for the size of the arrow identifying
147 -- the relation between the two shapes.
150 SetArrowSize(me: mutable;anArrowSize: Real from Standard)
154 -- Allows you to provide settings for the size of the
155 -- arrow anArrowsize identifying the relation between the two shapes.
157 SymbolPrs (me) returns ArrowSide from DsgPrs
161 -- Returns the value of the symbol presentation. This will be one of:
163 -- - AS_FIRSTAR - first arrow
164 -- - AS_LASTAR - last arrow
165 -- - AS_BOTHAR - both arrows
166 -- - AS_FIRSTPT - first point
167 -- - AS_LASTPT - last point
168 -- - AS_BOTHPT - both points
169 -- - AS_FIRSTAR_LASTPT - first arrow, last point
170 -- - AS_FIRSTPT_LASTAR - first point, last arrow
172 SetSymbolPrs(me: mutable;aSymbolPrs: ArrowSide from DsgPrs)
176 -- Allows you to provide settings for the symbol presentation.
178 SetExtShape(me:mutable; aIndex : Integer from Standard);
181 -- Allows you to set the status of the extension shape by
183 -- The status will be one of the following:
184 -- - 0 - there is no connection to a shape;
185 -- - 1 - there is a connection to the first shape;
186 -- - 2 - there is a connection to the second shape.
189 returns Integer from Standard;
191 -- Returns the status index of the extension shape.
194 AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined virtual;
196 -- Returns true if the display mode aMode is accepted
197 -- for the Interactive Objects in the relation.
198 -- ComputeProjPresentation(me;
199 -- aPres : mutable Presentation from Prs3d;
200 -- Curve1 : Curve from Geom;
201 -- Curve2 : Curve from Geom;
202 -- FirstP1 : Pnt from gp;
203 -- LastP1 : Pnt from gp;
204 -- FirstP2 : Pnt from gp;
205 -- LastP2 : Pnt from gp;
206 -- aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
207 -- aWidth : Real from Standard = 2;
208 -- aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH;
209 -- aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
212 ComputeProjEdgePresentation(me;
213 aPres : mutable Presentation from Prs3d;
214 anEdge : Edge from TopoDS;
215 ProjCurve: Curve from Geom;
216 FirstP : Pnt from gp;
218 aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
219 aWidth : Real from Standard = 2;
220 aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH;
221 aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
223 ---Purpose: Calculates the presentation aPres of the the edge
224 -- anEdge and the curve it defines, ProjCurve. The later
225 -- is also specified by the first point FirstP and the last point LastP.
226 -- The presentation includes settings for color aColor,
227 -- type - aProjTOL and aCallTOL - and width of line, aWidth.
229 ComputeProjVertexPresentation(me;
230 aPres : mutable Presentation from Prs3d;
231 aVertex : Vertex from TopoDS;
232 ProjPoint: Pnt from gp;
233 aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
234 aWidth : Real from Standard = 2;
235 aProjTOM : TypeOfMarker from Aspect = Aspect_TOM_PLUS;
236 aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
239 ---Purpose: Calculates the presentation aPres of the the vertex
240 -- aVertex and the point it defines, ProjPoint.
241 -- The presentation includes settings for color aColor,
242 -- type - aProjTOM and aCallTOL - and width of line, aWidth.
244 SetAutomaticPosition ( me : mutable ; aStatus : Boolean from Standard );
247 AutomaticPosition ( me )
248 returns Boolean from Standard ;
253 myFShape : Shape from TopoDS is protected;
254 mySShape : Shape from TopoDS is protected;
255 myPlane : Plane from Geom is protected;
256 myVal : Real from Standard is protected;
257 myPosition : Pnt from gp is protected;
258 myText : ExtendedString from TCollection is protected;
259 myArrowSize: Real from Standard is protected;
260 myAutomaticPosition : Boolean from Standard is protected;
261 mySymbolPrs: ArrowSide from DsgPrs is protected;
262 myExtShape : Integer from Standard is protected;
263 ---purpose: (0 no attachment,1 attachment with first shape, 2 attachment with second shape)
265 myFirstPlane : Pln from gp is protected;
266 mySecondPlane : Pln from gp is protected;
267 myFirstBasisSurf : Surface from Geom is protected;
268 mySecondBasisSurf : Surface from Geom is protected;
270 myFirstSurfType : KindOfSurface from AIS is protected;
271 mySecondSurfType : KindOfSurface from AIS is protected;
273 myFirstOffset : Real from Standard is protected;
274 mySecondOffset : Real from Standard is protected;
276 myBndBox : Box from Bnd is protected;
277 myIsSetBndBox : Boolean from Standard is protected;
278 myArrowSizeIsDefined: Boolean from Standard is protected;