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