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 TypeOfStructure from Graphic3d,
114 TransformError from Visual3d,
115 ViewDefinitionError from Visual3d
119 ----------------------------------------------
120 -- Summary of 3D Viewing --
122 -- To define a view, you must define --
124 -- The view orientation transformation --
125 -- The view mapping transformation --
126 -- The view representation. --
128 -- To activate a view, you must define --
130 -- The associated window. --
131 ----------------------------------------------
133 Create ( AManager : ViewManager from Visual3d )
134 returns View from Visual3d;
136 ---Purpose: Creates a view in the viewer <AManager> with a default
137 -- orientation and a default mapping.
139 ---------------------------------------------------
140 -- Category: Methods to modify the class definition
141 ---------------------------------------------------
143 Activate ( me : mutable )
145 ---Purpose: Activates the view <me>.
146 -- Map the associated window on the screen and
147 -- post the view in this window.
148 -- Category: Methods to modify the class definition
149 -- Warning: Raises ViewDefinitionError if the associated
150 -- window isn't defined.
151 raises ViewDefinitionError from Visual3d is static;
153 Deactivate ( me : mutable )
155 ---Purpose: Deactivates the view <me>.
156 -- Unmap the associated window on the screen and
157 -- unpost the view in this window.
158 -- Category: Methods to modify the class definition
159 -- Warning: Raises ViewDefinitionError if the associated
160 -- window isn't defined.
161 raises ViewDefinitionError from Visual3d is static;
163 Destroy ( me : mutable )
166 ---Purpose: Deletes and erases the view <me>.
167 ---Category: Methods to modify the class definition
170 Redraw ( me : mutable )
173 ---Purpose: Updates screen in all cases.
174 ---Category: Methods to modify the class definition
176 RedrawImmediate ( me : mutable )
179 ---Purpose: Updates layer of immediate presentations.
181 Redraw ( me : mutable; x,y,width,height: Integer from Standard )
184 ---Purpose: Updates screen area in all cases.
185 -- area is given by his xy min corner and size in pixel coordinates
186 ---Category: Methods to modify the class definition
188 Redraw ( me : mutable;
189 AnUnderLayer : Layer from Visual3d;
190 AnOverLayer : Layer from Visual3d )
193 ---Purpose: Updates screen in all cases.
194 ---Category: Methods to modify the class definition
196 RedrawImmediate ( me : mutable;
197 theUnderLayer : Layer from Visual3d;
198 theOverLayer : Layer from Visual3d )
201 ---Purpose: Updates layer of immediate presentations.
203 Invalidate ( me : mutable )
206 ---Purpose: Invalidates view content but does not redraw it.
208 Redraw ( me : mutable;
209 AnUnderLayer : Layer from Visual3d;
210 AnOverLayer : Layer from Visual3d;
211 x,y,width,height: Integer from Standard )
214 ---Purpose: Updates screen area in all cases.
215 -- area is given by his xy min corner and size in pixel coordinates
216 ---Category: Methods to modify the class definition
218 Remove ( me : mutable )
221 ---Purpose: Deletes and erases the view <me>.
222 -- Warning: No more graphic operations in <me> after this call.
223 ---Category: Methods to modify the class definition
225 Resized ( me : mutable )
227 ---Purpose: Updates the view <me> after the modification
228 -- of the associated window.
229 -- Category: Methods to modify the class definition
230 -- Warning: Raises ViewDefinitionError if the associated
231 -- window isn't defined.
232 raises ViewDefinitionError from Visual3d is static;
234 SetBackground ( me : mutable;
235 ABack : Background from Aspect )
237 ---Purpose: Modifies the default window background.
238 -- Category: Methods to modify the class definition
239 -- Warning: Raises ViewDefinitionError if the associated
240 -- window isn't defined.
241 raises ViewDefinitionError from Visual3d is static;
243 SetBackgroundImage( me : mutable; FileName : CString from Standard;
244 FillStyle : FillMethod from Aspect;
245 update : Boolean from Standard )
248 -- Category: Methods to modify the class definition
249 -- Warning: Raises ViewDefinitionError if the associated
250 -- window isn't defined.
251 raises ViewDefinitionError from Visual3d is static;
253 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
254 update : Boolean from Standard )
257 -- Category: Methods to modify the class definition
258 -- Warning: Raises ViewDefinitionError if the associated
259 -- window isn't defined.
260 raises ViewDefinitionError from Visual3d is static;
262 SetGradientBackground ( me : mutable;
263 ABack : GradientBackground from Aspect;
264 update : Boolean from Standard )
266 ---Purpose: Modifies the gradient window background.
267 -- Category: Methods to modify the class definition
268 -- Warning: Raises ViewDefinitionError if the associated
269 -- window isn't defined.
270 raises ViewDefinitionError from Visual3d is static;
272 SetBgGradientStyle( me : mutable;
273 FillStyle : GradientFillMethod from Aspect;
274 update : Boolean from Standard )
277 -- Category: Methods to modify the class definition
278 -- Warning: Raises ViewDefinitionError if the associated
279 -- window isn't defined.
280 raises ViewDefinitionError from Visual3d is static;
282 SetBackFacingModel ( me : mutable;
283 aModel : TypeOfBackfacingModel from Visual3d
286 ---Purpose : Manages display of the back faces
288 BackFacingModel ( me )
289 returns TypeOfBackfacingModel from Visual3d is static;
291 ---Purpose : Returns current state of the back faces display
293 SetContext ( me : mutable;
294 CTX : ContextView from Visual3d )
297 ---Purpose: Sets the context <CTX> in the view <me>.
298 ---Category: Methods to modify the class definition
300 SetViewMappingDefault ( me : mutable )
303 ---Purpose: Saves the current mapping which will be the
304 -- reference value for the reset of the mapping
305 -- done by the ViewmappingReset method.
306 ---Category: Methods to modify the class definition
308 SetViewOrientationDefault ( me : mutable )
311 ---Purpose: Saves the current orientation which will be the
312 -- reference value for the reset of the orientation
313 -- done by the ViewOrientationReset method.
314 ---Category: Methods to modify the class definition
316 SetWindow ( me : mutable;
317 AWindow : Window from Aspect )
319 ---Purpose: Associates the window <AWindow> to the view <me>.
320 -- No new association if the window is already defined.
321 -- Category: Methods to modify the class definition
322 -- Warning: Raises ViewDefinitionError if it is impossible
323 -- to associate a view and a window.
324 -- (association already done or another problem)
325 -- Modifies the viewmapping of the associated view
326 -- when it calls the SetRatio method.
327 raises ViewDefinitionError from Visual3d is static;
329 -- After this call, each view is mapped in an unique window.
331 -- Programming example :
333 -- An example when we have 1 view and 1 window
334 -- -------------------------------------------
336 -- Handle(Aspect_DisplayConnection) aDisplayConnection;
338 -- // Display connection initialization only needed on Linux platform
339 -- // and on Mac OS X, in cases when you use Xlib for windows drawing.
340 -- aDisplayConnection = new Aspect_DisplayConnection();
342 -- // Graphic driver initialization
343 -- Handle(Graphic3d_GraphicDriver) aGraphicDriver =
344 -- Graphic3d::InitGraphicDriver (aDisplayConnection);
346 -- // Define a view manager
347 -- Handle(Visual3d_ViewManager) aVisualManager = new Visual3d_ViewManager (aGraphicDriver);
350 -- Handle(Visual3d_View) aView = new Visual3d_View (aVisaulManager);
352 -- // Define a window
353 -- Handle(Xw_Window) aWindow = new Xw_Window
354 -- (aDisplayConnection, "Graphic View 1", 0.695, 0.695, 0.600, 0.600, Quantity_NOC_MATRAGRAY);
356 -- // Associate the view and the window
357 -- aView->SetWindow (aWindow);
362 -- // Activate the view
363 -- aView->Activate ();
366 SetWindow ( me : mutable;
367 AWindow : Window from Aspect;
368 AContext: RenderingContext from Aspect;
369 ADisplayCB: GraphicCallbackProc from Aspect;
370 AClientData: Address from Standard
373 ---Purpose: Associates the window <AWindow> and context <AContext>
375 -- If <AContext> is not NULL the graphic context is used
376 -- directly to draw something in this view.
377 -- Otherwise an internal context is created.
378 -- If <ADisplayCB> is not NULL then a user display CB is
379 -- call at the end of the OCC graphic traversal and just
380 -- before the swap of buffers. The <aClientData> is pass
381 -- to this call back.
382 -- No new association if the window is already defined.
383 -- Category: Methods to modify the class definition
384 -- Warning: Raises ViewDefinitionError if it is impossible
385 -- to associate a view and a window.
386 -- (association already done or another problem)
387 -- Modifies the viewmapping of the associated view
388 -- when it calls the SetRatio method.
389 raises ViewDefinitionError from Visual3d is static;
391 -- After this call, each view is mapped in an unique window.
393 Update ( me : mutable;
394 theUpdateMode : TypeOfUpdate from Aspect )
397 ---Purpose: Updates screen in function of modifications of
399 ---Category: Methods to modify the class definition
401 Update ( me : mutable;
402 AnUnderLayer : Layer from Visual3d;
403 AnOverLayer : Layer from Visual3d )
406 ---Purpose: Updates screen in function of modifications of
408 ---Category: Methods to modify the class definition
410 SetAutoZFitMode (me : mutable;
412 theScaleFactor : Real from Standard = 1.0);
414 ---Purpose: Sets the automatic z-fit mode and its parameters.
415 -- The auto z-fit has extra parameters which can controlled from application level
416 -- to ensure that the size of viewing volume will be sufficiently large to cover
417 -- the depth of unmanaged objects, for example, transformation persistent ones.
418 -- @param theScaleFactor [in] the scale factor for Z-range.
419 -- The range between Z-min, Z-max projection volume planes
420 -- evaluated by z fitting method will be scaled using this coefficient.
421 -- Program error exception is thrown if negative or zero value
424 AutoZFitMode (me) returns Boolean;
426 ---Purpose: returns TRUE if automatic z-fit mode is turned on.
428 AutoZFitScaleFactor (me) returns Real from Standard;
430 ---Purpose: returns scale factor parameter of automatic z-fit mode.
432 AutoZFit (me : mutable);
434 ---Purpose: If automatic z-range fitting is turned on, adjusts Z-min and Z-max
435 -- projection volume planes with call to ZFitAll.
437 ZFitAll (me : mutable; theScaleFactor : Real from Standard = 1.0);
439 ---Purpose: Change Z-min and Z-max planes of projection volume to match the
440 -- displayed objects.
442 ViewMappingReset ( me : mutable )
445 ---Purpose: Sets the value of the mapping to be the same as
446 -- the mapping saved by the SetViewMappingDefaut method.
447 ---Category: Methods to modify the class definition
449 ViewOrientationReset ( me : mutable )
452 ---Purpose: Sets the value of the orientation to be the same as the
453 -- orientation saved by the SetViewOrientationDefaut method.
454 ---Category: Methods to modify the class definition
456 SetComputedMode ( me : mutable; aMode : Boolean from Standard ) is static;
458 ---Purpose: Switches computed HLR mode in the view
459 ---Category: Methods to modify the class definition
461 ComputedMode ( me ) returns Boolean from Standard is static;
463 ---Purpose: Returns the computed HLR mode state
464 ---Category: Inquire methods
466 ---------------------------------------------------
467 -- Category: Methods to modify the class definition
469 ---------------------------------------------------
471 ZBufferTriedronSetup ( me : mutable;
472 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
473 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
474 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
475 SizeRatio : Real from Standard = 0.8;
476 AxisDiametr : Real from Standard = 0.05;
477 NbFacettes : Integer from Standard = 12)
480 ---Purpose: Customization of the ZBUFFER Triedron.
481 --- Initializes Colors of X Y and axis
482 --- Scale ratio defines decreasing of trihedron size when
483 --- its position is out of a View
485 TriedronDisplay ( me : mutable;
486 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
487 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
488 AScale : Real from Standard = 0.02;
489 AsWireframe : Boolean from Standard = Standard_True )
492 ---Purpose: Display of the Triedron.
493 --- Initialize position, color and length of Triedron axes.
494 --- The scale is a percent of the window width.
495 --- If AsWireframe is FALSE triedron is shown in shaded mode
496 --- AColor is not considered for ZBUFFER mode
499 TriedronErase ( me : mutable )
502 ---Purpose: Erases the Triedron.
505 TriedronEcho ( me : mutable;
506 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
509 ---Purpose: Highlights the echo zone of the Triedron.
512 ------------------------------------------
513 ---Category: Graduated trihedron
514 ------------------------------------------
516 GetGraduatedTrihedron(me;
518 xname, yname, zname : out ExtendedString from TCollection;
520 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
522 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
524 drawgrid : out Boolean from Standard;
526 drawaxes : out Boolean from Standard;
527 -- Number of splits along axes --
528 nbx, nby, nbz : out Integer from Standard;
529 -- Offset for drawing values --
530 xoffset, yoffset, zoffset : out Integer from Standard;
531 -- Offset for drawing names of axes --
532 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
534 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
535 -- Length of tickmarks --
536 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
538 gridcolor : out Color from Quantity;
539 -- Colors of axis names --
540 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
541 -- Colors of axis and values --
542 xcolor, ycolor, zcolor : out Color from Quantity;
543 -- Name of font for names of axes --
544 fontOfNames : out AsciiString from TCollection;
545 -- Style of names of axes --
546 styleOfNames : out FontAspect from Font;
547 -- Size of names of axes --
548 sizeOfNames : out Integer from Standard;
549 -- Name of font for values --
550 fontOfValues : out AsciiString from TCollection;
551 -- Style of values --
552 styleOfValues : out FontAspect from Font;
554 sizeOfValues : out Integer from Standard)
555 returns Boolean from Standard
557 ---Purpose: Returns data of a graduated trihedron if displayed (return value is True)
559 GraduatedTrihedronDisplay(me : mutable;
561 xname, yname, zname : ExtendedString from TCollection;
563 xdrawname, ydrawname, zdrawname : Boolean from Standard;
565 xdrawvalues, ydrawvalues, zdrawvalues : Boolean from Standard;
567 drawgrid : Boolean from Standard;
569 drawaxes : Boolean from Standard;
570 -- Number of splits along axes --
571 nbx, nby, nbz : Integer from Standard;
572 -- Offset for drawing values --
573 xoffset, yoffset, zoffset : Integer from Standard;
574 -- Offset for drawing names of axes --
575 xaxisoffset, yaxisoffset, zaxisoffset : Integer from Standard;
577 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : Boolean from Standard;
578 -- Length of tickmarks --
579 xtickmarklength, ytickmarklength, ztickmarklength : Integer from Standard;
581 gridcolor : Color from Quantity;
582 -- Colors of axis names --
583 xnamecolor, ynamecolor, znamecolor : Color from Quantity;
584 -- Colors of axis and values --
585 xcolor, ycolor, zcolor : Color from Quantity;
586 -- Name of font for names of axes --
587 fontOfNames : AsciiString from TCollection;
588 -- Style of names of axes --
589 styleOfNames : FontAspect from Font;
590 -- Size of names of axes --
591 sizeOfNames : Integer from Standard;
592 -- Name of font for values --
593 fontOfValues : AsciiString from TCollection;
594 -- Style of values --
595 styleOfValues : FontAspect from Font;
597 sizeOfValues : Integer from Standard)
598 ---Purpose: Displays a graduated trihedron.
601 GraduatedTrihedronErase(me : mutable)
602 ---Purpose: Erases a graduated trihedron from the view.
605 ----------------------------
606 ---Category: Inquire methods
607 ----------------------------
610 returns Background from Aspect
613 ---Purpose: Returns the value of the default window background.
615 GradientBackground ( me )
616 returns GradientBackground from Aspect
619 ---Purpose: Returns the value of the window background.
622 returns Boolean from Standard
625 ---Purpose: Returns Standard_True if one of the structures
626 -- displayed in the view <me> contains Polygons,
627 -- Triangles or Quadrangles.
630 ASet : MapOfStructure from Graphic3d )
631 returns Boolean from Standard
634 ---Purpose: Returns Standard_True if one of the structures
635 -- in the set <ASet> contains Polygons, Triangles
639 returns ContextView from Visual3d
642 ---Purpose: Returns the current context of the view <me>.
643 ---C++: return const &
645 DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d )
648 ---Purpose: Returns the set of structures displayed in
652 returns Boolean from Standard
655 ---Purpose: Returns the activity flag of the view <me>.
658 returns Boolean from Standard
661 ---Purpose: Returns True if the window associated to the view
665 returns Boolean from Standard
668 ---Purpose: Returns Standard_True is the view <me> is deleted.
669 -- <me> is deleted after the call Remove (me).
670 ---Category: Inquire methods
673 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
677 ---Purpose: Returns the coordinates of the boundary box of all
678 -- structures displayed in the view <me>.
679 -- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
680 -- also includes minimum and maximum limits of graphical elements
681 -- forming parts of infinite structures.
684 theSet : MapOfStructure from Graphic3d;
685 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
689 ---Purpose: Returns the coordinates of the boundary box of all
690 -- structures in the set <theSet>.
691 -- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
692 -- also includes minimum and maximum limits of graphical elements
693 -- forming parts of infinite structures.
695 NumberOfDisplayedStructures ( me )
696 returns Integer from Standard
699 ---Purpose: Returns number of displayed structures in
703 AX, AY, AZ : Real from Standard;
704 APX, APY, APZ : out Real from Standard )
707 ---Purpose: Returns the coordinates of the projection of the
708 -- 3d coordinates <AX>, <AY>, <AZ>.
711 returns Camera_Handle from Graphic3d
714 ---Purpose: @return the default camera of <me>.
715 ---C++: return const &
718 returns Camera_Handle from Graphic3d
721 ---Purpose: @return the camera of <me>.
722 ---C++: return const &
724 SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
726 ---Purpose: Set camera object to provide orientation and projection matrices
727 -- for graphic driver.
730 returns Window from Aspect
732 ---Purpose: Returns the window associated to the view <me>.
733 -- Warning: Raises ViewDefinitionError if the associated
734 -- window isn't defined.
735 raises ViewDefinitionError from Visual3d is static;
737 LightLimit ( me ) returns Integer is static;
739 ---Purpose: Returns the MAX number of light associated to the view <me>.
741 PlaneLimit ( me ) returns Integer is static;
743 ---Purpose: Returns the MAX number of clipping planes
744 -- associated to the view <me>.
746 ViewManager ( me ) returns ViewManager from Visual3d is static;
748 ---Purpose: Returns the view manager handle which manage this view
750 ----------------------------
751 -- Category: Private methods
752 ----------------------------
755 theStructType : TypeOfStructure from Graphic3d )
756 returns TypeOfAnswer from Visual3d
759 ---Purpose: Is it possible to display the structure in the view?
761 ReCompute ( me : mutable;
762 AStructure : Structure from Graphic3d );
764 ---Purpose: Computes the new presentation of the
765 -- structure <AStructure> displayed in <me>
766 -- with the type Graphic3d_TOS_COMPUTED.
767 ---Category: Private methods
769 Compute ( me : mutable ) is static private;
771 ---Purpose: Computes the new presentation of the
772 -- Structures displayed in <me> with the type
773 -- Graphic3d_TOS_COMPUTED.
774 ---Category: Private methods
776 ChangeDisplayPriority ( me : mutable;
777 AStructure : Structure from Graphic3d;
778 OldPriority : Integer from Standard;
779 NewPriority : Integer from Standard )
782 ---Purpose: Changes the display priority of the structure <AStructure>.
783 ---Category: Private methods
786 SetZLayerSettings ( me : mutable;
787 theLayerId : ZLayerId from Graphic3d;
788 theSettings : ZLayerSettings from Graphic3d )
790 ---Purpose: Sets the settings for a single Z layer of specified view.
792 AddZLayer ( me : mutable;
793 theLayerId : ZLayerId from Graphic3d )
795 ---Purpose: Add a new top-level Z layer to the view with ID
796 -- <theLayerId>. The z layer mechanism allows to display
797 -- structures in higher layers in overlay of structures in lower layers.
798 -- The layers in a particular view should be managed centrally
799 -- by its view manager so to avoid IDs mismatching and provide correct
800 -- display of graphics in all views.
802 RemoveZLayer ( me : mutable;
803 theLayerId : ZLayerId from Graphic3d )
805 ---Purpose: Remove z layer from the view by its ID.
807 ChangeZLayer ( me : mutable;
808 theStructure : Structure from Graphic3d;
809 theLayerId : ZLayerId from Graphic3d )
811 ---Purpose: Change Z layer of already displayed structure in the view.
813 Clear ( me : mutable;
814 AStructure : Structure from Graphic3d;
815 WithDestruction : Boolean from Standard )
818 ---Purpose: Clears the structure <AStructure> to the view <me>.
819 ---Category: Private methods
821 Connect ( me : mutable;
822 AMother : Structure from Graphic3d;
823 ADaughter : Structure from Graphic3d )
826 ---Purpose: Connects the structures <AMother> and <ADaughter>.
827 ---Category: Private methods
829 Disconnect ( me : mutable;
830 AMother : Structure from Graphic3d;
831 ADaughter : Structure from Graphic3d )
834 ---Purpose: Disconnects the structures <AMother> and <ADaughter>.
835 ---Category: Private methods
837 Display ( me : mutable;
838 AStructure : Structure from Graphic3d )
841 ---Purpose: Display the structure <AStructure> to the view <me>.
842 ---Category: Private methods
844 Display ( me : mutable;
845 AStructure : Structure from Graphic3d;
846 AnUpdateMode : TypeOfUpdate from Aspect )
849 ---Purpose: Display the structure <AStructure> to the view <me>.
850 ---Category: Private methods
852 DisplayImmediate ( me : mutable;
853 theStructure : Structure from Graphic3d;
854 theIsSingleView : Boolean from Standard = Standard_True)
855 returns Boolean from Standard
858 ---Purpose: Add structure to the list of immediate presentations.
859 -- @return true if structure has not been registered in this view
861 EraseImmediate ( me : mutable;
862 theStructure : Structure from Graphic3d )
863 returns Boolean from Standard
866 ---Purpose: Removes the structure from the list of immediate presentations.
867 -- @return true if structure has been registered in view
869 ClearImmediate ( me : mutable )
870 returns Boolean from Standard
873 ---Purpose: Clears list of immediate presentations.
874 -- @return true if list was not empty
876 Erase ( me : mutable;
877 AStructure : Structure from Graphic3d )
880 ---Purpose: Erases the structure <AStructure> from the view <me>.
881 ---Category: Private methods
883 Erase ( me : mutable;
884 AStructure : Structure from Graphic3d;
885 AnUpdateMode : TypeOfUpdate from Aspect )
888 ---Purpose: Erases the structure <AStructure> from the view <me>.
889 ---Category: Private methods
891 Highlight ( me : mutable;
892 AStructure : Structure from Graphic3d;
893 AMethod : TypeOfHighlightMethod from Aspect )
896 ---Purpose: Highlights the structure <AStructure> in the view <me>.
897 ---Category: Private methods
899 SetTransform ( me : mutable;
900 AStructure : Structure from Graphic3d;
901 ATrsf : Array2OfReal from TColStd )
904 ---Purpose: Transforms the structure <AStructure> in the view <me>.
905 ---Category: Private methods
907 UnHighlight ( me : mutable;
908 AStructure : Structure from Graphic3d )
911 ---Purpose: Suppress the highlighting on the structure <AStructure>
913 ---Category: Private methods
916 AStructure : Structure from Graphic3d )
917 returns Integer from Standard
920 ---Purpose: Returns an index != 0 if the structure <AStructure>
921 -- have another structure computed for the view <me>.
922 ---Category: Private methods
924 Identification ( me )
925 returns Integer from Standard
928 ---Purpose: Returns the identification number of the view <me>.
929 ---Category: Private methods
932 AStructure : Structure from Graphic3d )
933 returns Boolean from Standard
936 ---Purpose: Returns true if the structure <AStructure> is
937 -- displayed in the view <me>.
938 ---Category: Private methods
940 SetRatio ( me : mutable )
943 ---Purpose: Modifies the aspect ratio of the view <me> when the
944 -- associated window is defined or resized.
945 ---Category: Private methods
947 UpdateLights ( me : mutable )
950 ---Purpose: Updates the lights when the associated window is defined
951 -- and when the view is activated.
952 ---Category: Private methods
954 UpdatePlanes ( me : mutable )
957 ---Purpose: Updates the planes when the associated window is defined
958 -- and when the view is activated.
959 ---Category: Private methods
961 UpdateView ( me : mutable )
964 ---Purpose: Updates the associated c structure before a call to the
966 ---Category: Private methods
968 -----------------------------
969 -- Category: Internal methods
970 -----------------------------
973 returns Address from Standard
976 ---Purpose: Returns the c structure associated to <me>.
977 ---Category: Private methods
980 returns GraphicDriver from Graphic3d
983 ---Purpose: Returns the associated GraphicDriver.
984 ---Category: Internal methods
985 ---C++: return const &
987 HaveTheSameOwner ( me;
988 AStructure : Structure from Graphic3d )
989 returns Integer from Standard
992 ---Purpose: Returns an index != 0 if the structure <AStructure>
993 -- have the same owner than another structure in the
994 -- sequence of the computed structures.
995 ---Category: Private methods
997 Print (me; AnUnderLayer : Layer from Visual3d;
998 AnOverLayer : Layer from Visual3d;
999 hPrnDC : Handle from Aspect;
1000 showBackground : Boolean;
1002 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1003 theScaleFactor : Real from Standard = 1.0)
1004 returns Boolean from Standard is static;
1007 ---Purpose: print the contents of all layers of the view to the printer.
1008 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1009 -- <showBackground> : When set to FALSE then print the view without background color
1010 -- (background is white)
1011 -- else set to TRUE for printing with current background color.
1012 -- <filename>: If != NULL, then the view will be printed to a file.
1013 -- <printAlgo>: Select print algorithm: stretch, tile.
1014 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1015 -- printings accordingly to the scale factor selected in the printer
1016 -- properties dialog.
1017 -- Returns Standard_True if the data is passed to the printer, otherwise
1018 -- Standard_False if the print operation failed due to printer error
1019 -- or insufficient memory.
1020 -- Warning: Works only under Windows.
1022 Print (me; hPrnDC : Handle from Aspect;
1023 showBackground : Boolean;
1025 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1026 theScaleFactor : Real from Standard = 1.0 )
1027 returns Boolean from Standard is static;
1030 ---Purpose: print the contents of the view to printer.
1031 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1032 -- <showBackground> : When set to FALSE then print the view without background color
1033 -- (background is white)
1034 -- else set to TRUE for printing with current background color.
1035 -- <filename>: If != NULL, then the view will be printed to a file.
1036 -- <printAlgo>: Select print algorithm: stretch, tile.
1037 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1038 -- printings accordingly to the scale factor selected in the printer
1039 -- properties dialog.
1040 -- Returns Standard_True if the data is passed to the printer, otherwise
1041 -- Standard_False if the print operation failed due to printer error
1042 -- or insufficient memory.
1043 -- Warning: Works only under Windows.
1045 ZBufferIsActivated ( me )
1046 returns Boolean from Standard
1049 ---Purpose: Returns Standard_True if the ZBuffer is activated
1050 -- in the view <me> and Standard_False if not.
1051 ---Category: Internal methods
1053 SetZBufferActivity ( me : mutable; AnActivity : Integer from Standard )
1056 ---Purpose: Activates the ZBuffer if the integer <AnActivity>
1058 -- Deactivates the ZBuffer if the integer <AnActivity>
1060 -- If the integer <AnActivity> is equal to -1 then
1061 -- - the ZBuffer is activated if
1062 -- me->Context ().Visualization () == Visual3d_TOV_SHADING
1063 -- - the ZBuffer is deactivated if
1064 -- me->Context ().Visualization () == Visual3d_TOV_WIREFRAME
1065 ---Category: Internal methods
1068 returns Layer from Visual3d;
1070 ---Purpose: Returns the underlay of the view <me>.
1071 ---Category: Private methods
1072 ---C++: return const &
1075 returns Layer from Visual3d;
1077 ---Purpose: Returns the underlay of the view <me>.
1078 ---Category: Private methods
1079 ---C++: return const &
1081 EnableDepthTest( me; enable : Boolean from Standard )
1084 ---Purpose: turns on/off opengl depth
1086 IsDepthTestEnabled( me ) returns Boolean from Standard
1089 ---Purpose: returns current state of the opengl depth testing
1091 ReadDepths( me; x,y,width,height: Integer from Standard;
1094 ---Purpose: Reads depths of shown pixels of the given rectangle
1096 FBOCreate( me : mutable; width,height: Integer from Standard )
1097 returns PtrFrameBuffer from Graphic3d
1100 ---Purpose: Generate offscreen FBO in the graphic library
1102 FBORelease( me : mutable;
1103 fboPtr : in out PtrFrameBuffer from Graphic3d )
1106 ---Purpose: Remove offscreen FBO from the graphic library
1108 FBOGetDimensions( me : mutable;
1109 fboPtr : PtrFrameBuffer from Graphic3d;
1110 width, height : out Integer from Standard;
1111 widthMax, heightMax : out Integer from Standard )
1114 ---Purpose: Read offscreen FBO configuration.
1116 FBOChangeViewport( me : mutable;
1117 fboPtr : in out PtrFrameBuffer from Graphic3d;
1118 width, height : Integer from Standard )
1121 ---Purpose: Change offscreen FBO viewport.
1123 BufferDump( me : mutable;
1124 theImage : in out PixMap from Image;
1125 theBufferType : BufferType from Graphic3d )
1126 returns Boolean from Standard
1129 ---Purpose: Dump active rendering buffer into specified memory buffer.
1131 EnableGLLight( me; enable : Boolean from Standard )
1134 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1136 IsGLLightEnabled( me ) returns Boolean from Standard
1139 ---Purpose: returns the current state of the gl lighting
1140 -- currently used in triedron displaying
1143 theFileName : CString from Standard;
1144 theFormat : ExportFormat from Graphic3d;
1145 theSortType : SortType from Graphic3d = Graphic3d_ST_BSP_Tree;
1146 thePrecision : Real from Standard = 0.005;
1147 theProgressBarFunc : Address from Standard = NULL;
1148 theProgressObject : Address from Standard = NULL )
1149 returns Boolean from Standard;
1151 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1152 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1153 -- Notice however that results may differ a lot and do not contain some elements.
1157 -- the ViewManager associated with the view
1158 myViewManager : ViewManagerPtr from Visual3d;
1160 -- the associated C structure
1161 MyCView : CView from Graphic3d;
1163 -- the context of the view : Aliasing, Depth-Cueing, Lights ...
1164 MyContext : ContextView from Visual3d;
1166 -- the associated window
1167 MyWindow : Window from Aspect;
1169 -- association Structure_COMPUTE and Structure_Computed
1170 myStructsToCompute : SequenceOfStructure from Graphic3d;
1171 myStructsComputed : SequenceOfStructure from Graphic3d;
1172 myIsInComputedMode : Boolean from Standard;
1174 -- the graphic driver used
1175 myGraphicDriver : GraphicDriver from Graphic3d;
1177 -- the background of the associated window
1178 MyBackground : Background from Aspect;
1180 -- the gradient background of the associated window
1181 MyGradientBackground : GradientBackground from Aspect;
1183 -- the displayed structures in the view
1184 myStructsDisplayed : MapOfStructure from Graphic3d;
1185 myImmediateStructures : MapOfStructure from Graphic3d;
1187 MyGTrihedron : CGraduatedTrihedron from Graphic3d;
1189 myDefaultCamera : Camera_Handle from Graphic3d;
1191 myAutoZFitIsOn : Boolean from Standard;
1192 myAutoZFitScaleFactor : Real from Standard;
1194 myStructuresUpdated : Boolean from Standard;
1198 class ViewManager from Visual3d