Integration of OCCT 6.5.0 from SVN
[occt.git] / src / AIS / AIS_Relation.cdl
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
10
11 deferred class Relation from AIS inherits InteractiveObject from AIS
12
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.
22
23 uses 
24      TypeOfPresentation3d  from PrsMgr,
25      Shape                 from TopoDS,
26      Edge                  from TopoDS,
27      Vertex                from TopoDS,
28      Pnt                   from gp,
29      ExtendedString        from TCollection,
30      Plane                 from Geom,
31      ArrowSide             from DsgPrs, 
32      KindOfDimension       from AIS,
33      Presentation          from Prs3d,
34      Curve                 from Geom,
35      NameOfColor           from Quantity,
36      Color                         from Quantity,
37      TypeOfLine            from Aspect,
38      TypeOfMarker          from Aspect,
39      KindOfInteractive     from AIS,
40      
41      Pln                   from gp,
42      Surface               from Geom,
43      KindOfSurface         from AIS,
44      Box                   from Bnd
45 is
46     Initialize(aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView) ;
47
48     SetColor(me :mutable; aColor : NameOfColor from Quantity)
49     is redefined static;
50         ---Purpose: Allows you to provide settings for the color aColor
51         -- of the lines representing the relation between the two shapes.
52         
53     SetColor(me :mutable; aColor : Color from Quantity)
54     is redefined static;
55
56     UnsetColor(me:mutable)
57     is redefined static;    
58         ---Purpose: Allows you to remove settings for the color of the
59         -- lines representing the relation between the two shapes.
60     
61     Type(me) returns KindOfInteractive from AIS is redefined;
62         ---C++: inline
63
64     KindOfDimension(me) returns KindOfDimension from AIS is virtual;
65         ---Purpose: Indicates that the type of dimension is unknown.
66     
67     IsMovable(me) returns Boolean from Standard is virtual;
68         ---Purpose: Returns true if the interactive object is movable.
69     
70     FirstShape(me) returns Shape from TopoDS 
71     is static;
72         ---C++: return const &    
73         ---C++: inline
74
75     SetFirstShape(me: mutable;aFShape : Shape from TopoDS)
76     is virtual;
77
78     SecondShape(me) returns Shape from TopoDS 
79     is static;
80         ---Purpose: Returns the second shape.
81         ---C++: inline
82         ---C++: return const &    
83     
84     SetSecondShape(me: mutable;aSShape : Shape from TopoDS)
85     is virtual;
86         --- Purpose: Allows you to identify the second shape aSShape
87         -- relative to the first.   
88     
89     SetBndBox( me: mutable;  Xmin, Ymin, Zmin, Xmax, Ymax, Zmax : Real from Standard );
90         ---C++: inline
91     
92     UnsetBndBox( me: mutable );
93         ---C++: inline
94
95     Plane(me) returns any Plane from Geom 
96     is static;
97         ---Purpose: Returns the plane.
98         ---C++: inline
99         ---C++: return const &    
100
101     SetPlane(me: mutable;aPlane : Plane from Geom)
102     is static;
103         ---Purpose:
104         -- Allows you to set the plane aPlane. This is used to
105         -- define relations and dimensions in several daughter classes.
106         ---C++: inline
107
108     Value(me) returns Real from Standard 
109     is static;
110         ---Purpose: Returns the value of each object in the relation.
111         ---C++: inline
112
113     SetValue(me: mutable;aVal : Real from Standard)
114     is static;
115         ---Purpose: Allows you to provide settings for the value aVal for
116         -- each object in the relation.
117         ---C++: inline
118
119     Position(me) returns Pnt from gp 
120     is static;
121         ---Purpose: Returns the position set using SetPosition.
122         ---C++: inline
123         ---C++: return const &  
124         
125     SetPosition(me: mutable;aPosition: Pnt from gp)
126     is static;
127         ---Purpose:
128         -- Allows you to provide the objects in the relation with
129         -- settings for a non-default position.
130         ---C++: inline
131     
132     Text(me) returns  ExtendedString from TCollection
133     is static;
134         ---Purpose: Returns settings for text aspect.
135         ---C++: inline
136         ---C++: return const &    
137
138     SetText(me: mutable;aText:ExtendedString from TCollection)
139     is static;
140         ---Purpose: Allows you to provide the settings aText for text aspect.
141         ---C++: inline
142         
143     ArrowSize (me) returns Real from Standard
144     is static;
145         ---Purpose:
146         -- Returns the value for the size of the arrow identifying
147         -- the relation between the two shapes.
148         ---C++: inline
149
150     SetArrowSize(me: mutable;anArrowSize: Real from Standard)
151     is static;
152         ---C++: inline
153         ---Purpose:
154         -- Allows you to provide settings for the size of the
155         -- arrow anArrowsize identifying the relation between the two shapes.
156
157     SymbolPrs (me) returns ArrowSide from DsgPrs
158     is static;
159         ---C++: inline
160         ---Purpose:
161         -- Returns the value of the symbol presentation. This will be one of:
162         -- -   AS_NONE - none
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
171
172     SetSymbolPrs(me: mutable;aSymbolPrs: ArrowSide from DsgPrs)
173     is static;
174         ---C++: inline
175         ---Purpose:
176         -- Allows you to provide settings for the symbol presentation.
177
178     SetExtShape(me:mutable; aIndex : Integer from Standard);
179         ---C++: inline
180         ---Purpose:
181         -- Allows you to set the status of the extension shape by
182         -- the index aIndex.
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.
187         
188     ExtShape(me)
189     returns Integer from Standard;
190         ---Purpose:
191         -- Returns the status index of the extension shape.
192         ---C++: inline
193
194     AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from  Standard is redefined virtual;
195         ---Purpose:
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)
210     --is protected;
211     
212     ComputeProjEdgePresentation(me;
213                                 aPres    : mutable Presentation from Prs3d; 
214                                 anEdge   : Edge                 from TopoDS;
215                                 ProjCurve: Curve                from Geom;
216                                 FirstP   : Pnt                  from gp;
217                                 LastP    : 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)
222     is protected;
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.
228         
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)
237     is protected;
238     
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.
243         
244     SetAutomaticPosition ( me : mutable ; aStatus : Boolean from Standard );
245         ---C++: inline
246     
247     AutomaticPosition ( me ) 
248     returns Boolean from Standard  ;
249         ---C++: inline
250     
251 fields
252
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)
264     
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;
269     
270     myFirstSurfType  : KindOfSurface from AIS    is protected;
271     mySecondSurfType : KindOfSurface from AIS    is protected;
272     
273     myFirstOffset  : Real from Standard    is protected;
274     mySecondOffset : Real from Standard    is protected; 
275      
276     myBndBox      : Box     from Bnd    is protected; 
277     myIsSetBndBox : Boolean from Standard    is protected;
278     myArrowSizeIsDefined: Boolean      from Standard    is protected; 
279     
280 end Relation;