0022627: Change OCCT memory management defaults
[occt.git] / src / AIS / AIS_Shape.cdl
1 -- File:        AIS_Shape.cdl
2 -- Created:     Fri Dec 20 15:18:05 1996
3 -- Author:      Robert COUBLANC
4 --   GG  :  GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
5 --                                     the restricted NameOfColor.
6 --           Redefines the Color(),Material(),Transparency() methods 
7 --           for taking in acount the current facing model.
8 --   GG :   BUC60536 The compute methods must be defined "protected" 
9 --      and no more "private"
10
11 ---Copyright:    Matra Datavision 1996
12
13
14 class Shape from AIS inherits InteractiveObject from AIS
15
16         ---Purpose: A framework to manage presentation and selection of shapes.
17         -- AIS_Shape is the interactive object which is used the
18         -- most by   applications. There are standard functions
19         -- available which allow you to prepare selection
20         -- operations on the constituent elements of shapes -
21         -- vertices, edges, faces etc - in an open local context.
22         -- The selection modes specific to "Shape" type objects
23         -- are referred to as Standard Activation Mode. These
24         -- modes are only taken into account in open local
25         -- context and only act on Interactive Objects which
26         -- have redefined the virtual method
27         -- AcceptShapeDecomposition so that it returns true.
28         -- Several advanced functions are also available. These
29         -- include functions to manage deviation angle and
30         -- deviation coefficient - both HLR and non-HLR - of
31         -- an inheriting shape class. These services allow you to
32         -- select one type of shape interactive object for higher
33         -- precision drawing. When you do this, the
34         -- AIS_Drawer::IsOwn... functions corresponding to the
35         -- above deviation angle and coefficient functions return
36         -- true indicating that there is a local setting available
37         -- for the specific object.
38         
39 uses
40     NameOfColor           from Quantity,
41     Color                         from Quantity,
42     Box                   from Bnd,
43     ShapeEnum             from TopAbs,
44     Shape                 from TopoDS,
45     GraphicObject         from Graphic2d,
46     NameOfMaterial        from Graphic3d ,
47     ---NameOfPhysicalMaterial  from Graphic3d ,
48     MaterialAspect        from Graphic3d, 
49     Presentation          from Prs3d,
50     Projector             from Prs3d,
51     PresentationManager2d from PrsMgr,
52     PresentationManager3d from PrsMgr,
53     Selection             from SelectMgr,
54     KindOfInteractive     from AIS,
55     Transformation        from Geom,
56     Drawer                from Prs3d
57  is
58
59     Create(shap: Shape from TopoDS) 
60     returns mutable Shape from AIS;
61         ---Purpose: Initializes construction of the shape shap from wires,
62         -- edges and vertices.
63         
64     Signature(me) returns Integer from Standard is redefined virtual ;
65         ---Purpose: Returns index 0. This value refers to SHAPE from TopAbs_ShapeEnum
66         
67     Type(me) returns KindOfInteractive from AIS is redefined virtual;
68         ---Purpose: Returns Object as the type of Interactive Object.
69
70     AcceptShapeDecomposition(me) returns Boolean from Standard is redefined virtual;
71         ---Purpose: Returns true if the Interactive Object accepts shape decomposition.
72     
73     Set(me:mutable;ashap : Shape from TopoDS) is static;
74         ---Purpose: Constructs an instance of the shape object ashape.
75         ---C++: inline
76
77     Shape(me)  returns Shape from TopoDS ;
78         ---Purpose: Returns this shape object.
79         ---C++: inline
80         ---C++: return const&
81
82     
83     --------------------------------------------------------------------- 
84     SetOwnDeviationCoefficient(me: mutable) returns Boolean from Standard ;
85         ---Purpose: Sets a local value for deviation coefficient for this specific shape.                                                                                  
86     SetOwnHLRDeviationCoefficient(me: mutable) returns Boolean from Standard ;
87         ---Purpose: Sets a local value for HLR deviation coefficient for this specific shape.                                                             
88     SetOwnDeviationAngle(me: mutable) returns Boolean from Standard ;
89         ---Purpose: Sets a local value for deviation angle for this specific shape.
90         
91     SetOwnHLRDeviationAngle(me: mutable) returns Boolean from Standard ;
92         ---Purpose: Sets a local value for HLR deviation angle for this specific shape.
93     
94
95     SetOwnDeviationCoefficient(me: mutable; aCoefficient: Real from Standard) ;  
96         ---Purpose: Sets a local value for deviation coefficient for this specific shape.
97
98     SetOwnHLRDeviationCoefficient(me: mutable; aCoefficient : Real from Standard) ;  
99         ---Purpose: sets myOwnHLRDeviationCoefficient field in AIS_Drawer &
100         --          recomputes presentation 
101         
102     SetAngleAndDeviation(me:     mutable; anAngle: Real from Standard) ;  
103         ---Purpose: this compute a new angle and Deviation from the value anAngle               
104         --   and set the values stored in myDrawer with these that become local to the shape
105
106     UserAngle(me) returns Real from Standard;
107         ---Purpose: gives back the angle initial value put by the User.
108     
109     SetOwnDeviationAngle(me: mutable; anAngle: Real from Standard) ;  
110         ---Purpose: sets myOwnDeviationAngle field in AIS_Drawer & recomputes presentation
111     
112     
113     SetHLRAngleAndDeviation(me:     mutable; anAngle: Real from Standard) ;  
114         ---Purpose: this compute a new Angle and Deviation from the value anAngle for HLR               
115         --   and set the values stored in myDrawer for with these that become local to the shape
116
117     SetOwnHLRDeviationAngle(me: mutable; anAngle: Real from Standard) ;  
118         ---Purpose: sets myOwnHLRDeviationAngle field in AIS_Drawer & recomputes presentation
119     
120
121     OwnDeviationCoefficient(me; aCoefficient : out Real from Standard ;
122                                 aPreviousCoefficient : out Real from Standard ) returns Boolean from Standard;
123         ---Purpose:   Returns true and the values of the deviation
124         -- coefficient aCoefficient and the previous deviation
125         -- coefficient aPreviousCoefficient. If these values are
126         -- not already set, false is returned.
127     
128     OwnHLRDeviationCoefficient(me; aCoefficient : out Real from Standard;
129                                    aPreviousCoefficient : out Real from Standard ) returns Boolean from Standard;
130         ---Purpose:  Returns   true and the values of the HLR deviation
131         -- coefficient aCoefficient and the previous HLR
132         -- deviation coefficient aPreviousCoefficient. If these
133         -- values are not already set, false is returned.
134                    
135     OwnDeviationAngle(me; anAngle: out Real from Standard;
136                           aPreviousAngle : out Real from Standard ) returns Boolean from Standard;
137         ---Purpose: Returns true and the values of the deviation angle
138         -- anAngle and the previous deviation angle aPreviousAngle.
139         -- If these values are not already set, false is returned.
140     
141
142     OwnHLRDeviationAngle(me; anAngle : out Real from Standard ;
143                              aPreviousAngle : out Real from Standard ) returns Boolean from Standard;
144         ---Purpose: Returns true and the values   of the HLR deviation
145         -- angle anAngle and of the previous HLR deviation
146         -- angle aPreviousAngle. If these values are not
147         -- already set, false is returned.
148
149
150
151
152
153                     ---Category: Redefine Compute Methods...
154
155     Compute(me                   : mutable;
156             aPresentationManager : PresentationManager3d from PrsMgr;
157             aPresentation        : mutable Presentation from Prs3d;
158             aMode                : Integer from Standard = 0) 
159     is redefined virtual protected;
160
161     Compute(me                   : mutable;
162             aPresentationManager : PresentationManager2d from PrsMgr;
163             aPresentation        : mutable GraphicObject from Graphic2d;aMode:Integer from Standard = 0) 
164     is redefined virtual protected;
165   
166     Compute(me                   : mutable;
167             aProjector           : Projector from Prs3d;
168             aPresentation        : mutable Presentation from Prs3d)
169     is redefined virtual protected;
170
171     Compute(me                   : mutable;
172             aProjector           : Projector from Prs3d;
173             aTrsf                : Transformation from Geom;
174             aPresentation        : mutable Presentation from Prs3d)
175     is redefined virtual protected;
176     
177
178
179     ComputeSelection(me          : mutable;
180                      aSelection  : mutable Selection from SelectMgr;
181                      aMode       : Integer from Standard)
182     is redefined virtual protected; 
183                                 
184
185             ---Category: The Attributes to be redefined
186
187     
188     SetColor(me:mutable;aColor:NameOfColor from Quantity) 
189     is redefined virtual;
190         ---Purpose: Sets the color aColor in the reconstructed
191         -- compound shape. Acts via the Drawer methods below on the appearance of:
192         -- -   free boundaries:
193         --   AIS_Drawer_FreeBoundaryAspect,
194         -- -   isos: AIS_Drawer_UIsoAspect,
195         --   AIS_Drawer_VIsoAspect,
196         -- -   shared boundaries:
197         --   AIS_Drawer_UnFreeBoundaryAspect,
198         -- -   shading: AIS_Drawer_ShadingAspect,
199         -- -   visible line color in hidden line mode:
200         --   AIS_Drawer_SeenLineAspect
201         -- -   hidden line color in hidden line mode:
202         --   AIS_Drawer_HiddenLineAspect.
203         
204     SetColor(me:mutable;aColor:Color from Quantity) 
205     is redefined virtual;
206
207     UnsetColor(me:mutable) is redefined virtual;
208         ---Purpose: Removes settings for color in the reconstructed compound shape.
209         
210     SetWidth(me:mutable; aValue:Real from Standard) is  redefined virtual;
211         ---Purpose: Sets the value aValue for line width in the reconstructed compound shape.
212     UnsetWidth(me:mutable) is redefined virtual;
213         ---Purpose: Removes the setting for line width in the reconstructed compound shape.
214
215    SetMaterial(me:mutable;aName:NameOfMaterial from Graphic3d) is redefined virtual;
216
217     SetMaterial(me:mutable;aName:MaterialAspect from Graphic3d) is redefined virtual;
218         ---Purpose: Allows you to provide settings for the material aName
219         -- in the reconstructed compound shape.
220         
221     UnsetMaterial(me:mutable) is redefined virtual;
222         --- Purpose: Removes settings for material in the reconstructed compound shape.
223         
224     SetTransparency(me:mutable;aValue : Real from Standard=0.6) is redefined virtual;  
225         ---Purpose: Sets the value aValue for transparency in the reconstructed compound shape.
226     
227     UnsetTransparency(me:mutable) is redefined virtual;
228         ---Purpose: Removes the setting for transparency in the reconstructed compound shape.
229  
230     BoundingBox(me:mutable) returns Box from Bnd is virtual;
231         ---Purpose: Constructs a bounding box with which to reconstruct
232         -- compound topological shapes for presentation.
233         ---C++: return const &
234
235     Color(me) returns NameOfColor from Quantity is redefined;
236         ---Purpose: Returns the NameOfColor attributes of the shape accordingly to
237         --  the current facing model;
238
239     Color(me; aColor: out Color from Quantity) is redefined;
240         ---Purpose: Returns the Color attributes of the shape accordingly to
241         --  the current facing model;
242
243     Material(me) returns NameOfMaterial from Graphic3d is redefined;
244         ---Purpose: Returns the NameOfMaterial attributes of the shape accordingly to
245         --  the current facing model;
246     
247     Transparency(me) returns Real from Standard is redefined;
248         ---Purpose: Returns the transparency attributes of the shape accordingly to
249         --  the current facing model;
250
251
252                     ---Category: 
253
254
255     SelectionType(myclass; aDecompositionMode : Integer from Standard) 
256     returns ShapeEnum from TopAbs;
257         ---Purpose: Activates the same TopAbs shape enumerations as
258         -- those used by SelectionMode assigning a type to the mode aDecompositionMode. 
259
260     SelectionMode(myclass; aShapeType : ShapeEnum from TopAbs) 
261     returns Integer from Standard;
262         ---Purpose: Establishes an equivalence between a mode and the
263         -- type, aShapeType,   of selection. The correspondences are as follows:
264         -- -   mode 0 - Shape
265         -- -   mode 1 - Vertex
266         -- -   mode 2 - Edge
267         -- -   mode 3 - Wire
268         -- -   mode 4 - Face
269         -- -   mode 5 - Shell
270         -- -   mode 6 - Solid
271         -- -   mode 7 - Compsolid
272         -- -   mode 8 - Compound
273
274    LoadRecomputable(me:mutable;TheMode : Integer from Standard) is static protected;
275
276     Compute(me                   : mutable;
277             aProjector           : Projector from Prs3d;
278             aPresentation        : mutable Presentation from Prs3d;
279             ashape               : Shape from TopoDS) is static private;
280
281     GetDeflection(myclass; aShape  : Shape from TopoDS;
282                            aDrawer : Drawer from Prs3d)
283                            returns Real from Standard;
284                 
285     DisplayBox(myclass; aPrs : Presentation from Prs3d;
286                         aBox : Box from Bnd;
287                         aDrawer : Drawer from Prs3d) is protected;
288                 
289     
290 fields
291     myshape            : Shape   from TopoDS   is protected;
292     myBB               : Box     from Bnd      is protected;
293     myCompBB           : Boolean from Standard is protected;
294     myInitAng          : Real    from Standard;
295 end Shape;