1 -- Created on: 1995-01-25
2 -- Created by: Jean-Louis Frenkel
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class PresentationManager from PrsMgr
18 inherits TShared from MMgt
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.
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,
35 ShadingAspect from Prs3d,
36 Presentation from Prs3d
40 NoSuchObject from Standard
44 Create (theStructureManager : StructureManager from Graphic3d)
45 returns mutable PresentationManager from PrsMgr;
47 -- Creates a framework to manage displays and graphic entities with the 3D view theStructureManager.
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.
57 thePrsObject : PresentableObject from PrsMgr;
58 theMode : Integer from Standard = 0)
60 ---Purpose: erases the presentation of the object in the given
61 -- Presentation manager with the given mode.
65 thePrsObject : PresentableObject from PrsMgr;
66 theMode : Integer from Standard = 0)
69 -- Clears the presentation of the presentable object thePrsObject in this framework with the display mode theMode.
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.
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.
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.
91 SetDisplayPriority (me;
92 thePrsObject : PresentableObject from PrsMgr;
93 theMode : Integer from Standard;
94 theNewPrior : Integer from Standard);
96 -- Sets the display priority theNewPrior of the
97 -- presentable object thePrsObject in this framework with the display mode theMode.
100 thePrsObject : PresentableObject from PrsMgr;
101 theMode : Integer from Standard)
102 returns Integer from Standard;
104 -- Returns the display priority of the presentable object
105 -- thePrsObject in this framework with the display mode theMode.
107 SetZLayer (me : mutable;
108 thePrsObject : PresentableObject from PrsMgr;
109 theLayerId : Integer from Standard)
111 ---Purpose: Set Z layer ID for all presentations of the object.
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.
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
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
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.
143 ---Category: Immediate display methods.
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.
149 ClearImmediateDraw (me : mutable);
150 ---Purpose: Resets the transient list of presentations previously displayed in immediate mode.
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.
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.
161 IsImmediateModeOn (me) returns Boolean from Standard;
163 ---Purpose: Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
165 ---Category: Hilighting methods.
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.
176 BoundBox (me : mutable;
177 thePrsObject : mutable PresentableObject from PrsMgr;
178 theMode : Integer from Standard = 0)
179 ---Purpose: highlights the boundbox of the presentation
182 ---Category: references to other presentation.
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)
191 ---Category: Transformation methods.
193 Transform (me : mutable;
194 thePrsObject : PresentableObject from PrsMgr;
195 theTransformation : Transformation from Geom;
196 theMode : Integer from Standard = 0)
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.
203 thePrsObject : PresentableObject from PrsMgr;
204 X, Y, Z : Length from Quantity;
205 theMode : Integer from Standard = 0)
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.
214 Multiply (me : mutable;
215 thePrsObject : PresentableObject from PrsMgr;
216 theTransformation : Transformation from Geom;
217 theMode : Integer from Standard = 0)
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.
224 thePrsObject : PresentableObject from PrsMgr;
225 X, Y, Z : Length from Quantity;
226 theMode : Integer from Standard = 0)
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.
232 StructureManager (me) returns mutable StructureManager from Graphic3d
235 ---C++: return const&
236 ---Purpose: Returns the structure manager.
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.
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.
253 ---Category: Private & deferred methods.
256 thePrsObject : PresentableObject from PrsMgr;
257 theMode : Integer from Standard = 0)
258 returns Boolean from Standard
260 ---Purpose: Returns true if there is a presentation of the
261 -- presentable object thePrsObject in this framework, thePrsObject having the display mode theMode.
264 thePrsObject : PresentableObject from PrsMgr;
265 theMode : Integer from Standard = 0)
266 returns mutable Presentation from PrsMgr
267 raises NoSuchObject from Standard
269 ---Purpose: Returns the presentation Presentation of the presentable object thePrsObject in this framework. thePrsObject has the display mode theMode.
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.
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.
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;
291 end PresentationManager from PrsMgr;