0024023: Revamp the OCCT Handle -- ambiguity
[occt.git] / src / AIS / AIS_Relation.cdl
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
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 deferred class Relation from AIS inherits InteractiveObject from AIS
18
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.
28
29 uses 
30      TypeOfPresentation3d  from PrsMgr,
31      Shape                 from TopoDS,
32      Edge                  from TopoDS,
33      Vertex                from TopoDS,
34      Pnt                   from gp,
35      ExtendedString        from TCollection,
36      Plane                 from Geom,
37      ArrowSide             from DsgPrs, 
38      KindOfDimension       from AIS,
39      Presentation          from Prs3d,
40      Curve                 from Geom,
41      NameOfColor           from Quantity,
42      Color                 from Quantity,
43      TypeOfLine            from Aspect,
44      TypeOfMarker          from Aspect,
45      KindOfInteractive     from AIS,
46      
47      Pln                   from gp,
48      Surface               from Geom,
49      KindOfSurface         from AIS,
50      Box                   from Bnd
51 is
52     Initialize(aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView) ;
53
54     SetColor(me :mutable; aColor : NameOfColor from Quantity)
55     is redefined static;
56         ---Purpose: Allows you to provide settings for the color aColor
57         -- of the lines representing the relation between the two shapes.
58         
59     SetColor(me :mutable; aColor : Color from Quantity)
60     is redefined static;
61
62     UnsetColor(me:mutable)
63     is redefined static;    
64         ---Purpose: Allows you to remove settings for the color of the
65         -- lines representing the relation between the two shapes.
66     
67     Type(me) returns KindOfInteractive from AIS is redefined;
68         ---C++: inline
69
70     KindOfDimension(me) returns KindOfDimension from AIS is virtual;
71         ---Purpose: Indicates that the type of dimension is unknown.
72     
73     IsMovable(me) returns Boolean from Standard is virtual;
74         ---Purpose: Returns true if the interactive object is movable.
75     
76     FirstShape(me) returns Shape from TopoDS 
77     is static;
78         ---C++: return const &    
79         ---C++: inline
80
81     SetFirstShape(me: mutable;aFShape : Shape from TopoDS)
82     is virtual;
83
84     SecondShape(me) returns Shape from TopoDS 
85     is static;
86         ---Purpose: Returns the second shape.
87         ---C++: inline
88         ---C++: return const &    
89     
90     SetSecondShape(me: mutable;aSShape : Shape from TopoDS)
91     is virtual;
92         --- Purpose: Allows you to identify the second shape aSShape
93         -- relative to the first.   
94     
95     SetBndBox( me: mutable;  Xmin, Ymin, Zmin, Xmax, Ymax, Zmax : Real from Standard );
96         ---C++: inline
97     
98     UnsetBndBox( me: mutable );
99         ---C++: inline
100
101     Plane(me) returns any Plane from Geom 
102     is static;
103         ---Purpose: Returns the plane.
104         ---C++: inline
105         ---C++: return const &    
106
107     SetPlane(me: mutable;aPlane : Plane from Geom)
108     is static;
109         ---Purpose:
110         -- Allows you to set the plane aPlane. This is used to
111         -- define relations and dimensions in several daughter classes.
112         ---C++: inline
113
114     Value(me) returns Real from Standard 
115     is static;
116         ---Purpose: Returns the value of each object in the relation.
117         ---C++: inline
118
119     SetValue(me: mutable;aVal : Real from Standard)
120     is static;
121         ---Purpose: Allows you to provide settings for the value aVal for
122         -- each object in the relation.
123         ---C++: inline
124
125     Position(me) returns Pnt from gp 
126     is static;
127         ---Purpose: Returns the position set using SetPosition.
128         ---C++: inline
129         ---C++: return const &  
130         
131     SetPosition(me: mutable;aPosition: Pnt from gp)
132     is static;
133         ---Purpose:
134         -- Allows you to provide the objects in the relation with
135         -- settings for a non-default position.
136         ---C++: inline
137     
138     Text(me) returns  ExtendedString from TCollection
139     is static;
140         ---Purpose: Returns settings for text aspect.
141         ---C++: inline
142         ---C++: return const &    
143
144     SetText(me: mutable;aText:ExtendedString from TCollection)
145     is static;
146         ---Purpose: Allows you to provide the settings aText for text aspect.
147         ---C++: inline
148         
149     ArrowSize (me) returns Real from Standard
150     is static;
151         ---Purpose:
152         -- Returns the value for the size of the arrow identifying
153         -- the relation between the two shapes.
154         ---C++: inline
155
156     SetArrowSize(me: mutable;anArrowSize: Real from Standard)
157     is static;
158         ---C++: inline
159         ---Purpose:
160         -- Allows you to provide settings for the size of the
161         -- arrow anArrowsize identifying the relation between the two shapes.
162
163     SymbolPrs (me) returns ArrowSide from DsgPrs
164     is static;
165         ---C++: inline
166         ---Purpose:
167         -- Returns the value of the symbol presentation. This will be one of:
168         -- -   AS_NONE - none
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
177
178     SetSymbolPrs(me: mutable;aSymbolPrs: ArrowSide from DsgPrs)
179     is static;
180         ---C++: inline
181         ---Purpose:
182         -- Allows you to provide settings for the symbol presentation.
183
184     SetExtShape(me:mutable; aIndex : Integer from Standard);
185         ---C++: inline
186         ---Purpose:
187         -- Allows you to set the status of the extension shape by
188         -- the index aIndex.
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.
193         
194     ExtShape(me)
195     returns Integer from Standard;
196         ---Purpose:
197         -- Returns the status index of the extension shape.
198         ---C++: inline
199
200     AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from  Standard is redefined virtual;
201         ---Purpose:
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)
216     --is protected;
217     
218     ComputeProjEdgePresentation(me;
219                                 aPres    : Presentation from Prs3d; 
220                                 anEdge   : Edge                 from TopoDS;
221                                 ProjCurve: Curve                from Geom;
222                                 FirstP   : Pnt                  from gp;
223                                 LastP    : 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)
228     is protected;
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.
234         
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)
243     is protected;
244     
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.
249         
250     SetAutomaticPosition ( me : mutable ; aStatus : Boolean from Standard );
251         ---C++: inline
252     
253     AutomaticPosition ( me ) 
254     returns Boolean from Standard  ;
255         ---C++: inline
256     
257 fields
258
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)
270     
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;
275     
276     myFirstSurfType  : KindOfSurface from AIS    is protected;
277     mySecondSurfType : KindOfSurface from AIS    is protected;
278     
279     myFirstOffset  : Real from Standard    is protected;
280     mySecondOffset : Real from Standard    is protected; 
281      
282     myBndBox      : Box     from Bnd    is protected; 
283     myIsSetBndBox : Boolean from Standard    is protected;
284     myArrowSizeIsDefined: Boolean      from Standard    is protected; 
285     
286 end Relation;