1 -- Created on: 1991-09-17
2 -- Created by: NW,JPB,CAL
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 -- 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 -- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
27 -- -> Add Print methods (works only under Windows).-
28 -- GG - RIC120302 Add NEW SetWindow method.
29 -- 30-04-02: JMB; MyDisplayedStructure is now a Map instead
30 -- of a Set. Improves performance of Selection
33 -- SAV - 22/10/01 -> Add EnableDepthTest() & IsDepthTestEnabled() methods.
34 -- SAV - 25/10/01 -> Add EnableGLLight() & IsGLLightEnabled() methods.
35 -- VSV - 28/05/02: ZBUFFER mode of Trihedron
36 -- SAV - 23/12/02 Added methods too set background image
38 class View from Visual3d inherits DataStructureManager from Graphic3d
42 ---Purpose: Creation and edition of a view in a 3D visualiser.
43 -- A 3D view is composed of an "orientation" part defined
44 -- by the position of the observer, the direction of view,
45 -- and a "mapping" part defined by the type of projection
46 -- (parallel or perspective) and by the window-viewport
47 -- couple which allows passage from the projected coordinate
48 -- space into the screen space.
49 -- Summary of 3D Viewing
50 -- To define a view, you must define:
51 -- - The view orientation transformation
52 -- - The view mapping transformation
53 -- - The view representation.
54 -- To activate a view, you must define:
55 -- - The associated window.
60 Array2OfReal from TColStd,
62 Background from Aspect,
63 GradientBackground from Aspect,
65 TypeOfUpdate from Aspect,
66 TypeOfHighlightMethod from Aspect,
67 TypeOfTriedronEcho from Aspect,
68 TypeOfTriedronPosition from Aspect,
70 RenderingContext from Aspect,
71 GraphicCallbackProc from Aspect,
72 ColorScale from Aspect,
73 PrintAlgo from Aspect,
75 BufferType from Graphic3d,
76 CBitFields8 from Graphic3d,
78 GraphicDriver from Graphic3d,
79 PtrFrameBuffer from Graphic3d,
80 Structure from Graphic3d,
81 SequenceOfStructure from Graphic3d,
82 MapOfStructure from Graphic3d,
83 Camera_Handle from Graphic3d,
85 ZLayerId from Graphic3d,
86 ZLayerSettings from Graphic3d,
88 ContextView from Visual3d,
91 SequenceOfLight from Visual3d,
92 TypeOfAnswer from Visual3d,
93 ViewManager from Visual3d,
94 ViewManagerPtr from Visual3d,
96 TypeOfBackfacingModel from Visual3d,
98 NameOfColor from Quantity,
99 FillMethod from Aspect,
100 GradientFillMethod from Aspect,
101 ExportFormat from Graphic3d,
102 SortType from Graphic3d,
104 FontAspect from Font,
105 AsciiString from TCollection,
106 ExtendedString from TCollection,
107 CGraduatedTrihedron from Graphic3d,
108 NMapOfTransient from Graphic3d,
109 TypeOfStructure from Graphic3d,
115 TransformError from Visual3d,
116 ViewDefinitionError from Visual3d
120 ----------------------------------------------
121 -- Summary of 3D Viewing --
123 -- To define a view, you must define --
125 -- The view orientation transformation --
126 -- The view mapping transformation --
127 -- The view representation. --
129 -- To activate a view, you must define --
131 -- The associated window. --
132 ----------------------------------------------
134 Create ( AManager : ViewManager from Visual3d )
135 returns View from Visual3d;
137 ---Purpose: Creates a view in the viewer <AManager> with a default
138 -- orientation and a default mapping.
140 ---------------------------------------------------
141 -- Category: Methods to modify the class definition
142 ---------------------------------------------------
144 Activate ( me : mutable )
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;
154 Deactivate ( me : mutable )
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;
164 Destroy ( me : mutable )
167 ---Purpose: Deletes and erases the view <me>.
168 ---Category: Methods to modify the class definition
171 Redraw ( me : mutable )
174 ---Purpose: Updates screen in all cases.
175 ---Category: Methods to modify the class definition
177 RedrawImmediate ( me : mutable )
180 ---Purpose: Updates layer of immediate presentations.
182 Redraw ( me : mutable; x,y,width,height: Integer from Standard )
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
189 Redraw ( me : mutable;
190 AnUnderLayer : Layer from Visual3d;
191 AnOverLayer : Layer from Visual3d )
194 ---Purpose: Updates screen in all cases.
195 ---Category: Methods to modify the class definition
197 RedrawImmediate ( me : mutable;
198 theUnderLayer : Layer from Visual3d;
199 theOverLayer : Layer from Visual3d )
202 ---Purpose: Updates layer of immediate presentations.
204 Invalidate ( me : mutable )
207 ---Purpose: Invalidates view content but does not redraw it.
209 Redraw ( me : mutable;
210 AnUnderLayer : Layer from Visual3d;
211 AnOverLayer : Layer from Visual3d;
212 x,y,width,height: Integer from Standard )
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
219 Remove ( me : mutable )
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
226 Resized ( me : mutable )
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;
235 SetBackground ( me : mutable;
236 ABack : Background from Aspect )
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;
244 SetBackgroundImage( me : mutable; FileName : CString from Standard;
245 FillStyle : FillMethod from Aspect;
246 update : Boolean from Standard )
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;
254 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
255 update : Boolean from Standard )
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;
263 SetGradientBackground ( me : mutable;
264 ABack : GradientBackground from Aspect;
265 update : Boolean from Standard )
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;
273 SetBgGradientStyle( me : mutable;
274 FillStyle : GradientFillMethod from Aspect;
275 update : Boolean from Standard )
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;
283 SetBackFacingModel ( me : mutable;
284 aModel : TypeOfBackfacingModel from Visual3d
287 ---Purpose : Manages display of the back faces
289 BackFacingModel ( me )
290 returns TypeOfBackfacingModel from Visual3d is static;
292 ---Purpose : Returns current state of the back faces display
294 SetContext ( me : mutable;
295 CTX : ContextView from Visual3d )
298 ---Purpose: Sets the context <CTX> in the view <me>.
299 ---Category: Methods to modify the class definition
301 SetViewMappingDefault ( me : mutable )
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
309 SetViewOrientationDefault ( me : mutable )
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
317 SetWindow ( me : mutable;
318 AWindow : Window from Aspect )
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;
330 -- After this call, each view is mapped in an unique window.
332 -- Programming example :
334 -- An example when we have 1 view and 1 window
335 -- -------------------------------------------
337 -- Handle(Aspect_DisplayConnection) aDisplayConnection;
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();
343 -- // Graphic driver initialization
344 -- Handle(Graphic3d_GraphicDriver) aGraphicDriver =
345 -- Graphic3d::InitGraphicDriver (aDisplayConnection);
347 -- // Define a view manager
348 -- Handle(Visual3d_ViewManager) aVisualManager = new Visual3d_ViewManager (aGraphicDriver);
351 -- Handle(Visual3d_View) aView = new Visual3d_View (aVisaulManager);
353 -- // Define a window
354 -- Handle(Xw_Window) aWindow = new Xw_Window
355 -- (aDisplayConnection, "Graphic View 1", 0.695, 0.695, 0.600, 0.600, Quantity_NOC_MATRAGRAY);
357 -- // Associate the view and the window
358 -- aView->SetWindow (aWindow);
363 -- // Activate the view
364 -- aView->Activate ();
367 SetWindow ( me : mutable;
368 AWindow : Window from Aspect;
369 AContext: RenderingContext from Aspect;
370 ADisplayCB: GraphicCallbackProc from Aspect;
371 AClientData: Address from Standard
374 ---Purpose: Associates the window <AWindow> and context <AContext>
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;
392 -- After this call, each view is mapped in an unique window.
394 Update ( me : mutable;
395 theUpdateMode : TypeOfUpdate from Aspect )
398 ---Purpose: Updates screen in function of modifications of
400 ---Category: Methods to modify the class definition
402 Update ( me : mutable;
403 AnUnderLayer : Layer from Visual3d;
404 AnOverLayer : Layer from Visual3d )
407 ---Purpose: Updates screen in function of modifications of
409 ---Category: Methods to modify the class definition
411 SetAutoZFitMode (me : mutable;
413 theScaleFactor : Real from Standard = 1.0);
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
425 AutoZFitMode (me) returns Boolean;
427 ---Purpose: returns TRUE if automatic z-fit mode is turned on.
429 AutoZFitScaleFactor (me) returns Real from Standard;
431 ---Purpose: returns scale factor parameter of automatic z-fit mode.
433 AutoZFit (me : mutable);
435 ---Purpose: If automatic z-range fitting is turned on, adjusts Z-min and Z-max
436 -- projection volume planes with call to ZFitAll.
438 ZFitAll (me : mutable; theScaleFactor : Real from Standard = 1.0);
440 ---Purpose: Change Z-min and Z-max planes of projection volume to match the
441 -- displayed objects.
443 ViewMappingReset ( me : mutable )
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
450 ViewOrientationReset ( me : mutable )
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
457 SetComputedMode ( me : mutable; aMode : Boolean from Standard ) is static;
459 ---Purpose: Switches computed HLR mode in the view
460 ---Category: Methods to modify the class definition
462 ComputedMode ( me ) returns Boolean from Standard is static;
464 ---Purpose: Returns the computed HLR mode state
465 ---Category: Inquire methods
467 ---------------------------------------------------
468 -- Category: Methods to modify the class definition
470 ---------------------------------------------------
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)
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
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 )
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
500 TriedronErase ( me : mutable )
503 ---Purpose: Erases the Triedron.
506 TriedronEcho ( me : mutable;
507 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
510 ---Purpose: Highlights the echo zone of the Triedron.
513 ------------------------------------------
514 ---Category: Graduated trihedron
515 ------------------------------------------
517 GetGraduatedTrihedron(me;
519 xname, yname, zname : out ExtendedString from TCollection;
521 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
523 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
525 drawgrid : out Boolean from Standard;
527 drawaxes : out Boolean from Standard;
528 -- Number of splits along axes --
529 nbx, nby, nbz : out Integer from Standard;
530 -- Offset for drawing values --
531 xoffset, yoffset, zoffset : out Integer from Standard;
532 -- Offset for drawing names of axes --
533 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
535 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
536 -- Length of tickmarks --
537 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
539 gridcolor : out Color from Quantity;
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;
544 -- Name of font for names of axes --
545 fontOfNames : out AsciiString from TCollection;
546 -- Style of names of axes --
547 styleOfNames : out FontAspect from Font;
548 -- Size of names of axes --
549 sizeOfNames : out Integer from Standard;
550 -- Name of font for values --
551 fontOfValues : out AsciiString from TCollection;
552 -- Style of values --
553 styleOfValues : out FontAspect from Font;
555 sizeOfValues : out Integer from Standard)
556 returns Boolean from Standard
558 ---Purpose: Returns data of a graduated trihedron if displayed (return value is True)
560 GraduatedTrihedronDisplay(me : mutable;
562 xname, yname, zname : ExtendedString from TCollection;
564 xdrawname, ydrawname, zdrawname : Boolean from Standard;
566 xdrawvalues, ydrawvalues, zdrawvalues : Boolean from Standard;
568 drawgrid : Boolean from Standard;
570 drawaxes : Boolean from Standard;
571 -- Number of splits along axes --
572 nbx, nby, nbz : Integer from Standard;
573 -- Offset for drawing values --
574 xoffset, yoffset, zoffset : Integer from Standard;
575 -- Offset for drawing names of axes --
576 xaxisoffset, yaxisoffset, zaxisoffset : Integer from Standard;
578 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : Boolean from Standard;
579 -- Length of tickmarks --
580 xtickmarklength, ytickmarklength, ztickmarklength : Integer from Standard;
582 gridcolor : Color from Quantity;
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;
587 -- Name of font for names of axes --
588 fontOfNames : AsciiString from TCollection;
589 -- Style of names of axes --
590 styleOfNames : FontAspect from Font;
591 -- Size of names of axes --
592 sizeOfNames : Integer from Standard;
593 -- Name of font for values --
594 fontOfValues : AsciiString from TCollection;
595 -- Style of values --
596 styleOfValues : FontAspect from Font;
598 sizeOfValues : Integer from Standard)
599 ---Purpose: Displays a graduated trihedron.
602 GraduatedTrihedronErase(me : mutable)
603 ---Purpose: Erases a graduated trihedron from the view.
606 ----------------------------
607 ---Category: Inquire methods
608 ----------------------------
611 returns Background from Aspect
614 ---Purpose: Returns the value of the default window background.
616 GradientBackground ( me )
617 returns GradientBackground from Aspect
620 ---Purpose: Returns the value of the window background.
623 returns Boolean from Standard
626 ---Purpose: Returns Standard_True if one of the structures
627 -- displayed in the view <me> contains Polygons,
628 -- Triangles or Quadrangles.
631 ASet : MapOfStructure from Graphic3d )
632 returns Boolean from Standard
635 ---Purpose: Returns Standard_True if one of the structures
636 -- in the set <ASet> contains Polygons, Triangles
640 returns ContextView from Visual3d
643 ---Purpose: Returns the current context of the view <me>.
644 ---C++: return const &
646 DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d )
649 ---Purpose: Returns the set of structures displayed in
653 returns Boolean from Standard
656 ---Purpose: Returns the activity flag of the view <me>.
659 returns Boolean from Standard
662 ---Purpose: Returns True if the window associated to the view
666 returns Boolean from Standard
669 ---Purpose: Returns Standard_True is the view <me> is deleted.
670 -- <me> is deleted after the call Remove (me).
671 ---Category: Inquire methods
674 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
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.
685 theSet : MapOfStructure from Graphic3d;
686 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
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
694 -- forming parts of infinite structures.
696 NumberOfDisplayedStructures ( me )
697 returns Integer from Standard
700 ---Purpose: Returns number of displayed structures in
704 AX, AY, AZ : Real from Standard;
705 APX, APY, APZ : out Real from Standard )
708 ---Purpose: Returns the coordinates of the projection of the
709 -- 3d coordinates <AX>, <AY>, <AZ>.
712 returns Camera_Handle from Graphic3d
715 ---Purpose: @return the default camera of <me>.
716 ---C++: return const &
719 returns Camera_Handle from Graphic3d
722 ---Purpose: @return the camera of <me>.
723 ---C++: return const &
725 SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
727 ---Purpose: Set camera object to provide orientation and projection matrices
728 -- for graphic driver.
731 returns Window from Aspect
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;
738 LightLimit ( me ) returns Integer is static;
740 ---Purpose: Returns the MAX number of light associated to the view <me>.
742 PlaneLimit ( me ) returns Integer is static;
744 ---Purpose: Returns the MAX number of clipping planes
745 -- associated to the view <me>.
747 ViewManager ( me ) returns ViewManager from Visual3d is static;
749 ---Purpose: Returns the view manager handle which manage this view
751 ----------------------------
752 -- Category: Private methods
753 ----------------------------
756 theStructType : TypeOfStructure from Graphic3d )
757 returns TypeOfAnswer from Visual3d
760 ---Purpose: Is it possible to display the structure in the view?
762 ReCompute ( me : mutable;
763 AStructure : Structure from Graphic3d );
765 ---Purpose: Computes the new presentation of the
766 -- structure <AStructure> displayed in <me>
767 -- with the type Graphic3d_TOS_COMPUTED.
768 ---Category: Private methods
770 Compute ( me : mutable ) is static private;
772 ---Purpose: Computes the new presentation of the
773 -- Structures displayed in <me> with the type
774 -- Graphic3d_TOS_COMPUTED.
775 ---Category: Private methods
777 ChangeDisplayPriority ( me : mutable;
778 AStructure : Structure from Graphic3d;
779 OldPriority : Integer from Standard;
780 NewPriority : Integer from Standard )
783 ---Purpose: Changes the display priority of the structure <AStructure>.
784 ---Category: Private methods
787 SetZLayerSettings ( me : mutable;
788 theLayerId : ZLayerId from Graphic3d;
789 theSettings : ZLayerSettings from Graphic3d )
791 ---Purpose: Sets the settings for a single Z layer of specified view.
793 AddZLayer ( me : mutable;
794 theLayerId : ZLayerId from Graphic3d )
796 ---Purpose: Add a new top-level Z layer to the view with ID
797 -- <theLayerId>. The z layer mechanism allows to display
798 -- structures in higher layers in overlay of structures in lower layers.
799 -- The layers in a particular view should be managed centrally
800 -- by its view manager so to avoid IDs mismatching and provide correct
801 -- display of graphics in all views.
803 RemoveZLayer ( me : mutable;
804 theLayerId : ZLayerId from Graphic3d )
806 ---Purpose: Remove z layer from the view by its ID.
808 ChangeZLayer ( me : mutable;
809 theStructure : Structure from Graphic3d;
810 theLayerId : ZLayerId from Graphic3d )
812 ---Purpose: Change Z layer of already displayed structure in the view.
814 Clear ( me : mutable;
815 AStructure : Structure from Graphic3d;
816 WithDestruction : Boolean from Standard )
819 ---Purpose: Clears the structure <AStructure> to the view <me>.
820 ---Category: Private methods
822 Connect ( me : mutable;
823 AMother : Structure from Graphic3d;
824 ADaughter : Structure from Graphic3d )
827 ---Purpose: Connects the structures <AMother> and <ADaughter>.
828 ---Category: Private methods
830 Disconnect ( me : mutable;
831 AMother : Structure from Graphic3d;
832 ADaughter : Structure from Graphic3d )
835 ---Purpose: Disconnects the structures <AMother> and <ADaughter>.
836 ---Category: Private methods
838 Display ( me : mutable;
839 AStructure : Structure from Graphic3d )
842 ---Purpose: Display the structure <AStructure> to the view <me>.
843 ---Category: Private methods
845 Display ( me : mutable;
846 AStructure : Structure from Graphic3d;
847 AnUpdateMode : TypeOfUpdate from Aspect )
850 ---Purpose: Display the structure <AStructure> to the view <me>.
851 ---Category: Private methods
853 DisplayImmediate ( me : mutable;
854 theStructure : Structure from Graphic3d;
855 theIsSingleView : Boolean from Standard = Standard_True)
856 returns Boolean from Standard
859 ---Purpose: Add structure to the list of immediate presentations.
860 -- @return true if structure has not been registered in this view
862 EraseImmediate ( me : mutable;
863 theStructure : Structure from Graphic3d )
864 returns Boolean from Standard
867 ---Purpose: Removes the structure from the list of immediate presentations.
868 -- @return true if structure has been registered in view
870 ClearImmediate ( me : mutable )
871 returns Boolean from Standard
874 ---Purpose: Clears list of immediate presentations.
875 -- @return true if list was not empty
877 Erase ( me : mutable;
878 AStructure : Structure from Graphic3d )
881 ---Purpose: Erases the structure <AStructure> from the view <me>.
882 ---Category: Private methods
884 Erase ( me : mutable;
885 AStructure : Structure from Graphic3d;
886 AnUpdateMode : TypeOfUpdate from Aspect )
889 ---Purpose: Erases the structure <AStructure> from the view <me>.
890 ---Category: Private methods
892 Highlight ( me : mutable;
893 AStructure : Structure from Graphic3d;
894 AMethod : TypeOfHighlightMethod from Aspect )
897 ---Purpose: Highlights the structure <AStructure> in the view <me>.
898 ---Category: Private methods
900 SetTransform ( me : mutable;
901 AStructure : Structure from Graphic3d;
902 ATrsf : Array2OfReal from TColStd )
905 ---Purpose: Transforms the structure <AStructure> in the view <me>.
906 ---Category: Private methods
908 UnHighlight ( me : mutable;
909 AStructure : Structure from Graphic3d )
912 ---Purpose: Suppress the highlighting on the structure <AStructure>
914 ---Category: Private methods
917 AStructure : Structure from Graphic3d )
918 returns Integer from Standard
921 ---Purpose: Returns an index != 0 if the structure <AStructure>
922 -- have another structure computed for the view <me>.
923 ---Category: Private methods
925 Identification ( me )
926 returns Integer from Standard
929 ---Purpose: Returns the identification number of the view <me>.
930 ---Category: Private methods
933 AStructure : Structure from Graphic3d )
934 returns Boolean from Standard
937 ---Purpose: Returns true if the structure <AStructure> is
938 -- displayed in the view <me>.
939 ---Category: Private methods
941 SetRatio ( me : mutable )
944 ---Purpose: Modifies the aspect ratio of the view <me> when the
945 -- associated window is defined or resized.
946 ---Category: Private methods
948 UpdateLights ( me : mutable )
951 ---Purpose: Updates the lights when the associated window is defined
952 -- and when the view is activated.
953 ---Category: Private methods
955 UpdatePlanes ( me : mutable )
958 ---Purpose: Updates the planes when the associated window is defined
959 -- and when the view is activated.
960 ---Category: Private methods
962 UpdateView ( me : mutable )
965 ---Purpose: Updates the associated c structure before a call to the
967 ---Category: Private methods
969 -----------------------------
970 -- Category: Internal methods
971 -----------------------------
974 returns Address from Standard
977 ---Purpose: Returns the c structure associated to <me>.
978 ---Category: Private methods
981 returns GraphicDriver from Graphic3d
984 ---Purpose: Returns the associated GraphicDriver.
985 ---Category: Internal methods
986 ---C++: return const &
988 HaveTheSameOwner ( me;
989 AStructure : Structure from Graphic3d )
990 returns Integer from Standard
993 ---Purpose: Returns an index != 0 if the structure <AStructure>
994 -- have the same owner than another structure in the
995 -- sequence of the computed structures.
996 ---Category: Private methods
998 Print (me; AnUnderLayer : Layer from Visual3d;
999 AnOverLayer : Layer from Visual3d;
1000 hPrnDC : Handle from Aspect;
1001 showBackground : Boolean;
1003 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1004 theScaleFactor : Real from Standard = 1.0)
1005 returns Boolean from Standard is static;
1008 ---Purpose: print the contents of all layers of the view to the printer.
1009 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1010 -- <showBackground> : When set to FALSE then print the view without background color
1011 -- (background is white)
1012 -- else set to TRUE for printing with current background color.
1013 -- <filename>: If != NULL, then the view will be printed to a file.
1014 -- <printAlgo>: Select print algorithm: stretch, tile.
1015 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1016 -- printings accordingly to the scale factor selected in the printer
1017 -- properties dialog.
1018 -- Returns Standard_True if the data is passed to the printer, otherwise
1019 -- Standard_False if the print operation failed due to printer error
1020 -- or insufficient memory.
1021 -- Warning: Works only under Windows.
1023 Print (me; hPrnDC : Handle from Aspect;
1024 showBackground : Boolean;
1026 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1027 theScaleFactor : Real from Standard = 1.0 )
1028 returns Boolean from Standard is static;
1031 ---Purpose: print the contents of the view to printer.
1032 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1033 -- <showBackground> : When set to FALSE then print the view without background color
1034 -- (background is white)
1035 -- else set to TRUE for printing with current background color.
1036 -- <filename>: If != NULL, then the view will be printed to a file.
1037 -- <printAlgo>: Select print algorithm: stretch, tile.
1038 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1039 -- printings accordingly to the scale factor selected in the printer
1040 -- properties dialog.
1041 -- Returns Standard_True if the data is passed to the printer, otherwise
1042 -- Standard_False if the print operation failed due to printer error
1043 -- or insufficient memory.
1044 -- Warning: Works only under Windows.
1046 ZBufferIsActivated ( me )
1047 returns Boolean from Standard
1050 ---Purpose: Returns Standard_True if the ZBuffer is activated
1051 -- in the view <me> and Standard_False if not.
1052 ---Category: Internal methods
1054 SetZBufferActivity ( me : mutable; AnActivity : Integer from Standard )
1057 ---Purpose: Activates the ZBuffer if the integer <AnActivity>
1059 -- Deactivates the ZBuffer if the integer <AnActivity>
1061 -- If the integer <AnActivity> is equal to -1 then
1062 -- - the ZBuffer is activated if
1063 -- me->Context ().Visualization () == Visual3d_TOV_SHADING
1064 -- - the ZBuffer is deactivated if
1065 -- me->Context ().Visualization () == Visual3d_TOV_WIREFRAME
1066 ---Category: Internal methods
1069 returns Layer from Visual3d;
1071 ---Purpose: Returns the underlay of the view <me>.
1072 ---Category: Private methods
1073 ---C++: return const &
1076 returns Layer from Visual3d;
1078 ---Purpose: Returns the underlay of the view <me>.
1079 ---Category: Private methods
1080 ---C++: return const &
1082 EnableDepthTest( me; enable : Boolean from Standard )
1085 ---Purpose: turns on/off opengl depth
1087 IsDepthTestEnabled( me ) returns Boolean from Standard
1090 ---Purpose: returns current state of the opengl depth testing
1092 ReadDepths( me; x,y,width,height: Integer from Standard;
1095 ---Purpose: Reads depths of shown pixels of the given rectangle
1097 FBOCreate( me : mutable; width,height: Integer from Standard )
1098 returns PtrFrameBuffer from Graphic3d
1101 ---Purpose: Generate offscreen FBO in the graphic library
1103 FBORelease( me : mutable;
1104 fboPtr : in out PtrFrameBuffer from Graphic3d )
1107 ---Purpose: Remove offscreen FBO from the graphic library
1109 FBOGetDimensions( me : mutable;
1110 fboPtr : PtrFrameBuffer from Graphic3d;
1111 width, height : out Integer from Standard;
1112 widthMax, heightMax : out Integer from Standard )
1115 ---Purpose: Read offscreen FBO configuration.
1117 FBOChangeViewport( me : mutable;
1118 fboPtr : in out PtrFrameBuffer from Graphic3d;
1119 width, height : Integer from Standard )
1122 ---Purpose: Change offscreen FBO viewport.
1124 BufferDump( me : mutable;
1125 theImage : in out PixMap from Image;
1126 theBufferType : BufferType from Graphic3d )
1127 returns Boolean from Standard
1130 ---Purpose: Dump active rendering buffer into specified memory buffer.
1132 EnableGLLight( me; enable : Boolean from Standard )
1135 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1137 IsGLLightEnabled( me ) returns Boolean from Standard
1140 ---Purpose: returns the current state of the gl lighting
1141 -- currently used in triedron displaying
1144 theFileName : CString from Standard;
1145 theFormat : ExportFormat from Graphic3d;
1146 theSortType : SortType from Graphic3d = Graphic3d_ST_BSP_Tree;
1147 thePrecision : Real from Standard = 0.005;
1148 theProgressBarFunc : Address from Standard = NULL;
1149 theProgressObject : Address from Standard = NULL )
1150 returns Boolean from Standard;
1152 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1153 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1154 -- Notice however that results may differ a lot and do not contain some elements.
1156 HiddenObjects (me) returns NMapOfTransient from Graphic3d is static;
1157 ---C++: return const &
1159 ---Purpose: Returns map of objects hidden within this specific view (not viewer-wise).
1161 ChangeHiddenObjects (me : mutable) returns NMapOfTransient from Graphic3d is static;
1164 ---Purpose: Returns map of objects hidden within this specific view (not viewer-wise).
1168 -- the ViewManager associated with the view
1169 myViewManager : ViewManagerPtr from Visual3d;
1171 -- the associated C structure
1172 MyCView : CView from Graphic3d;
1174 -- the context of the view : Aliasing, Depth-Cueing, Lights ...
1175 MyContext : ContextView from Visual3d;
1177 -- the associated window
1178 MyWindow : Window from Aspect;
1180 -- association Structure_COMPUTE and Structure_Computed
1181 myStructsToCompute : SequenceOfStructure from Graphic3d;
1182 myStructsComputed : SequenceOfStructure from Graphic3d;
1183 myIsInComputedMode : Boolean from Standard;
1185 -- the graphic driver used
1186 myGraphicDriver : GraphicDriver from Graphic3d;
1188 -- the background of the associated window
1189 MyBackground : Background from Aspect;
1191 -- the gradient background of the associated window
1192 MyGradientBackground : GradientBackground from Aspect;
1194 -- the displayed structures in the view
1195 myStructsDisplayed : MapOfStructure from Graphic3d;
1196 myImmediateStructures : MapOfStructure from Graphic3d;
1198 MyGTrihedron : CGraduatedTrihedron from Graphic3d;
1200 myDefaultCamera : Camera_Handle from Graphic3d;
1202 myAutoZFitIsOn : Boolean from Standard;
1203 myAutoZFitScaleFactor : Real from Standard;
1205 myStructuresUpdated : Boolean from Standard;
1207 myHiddenObjects : NMapOfTransient from Graphic3d;
1211 class ViewManager from Visual3d