0025332: Visualization - rewrite MinMaxValues methods to using of Bnd_Box
[occt.git] / src / Visual3d / Visual3d_View.cdl
CommitLineData
b311480e 1-- Created on: 1991-09-17
2-- Created by: NW,JPB,CAL
3-- Copyright (c) 1991-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
7fd59977 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.
b311480e 16
7fd59977 17-- 05-97: CAL; Ajout du Clear sur les TOS_COMPUTED.
18-- 10-97: CAL; Retrait des DataStructure.
19-- 11-97: CAL; Retrait de la dependance avec math.Calcul developpe.
20-- 11-97: CAL; Ajout de NumberOfDisplayedStructures
21-- 05-98: CAL; Perfs. Connection entre structures COMPUTED.
22-- 16-09-98: BGN; Points d'entree du Triedre (S3819, Phase 1)
23-- 22-09-98: BGN; S3989 (anciennement S3819)
24-- TypeOfTriedron* from Aspect(et pas Visual3d)
25-- 02-12-98: S4062. Ajout des layers.
26-- 13-09-99: GG; GER61454 Adds LightLimit() and PlaneLimit() methods
27-- 10-11-99: GG; Add PRO19603 Redraw( area ) method
28-- 14-01-00: GG; Add IMP140100 ViewManager() method
7fd59977 29-- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
30-- -> Add Print methods (works only under Windows).-
31-- GG - RIC120302 Add NEW SetWindow method.
7fd59977 32-- 30-04-02: JMB; MyDisplayedStructure is now a Map instead
33-- of a Set. Improves performance of Selection
34-- mechanisms
7fd59977 35
36-- SAV - 22/10/01 -> Add EnableDepthTest() & IsDepthTestEnabled() methods.
37-- SAV - 25/10/01 -> Add EnableGLLight() & IsGLLightEnabled() methods.
38-- VSV - 28/05/02: ZBUFFER mode of Trihedron
39-- SAV - 23/12/02 Added methods too set background image
7fd59977 40
41class View from Visual3d inherits DataStructureManager from Graphic3d
42
43 ---Version:
44
45 ---Purpose: Creation and edition of a view in a 3D visualiser.
46 -- A 3D view is composed of an "orientation" part defined
47 -- by the position of the observer, the direction of view,
48 -- and a "mapping" part defined by the type of projection
49 -- (parallel or perspective) and by the window-viewport
50 -- couple which allows passage from the projected coordinate
51 -- space into the screen space.
52 -- Summary of 3D Viewing
53 -- To define a view, you must define:
54 -- - The view orientation transformation
55 -- - The view mapping transformation
56 -- - The view representation.
57 -- To activate a view, you must define:
58 -- - The associated window.
59
60
61uses
62
63 Array2OfReal from TColStd,
64
65 Background from Aspect,
66 GradientBackground from Aspect,
7fd59977 67 Window from Aspect,
68 TypeOfUpdate from Aspect,
69 TypeOfHighlightMethod from Aspect,
70 TypeOfTriedronEcho from Aspect,
71 TypeOfTriedronPosition from Aspect,
72 Handle from Aspect,
73 RenderingContext from Aspect,
74 GraphicCallbackProc from Aspect,
75 ColorScale from Aspect,
7edf74fd 76 PrintAlgo from Aspect,
7fd59977 77
692613e5 78 BufferType from Graphic3d,
7fd59977 79 CBitFields8 from Graphic3d,
80 CView from Graphic3d,
81 GraphicDriver from Graphic3d,
82 PtrFrameBuffer from Graphic3d,
7fd59977 83 Structure from Graphic3d,
84 SequenceOfStructure from Graphic3d,
85 MapOfStructure from Graphic3d,
b5ac8292 86 Camera_Handle from Graphic3d,
7fd59977 87
c5751993 88 ZLayerSettings from Graphic3d,
89
7fd59977 90 ContextView from Visual3d,
7fd59977 91 Layer from Visual3d,
92 Light from Visual3d,
54f7544d 93 SequenceOfLight from Visual3d,
7fd59977 94 TypeOfAnswer from Visual3d,
7fd59977 95 ViewManager from Visual3d,
96 ViewManagerPtr from Visual3d,
97
98 TypeOfBackfacingModel from Visual3d,
99
100 NameOfColor from Quantity,
101 FillMethod from Aspect,
102 GradientFillMethod from Aspect,
103 ExportFormat from Graphic3d,
104 SortType from Graphic3d,
105 Color from Quantity,
eeaaaefb 106 FontAspect from Font,
13a22457
S
107 AsciiString from TCollection,
108 ExtendedString from TCollection,
692613e5 109 CGraduatedTrihedron from Graphic3d,
110
ed063270 111 PixMap from Image,
112 Box from Bnd
7fd59977 113
114raises
115 TransformError from Visual3d,
116 ViewDefinitionError from Visual3d
117
118is
119
120 ----------------------------------------------
121 -- Summary of 3D Viewing --
122 -- --
123 -- To define a view, you must define --
124 -- --
125 -- The view orientation transformation --
126 -- The view mapping transformation --
127 -- The view representation. --
128 -- --
129 -- To activate a view, you must define --
130 -- --
131 -- The associated window. --
132 ----------------------------------------------
133
6e33d3ce 134 Create ( AManager : ViewManager from Visual3d )
135 returns View from Visual3d;
7fd59977 136 ---Level: Public
137 ---Purpose: Creates a view in the viewer <AManager> with a default
138 -- orientation and a default mapping.
139
7fd59977 140 ---------------------------------------------------
141 -- Category: Methods to modify the class definition
142 ---------------------------------------------------
143
144 Activate ( me : mutable )
145 ---Level: Public
146 ---Purpose: Activates the view <me>.
147 -- Map the associated window on the screen and
148 -- post the view in this window.
149 -- Category: Methods to modify the class definition
150 -- Warning: Raises ViewDefinitionError if the associated
151 -- window isn't defined.
152 raises ViewDefinitionError from Visual3d is static;
153
154 Deactivate ( me : mutable )
155 ---Level: Public
156 ---Purpose: Deactivates the view <me>.
157 -- Unmap the associated window on the screen and
158 -- unpost the view in this window.
159 -- Category: Methods to modify the class definition
160 -- Warning: Raises ViewDefinitionError if the associated
161 -- window isn't defined.
162 raises ViewDefinitionError from Visual3d is static;
163
164 Destroy ( me : mutable )
165 is redefined;
166 ---Level: Public
167 ---Purpose: Deletes and erases the view <me>.
168 ---Category: Methods to modify the class definition
169 ---C++: alias ~
170
171 Redraw ( me : mutable )
172 is static;
173 ---Level: Public
174 ---Purpose: Updates screen in all cases.
175 ---Category: Methods to modify the class definition
176
679ecdee 177 RedrawImmediate ( me : mutable )
178 is static;
179 ---Level: Public
180 ---Purpose: Updates layer of immediate presentations.
181
7fd59977 182 Redraw ( me : mutable; x,y,width,height: Integer from Standard )
183 is static;
184 ---Level: Public
185 ---Purpose: Updates screen area in all cases.
186 -- area is given by his xy min corner and size in pixel coordinates
187 ---Category: Methods to modify the class definition
188
189 Redraw ( me : mutable;
190 AnUnderLayer : Layer from Visual3d;
191 AnOverLayer : Layer from Visual3d )
192 is static;
193 ---Level: Internal
194 ---Purpose: Updates screen in all cases.
195 ---Category: Methods to modify the class definition
196
679ecdee 197 RedrawImmediate ( me : mutable;
198 theUnderLayer : Layer from Visual3d;
199 theOverLayer : Layer from Visual3d )
200 is static;
201 ---Level: Public
202 ---Purpose: Updates layer of immediate presentations.
203
204 Invalidate ( me : mutable )
205 is static;
206 ---Level: Public
207 ---Purpose: Invalidates view content but does not redraw it.
208
7fd59977 209 Redraw ( me : mutable;
210 AnUnderLayer : Layer from Visual3d;
211 AnOverLayer : Layer from Visual3d;
212 x,y,width,height: Integer from Standard )
213 is static;
214 ---Level: Internal
215 ---Purpose: Updates screen area in all cases.
216 -- area is given by his xy min corner and size in pixel coordinates
217 ---Category: Methods to modify the class definition
218
219 Remove ( me : mutable )
220 is static;
221 ---Level: Public
222 ---Purpose: Deletes and erases the view <me>.
223 -- Warning: No more graphic operations in <me> after this call.
224 ---Category: Methods to modify the class definition
225
226 Resized ( me : mutable )
227 ---Level: Public
228 ---Purpose: Updates the view <me> after the modification
229 -- of the associated window.
230 -- Category: Methods to modify the class definition
231 -- Warning: Raises ViewDefinitionError if the associated
232 -- window isn't defined.
233 raises ViewDefinitionError from Visual3d is static;
234
235 SetBackground ( me : mutable;
236 ABack : Background from Aspect )
237 ---Level: Internal
238 ---Purpose: Modifies the default window background.
239 -- Category: Methods to modify the class definition
240 -- Warning: Raises ViewDefinitionError if the associated
241 -- window isn't defined.
242 raises ViewDefinitionError from Visual3d is static;
243
244 SetBackgroundImage( me : mutable; FileName : CString from Standard;
245 FillStyle : FillMethod from Aspect;
246 update : Boolean from Standard )
247 ---Level: Internal
248 ---Purpose:
249 -- Category: Methods to modify the class definition
250 -- Warning: Raises ViewDefinitionError if the associated
251 -- window isn't defined.
252 raises ViewDefinitionError from Visual3d is static;
253
254 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
255 update : Boolean from Standard )
256 ---Level: Internal
257 ---Purpose:
258 -- Category: Methods to modify the class definition
259 -- Warning: Raises ViewDefinitionError if the associated
260 -- window isn't defined.
261 raises ViewDefinitionError from Visual3d is static;
262
263 SetGradientBackground ( me : mutable;
264 ABack : GradientBackground from Aspect;
265 update : Boolean from Standard )
266 ---Level: Internal
267 ---Purpose: Modifies the gradient window background.
268 -- Category: Methods to modify the class definition
269 -- Warning: Raises ViewDefinitionError if the associated
270 -- window isn't defined.
271 raises ViewDefinitionError from Visual3d is static;
272
273 SetBgGradientStyle( me : mutable;
274 FillStyle : GradientFillMethod from Aspect;
275 update : Boolean from Standard )
276 ---Level: Internal
277 ---Purpose:
278 -- Category: Methods to modify the class definition
279 -- Warning: Raises ViewDefinitionError if the associated
280 -- window isn't defined.
281 raises ViewDefinitionError from Visual3d is static;
282
283 SetBackFacingModel ( me : mutable;
284 aModel : TypeOfBackfacingModel from Visual3d
285 ) is static;
286 ---Level : Public
287 ---Purpose : Manages display of the back faces
288
289 BackFacingModel ( me )
290 returns TypeOfBackfacingModel from Visual3d is static;
291 ---Level : Public
292 ---Purpose : Returns current state of the back faces display
293
294 SetContext ( me : mutable;
295 CTX : ContextView from Visual3d )
296 is static;
297 ---Level: Public
298 ---Purpose: Sets the context <CTX> in the view <me>.
299 ---Category: Methods to modify the class definition
300
7fd59977 301 SetViewMappingDefault ( me : mutable )
302 is static;
303 ---Level: Public
304 ---Purpose: Saves the current mapping which will be the
305 -- reference value for the reset of the mapping
306 -- done by the ViewmappingReset method.
307 ---Category: Methods to modify the class definition
308
7fd59977 309 SetViewOrientationDefault ( me : mutable )
310 is static;
311 ---Level: Public
312 ---Purpose: Saves the current orientation which will be the
313 -- reference value for the reset of the orientation
314 -- done by the ViewOrientationReset method.
315 ---Category: Methods to modify the class definition
316
317 SetWindow ( me : mutable;
318 AWindow : Window from Aspect )
319 ---Level: Public
320 ---Purpose: Associates the window <AWindow> to the view <me>.
321 -- No new association if the window is already defined.
322 -- Category: Methods to modify the class definition
323 -- Warning: Raises ViewDefinitionError if it is impossible
324 -- to associate a view and a window.
325 -- (association already done or another problem)
326 -- Modifies the viewmapping of the associated view
327 -- when it calls the SetRatio method.
328 raises ViewDefinitionError from Visual3d is static;
329 ---Purpose:
330 -- After this call, each view is mapped in an unique window.
331 --
332 -- Programming example :
333 --
334 -- An example when we have 1 view and 1 window
335 -- -------------------------------------------
336 --
dc3fe572 337 -- Handle(Aspect_DisplayConnection) aDisplayConnection;
338 --
339 -- // Display connection initialization only needed on Linux platform
340 -- // and on Mac OS X, in cases when you use Xlib for windows drawing.
341 -- aDisplayConnection = new Aspect_DisplayConnection();
342 --
343 -- // Graphic driver initialization
344 -- Handle(Graphic3d_GraphicDriver) aGraphicDriver =
345 -- Graphic3d::InitGraphicDriver (aDisplayConnection);
7fd59977 346 --
347 -- // Define a view manager
dc3fe572 348 -- Handle(Visual3d_ViewManager) aVisualManager = new Visual3d_ViewManager (aGraphicDriver);
7fd59977 349 --
350 -- // Define a view
dc3fe572 351 -- Handle(Visual3d_View) aView = new Visual3d_View (aVisaulManager);
7fd59977 352 --
353 -- // Define a window
dc3fe572 354 -- Handle(Xw_Window) aWindow = new Xw_Window
355 -- (aDisplayConnection, "Graphic View 1", 0.695, 0.695, 0.600, 0.600, Quantity_NOC_MATRAGRAY);
7fd59977 356 --
357 -- // Associate the view and the window
dc3fe572 358 -- aView->SetWindow (aWindow);
7fd59977 359 --
360 -- // Map the window
dc3fe572 361 -- aWindow->Map ();
7fd59977 362 --
363 -- // Activate the view
dc3fe572 364 -- aView->Activate ();
7fd59977 365 --
366
367 SetWindow ( me : mutable;
368 AWindow : Window from Aspect;
369 AContext: RenderingContext from Aspect;
370 ADisplayCB: GraphicCallbackProc from Aspect;
371 AClientData: Address from Standard
372 )
373 ---Level: Public
374 ---Purpose: Associates the window <AWindow> and context <AContext>
375 -- to the view <me>.
376 -- If <AContext> is not NULL the graphic context is used
377 -- directly to draw something in this view.
378 -- Otherwise an internal context is created.
379 -- If <ADisplayCB> is not NULL then a user display CB is
380 -- call at the end of the OCC graphic traversal and just
381 -- before the swap of buffers. The <aClientData> is pass
382 -- to this call back.
383 -- No new association if the window is already defined.
384 -- Category: Methods to modify the class definition
385 -- Warning: Raises ViewDefinitionError if it is impossible
386 -- to associate a view and a window.
387 -- (association already done or another problem)
388 -- Modifies the viewmapping of the associated view
389 -- when it calls the SetRatio method.
390 raises ViewDefinitionError from Visual3d is static;
391 ---Purpose:
392 -- After this call, each view is mapped in an unique window.
7fd59977 393
6bc6a6fc 394 Update ( me : mutable;
395 theUpdateMode : TypeOfUpdate from Aspect )
7fd59977 396 is static;
397 ---Level: Public
398 ---Purpose: Updates screen in function of modifications of
399 -- the structures.
400 ---Category: Methods to modify the class definition
401
402 Update ( me : mutable;
403 AnUnderLayer : Layer from Visual3d;
404 AnOverLayer : Layer from Visual3d )
405 is static;
406 ---Level: Internal
407 ---Purpose: Updates screen in function of modifications of
408 -- the structures.
409 ---Category: Methods to modify the class definition
410
6bc6a6fc 411 SetAutoZFitMode (me : mutable;
412 theIsOn : Boolean;
413 theScaleFactor : Real from Standard = 1.0);
414 ---Level: public
415 ---Purpose: Sets the automatic z-fit mode and its parameters.
416 -- The auto z-fit has extra parameters which can controlled from application level
417 -- to ensure that the size of viewing volume will be sufficiently large to cover
418 -- the depth of unmanaged objects, for example, transformation persistent ones.
419 -- @param theScaleFactor [in] the scale factor for Z-range.
420 -- The range between Z-min, Z-max projection volume planes
421 -- evaluated by z fitting method will be scaled using this coefficient.
422 -- Program error exception is thrown if negative or zero value
423 -- is passed.
424
425 AutoZFitMode (me) returns Boolean;
426 ---Level: public
427 ---Purpose: returns TRUE if automatic z-fit mode is turned on.
428
429 AutoZFitScaleFactor (me) returns Real from Standard;
430 ---Level: public
431 ---Purpose: returns scale factor parameter of automatic z-fit mode.
432
433 AutoZFit (me : mutable);
434 ---Level: Public
435 ---Purpose: If automatic z-range fitting is turned on, adjusts Z-min and Z-max
436 -- projection volume planes with call to ZFitAll.
437
438 ZFitAll (me : mutable; theScaleFactor : Real from Standard = 1.0);
439 ---Level: Public
440 ---Purpose: Change Z-min and Z-max planes of projection volume to match the
441 -- displayed objects.
442
7fd59977 443 ViewMappingReset ( me : mutable )
444 is static;
445 ---Level: Public
446 ---Purpose: Sets the value of the mapping to be the same as
447 -- the mapping saved by the SetViewMappingDefaut method.
448 ---Category: Methods to modify the class definition
449
450 ViewOrientationReset ( me : mutable )
451 is static;
452 ---Level: Public
453 ---Purpose: Sets the value of the orientation to be the same as the
454 -- orientation saved by the SetViewOrientationDefaut method.
455 ---Category: Methods to modify the class definition
456
7fd59977 457 SetComputedMode ( me : mutable; aMode : Boolean from Standard ) is static;
458 ---Level: Advanced
459 ---Purpose: Switches computed HLR mode in the view
460 ---Category: Methods to modify the class definition
461
462 ComputedMode ( me ) returns Boolean from Standard is static;
463 ---Level: Advanced
464 ---Purpose: Returns the computed HLR mode state
465 ---Category: Inquire methods
466
467 ---------------------------------------------------
468 -- Category: Methods to modify the class definition
469 -- Triedron methods
470 ---------------------------------------------------
471
472 ZBufferTriedronSetup ( me : mutable;
473 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
474 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
475 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
476 SizeRatio : Real from Standard = 0.8;
477 AxisDiametr : Real from Standard = 0.05;
478 NbFacettes : Integer from Standard = 12)
479 is static;
480 ---Level: Advanced
481 ---Purpose: Customization of the ZBUFFER Triedron.
482 --- Initializes Colors of X Y and axis
483 --- Scale ratio defines decreasing of trihedron size when
484 --- its position is out of a View
485
486 TriedronDisplay ( me : mutable;
487 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
488 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
489 AScale : Real from Standard = 0.02;
490 AsWireframe : Boolean from Standard = Standard_True )
491 is static;
492 ---Level: Public
493 ---Purpose: Display of the Triedron.
494 --- Initialize position, color and length of Triedron axes.
495 --- The scale is a percent of the window width.
496 --- If AsWireframe is FALSE triedron is shown in shaded mode
497 --- AColor is not considered for ZBUFFER mode
498 ---Category:
499
500 TriedronErase ( me : mutable )
501 is static;
502 ---Level: Public
503 ---Purpose: Erases the Triedron.
504 ---Category:
505
506 TriedronEcho ( me : mutable;
507 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
508 is static;
509 ---Level: Public
510 ---Purpose: Highlights the echo zone of the Triedron.
511 ---Category:
512
513 ------------------------------------------
514 ---Category: Graduated trihedron
515 ------------------------------------------
516
517 GetGraduatedTrihedron(me;
518 -- Names of axes --
13a22457 519 xname, yname, zname : out ExtendedString from TCollection;
7fd59977 520 -- Draw names --
13a22457 521 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
7fd59977 522 -- Draw values --
13a22457 523 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
7fd59977 524 -- Draw grid --
525 drawgrid : out Boolean from Standard;
526 -- Draw axes --
527 drawaxes : out Boolean from Standard;
528 -- Number of splits along axes --
13a22457 529 nbx, nby, nbz : out Integer from Standard;
7fd59977 530 -- Offset for drawing values --
13a22457 531 xoffset, yoffset, zoffset : out Integer from Standard;
7fd59977 532 -- Offset for drawing names of axes --
13a22457 533 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
7fd59977 534 -- Draw tickmarks --
13a22457 535 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
7fd59977 536 -- Length of tickmarks --
13a22457 537 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
7fd59977 538 -- Grid color --
539 gridcolor : out Color from Quantity;
13a22457
S
540 -- Colors of axis names --
541 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
542 -- Colors of axis and values --
543 xcolor, ycolor, zcolor : out Color from Quantity;
7fd59977 544 -- Name of font for names of axes --
13a22457 545 fontOfNames : out AsciiString from TCollection;
7fd59977 546 -- Style of names of axes --
eeaaaefb 547 styleOfNames : out FontAspect from Font;
7fd59977 548 -- Size of names of axes --
549 sizeOfNames : out Integer from Standard;
550 -- Name of font for values --
13a22457 551 fontOfValues : out AsciiString from TCollection;
7fd59977 552 -- Style of values --
eeaaaefb 553 styleOfValues : out FontAspect from Font;
7fd59977 554 -- Size of values --
555 sizeOfValues : out Integer from Standard)
13a22457 556 returns Boolean from Standard
7fd59977 557 is static;
13a22457 558 ---Purpose: Returns data of a graduated trihedron if displayed (return value is True)
7fd59977 559
560 GraduatedTrihedronDisplay(me : mutable;
561 -- Names of axes --
13a22457 562 xname, yname, zname : ExtendedString from TCollection;
7fd59977 563 -- Draw names --
13a22457 564 xdrawname, ydrawname, zdrawname : Boolean from Standard;
7fd59977 565 -- Draw values --
13a22457 566 xdrawvalues, ydrawvalues, zdrawvalues : Boolean from Standard;
7fd59977 567 -- Draw grid --
568 drawgrid : Boolean from Standard;
569 -- Draw axes --
570 drawaxes : Boolean from Standard;
571 -- Number of splits along axes --
13a22457 572 nbx, nby, nbz : Integer from Standard;
7fd59977 573 -- Offset for drawing values --
13a22457 574 xoffset, yoffset, zoffset : Integer from Standard;
7fd59977 575 -- Offset for drawing names of axes --
13a22457 576 xaxisoffset, yaxisoffset, zaxisoffset : Integer from Standard;
7fd59977 577 -- Draw tickmarks --
13a22457 578 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : Boolean from Standard;
7fd59977 579 -- Length of tickmarks --
13a22457 580 xtickmarklength, ytickmarklength, ztickmarklength : Integer from Standard;
7fd59977 581 -- Grid color --
582 gridcolor : Color from Quantity;
13a22457
S
583 -- Colors of axis names --
584 xnamecolor, ynamecolor, znamecolor : Color from Quantity;
585 -- Colors of axis and values --
586 xcolor, ycolor, zcolor : Color from Quantity;
7fd59977 587 -- Name of font for names of axes --
13a22457 588 fontOfNames : AsciiString from TCollection;
7fd59977 589 -- Style of names of axes --
eeaaaefb 590 styleOfNames : FontAspect from Font;
7fd59977 591 -- Size of names of axes --
592 sizeOfNames : Integer from Standard;
593 -- Name of font for values --
13a22457 594 fontOfValues : AsciiString from TCollection;
7fd59977 595 -- Style of values --
eeaaaefb 596 styleOfValues : FontAspect from Font;
7fd59977 597 -- Size of values --
598 sizeOfValues : Integer from Standard)
599 ---Purpose: Displays a graduated trihedron.
600 is static;
601
602 GraduatedTrihedronErase(me : mutable)
603 ---Purpose: Erases a graduated trihedron from the view.
604 is static;
605
606 ----------------------------
607 ---Category: Inquire methods
608 ----------------------------
609
610 Background ( me )
611 returns Background from Aspect
612 is static;
613 ---Level: Internal
614 ---Purpose: Returns the value of the default window background.
615
616 GradientBackground ( me )
617 returns GradientBackground from Aspect
618 is static;
619 ---Level: Internal
620 ---Purpose: Returns the value of the window background.
621
622 ContainsFacet ( me )
623 returns Boolean from Standard
624 is static;
625 ---Level: Public
626 ---Purpose: Returns Standard_True if one of the structures
627 -- displayed in the view <me> contains Polygons,
628 -- Triangles or Quadrangles.
629
630 ContainsFacet ( me;
631 ASet : MapOfStructure from Graphic3d )
632 returns Boolean from Standard
633 is static;
634 ---Level: Public
635 ---Purpose: Returns Standard_True if one of the structures
636 -- in the set <ASet> contains Polygons, Triangles
637 -- or Quadrangles.
638
639 Context ( me )
640 returns ContextView from Visual3d
641 is static;
642 ---Level: Public
643 ---Purpose: Returns the current context of the view <me>.
644 ---C++: return const &
645
646 DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d )
647 is static;
648 ---Level: Internal
649 ---Purpose: Returns the set of structures displayed in
650 -- the view <me>.
651
652 IsActive ( me )
653 returns Boolean from Standard
654 is static;
655 ---Level: Public
656 ---Purpose: Returns the activity flag of the view <me>.
657
658 IsDefined ( me )
659 returns Boolean from Standard
660 is static;
661 ---Level: Public
662 ---Purpose: Returns True if the window associated to the view
663 -- <me> is defined.
664
665 IsDeleted ( me )
666 returns Boolean from Standard
667 is static;
668 ---Level: Public
669 ---Purpose: Returns Standard_True is the view <me> is deleted.
670 -- <me> is deleted after the call Remove (me).
671 ---Category: Inquire methods
672
197ac94e 673 MinMaxValues (me;
197ac94e 674 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
ed063270 675 returns Box from Bnd
197ac94e 676 is static;
677 ---Level: Public
678 ---Purpose: Returns the coordinates of the boundary box of all
679 -- structures displayed in the view <me>.
680 -- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
681 -- also includes minimum and maximum limits of graphical elements
682 -- forming parts of infinite structures.
683
684 MinMaxValues (me;
685 theSet : MapOfStructure from Graphic3d;
197ac94e 686 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
ed063270 687 returns Box from Bnd
197ac94e 688 is static;
689 ---Level: Public
690 ---Purpose: Returns the coordinates of the boundary box of all
691 -- structures in the set <theSet>.
692 -- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
693 -- also includes minimum and maximum limits of graphical elements
197ac94e 694 -- forming parts of infinite structures.
7fd59977 695
696 NumberOfDisplayedStructures ( me )
697 returns Integer from Standard
698 is static;
699 ---Level: Internal
700 ---Purpose: Returns number of displayed structures in
701 -- the view <me>.
702
197ac94e 703 Projects (me;
7fd59977 704 AX, AY, AZ : Real from Standard;
705 APX, APY, APZ : out Real from Standard )
706 is static;
707 ---Level: Public
708 ---Purpose: Returns the coordinates of the projection of the
709 -- 3d coordinates <AX>, <AY>, <AZ>.
710
b5ac8292 711 DefaultCamera (me)
712 returns Camera_Handle from Graphic3d
713 is static;
714 ---Level: Public
715 ---Purpose: @return the default camera of <me>.
716 ---C++: return const &
7fd59977 717
b5ac8292 718 Camera (me)
719 returns Camera_Handle from Graphic3d
720 is static;
721 ---Level: Public
722 ---Purpose: @return the camera of <me>.
723 ---C++: return const &
7fd59977 724
b5ac8292 725 SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
726 ---Level: Public
727 ---Purpose: Set camera object to provide orientation and projection matrices
728 -- for graphic driver.
7fd59977 729
730 Window ( me )
731 returns Window from Aspect
732 ---Level: Public
733 ---Purpose: Returns the window associated to the view <me>.
734 -- Warning: Raises ViewDefinitionError if the associated
735 -- window isn't defined.
736 raises ViewDefinitionError from Visual3d is static;
737
738 LightLimit ( me ) returns Integer is static;
739 ---Level: Public
740 ---Purpose: Returns the MAX number of light associated to the view <me>.
741
742 PlaneLimit ( me ) returns Integer is static;
743 ---Level: Public
744 ---Purpose: Returns the MAX number of clipping planes
745 -- associated to the view <me>.
746
747 ViewManager ( me ) returns ViewManager from Visual3d is static;
748 ---Level: Advanced
749 ---Purpose: Returns the view manager handle which manage this view
750
751 ----------------------------
752 -- Category: Private methods
753 ----------------------------
754
755 AcceptDisplay ( me;
756 AStructure : Structure from Graphic3d )
757 returns TypeOfAnswer from Visual3d
758 is static private;
759 ---Level: Internal
760 ---Purpose: Is it possible to display the structure
761 -- <AStructure> in the view <me> ?
762 ---Category: Private methods
763
764 ReCompute ( me : mutable;
765 AStructure : Structure from Graphic3d );
766 ---Level: Advanced
767 ---Purpose: Computes the new presentation of the
768 -- structure <AStructure> displayed in <me>
769 -- with the type Graphic3d_TOS_COMPUTED.
770 ---Category: Private methods
771
772 Compute ( me : mutable ) is static private;
773 ---Level: Internal
774 ---Purpose: Computes the new presentation of the
775 -- Structures displayed in <me> with the type
776 -- Graphic3d_TOS_COMPUTED.
777 ---Category: Private methods
778
779 ChangeDisplayPriority ( me : mutable;
780 AStructure : Structure from Graphic3d;
781 OldPriority : Integer from Standard;
782 NewPriority : Integer from Standard )
783 is static private;
784 ---Level: Internal
785 ---Purpose: Changes the display priority of the structure <AStructure>.
786 ---Category: Private methods
787
c5751993 788
789 SetZLayerSettings ( me : mutable;
790 theLayerId : Integer from Standard;
791 theSettings : ZLayerSettings from Graphic3d )
792 is static private;
793 ---Purpose: Sets the settings for a single Z layer of specified view.
794
59f45b7c 795 AddZLayer ( me : mutable;
796 theLayerId : Integer from Standard )
797 is static private;
798 ---Purpose: Add a new top-level Z layer to the view with ID
799 -- <theLayerId>. The z layer mechanism allows to display
800 -- structures in higher layers in overlay of structures in lower layers.
801 -- The layers in a particular view should be managed centrally
802 -- by its view manager so to avoid IDs mismatching and provide correct
803 -- display of graphics in all views.
804
805 RemoveZLayer ( me : mutable;
806 theLayerId : Integer from Standard )
807 is static private;
808 ---Purpose: Remove z layer from the view by its ID.
809
810 ChangeZLayer ( me : mutable;
811 theStructure : Structure from Graphic3d;
812 theLayerId : Integer from Standard )
813 is static private;
814 ---Purpose: Change Z layer of already displayed structure in the view.
815
7fd59977 816 Clear ( me : mutable;
817 AStructure : Structure from Graphic3d;
818 WithDestruction : Boolean from Standard )
819 is static private;
820 ---Level: Internal
821 ---Purpose: Clears the structure <AStructure> to the view <me>.
822 ---Category: Private methods
823
824 Connect ( me : mutable;
825 AMother : Structure from Graphic3d;
826 ADaughter : Structure from Graphic3d )
827 is static private;
828 ---Level: Internal
829 ---Purpose: Connects the structures <AMother> and <ADaughter>.
830 ---Category: Private methods
831
832 Disconnect ( me : mutable;
833 AMother : Structure from Graphic3d;
834 ADaughter : Structure from Graphic3d )
835 is static private;
836 ---Level: Internal
837 ---Purpose: Disconnects the structures <AMother> and <ADaughter>.
838 ---Category: Private methods
839
840 Display ( me : mutable;
841 AStructure : Structure from Graphic3d )
842 is static private;
843 ---Level: Internal
844 ---Purpose: Display the structure <AStructure> to the view <me>.
845 ---Category: Private methods
846
847 Display ( me : mutable;
848 AStructure : Structure from Graphic3d;
849 AnUpdateMode : TypeOfUpdate from Aspect )
850 is static private;
851 ---Level: Internal
852 ---Purpose: Display the structure <AStructure> to the view <me>.
853 ---Category: Private methods
854
679ecdee 855 DisplayImmediate ( me : mutable;
856 theStructure : Structure from Graphic3d;
857 theIsSingleView : Boolean from Standard = Standard_True)
858 returns Boolean from Standard
859 is static;
860 ---Level: Internal
861 ---Purpose: Add structure to the list of immediate presentations.
862 -- @return true if structure has not been registered in this view
863
864 EraseImmediate ( me : mutable;
865 theStructure : Structure from Graphic3d )
866 returns Boolean from Standard
867 is static;
868 ---Level: Internal
869 ---Purpose: Removes the structure from the list of immediate presentations.
870 -- @return true if structure has been registered in view
871
872 ClearImmediate ( me : mutable )
873 returns Boolean from Standard
874 is static;
875 ---Level: Internal
876 ---Purpose: Clears list of immediate presentations.
877 -- @return true if list was not empty
878
7fd59977 879 Erase ( me : mutable;
880 AStructure : Structure from Graphic3d )
881 is static private;
882 ---Level: Internal
883 ---Purpose: Erases the structure <AStructure> from the view <me>.
884 ---Category: Private methods
885
886 Erase ( me : mutable;
887 AStructure : Structure from Graphic3d;
888 AnUpdateMode : TypeOfUpdate from Aspect )
889 is static private;
890 ---Level: Internal
891 ---Purpose: Erases the structure <AStructure> from the view <me>.
892 ---Category: Private methods
893
7fd59977 894 Highlight ( me : mutable;
895 AStructure : Structure from Graphic3d;
896 AMethod : TypeOfHighlightMethod from Aspect )
897 is static private;
898 ---Level: Internal
899 ---Purpose: Highlights the structure <AStructure> in the view <me>.
900 ---Category: Private methods
901
902 SetTransform ( me : mutable;
903 AStructure : Structure from Graphic3d;
904 ATrsf : Array2OfReal from TColStd )
905 is static private;
906 ---Level: Internal
907 ---Purpose: Transforms the structure <AStructure> in the view <me>.
908 ---Category: Private methods
909
910 UnHighlight ( me : mutable;
911 AStructure : Structure from Graphic3d )
912 is static private;
913 ---Level: Internal
914 ---Purpose: Suppress the highlighting on the structure <AStructure>
915 -- in the view <me>.
916 ---Category: Private methods
917
918 IsComputed ( me;
919 AStructure : Structure from Graphic3d )
920 returns Integer from Standard
921 is static private;
922 ---Level: Internal
923 ---Purpose: Returns an index != 0 if the structure <AStructure>
924 -- have another structure computed for the view <me>.
925 ---Category: Private methods
926
927 Identification ( me )
928 returns Integer from Standard
929 is static;
930 ---Level: Internal
931 ---Purpose: Returns the identification number of the view <me>.
932 ---Category: Private methods
933
934 IsDisplayed ( me;
935 AStructure : Structure from Graphic3d )
936 returns Boolean from Standard
937 is static private;
938 ---Level: Internal
939 ---Purpose: Returns true if the structure <AStructure> is
940 -- displayed in the view <me>.
941 ---Category: Private methods
942
7fd59977 943 SetRatio ( me : mutable )
944 is static private;
945 ---Level: Internal
946 ---Purpose: Modifies the aspect ratio of the view <me> when the
947 -- associated window is defined or resized.
948 ---Category: Private methods
949
950 UpdateLights ( me : mutable )
951 is static private;
952 ---Level: Internal
953 ---Purpose: Updates the lights when the associated window is defined
954 -- and when the view is activated.
955 ---Category: Private methods
956
957 UpdatePlanes ( me : mutable )
958 is static private;
959 ---Level: Internal
960 ---Purpose: Updates the planes when the associated window is defined
961 -- and when the view is activated.
962 ---Category: Private methods
963
964 UpdateView ( me : mutable )
965 is static private;
966 ---Level: Internal
967 ---Purpose: Updates the associated c structure before a call to the
968 -- graphic library.
969 ---Category: Private methods
970
971 -----------------------------
972 -- Category: Internal methods
973 -----------------------------
974
975 CView ( me )
976 returns Address from Standard
977 is static;
978 ---Level: Internal
979 ---Purpose: Returns the c structure associated to <me>.
980 ---Category: Private methods
981
982 GraphicDriver ( me )
6942f04a 983 returns GraphicDriver from Graphic3d
7fd59977 984 is static;
985 ---Level: Internal
986 ---Purpose: Returns the associated GraphicDriver.
987 ---Category: Internal methods
dc3fe572 988 ---C++: return const &
7fd59977 989
990 HaveTheSameOwner ( me;
991 AStructure : Structure from Graphic3d )
992 returns Integer from Standard
993 is static private;
994 ---Level: Internal
995 ---Purpose: Returns an index != 0 if the structure <AStructure>
996 -- have the same owner than another structure in the
997 -- sequence of the computed structures.
7fd59977 998 ---Category: Private methods
999
7edf74fd
A
1000 Print (me; AnUnderLayer : Layer from Visual3d;
1001 AnOverLayer : Layer from Visual3d;
1002 hPrnDC : Handle from Aspect;
1003 showBackground : Boolean;
1004 filename : CString;
1005 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1006 theScaleFactor : Real from Standard = 1.0)
1007 returns Boolean from Standard is static;
7fd59977 1008
1009 ---Level: Internal
1010 ---Purpose: print the contents of all layers of the view to the printer.
1011 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1012 -- <showBackground> : When set to FALSE then print the view without background color
1013 -- (background is white)
1014 -- else set to TRUE for printing with current background color.
1015 -- <filename>: If != NULL, then the view will be printed to a file.
7edf74fd
A
1016 -- <printAlgo>: Select print algorithm: stretch, tile.
1017 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1018 -- printings accordingly to the scale factor selected in the printer
1019 -- properties dialog.
1020 -- Returns Standard_True if the data is passed to the printer, otherwise
1021 -- Standard_False if the print operation failed due to printer error
1022 -- or insufficient memory.
7fd59977 1023 -- Warning: Works only under Windows.
1024
7edf74fd
A
1025 Print (me; hPrnDC : Handle from Aspect;
1026 showBackground : Boolean;
1027 filename : CString;
1028 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1029 theScaleFactor : Real from Standard = 1.0 )
1030 returns Boolean from Standard is static;
7fd59977 1031
1032 ---Level: Internal
1033 ---Purpose: print the contents of the view to printer.
1034 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1035 -- <showBackground> : When set to FALSE then print the view without background color
1036 -- (background is white)
1037 -- else set to TRUE for printing with current background color.
1038 -- <filename>: If != NULL, then the view will be printed to a file.
7edf74fd
A
1039 -- <printAlgo>: Select print algorithm: stretch, tile.
1040 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1041 -- printings accordingly to the scale factor selected in the printer
1042 -- properties dialog.
1043 -- Returns Standard_True if the data is passed to the printer, otherwise
1044 -- Standard_False if the print operation failed due to printer error
1045 -- or insufficient memory.
7fd59977 1046 -- Warning: Works only under Windows.
1047
1048 SetTransparency ( me : mutable;
1049 AFlag : Boolean from Standard )
1050 is static;
1051 ---Level: Advanced
1052 ---Purpose: if <AFlag> is Standard_True then the transparency
1053 -- is managed in the view <me>.
1054 -- Default Standard_False
1055 ---Category: Internal methods
1056
1057 ZBufferIsActivated ( me )
1058 returns Boolean from Standard
1059 is static;
1060 ---Level: Advanced
1061 ---Purpose: Returns Standard_True if the ZBuffer is activated
1062 -- in the view <me> and Standard_False if not.
1063 ---Category: Internal methods
1064
1065 SetZBufferActivity ( me : mutable; AnActivity : Integer from Standard )
1066 is static;
1067 ---Level: Advanced
1068 ---Purpose: Activates the ZBuffer if the integer <AnActivity>
1069 -- is equal to 1.
1070 -- Deactivates the ZBuffer if the integer <AnActivity>
1071 -- is equal to 0.
1072 -- If the integer <AnActivity> is equal to -1 then
1073 -- - the ZBuffer is activated if
1074 -- me->Context ().Visualization () == Visual3d_TOV_SHADING
1075 -- - the ZBuffer is deactivated if
1076 -- me->Context ().Visualization () == Visual3d_TOV_WIREFRAME
1077 ---Category: Internal methods
1078
1079 UnderLayer ( me )
1080 returns Layer from Visual3d;
1081 ---Level: Internal
1082 ---Purpose: Returns the underlay of the view <me>.
1083 ---Category: Private methods
1084 ---C++: return const &
1085
1086 OverLayer ( me )
1087 returns Layer from Visual3d;
1088 ---Level: Internal
1089 ---Purpose: Returns the underlay of the view <me>.
1090 ---Category: Private methods
1091 ---C++: return const &
1092
1093 EnableDepthTest( me; enable : Boolean from Standard )
1094 is static;
1095 ---Level: Public
1096 ---Purpose: turns on/off opengl depth
1097
1098 IsDepthTestEnabled( me ) returns Boolean from Standard
1099 is static;
1100 ---Level: Public
1101 ---Purpose: returns current state of the opengl depth testing
1102
1103 ReadDepths( me; x,y,width,height: Integer from Standard;
1104 buffer : Address )
1105 is static;
1106 ---Purpose: Reads depths of shown pixels of the given rectangle
1107
1108 FBOCreate( me : mutable; width,height: Integer from Standard )
1109 returns PtrFrameBuffer from Graphic3d
1110 is static;
1111 ---Level: Public
1112 ---Purpose: Generate offscreen FBO in the graphic library
1113
1114 FBORelease( me : mutable;
1115 fboPtr : in out PtrFrameBuffer from Graphic3d )
1116 is static;
1117 ---Level: Public
1118 ---Purpose: Remove offscreen FBO from the graphic library
1119
1120 FBOGetDimensions( me : mutable;
1121 fboPtr : PtrFrameBuffer from Graphic3d;
1122 width, height : out Integer from Standard;
1123 widthMax, heightMax : out Integer from Standard )
1124 is static;
1125 ---Level: Public
1126 ---Purpose: Read offscreen FBO configuration.
1127
1128 FBOChangeViewport( me : mutable;
1129 fboPtr : in out PtrFrameBuffer from Graphic3d;
1130 width, height : Integer from Standard )
1131 is static;
1132 ---Level: Public
1133 ---Purpose: Change offscreen FBO viewport.
1134
1135 BufferDump( me : mutable;
692613e5 1136 theImage : in out PixMap from Image;
1137 theBufferType : BufferType from Graphic3d )
7fd59977 1138 returns Boolean from Standard
1139 is static;
1140 ---Level: Public
1141 ---Purpose: Dump active rendering buffer into specified memory buffer.
1142
1143 EnableGLLight( me; enable : Boolean from Standard )
1144 is static;
1145 ---Level: Public
1146 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1147
1148 IsGLLightEnabled( me ) returns Boolean from Standard
1149 is static;
1150 ---Level: Public
1151 ---Purpose: returns the current state of the gl lighting
1152 -- currently used in triedron displaying
1153
1154 Export( me;
5cedc27f
K
1155 theFileName : CString from Standard;
1156 theFormat : ExportFormat from Graphic3d;
1157 theSortType : SortType from Graphic3d = Graphic3d_ST_BSP_Tree;
1158 thePrecision : Real from Standard = 0.005;
1159 theProgressBarFunc : Address from Standard = NULL;
1160 theProgressObject : Address from Standard = NULL )
1161 returns Boolean from Standard;
1162 ---Purpose:
1163 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1164 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1165 -- Notice however that results may differ a lot and do not contain some elements.
7fd59977 1166
1167fields
1168
d4f1753b 1169 -- the ViewManager associated with the view
1170 myViewManager : ViewManagerPtr from Visual3d;
679ecdee 1171
1172 -- the associated C structure
1173 MyCView : CView from Graphic3d;
7fd59977 1174
679ecdee 1175 -- the context of the view : Aliasing, Depth-Cueing, Lights ...
1176 MyContext : ContextView from Visual3d;
7fd59977 1177
679ecdee 1178 -- the associated window
1179 MyWindow : Window from Aspect;
7fd59977 1180
679ecdee 1181 -- association Structure_COMPUTE and Structure_Computed
d4f1753b 1182 myStructsToCompute : SequenceOfStructure from Graphic3d;
1183 myStructsComputed : SequenceOfStructure from Graphic3d;
1184 myIsInComputedMode : Boolean from Standard;
7fd59977 1185
679ecdee 1186 -- the graphic driver used
d4f1753b 1187 myGraphicDriver : GraphicDriver from Graphic3d;
7fd59977 1188
679ecdee 1189 -- the background of the associated window
1190 MyBackground : Background from Aspect;
7fd59977 1191
679ecdee 1192 -- the gradient background of the associated window
1193 MyGradientBackground : GradientBackground from Aspect;
7fd59977 1194
679ecdee 1195 -- the displayed structures in the view
d4f1753b 1196 myStructsDisplayed : MapOfStructure from Graphic3d;
679ecdee 1197 myImmediateStructures : MapOfStructure from Graphic3d;
7fd59977 1198
679ecdee 1199 MyGTrihedron : CGraduatedTrihedron from Graphic3d;
13a22457 1200
679ecdee 1201 myDefaultCamera : Camera_Handle from Graphic3d;
b5ac8292 1202
6bc6a6fc 1203 myAutoZFitIsOn : Boolean from Standard;
1204 myAutoZFitScaleFactor : Real from Standard;
1205
1206 myStructuresUpdated : Boolean from Standard;
1207
7fd59977 1208friends
1209
679ecdee 1210 class ViewManager from Visual3d
7fd59977 1211
1212end View;