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 |
17 | class PresentationManager from PrsMgr |
7fd59977 |
18 | inherits 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 | |
25 | uses |
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 | |
38 | raises |
39 | |
40 | NoSuchObject from Standard |
41 | |
7fd59977 |
42 | is |
43 | |
679ecdee |
44 | Create (theStructureManager : StructureManager from Graphic3d) |
6e33d3ce |
45 | returns PresentationManager from PrsMgr; |
679ecdee |
46 | ---Purpose: |
47 | -- Creates a framework to manage displays and graphic entities with the 3D view theStructureManager. |
48 | |
49 | Display (me : mutable; |
6e33d3ce |
50 | thePrsObject : PresentableObject from PrsMgr; |
679ecdee |
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; |
6e33d3ce |
78 | thePrsObject : PresentableObject from PrsMgr; |
679ecdee |
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; |
6e33d3ce |
168 | thePrsObject : PresentableObject from PrsMgr; |
679ecdee |
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; |
6e33d3ce |
177 | thePrsObject : PresentableObject from PrsMgr; |
679ecdee |
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; |
6e33d3ce |
186 | theOtherObject : PresentableObject from PrsMgr; |
679ecdee |
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 | |
6e33d3ce |
202 | StructureManager (me) returns StructureManager from Graphic3d |
679ecdee |
203 | is static; |
204 | ---C++: inline |
205 | ---C++: return const& |
206 | ---Purpose: Returns the structure manager. |
207 | |
208 | SetShadingAspect (me : mutable; |
209 | thePrsObject : PresentableObject from PrsMgr; |
210 | theColor : NameOfColor from Quantity; |
211 | theMaterial : NameOfMaterial from Graphic3d; |
212 | theMode : Integer from Standard = 0) |
213 | ---Purpose: this method will change the color and the aspect of the presentations containing shaded structures. |
214 | is static; |
215 | |
216 | SetShadingAspect (me : mutable; |
217 | thePrsObject : PresentableObject from PrsMgr; |
218 | theShadingAspect : ShadingAspect from Prs3d; |
219 | theMode : Integer from Standard = 0) |
220 | ---Purpose: this method will change the color and the aspect of the presentations containing shaded structures. |
221 | is static; |
222 | |
679ecdee |
223 | ---Category: Private & deferred methods. |
224 | |
225 | HasPresentation (me; |
226 | thePrsObject : PresentableObject from PrsMgr; |
227 | theMode : Integer from Standard = 0) |
228 | returns Boolean from Standard |
229 | is static; |
230 | ---Purpose: Returns true if there is a presentation of the |
231 | -- presentable object thePrsObject in this framework, thePrsObject having the display mode theMode. |
232 | |
233 | Presentation (me; |
234 | thePrsObject : PresentableObject from PrsMgr; |
235 | theMode : Integer from Standard = 0) |
6e33d3ce |
236 | returns Presentation from PrsMgr |
679ecdee |
237 | raises NoSuchObject from Standard |
238 | is static; |
239 | ---Purpose: Returns the presentation Presentation of the presentable object thePrsObject in this framework. thePrsObject has the display mode theMode. |
240 | |
241 | AddPresentation (me : mutable; |
242 | thePrsObject : PresentableObject from PrsMgr; |
243 | theMode : Integer from Standard = 0) |
244 | ---Purpose: Adds a presentation of the presentable object thePrsObject to this framework. |
245 | -- thePrsObject has the display mode theMode. |
246 | is protected; |
247 | |
248 | RemovePresentation (me : mutable; |
249 | thePrsObject : PresentableObject from PrsMgr; |
250 | theMode : Integer from Standard = 0) |
251 | ---Purpose: Removes a presentation of the presentable object thePrsObject to this framework. thePrsObject has the display mode theMode. |
252 | is protected; |
7fd59977 |
253 | |
254 | fields |
679ecdee |
255 | |
256 | myStructureManager : StructureManager from Graphic3d is protected; |
257 | myImmediateModeOn : Integer from Standard is protected; |
258 | myImmediateList : ListOfPresentations from PrsMgr is protected; |
259 | myImmediateView : View from V3d is protected; |
260 | |
7fd59977 |
261 | end PresentationManager from PrsMgr; |