0023710: Simplification of presentation managment classes
[occt.git] / src / PrsMgr / PrsMgr_PresentationManager.cdl
CommitLineData
b311480e 1-- Created on: 1995-01-25
2-- Created by: Jean-Louis Frenkel
3-- Copyright (c) 1995-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
d5f74e42 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
973c2be1 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.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
7fd59977 16
679ecdee 17class PresentationManager from PrsMgr
7fd59977 18inherits TShared from MMgt
19
679ecdee 20 ---Purpose: A framework to manage 3D displays, graphic entities and their updates.
21 -- Used in the AIS package (Application Interactive Services), to enable the advanced user to define the
22 -- default display mode of a new interactive object which extends the list of signatures and types.
23 -- Definition of new display types is handled by calling the presentation algorithms provided by the StdPrs package.
7fd59977 24
25uses
679ecdee 26
27 StructureManager from Graphic3d,
28 PresentableObject from PrsMgr,
29 ListOfPresentations from PrsMgr,
30 Length,NameOfColor from Quantity,
31 Transformation from Geom,
32 NameOfMaterial from Graphic3d,
33 Presentation from PrsMgr,
679ecdee 34 View from V3d,
35 ShadingAspect from Prs3d,
36 Presentation from Prs3d
37
38raises
39
40 NoSuchObject from Standard
41
7fd59977 42is
43
679ecdee 44 Create (theStructureManager : StructureManager from Graphic3d)
45 returns mutable PresentationManager from PrsMgr;
46 ---Purpose:
47 -- Creates a framework to manage displays and graphic entities with the 3D view theStructureManager.
48
49 Display (me : mutable;
50 thePrsObject : mutable PresentableObject from PrsMgr;
51 theMode : Integer from Standard = 0)
52 ---Purpose: Displays the presentation of the object in the given Presentation manager with the given mode.
53 -- The mode should be enumerated by the object which inherits PresentableObject.
54 is static;
55
56 Erase (me : mutable;
57 thePrsObject : PresentableObject from PrsMgr;
58 theMode : Integer from Standard = 0)
59 ---Level: public
60 ---Purpose: erases the presentation of the object in the given
61 -- Presentation manager with the given mode.
62 is static;
63
64 Clear (me : mutable;
65 thePrsObject : PresentableObject from PrsMgr;
66 theMode : Integer from Standard = 0)
67 is virtual;
68 ---Purpose:
69 -- Clears the presentation of the presentable object thePrsObject in this framework with the display mode theMode.
70
71 SetVisibility (me : mutable;
72 thePrsObject : PresentableObject from PrsMgr;
73 theMode : Integer from Standard;
74 theValue : Boolean from Standard);
75 ---Purpose: Sets the visibility of presentable object.
76
77 Highlight (me : mutable;
78 thePrsObject : mutable PresentableObject from PrsMgr;
79 theMode : Integer from Standard = 0)
80 ---Purpose: Highlights the presentation of the presentable object
81 -- thePrsObject in this framework with the display mode theMode.
82 is static;
83
84 Unhighlight (me : mutable;
85 thePrsObject : PresentableObject from PrsMgr;
86 theMode : Integer from Standard = 0)
87 ---Purpose: Removes highlighting from the presentation of the
88 -- presentable object thePrsObject in this framework with the display mode theMode.
89 is static;
90
91 SetDisplayPriority (me;
92 thePrsObject : PresentableObject from PrsMgr;
93 theMode : Integer from Standard;
94 theNewPrior : Integer from Standard);
95 ---Purpose:
96 -- Sets the display priority theNewPrior of the
97 -- presentable object thePrsObject in this framework with the display mode theMode.
98
99 DisplayPriority (me;
100 thePrsObject : PresentableObject from PrsMgr;
101 theMode : Integer from Standard)
102 returns Integer from Standard;
103 ---Purpose:
104 -- Returns the display priority of the presentable object
105 -- thePrsObject in this framework with the display mode theMode.
106
107 SetZLayer (me : mutable;
108 thePrsObject : PresentableObject from PrsMgr;
109 theLayerId : Integer from Standard)
110 is static;
111 ---Purpose: Set Z layer ID for all presentations of the object.
112
113 GetZLayer (me;
114 thePrsObject : PresentableObject from PrsMgr)
115 returns Integer from Standard is static;
116 ---Purpose: Get Z layer ID assigned to all presentations of the object.
117 -- Method returns -1 value if object has no presentations and is
118 -- impossible to get layer index.
119
120 IsDisplayed (me;
121 thePrsObject : PresentableObject from PrsMgr;
122 theMode: Integer from Standard = 0)
123 --Purpose: Returns true if the presentation of the presentable
124 -- object thePrsObject in this framework with the display mode theMode is displayed.
125 returns Boolean from Standard
126 is static;
127
128 IsHighlighted (me;
129 thePrsObject : PresentableObject from PrsMgr;
130 theMode: Integer from Standard = 0)
131 ---Purpose: Returns true if the presentation of the presentable
132 -- object thePrsObject in this framework with the display mode theMode is highlighted.
133 returns Boolean from Standard
134 is static;
135
136 Update (me;
137 thePrsObject : PresentableObject from PrsMgr;
138 theMode : Integer from Standard = 0)
139 ---Purpose: Updates the presentation of the presentable object
140 -- thePrsObject in this framework with the display mode theMode.
141 is static;
142
143---Category: Immediate display methods.
144
145 BeginImmediateDraw (me : mutable);
146 ---Purpose: Resets the transient list of presentations previously displayed in immediate mode
147 -- and begins accumulation of new list by following AddToImmediateList()/Color()/Highlight() calls.
148
149 ClearImmediateDraw (me : mutable);
150 ---Purpose: Resets the transient list of presentations previously displayed in immediate mode.
151
152 AddToImmediateList (me : mutable;
153 thePrs : Presentation from Prs3d);
154 ---Purpose: Stores thePrs in the transient list of presentations to be displayed in immediate mode.
155 -- Will be taken in account in EndImmediateDraw method.
156
157 EndImmediateDraw (me : mutable;
158 theView : View from V3d);
159 ---Purpose: Allows rapid drawing of the view theView by avoiding an update of the whole background.
160
161 IsImmediateModeOn (me) returns Boolean from Standard;
162 ---C++: inline
163 ---Purpose: Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
164
165---Category: Hilighting methods.
166
167 Color (me : mutable;
168 thePrsObject : mutable PresentableObject from PrsMgr;
169 theColor : NameOfColor from Quantity = Quantity_NOC_YELLOW;
170 theMode : Integer from Standard = 0)
171 ---Purpose: Highlights the graphic object thePrsObject in the color theColor.
172 -- thePrsObject has the display mode theMode;
173 -- this has the default value of 0, that is, the wireframe display mode.
174 is static;
175
176 BoundBox (me : mutable;
177 thePrsObject : mutable PresentableObject from PrsMgr;
178 theMode : Integer from Standard = 0)
179 ---Purpose: highlights the boundbox of the presentation
180 is static;
181
182---Category: references to other presentation.
183
184 Connect (me : mutable;
185 thePrsObject : PresentableObject from PrsMgr;
186 theOtherObject : mutable PresentableObject from PrsMgr;
187 theMode : Integer from Standard = 0;
188 theOtherMode : Integer from Standard = 0)
189 is static;
190
191---Category: Transformation methods.
192
193 Transform (me : mutable;
194 thePrsObject : PresentableObject from PrsMgr;
195 theTransformation : Transformation from Geom;
196 theMode : Integer from Standard = 0)
197 ---Purpose:
198 -- Sets the transformation theTransformation for the presentable object thePrsObject.
199 -- thePrsObject has the display mode theMode; this has the default value of 0, that is, the wireframe display mode.
200 is static;
201
202 Place (me : mutable;
203 thePrsObject : PresentableObject from PrsMgr;
204 X, Y, Z : Length from Quantity;
205 theMode : Integer from Standard = 0)
206 ---Purpose:
207 -- Sets a position to move the presentable object
208 -- aPresentableObject to. This position is defined by the
209 -- lengths along the x, y and z axes: X, Y and Z respectively.
210 -- aPresentableObject has the display mode aMode;
211 -- this has the default value of 0, that is, the wireframe display mode.
212 is static;
213
214 Multiply (me : mutable;
215 thePrsObject : PresentableObject from PrsMgr;
216 theTransformation : Transformation from Geom;
217 theMode : Integer from Standard = 0)
218 ---Purpose:
219 -- Defines the transformation theTransformation for the presentable object thePrsObject.
220 -- thePrsObject has the display mode aMode; this has the default value of 0, that is, the wireframe display mode.
221 is static;
222
223 Move (me : mutable;
224 thePrsObject : PresentableObject from PrsMgr;
225 X, Y, Z : Length from Quantity;
226 theMode : Integer from Standard = 0)
227 ---Purpose:
228 -- Sets a position to move the presentable object thePrsObject to. This position is defined by the lengths along the x, y and z axes: X, Y and Z respectively.
229 -- thePrsObject has the display mode aMode; this has the default value of 0, that is, the wireframe display mode.
230 is static;
231
232 StructureManager (me) returns mutable StructureManager from Graphic3d
233 is static;
234 ---C++: inline
235 ---C++: return const&
236 ---Purpose: Returns the structure manager.
237
238 SetShadingAspect (me : mutable;
239 thePrsObject : PresentableObject from PrsMgr;
240 theColor : NameOfColor from Quantity;
241 theMaterial : NameOfMaterial from Graphic3d;
242 theMode : Integer from Standard = 0)
243 ---Purpose: this method will change the color and the aspect of the presentations containing shaded structures.
244 is static;
245
246 SetShadingAspect (me : mutable;
247 thePrsObject : PresentableObject from PrsMgr;
248 theShadingAspect : ShadingAspect from Prs3d;
249 theMode : Integer from Standard = 0)
250 ---Purpose: this method will change the color and the aspect of the presentations containing shaded structures.
251 is static;
252
679ecdee 253---Category: Private & deferred methods.
254
255 HasPresentation (me;
256 thePrsObject : PresentableObject from PrsMgr;
257 theMode : Integer from Standard = 0)
258 returns Boolean from Standard
259 is static;
260 ---Purpose: Returns true if there is a presentation of the
261 -- presentable object thePrsObject in this framework, thePrsObject having the display mode theMode.
262
263 Presentation (me;
264 thePrsObject : PresentableObject from PrsMgr;
265 theMode : Integer from Standard = 0)
266 returns mutable Presentation from PrsMgr
267 raises NoSuchObject from Standard
268 is static;
269 ---Purpose: Returns the presentation Presentation of the presentable object thePrsObject in this framework. thePrsObject has the display mode theMode.
270
271 AddPresentation (me : mutable;
272 thePrsObject : PresentableObject from PrsMgr;
273 theMode : Integer from Standard = 0)
274 ---Purpose: Adds a presentation of the presentable object thePrsObject to this framework.
275 -- thePrsObject has the display mode theMode.
276 is protected;
277
278 RemovePresentation (me : mutable;
279 thePrsObject : PresentableObject from PrsMgr;
280 theMode : Integer from Standard = 0)
281 ---Purpose: Removes a presentation of the presentable object thePrsObject to this framework. thePrsObject has the display mode theMode.
282 is protected;
7fd59977 283
284fields
679ecdee 285
286 myStructureManager : StructureManager from Graphic3d is protected;
287 myImmediateModeOn : Integer from Standard is protected;
288 myImmediateList : ListOfPresentations from PrsMgr is protected;
289 myImmediateView : View from V3d is protected;
290
7fd59977 291end PresentationManager from PrsMgr;