7fd59977 |
1 | -- |
2 | -- File: Graphic3d_StructureManager.cdl |
3 | -- Created: Jeudi 5 Septembre 1991 |
4 | -- Author: NW,JPB,CAL |
5 | -- 11/97 ; CAL : gestion du GraphicClear |
6 | -- 05/98 ; CAL : gestion du GraphicConnect et Disconnect |
7 | -- |
8 | ---Copyright: MatraDatavision 1991,1992,1993,1994 |
9 | -- |
10 | |
11 | deferred class StructureManager from Graphic3d inherits TShared |
12 | |
13 | ---Version: |
14 | |
15 | ---Purpose: This class allows the definition of a manager to |
16 | -- which the graphic objects are associated. |
17 | -- It allows them to be globally manipulated. |
18 | -- It defines the global attributes. |
19 | -- Keywords: Structure, Structure Manager, Update Mode, |
20 | -- Destroy, Highlight, Visible, Detectable |
21 | |
22 | ---Warning: |
23 | ---References: |
24 | |
25 | uses |
26 | |
27 | Array2OfReal from TColStd, |
59f45b7c |
28 | SequenceOfInteger from TColStd, |
7fd59977 |
29 | |
30 | GenId from Aspect, |
31 | GraphicDevice from Aspect, |
32 | TypeOfHighlightMethod from Aspect, |
33 | TypeOfUpdate from Aspect, |
34 | |
35 | DataStructureManager from Graphic3d, |
36 | AspectFillArea3d from Graphic3d, |
37 | AspectLine3d from Graphic3d, |
38 | AspectMarker3d from Graphic3d, |
39 | AspectText3d from Graphic3d, |
40 | Structure from Graphic3d, |
41 | MapOfStructure from Graphic3d, |
42 | SequenceOfStructure from Graphic3d |
43 | |
44 | raises |
45 | |
46 | InitialisationError from Graphic3d |
47 | |
48 | is |
49 | |
50 | Initialize ( aDevice : GraphicDevice from Aspect ) |
51 | ---Level: Public |
52 | ---Purpose: Initialise the constructor of the ViewManager. |
53 | -- Warning: Raises InitialisationError if the initialisation |
54 | -- of the ViewManager failed. |
55 | raises InitialisationError from Graphic3d; |
56 | -- if the initialisation of the ViewManager failed. |
57 | |
58 | Destroy ( me : mutable ) |
59 | is virtual; |
60 | ---Level: Public |
61 | ---Purpose: Deletes the manager <me>. |
62 | ---C++: alias ~ |
63 | |
64 | --------------------------------------------------- |
65 | -- Category: Methods to modify the class definition |
66 | --------------------------------------------------- |
67 | |
68 | SetPrimitivesAspect ( me : mutable; |
69 | CTX : AspectLine3d from Graphic3d ) |
70 | is static; |
71 | ---Level: Public |
72 | ---Purpose: Modifies the default attributes for lines |
73 | -- in the visualiser. |
74 | ---Category: Methods to modify the class definition |
75 | |
76 | SetPrimitivesAspect ( me : mutable; |
77 | CTX : AspectFillArea3d from Graphic3d) |
78 | is static; |
79 | ---Level: Public |
80 | ---Purpose: Modifies the default attributes for faces |
81 | -- in the visualiser. |
82 | ---Category: Methods to modify the class definition |
83 | |
84 | SetPrimitivesAspect ( me : mutable; |
85 | CTX : AspectText3d from Graphic3d ) |
86 | is static; |
87 | ---Level: Public |
88 | ---Purpose: Modifies the default attributes for text |
89 | -- in the visualiser. |
90 | ---Category: Methods to modify the class definition |
91 | |
92 | SetPrimitivesAspect ( me : mutable; |
93 | CTX : AspectMarker3d from Graphic3d) |
94 | is static; |
95 | ---Level: Public |
96 | ---Purpose: Modifies the default attributes for markers |
97 | -- in the visualiser. |
98 | ---Category: Methods to modify the class definition |
99 | |
100 | --------------------------------------------------- |
101 | -- Summary of Dynamic Operations and Update Mode -- |
102 | -- -- |
103 | -- Use SetUpdateMode to control when changes to -- |
104 | -- the display are made. -- |
105 | -- -- |
106 | -- Use one of the following functions to update -- |
107 | -- one or more views : -- |
108 | -- -- |
109 | -- Update all views of the viewer : -- |
110 | -- Visual3d_ViewManager::Update () -- |
111 | -- -- |
112 | -- Update one view of the viewer -- |
113 | -- Visual3d_View::Update () -- |
114 | -- -- |
115 | -- Use one of the following functions to update -- |
116 | -- the entire display : -- |
117 | -- -- |
118 | -- Redraw all structures in all views : -- |
119 | -- Visual3d_ViewManager::Redraw () -- |
120 | -- -- |
121 | -- Redraw all structures in one view : -- |
122 | -- Visual3d_View::Redraw () -- |
123 | --------------------------------------------------- |
124 | |
125 | SetUpdateMode ( me : mutable; |
126 | AType : TypeOfUpdate from Aspect ) |
127 | is static; |
128 | ---Level: Public |
129 | ---Purpose: Modifies the screen update mode. |
130 | -- |
131 | -- TOU_ASAP as soon as possible |
132 | -- TOU_WAIT on demand (with the Update function) |
133 | -- Note : Dynamic Operations and Update Mode |
134 | -- Use SetUpdateMode to control when changes to |
135 | -- the display are made. Use one of the following |
136 | -- functions to update one or more views: |
137 | -- - Update all views of the viewer: Visual3d_ViewManager::Update () |
138 | -- - Update one view of the viewer: Visual3d_View::Update () Use one of |
139 | -- the following functions to update the entire display: |
140 | -- - Redraw all structures in all views: Visual3d_ViewManager::Redraw () |
141 | -- - Redraw all structures in one view: Visual3d_View::Redraw () Update) |
142 | |
143 | Update ( me ) |
144 | is deferred; |
145 | ---Purpose: Updates screen in function of modifications of |
146 | -- the structures. |
147 | -- Warning: Not necessary if the update mode is TOU_ASAP. |
148 | |
149 | --------------------------------------------- |
150 | -- Category: Inquire methods, MapOfStructure |
151 | --------------------------------------------- |
152 | |
153 | DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d) |
154 | is static; |
155 | ---Level: Internal |
156 | ---Purpose: Returns the set of structures displayed in |
157 | -- visualiser <me>. |
158 | ---Category: Inquire methods, MapOfStructure |
159 | |
160 | NumberOfDisplayedStructures ( me ) |
161 | returns Integer from Standard |
162 | is static protected; |
163 | ---Level: Internal |
164 | ---Purpose: Returns the number of structures displayed in |
165 | -- visualiser <me>. |
166 | |
167 | --DisplayedStructure ( me; |
168 | -- AnIndex : Integer from Standard ) |
169 | --returns Structure from Graphic3d |
170 | --is static protected; |
171 | ---Level: Internal |
172 | ---Purpose: Returns the structure displayed in visualiser <me>. |
173 | |
174 | HighlightedStructures ( me; SG: in out MapOfStructure from Graphic3d ) |
175 | is static; |
176 | ---Level: Internal |
177 | ---Purpose: Returns the set of highlighted structures |
178 | -- in a visualiser <me>. |
179 | ---Category: Inquire methods, MapOfStructure |
180 | |
181 | PickStructures ( me; SG: in out MapOfStructure from Graphic3d ) |
182 | is static; |
183 | ---Level: Internal |
184 | ---Purpose: Returns the set of detectable structures |
185 | -- in a visualiser <me>. |
186 | ---Category: Inquire methods, MapOfStructure |
187 | |
188 | VisibleStructures ( me; SG: in out MapOfStructure from Graphic3d ) |
189 | is static; |
190 | ---Level: Internal |
191 | ---Purpose: Returns the set of visible structures |
192 | -- in a visualiser <me>. |
193 | ---Category: Inquire methods, MapOfStructure |
194 | |
195 | ---------------------------- |
196 | -- Category: Inquire methods |
197 | ---------------------------- |
198 | |
199 | FillArea3dAspect ( me ) |
200 | returns AspectFillArea3d from Graphic3d |
201 | is static; |
202 | ---Level: Public |
203 | ---Purpose: Returns the values of the current default attributes. |
204 | ---Category: Inquire methods |
205 | |
206 | Limit ( myclass ) |
207 | returns Integer from Standard; |
208 | ---Level: Internal |
209 | ---Purpose: Returns maximum number of managers defineable. |
210 | ---Category: Inquire methods |
211 | |
212 | Line3dAspect ( me ) |
213 | returns AspectLine3d from Graphic3d |
214 | is static; |
215 | ---Level: Public |
216 | ---Purpose: Returns the values of the current default attributes. |
217 | ---Category: Inquire methods |
218 | |
219 | Marker3dAspect ( me ) |
220 | returns AspectMarker3d from Graphic3d |
221 | is static; |
222 | ---Level: Public |
223 | ---Purpose: Returns the values of the current default attributes. |
224 | ---Category: Inquire methods |
225 | |
226 | MinMaxValues ( me; |
227 | XMin, YMin, ZMin : out Real from Standard; |
228 | XMax, YMax, ZMax : out Real from Standard ) |
229 | is static; |
230 | ---Level: Public |
231 | ---Purpose: Returns the coordinates of the boundary box of all |
232 | -- structures displayed in the manager <me>. |
233 | ---Category: Inquire methods |
234 | |
235 | PrimitivesAspect ( me; |
236 | CTXL : out AspectLine3d from Graphic3d; |
237 | CTXT : out AspectText3d from Graphic3d; |
238 | CTXM : out AspectMarker3d from Graphic3d; |
239 | CTXF : out AspectFillArea3d from Graphic3d ) |
240 | is static; |
241 | ---Level: Public |
242 | ---Purpose: Returns the values of the current default attributes. |
243 | ---Category: Inquire methods |
244 | |
245 | Text3dAspect ( me ) |
246 | returns AspectText3d from Graphic3d |
247 | is static; |
248 | ---Level: Public |
249 | ---Purpose: Returns the values of the current default attributes. |
250 | ---Category: Inquire methods |
251 | |
252 | UpdateMode ( me ) |
253 | returns TypeOfUpdate from Aspect |
254 | is static; |
255 | ---Level: Public |
256 | ---Purpose: Returns the screen update mode. |
257 | -- |
258 | -- TOU_ASAP as soon as possible |
259 | -- TOU_WAIT on demand (Update) |
260 | -- |
261 | ---Category: Inquire methods |
262 | |
263 | ---------------------------- |
264 | -- Category: Private methods |
265 | ---------------------------- |
266 | |
267 | ChangeDisplayPriority ( me : mutable; |
268 | AStructure : Structure from Graphic3d; |
269 | OldPriority : Integer from Standard; |
270 | NewPriority : Integer from Standard ) |
271 | is deferred; |
272 | ---Level: Internal |
273 | ---Purpose: Changes the display priority of the structure <AStructure>. |
274 | ---Category: Private methods |
275 | |
59f45b7c |
276 | ChangeZLayer ( me : mutable; |
277 | theStructure : Structure from Graphic3d; |
278 | theLayerId : Integer from Standard ) |
279 | is deferred; |
280 | ---Purpose: Change Z layer for structure. The z layer mechanism allows |
281 | -- to display structures in higher layers in overlay of structures in |
282 | -- lower layers. |
283 | |
284 | GetZLayer ( me; |
285 | theStructure : Structure from Graphic3d ) |
286 | returns Integer from Standard is deferred; |
287 | ---Purpose: Get Z layer ID assigned to structure. If the structure |
288 | -- has no layer ID (deleted from graphic driver), the method returns -1. |
289 | |
290 | AddZLayer ( me : mutable; |
291 | theLayerId : in out Integer from Standard ) |
292 | returns Boolean from Standard is deferred; |
293 | ---Purpose: Add a new top-level Z layer and get its ID as |
294 | -- <theLayerId> value. The method returns Standard_False if the layer |
295 | -- can not be created. The z layer mechanism allows to display |
296 | -- structures in higher layers in overlay of structures in lower layers. |
297 | |
298 | RemoveZLayer ( me : mutable; |
299 | theLayerId : Integer from Standard ) |
300 | returns Boolean from Standard is deferred; |
301 | ---Purpose: Remove Z layer with ID <theLayerId>. Method returns |
302 | -- Standard_False if the layer can not be removed or doesn't exists. |
303 | -- By default, there is always a default bottom-level layer that can't |
304 | -- be removed. |
305 | |
306 | GetAllZLayers ( me; |
307 | theLayerSeq : out SequenceOfInteger from TColStd ) |
308 | is deferred; |
309 | ---Purpose: Return all Z layer ids in sequence ordered by level |
310 | -- from lowest layer to highest. The first layer ID in sequence is |
311 | -- the default layer that can't be removed. |
312 | |
7fd59977 |
313 | CurrentId ( myclass ) |
314 | returns Integer from Standard; |
315 | ---Level: Internal |
316 | ---Purpose: Returns a current identifier available. |
317 | ---Category: Private methods |
318 | |
319 | ReCompute ( me : mutable; |
320 | AStructure : Structure from Graphic3d ) |
321 | is deferred; |
322 | ---Level: Advanced |
323 | ---Purpose: Forces a new construction of the structure <AStructure> |
324 | -- if <AStructure> is displayed and TOS_COMPUTED. |
325 | ---Category: Private methods |
326 | |
327 | ReCompute ( me : mutable; |
328 | AStructure : Structure from Graphic3d; |
329 | AProjector : DataStructureManager from Graphic3d ) |
330 | is deferred; |
331 | ---Level: Advanced |
332 | ---Purpose: Forces a new construction of the structure <AStructure> |
333 | -- if <AStructure> is displayed in <AProjector> and TOS_COMPUTED. |
334 | ---Category: Private methods |
335 | |
336 | Detectable ( me : mutable; |
337 | AStructure : Structure from Graphic3d ) |
338 | is static private; |
339 | ---Level: Internal |
340 | ---Purpose: Sets detectable the structure <AStructure>. |
341 | ---Category: Private methods |
342 | |
343 | Clear ( me : mutable; |
344 | AStructure : Structure from Graphic3d; |
345 | WithDestruction : Boolean from Standard ) |
346 | is deferred; |
347 | ---Level: Internal |
348 | ---Purpose: Clears the structure <AStructure>. |
349 | ---Category: Private methods |
350 | |
351 | Connect ( me : mutable; |
352 | AMother : Structure from Graphic3d; |
353 | ADaughter : Structure from Graphic3d ) |
354 | is deferred; |
355 | ---Level: Internal |
356 | ---Purpose: Connects the structures <AMother> and <ADaughter>. |
357 | ---Category: Private methods |
358 | |
359 | Disconnect ( me : mutable; |
360 | AMother : Structure from Graphic3d; |
361 | ADaughter : Structure from Graphic3d ) |
362 | is deferred; |
363 | ---Level: Internal |
364 | ---Purpose: Disconnects the structures <AMother> and <ADaughter>. |
365 | ---Category: Private methods |
366 | |
367 | Display ( me : mutable; |
368 | AStructure : Structure from Graphic3d ) |
369 | is deferred; |
370 | ---Level: Internal |
371 | ---Purpose: Display the structure <AStructure>. |
372 | ---Category: Private methods |
373 | |
374 | Erase ( me : mutable; |
375 | AStructure : Structure from Graphic3d ) |
376 | is deferred; |
377 | ---Level: Internal |
378 | ---Purpose: Erases the structure <AStructure>. |
379 | ---Category: Private methods |
380 | |
381 | Highlight ( me : mutable; |
382 | AStructure : Structure from Graphic3d; |
383 | AMethod : TypeOfHighlightMethod from Aspect ) |
384 | is deferred; |
385 | ---Level: Internal |
386 | ---Purpose: Highlights the structure <AStructure>. |
387 | ---Category: Private methods |
388 | |
389 | SetTransform ( me : mutable; |
390 | AStructure : Structure from Graphic3d; |
391 | ATrsf : Array2OfReal from TColStd ) |
392 | is deferred; |
393 | ---Level: Internal |
394 | ---Purpose: Transforms the structure <AStructure>. |
395 | ---Category: Private methods |
396 | |
397 | GraphicDevice ( me ) |
398 | returns GraphicDevice from Aspect; |
399 | ---Level: Internal |
400 | ---Purpose: Returns the graphic device of <me>. |
401 | ---Category: Private methods |
402 | |
403 | Invisible ( me : mutable; |
404 | AStructure : Structure from Graphic3d ) |
405 | is static private; |
406 | ---Level: Internal |
407 | ---Purpose: Sets invisible the structure <AStructure>. |
408 | ---Category: Private methods |
409 | |
410 | Identification ( me ) |
411 | returns Integer from Standard |
412 | is virtual; |
413 | ---Level: Internal |
414 | ---Purpose: Returns the identification number of the manager. |
415 | ---Category: Private methods |
416 | |
417 | Identification ( me; |
418 | AId : Integer from Standard ) |
419 | returns Structure from Graphic3d |
420 | is virtual; |
421 | ---Level: Internal |
422 | ---Purpose: Returns the structure with the identification number <AId>. |
423 | ---Warning: Returns a null structure if the identification number |
424 | -- is not a structure identifier. |
425 | ---Category: Private methods |
426 | |
427 | NewIdentification ( me : mutable ) |
428 | returns Integer from Standard |
429 | is static private; |
430 | ---Level: Internal |
431 | ---Purpose: Returns a new identification number for a new structure |
432 | -- in the manager. |
433 | ---Category: Private methods |
434 | |
435 | Remove ( me : mutable; |
436 | AnId : Integer from Standard ) |
437 | is static private; |
438 | ---Level: Internal |
439 | ---Purpose: Frees the identifieur <AnId>. |
440 | ---Category: Private methods |
441 | |
442 | Undetectable ( me : mutable; |
443 | AStructure : Structure from Graphic3d ) |
444 | is static private; |
445 | ---Level: Internal |
446 | ---Purpose: Sets no detectable the structure <AStructure>. |
447 | ---Category: Private methods |
448 | |
449 | UnHighlight ( me : mutable ) |
450 | is deferred; |
451 | ---Level: Internal |
452 | ---Purpose: Suppresses the highlighting on all the structures in <me>. |
453 | ---Category: Private methods |
454 | |
455 | UnHighlight ( me : mutable; |
456 | AStructure : Structure from Graphic3d ) |
457 | is deferred; |
458 | ---Level: Internal |
459 | ---Purpose: Suppress the highlighting on the structure <AStructure>. |
460 | ---Category: Private methods |
461 | |
462 | Visible ( me : mutable; |
463 | AStructure : Structure from Graphic3d ) |
464 | is static private; |
465 | ---Level: Internal |
466 | ---Purpose: Sets visible the structure <AStructure>. |
467 | -- in the manager. |
468 | ---Category: Private methods |
469 | --\f |
470 | |
471 | fields |
472 | |
473 | -- |
474 | -- Class : Graphic3d_StructureManager |
475 | -- |
476 | -- Purpose : Declaration of variables specific to managers |
477 | -- |
478 | -- Reminder : A manager manipulates a group of structures |
479 | |
480 | -- the identifier of the manager |
481 | MyId : Integer from Standard is protected; |
482 | |
483 | -- the update display mode |
484 | MyUpdateMode : TypeOfUpdate from Aspect is protected; |
485 | |
486 | -- the different contexts for primitives |
487 | MyAspectLine3d : AspectLine3d from Graphic3d |
488 | is protected; |
489 | MyAspectText3d : AspectText3d from Graphic3d |
490 | is protected; |
491 | MyAspectMarker3d : AspectMarker3d from Graphic3d |
492 | is protected; |
493 | MyAspectFillArea3d : AspectFillArea3d from Graphic3d |
494 | is protected; |
495 | |
496 | -- the displayed structures |
497 | MyDisplayedStructure : MapOfStructure from Graphic3d |
498 | is protected; |
499 | |
500 | -- the highlighted structures |
501 | MyHighlightedStructure : MapOfStructure from Graphic3d |
502 | is protected; |
503 | |
504 | -- the visible structures |
505 | MyVisibleStructure : MapOfStructure from Graphic3d |
506 | is protected; |
507 | |
508 | -- the pickable structures |
509 | MyPickStructure : MapOfStructure from Graphic3d |
510 | is protected; |
511 | |
512 | -- the structure identifier generator |
513 | MyStructGenId : GenId from Aspect is protected; |
514 | |
515 | |
516 | MyGraphicDevice : GraphicDevice from Aspect is protected; |
517 | |
518 | friends |
519 | |
520 | class Structure from Graphic3d |
521 | |
522 | end StructureManager; |