1 -- Created on: 1997-02-27
2 -- Created by: Odile Olivier
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
21 -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
22 -- the restricted NameOfColor.
23 -- GG : BUC60915 05/06/01 Enable to compute the requested arrow size if any
24 -- in all dimensions, add a field myArrowSizeIsDefined.
26 deferred class Relation from AIS inherits InteractiveObject from AIS
28 ---Purpose: One of the four types of interactive object in
29 -- AIS,comprising dimensions and constraints. Serves
30 -- as the abstract class for the seven relation classes as
31 -- well as the seven dimension classes.
32 -- The statuses available for relations between shapes are as follows:
33 -- - 0 - there is no connection to a shape;
34 -- - 1 - there is a connection to the first shape;
35 -- - 2 - there is a connection to the second shape.
36 -- The connection takes the form of an edge between the two shapes.
39 TypeOfPresentation3d from PrsMgr,
44 ExtendedString from TCollection,
46 ArrowSide from DsgPrs,
47 KindOfDimension from AIS,
48 Presentation from Prs3d,
50 NameOfColor from Quantity,
52 TypeOfLine from Aspect,
53 TypeOfMarker from Aspect,
54 KindOfInteractive from AIS,
58 KindOfSurface from AIS,
61 Initialize(aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView) ;
63 SetColor(me :mutable; aColor : NameOfColor from Quantity)
65 ---Purpose: Allows you to provide settings for the color aColor
66 -- of the lines representing the relation between the two shapes.
68 SetColor(me :mutable; aColor : Color from Quantity)
71 UnsetColor(me:mutable)
73 ---Purpose: Allows you to remove settings for the color of the
74 -- lines representing the relation between the two shapes.
76 Type(me) returns KindOfInteractive from AIS is redefined;
79 KindOfDimension(me) returns KindOfDimension from AIS is virtual;
80 ---Purpose: Indicates that the type of dimension is unknown.
82 IsMovable(me) returns Boolean from Standard is virtual;
83 ---Purpose: Returns true if the interactive object is movable.
85 FirstShape(me) returns Shape from TopoDS
87 ---C++: return const &
90 SetFirstShape(me: mutable;aFShape : Shape from TopoDS)
93 SecondShape(me) returns Shape from TopoDS
95 ---Purpose: Returns the second shape.
97 ---C++: return const &
99 SetSecondShape(me: mutable;aSShape : Shape from TopoDS)
101 --- Purpose: Allows you to identify the second shape aSShape
102 -- relative to the first.
104 SetBndBox( me: mutable; Xmin, Ymin, Zmin, Xmax, Ymax, Zmax : Real from Standard );
107 UnsetBndBox( me: mutable );
110 Plane(me) returns any Plane from Geom
112 ---Purpose: Returns the plane.
114 ---C++: return const &
116 SetPlane(me: mutable;aPlane : Plane from Geom)
119 -- Allows you to set the plane aPlane. This is used to
120 -- define relations and dimensions in several daughter classes.
123 Value(me) returns Real from Standard
125 ---Purpose: Returns the value of each object in the relation.
128 SetValue(me: mutable;aVal : Real from Standard)
130 ---Purpose: Allows you to provide settings for the value aVal for
131 -- each object in the relation.
134 Position(me) returns Pnt from gp
136 ---Purpose: Returns the position set using SetPosition.
138 ---C++: return const &
140 SetPosition(me: mutable;aPosition: Pnt from gp)
143 -- Allows you to provide the objects in the relation with
144 -- settings for a non-default position.
147 Text(me) returns ExtendedString from TCollection
149 ---Purpose: Returns settings for text aspect.
151 ---C++: return const &
153 SetText(me: mutable;aText:ExtendedString from TCollection)
155 ---Purpose: Allows you to provide the settings aText for text aspect.
158 ArrowSize (me) returns Real from Standard
161 -- Returns the value for the size of the arrow identifying
162 -- the relation between the two shapes.
165 SetArrowSize(me: mutable;anArrowSize: Real from Standard)
169 -- Allows you to provide settings for the size of the
170 -- arrow anArrowsize identifying the relation between the two shapes.
172 SymbolPrs (me) returns ArrowSide from DsgPrs
176 -- Returns the value of the symbol presentation. This will be one of:
178 -- - AS_FIRSTAR - first arrow
179 -- - AS_LASTAR - last arrow
180 -- - AS_BOTHAR - both arrows
181 -- - AS_FIRSTPT - first point
182 -- - AS_LASTPT - last point
183 -- - AS_BOTHPT - both points
184 -- - AS_FIRSTAR_LASTPT - first arrow, last point
185 -- - AS_FIRSTPT_LASTAR - first point, last arrow
187 SetSymbolPrs(me: mutable;aSymbolPrs: ArrowSide from DsgPrs)
191 -- Allows you to provide settings for the symbol presentation.
193 SetExtShape(me:mutable; aIndex : Integer from Standard);
196 -- Allows you to set the status of the extension shape by
198 -- The status will be one of the following:
199 -- - 0 - there is no connection to a shape;
200 -- - 1 - there is a connection to the first shape;
201 -- - 2 - there is a connection to the second shape.
204 returns Integer from Standard;
206 -- Returns the status index of the extension shape.
209 AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined virtual;
211 -- Returns true if the display mode aMode is accepted
212 -- for the Interactive Objects in the relation.
213 -- ComputeProjPresentation(me;
214 -- aPres : mutable Presentation from Prs3d;
215 -- Curve1 : Curve from Geom;
216 -- Curve2 : Curve from Geom;
217 -- FirstP1 : Pnt from gp;
218 -- LastP1 : Pnt from gp;
219 -- FirstP2 : Pnt from gp;
220 -- LastP2 : Pnt from gp;
221 -- aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
222 -- aWidth : Real from Standard = 2;
223 -- aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH;
224 -- aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
227 ComputeProjEdgePresentation(me;
228 aPres : mutable Presentation from Prs3d;
229 anEdge : Edge from TopoDS;
230 ProjCurve: Curve from Geom;
231 FirstP : Pnt from gp;
233 aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
234 aWidth : Real from Standard = 2;
235 aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH;
236 aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
238 ---Purpose: Calculates the presentation aPres of the the edge
239 -- anEdge and the curve it defines, ProjCurve. The later
240 -- is also specified by the first point FirstP and the last point LastP.
241 -- The presentation includes settings for color aColor,
242 -- type - aProjTOL and aCallTOL - and width of line, aWidth.
244 ComputeProjVertexPresentation(me;
245 aPres : mutable Presentation from Prs3d;
246 aVertex : Vertex from TopoDS;
247 ProjPoint: Pnt from gp;
248 aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
249 aWidth : Real from Standard = 2;
250 aProjTOM : TypeOfMarker from Aspect = Aspect_TOM_PLUS;
251 aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
254 ---Purpose: Calculates the presentation aPres of the the vertex
255 -- aVertex and the point it defines, ProjPoint.
256 -- The presentation includes settings for color aColor,
257 -- type - aProjTOM and aCallTOL - and width of line, aWidth.
259 SetAutomaticPosition ( me : mutable ; aStatus : Boolean from Standard );
262 AutomaticPosition ( me )
263 returns Boolean from Standard ;
268 myFShape : Shape from TopoDS is protected;
269 mySShape : Shape from TopoDS is protected;
270 myPlane : Plane from Geom is protected;
271 myVal : Real from Standard is protected;
272 myPosition : Pnt from gp is protected;
273 myText : ExtendedString from TCollection is protected;
274 myArrowSize: Real from Standard is protected;
275 myAutomaticPosition : Boolean from Standard is protected;
276 mySymbolPrs: ArrowSide from DsgPrs is protected;
277 myExtShape : Integer from Standard is protected;
278 ---purpose: (0 no attachment,1 attachment with first shape, 2 attachment with second shape)
280 myFirstPlane : Pln from gp is protected;
281 mySecondPlane : Pln from gp is protected;
282 myFirstBasisSurf : Surface from Geom is protected;
283 mySecondBasisSurf : Surface from Geom is protected;
285 myFirstSurfType : KindOfSurface from AIS is protected;
286 mySecondSurfType : KindOfSurface from AIS is protected;
288 myFirstOffset : Real from Standard is protected;
289 mySecondOffset : Real from Standard is protected;
291 myBndBox : Box from Bnd is protected;
292 myIsSetBndBox : Boolean from Standard is protected;
293 myArrowSizeIsDefined: Boolean from Standard is protected;