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 -- 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
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.
32 -- 30-04-02: JMB; MyDisplayedStructure is now a Map instead
33 -- of a Set. Improves performance of Selection
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
41 class View from Visual3d inherits DataStructureManager from Graphic3d
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.
63 Array2OfReal from TColStd,
65 Background from Aspect,
66 GradientBackground from Aspect,
68 TypeOfUpdate from Aspect,
69 TypeOfHighlightMethod from Aspect,
70 TypeOfTriedronEcho from Aspect,
71 TypeOfTriedronPosition from Aspect,
73 RenderingContext from Aspect,
74 GraphicCallbackProc from Aspect,
75 ColorScale from Aspect,
76 PrintAlgo from Aspect,
78 BufferType from Graphic3d,
79 CBitFields8 from Graphic3d,
81 GraphicDriver from Graphic3d,
82 PtrFrameBuffer from Graphic3d,
83 Structure from Graphic3d,
84 SequenceOfStructure from Graphic3d,
85 MapOfStructure from Graphic3d,
86 Camera_Handle from Graphic3d,
88 ZLayerId from Graphic3d,
89 ZLayerSettings from Graphic3d,
91 ContextView from Visual3d,
94 SequenceOfLight from Visual3d,
95 TypeOfAnswer from Visual3d,
96 ViewManager from Visual3d,
97 ViewManagerPtr from Visual3d,
99 TypeOfBackfacingModel from Visual3d,
101 NameOfColor from Quantity,
102 FillMethod from Aspect,
103 GradientFillMethod from Aspect,
104 ExportFormat from Graphic3d,
105 SortType from Graphic3d,
107 FontAspect from Font,
108 AsciiString from TCollection,
109 ExtendedString from TCollection,
110 CGraduatedTrihedron from Graphic3d,
111 TypeOfStructure from Graphic3d,
117 TransformError from Visual3d,
118 ViewDefinitionError from Visual3d
122 ----------------------------------------------
123 -- Summary of 3D Viewing --
125 -- To define a view, you must define --
127 -- The view orientation transformation --
128 -- The view mapping transformation --
129 -- The view representation. --
131 -- To activate a view, you must define --
133 -- The associated window. --
134 ----------------------------------------------
136 Create ( AManager : ViewManager from Visual3d )
137 returns View from Visual3d;
139 ---Purpose: Creates a view in the viewer <AManager> with a default
140 -- orientation and a default mapping.
142 ---------------------------------------------------
143 -- Category: Methods to modify the class definition
144 ---------------------------------------------------
146 Activate ( me : mutable )
148 ---Purpose: Activates the view <me>.
149 -- Map the associated window on the screen and
150 -- post the view in this window.
151 -- Category: Methods to modify the class definition
152 -- Warning: Raises ViewDefinitionError if the associated
153 -- window isn't defined.
154 raises ViewDefinitionError from Visual3d is static;
156 Deactivate ( me : mutable )
158 ---Purpose: Deactivates the view <me>.
159 -- Unmap the associated window on the screen and
160 -- unpost the view in this window.
161 -- Category: Methods to modify the class definition
162 -- Warning: Raises ViewDefinitionError if the associated
163 -- window isn't defined.
164 raises ViewDefinitionError from Visual3d is static;
166 Destroy ( me : mutable )
169 ---Purpose: Deletes and erases the view <me>.
170 ---Category: Methods to modify the class definition
173 Redraw ( me : mutable )
176 ---Purpose: Updates screen in all cases.
177 ---Category: Methods to modify the class definition
179 RedrawImmediate ( me : mutable )
182 ---Purpose: Updates layer of immediate presentations.
184 Redraw ( me : mutable; x,y,width,height: Integer from Standard )
187 ---Purpose: Updates screen area in all cases.
188 -- area is given by his xy min corner and size in pixel coordinates
189 ---Category: Methods to modify the class definition
191 Redraw ( me : mutable;
192 AnUnderLayer : Layer from Visual3d;
193 AnOverLayer : Layer from Visual3d )
196 ---Purpose: Updates screen in all cases.
197 ---Category: Methods to modify the class definition
199 RedrawImmediate ( me : mutable;
200 theUnderLayer : Layer from Visual3d;
201 theOverLayer : Layer from Visual3d )
204 ---Purpose: Updates layer of immediate presentations.
206 Invalidate ( me : mutable )
209 ---Purpose: Invalidates view content but does not redraw it.
211 Redraw ( me : mutable;
212 AnUnderLayer : Layer from Visual3d;
213 AnOverLayer : Layer from Visual3d;
214 x,y,width,height: Integer from Standard )
217 ---Purpose: Updates screen area in all cases.
218 -- area is given by his xy min corner and size in pixel coordinates
219 ---Category: Methods to modify the class definition
221 Remove ( me : mutable )
224 ---Purpose: Deletes and erases the view <me>.
225 -- Warning: No more graphic operations in <me> after this call.
226 ---Category: Methods to modify the class definition
228 Resized ( me : mutable )
230 ---Purpose: Updates the view <me> after the modification
231 -- of the associated window.
232 -- Category: Methods to modify the class definition
233 -- Warning: Raises ViewDefinitionError if the associated
234 -- window isn't defined.
235 raises ViewDefinitionError from Visual3d is static;
237 SetBackground ( me : mutable;
238 ABack : Background from Aspect )
240 ---Purpose: Modifies the default window background.
241 -- Category: Methods to modify the class definition
242 -- Warning: Raises ViewDefinitionError if the associated
243 -- window isn't defined.
244 raises ViewDefinitionError from Visual3d is static;
246 SetBackgroundImage( me : mutable; FileName : CString from Standard;
247 FillStyle : FillMethod from Aspect;
248 update : Boolean from Standard )
251 -- Category: Methods to modify the class definition
252 -- Warning: Raises ViewDefinitionError if the associated
253 -- window isn't defined.
254 raises ViewDefinitionError from Visual3d is static;
256 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
257 update : Boolean from Standard )
260 -- Category: Methods to modify the class definition
261 -- Warning: Raises ViewDefinitionError if the associated
262 -- window isn't defined.
263 raises ViewDefinitionError from Visual3d is static;
265 SetGradientBackground ( me : mutable;
266 ABack : GradientBackground from Aspect;
267 update : Boolean from Standard )
269 ---Purpose: Modifies the gradient window background.
270 -- Category: Methods to modify the class definition
271 -- Warning: Raises ViewDefinitionError if the associated
272 -- window isn't defined.
273 raises ViewDefinitionError from Visual3d is static;
275 SetBgGradientStyle( me : mutable;
276 FillStyle : GradientFillMethod from Aspect;
277 update : Boolean from Standard )
280 -- Category: Methods to modify the class definition
281 -- Warning: Raises ViewDefinitionError if the associated
282 -- window isn't defined.
283 raises ViewDefinitionError from Visual3d is static;
285 SetBackFacingModel ( me : mutable;
286 aModel : TypeOfBackfacingModel from Visual3d
289 ---Purpose : Manages display of the back faces
291 BackFacingModel ( me )
292 returns TypeOfBackfacingModel from Visual3d is static;
294 ---Purpose : Returns current state of the back faces display
296 SetContext ( me : mutable;
297 CTX : ContextView from Visual3d )
300 ---Purpose: Sets the context <CTX> in the view <me>.
301 ---Category: Methods to modify the class definition
303 SetViewMappingDefault ( me : mutable )
306 ---Purpose: Saves the current mapping which will be the
307 -- reference value for the reset of the mapping
308 -- done by the ViewmappingReset method.
309 ---Category: Methods to modify the class definition
311 SetViewOrientationDefault ( me : mutable )
314 ---Purpose: Saves the current orientation which will be the
315 -- reference value for the reset of the orientation
316 -- done by the ViewOrientationReset method.
317 ---Category: Methods to modify the class definition
319 SetWindow ( me : mutable;
320 AWindow : Window from Aspect )
322 ---Purpose: Associates the window <AWindow> to the view <me>.
323 -- No new association if the window is already defined.
324 -- Category: Methods to modify the class definition
325 -- Warning: Raises ViewDefinitionError if it is impossible
326 -- to associate a view and a window.
327 -- (association already done or another problem)
328 -- Modifies the viewmapping of the associated view
329 -- when it calls the SetRatio method.
330 raises ViewDefinitionError from Visual3d is static;
332 -- After this call, each view is mapped in an unique window.
334 -- Programming example :
336 -- An example when we have 1 view and 1 window
337 -- -------------------------------------------
339 -- Handle(Aspect_DisplayConnection) aDisplayConnection;
341 -- // Display connection initialization only needed on Linux platform
342 -- // and on Mac OS X, in cases when you use Xlib for windows drawing.
343 -- aDisplayConnection = new Aspect_DisplayConnection();
345 -- // Graphic driver initialization
346 -- Handle(Graphic3d_GraphicDriver) aGraphicDriver =
347 -- Graphic3d::InitGraphicDriver (aDisplayConnection);
349 -- // Define a view manager
350 -- Handle(Visual3d_ViewManager) aVisualManager = new Visual3d_ViewManager (aGraphicDriver);
353 -- Handle(Visual3d_View) aView = new Visual3d_View (aVisaulManager);
355 -- // Define a window
356 -- Handle(Xw_Window) aWindow = new Xw_Window
357 -- (aDisplayConnection, "Graphic View 1", 0.695, 0.695, 0.600, 0.600, Quantity_NOC_MATRAGRAY);
359 -- // Associate the view and the window
360 -- aView->SetWindow (aWindow);
365 -- // Activate the view
366 -- aView->Activate ();
369 SetWindow ( me : mutable;
370 AWindow : Window from Aspect;
371 AContext: RenderingContext from Aspect;
372 ADisplayCB: GraphicCallbackProc from Aspect;
373 AClientData: Address from Standard
376 ---Purpose: Associates the window <AWindow> and context <AContext>
378 -- If <AContext> is not NULL the graphic context is used
379 -- directly to draw something in this view.
380 -- Otherwise an internal context is created.
381 -- If <ADisplayCB> is not NULL then a user display CB is
382 -- call at the end of the OCC graphic traversal and just
383 -- before the swap of buffers. The <aClientData> is pass
384 -- to this call back.
385 -- No new association if the window is already defined.
386 -- Category: Methods to modify the class definition
387 -- Warning: Raises ViewDefinitionError if it is impossible
388 -- to associate a view and a window.
389 -- (association already done or another problem)
390 -- Modifies the viewmapping of the associated view
391 -- when it calls the SetRatio method.
392 raises ViewDefinitionError from Visual3d is static;
394 -- After this call, each view is mapped in an unique window.
396 Update ( me : mutable;
397 theUpdateMode : TypeOfUpdate from Aspect )
400 ---Purpose: Updates screen in function of modifications of
402 ---Category: Methods to modify the class definition
404 Update ( me : mutable;
405 AnUnderLayer : Layer from Visual3d;
406 AnOverLayer : Layer from Visual3d )
409 ---Purpose: Updates screen in function of modifications of
411 ---Category: Methods to modify the class definition
413 SetAutoZFitMode (me : mutable;
415 theScaleFactor : Real from Standard = 1.0);
417 ---Purpose: Sets the automatic z-fit mode and its parameters.
418 -- The auto z-fit has extra parameters which can controlled from application level
419 -- to ensure that the size of viewing volume will be sufficiently large to cover
420 -- the depth of unmanaged objects, for example, transformation persistent ones.
421 -- @param theScaleFactor [in] the scale factor for Z-range.
422 -- The range between Z-min, Z-max projection volume planes
423 -- evaluated by z fitting method will be scaled using this coefficient.
424 -- Program error exception is thrown if negative or zero value
427 AutoZFitMode (me) returns Boolean;
429 ---Purpose: returns TRUE if automatic z-fit mode is turned on.
431 AutoZFitScaleFactor (me) returns Real from Standard;
433 ---Purpose: returns scale factor parameter of automatic z-fit mode.
435 AutoZFit (me : mutable);
437 ---Purpose: If automatic z-range fitting is turned on, adjusts Z-min and Z-max
438 -- projection volume planes with call to ZFitAll.
440 ZFitAll (me : mutable; theScaleFactor : Real from Standard = 1.0);
442 ---Purpose: Change Z-min and Z-max planes of projection volume to match the
443 -- displayed objects.
445 ViewMappingReset ( me : mutable )
448 ---Purpose: Sets the value of the mapping to be the same as
449 -- the mapping saved by the SetViewMappingDefaut method.
450 ---Category: Methods to modify the class definition
452 ViewOrientationReset ( me : mutable )
455 ---Purpose: Sets the value of the orientation to be the same as the
456 -- orientation saved by the SetViewOrientationDefaut method.
457 ---Category: Methods to modify the class definition
459 SetComputedMode ( me : mutable; aMode : Boolean from Standard ) is static;
461 ---Purpose: Switches computed HLR mode in the view
462 ---Category: Methods to modify the class definition
464 ComputedMode ( me ) returns Boolean from Standard is static;
466 ---Purpose: Returns the computed HLR mode state
467 ---Category: Inquire methods
469 ---------------------------------------------------
470 -- Category: Methods to modify the class definition
472 ---------------------------------------------------
474 ZBufferTriedronSetup ( me : mutable;
475 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
476 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
477 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
478 SizeRatio : Real from Standard = 0.8;
479 AxisDiametr : Real from Standard = 0.05;
480 NbFacettes : Integer from Standard = 12)
483 ---Purpose: Customization of the ZBUFFER Triedron.
484 --- Initializes Colors of X Y and axis
485 --- Scale ratio defines decreasing of trihedron size when
486 --- its position is out of a View
488 TriedronDisplay ( me : mutable;
489 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
490 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
491 AScale : Real from Standard = 0.02;
492 AsWireframe : Boolean from Standard = Standard_True )
495 ---Purpose: Display of the Triedron.
496 --- Initialize position, color and length of Triedron axes.
497 --- The scale is a percent of the window width.
498 --- If AsWireframe is FALSE triedron is shown in shaded mode
499 --- AColor is not considered for ZBUFFER mode
502 TriedronErase ( me : mutable )
505 ---Purpose: Erases the Triedron.
508 TriedronEcho ( me : mutable;
509 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
512 ---Purpose: Highlights the echo zone of the Triedron.
515 ------------------------------------------
516 ---Category: Graduated trihedron
517 ------------------------------------------
519 GetGraduatedTrihedron(me;
521 xname, yname, zname : out ExtendedString from TCollection;
523 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
525 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
527 drawgrid : out Boolean from Standard;
529 drawaxes : out Boolean from Standard;
530 -- Number of splits along axes --
531 nbx, nby, nbz : out Integer from Standard;
532 -- Offset for drawing values --
533 xoffset, yoffset, zoffset : out Integer from Standard;
534 -- Offset for drawing names of axes --
535 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
537 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
538 -- Length of tickmarks --
539 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
541 gridcolor : out Color from Quantity;
542 -- Colors of axis names --
543 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
544 -- Colors of axis and values --
545 xcolor, ycolor, zcolor : out Color from Quantity;
546 -- Name of font for names of axes --
547 fontOfNames : out AsciiString from TCollection;
548 -- Style of names of axes --
549 styleOfNames : out FontAspect from Font;
550 -- Size of names of axes --
551 sizeOfNames : out Integer from Standard;
552 -- Name of font for values --
553 fontOfValues : out AsciiString from TCollection;
554 -- Style of values --
555 styleOfValues : out FontAspect from Font;
557 sizeOfValues : out Integer from Standard)
558 returns Boolean from Standard
560 ---Purpose: Returns data of a graduated trihedron if displayed (return value is True)
562 GraduatedTrihedronDisplay(me : mutable;
564 xname, yname, zname : ExtendedString from TCollection;
566 xdrawname, ydrawname, zdrawname : Boolean from Standard;
568 xdrawvalues, ydrawvalues, zdrawvalues : Boolean from Standard;
570 drawgrid : Boolean from Standard;
572 drawaxes : Boolean from Standard;
573 -- Number of splits along axes --
574 nbx, nby, nbz : Integer from Standard;
575 -- Offset for drawing values --
576 xoffset, yoffset, zoffset : Integer from Standard;
577 -- Offset for drawing names of axes --
578 xaxisoffset, yaxisoffset, zaxisoffset : Integer from Standard;
580 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : Boolean from Standard;
581 -- Length of tickmarks --
582 xtickmarklength, ytickmarklength, ztickmarklength : Integer from Standard;
584 gridcolor : Color from Quantity;
585 -- Colors of axis names --
586 xnamecolor, ynamecolor, znamecolor : Color from Quantity;
587 -- Colors of axis and values --
588 xcolor, ycolor, zcolor : Color from Quantity;
589 -- Name of font for names of axes --
590 fontOfNames : AsciiString from TCollection;
591 -- Style of names of axes --
592 styleOfNames : FontAspect from Font;
593 -- Size of names of axes --
594 sizeOfNames : Integer from Standard;
595 -- Name of font for values --
596 fontOfValues : AsciiString from TCollection;
597 -- Style of values --
598 styleOfValues : FontAspect from Font;
600 sizeOfValues : Integer from Standard)
601 ---Purpose: Displays a graduated trihedron.
604 GraduatedTrihedronErase(me : mutable)
605 ---Purpose: Erases a graduated trihedron from the view.
608 ----------------------------
609 ---Category: Inquire methods
610 ----------------------------
613 returns Background from Aspect
616 ---Purpose: Returns the value of the default window background.
618 GradientBackground ( me )
619 returns GradientBackground from Aspect
622 ---Purpose: Returns the value of the window background.
625 returns Boolean from Standard
628 ---Purpose: Returns Standard_True if one of the structures
629 -- displayed in the view <me> contains Polygons,
630 -- Triangles or Quadrangles.
633 ASet : MapOfStructure from Graphic3d )
634 returns Boolean from Standard
637 ---Purpose: Returns Standard_True if one of the structures
638 -- in the set <ASet> contains Polygons, Triangles
642 returns ContextView from Visual3d
645 ---Purpose: Returns the current context of the view <me>.
646 ---C++: return const &
648 DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d )
651 ---Purpose: Returns the set of structures displayed in
655 returns Boolean from Standard
658 ---Purpose: Returns the activity flag of the view <me>.
661 returns Boolean from Standard
664 ---Purpose: Returns True if the window associated to the view
668 returns Boolean from Standard
671 ---Purpose: Returns Standard_True is the view <me> is deleted.
672 -- <me> is deleted after the call Remove (me).
673 ---Category: Inquire methods
676 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
680 ---Purpose: Returns the coordinates of the boundary box of all
681 -- structures displayed in the view <me>.
682 -- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
683 -- also includes minimum and maximum limits of graphical elements
684 -- forming parts of infinite structures.
687 theSet : MapOfStructure from Graphic3d;
688 theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
692 ---Purpose: Returns the coordinates of the boundary box of all
693 -- structures in the set <theSet>.
694 -- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
695 -- also includes minimum and maximum limits of graphical elements
696 -- forming parts of infinite structures.
698 NumberOfDisplayedStructures ( me )
699 returns Integer from Standard
702 ---Purpose: Returns number of displayed structures in
706 AX, AY, AZ : Real from Standard;
707 APX, APY, APZ : out Real from Standard )
710 ---Purpose: Returns the coordinates of the projection of the
711 -- 3d coordinates <AX>, <AY>, <AZ>.
714 returns Camera_Handle from Graphic3d
717 ---Purpose: @return the default camera of <me>.
718 ---C++: return const &
721 returns Camera_Handle from Graphic3d
724 ---Purpose: @return the camera of <me>.
725 ---C++: return const &
727 SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
729 ---Purpose: Set camera object to provide orientation and projection matrices
730 -- for graphic driver.
733 returns Window from Aspect
735 ---Purpose: Returns the window associated to the view <me>.
736 -- Warning: Raises ViewDefinitionError if the associated
737 -- window isn't defined.
738 raises ViewDefinitionError from Visual3d is static;
740 LightLimit ( me ) returns Integer is static;
742 ---Purpose: Returns the MAX number of light associated to the view <me>.
744 PlaneLimit ( me ) returns Integer is static;
746 ---Purpose: Returns the MAX number of clipping planes
747 -- associated to the view <me>.
749 ViewManager ( me ) returns ViewManager from Visual3d is static;
751 ---Purpose: Returns the view manager handle which manage this view
753 ----------------------------
754 -- Category: Private methods
755 ----------------------------
758 theStructType : TypeOfStructure from Graphic3d )
759 returns TypeOfAnswer from Visual3d
762 ---Purpose: Is it possible to display the structure in the view?
764 ReCompute ( me : mutable;
765 AStructure : Structure from Graphic3d );
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
772 Compute ( me : mutable ) is static private;
774 ---Purpose: Computes the new presentation of the
775 -- Structures displayed in <me> with the type
776 -- Graphic3d_TOS_COMPUTED.
777 ---Category: Private methods
779 ChangeDisplayPriority ( me : mutable;
780 AStructure : Structure from Graphic3d;
781 OldPriority : Integer from Standard;
782 NewPriority : Integer from Standard )
785 ---Purpose: Changes the display priority of the structure <AStructure>.
786 ---Category: Private methods
789 SetZLayerSettings ( me : mutable;
790 theLayerId : ZLayerId from Graphic3d;
791 theSettings : ZLayerSettings from Graphic3d )
793 ---Purpose: Sets the settings for a single Z layer of specified view.
795 AddZLayer ( me : mutable;
796 theLayerId : ZLayerId from Graphic3d )
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.
805 RemoveZLayer ( me : mutable;
806 theLayerId : ZLayerId from Graphic3d )
808 ---Purpose: Remove z layer from the view by its ID.
810 ChangeZLayer ( me : mutable;
811 theStructure : Structure from Graphic3d;
812 theLayerId : ZLayerId from Graphic3d )
814 ---Purpose: Change Z layer of already displayed structure in the view.
816 Clear ( me : mutable;
817 AStructure : Structure from Graphic3d;
818 WithDestruction : Boolean from Standard )
821 ---Purpose: Clears the structure <AStructure> to the view <me>.
822 ---Category: Private methods
824 Connect ( me : mutable;
825 AMother : Structure from Graphic3d;
826 ADaughter : Structure from Graphic3d )
829 ---Purpose: Connects the structures <AMother> and <ADaughter>.
830 ---Category: Private methods
832 Disconnect ( me : mutable;
833 AMother : Structure from Graphic3d;
834 ADaughter : Structure from Graphic3d )
837 ---Purpose: Disconnects the structures <AMother> and <ADaughter>.
838 ---Category: Private methods
840 Display ( me : mutable;
841 AStructure : Structure from Graphic3d )
844 ---Purpose: Display the structure <AStructure> to the view <me>.
845 ---Category: Private methods
847 Display ( me : mutable;
848 AStructure : Structure from Graphic3d;
849 AnUpdateMode : TypeOfUpdate from Aspect )
852 ---Purpose: Display the structure <AStructure> to the view <me>.
853 ---Category: Private methods
855 DisplayImmediate ( me : mutable;
856 theStructure : Structure from Graphic3d;
857 theIsSingleView : Boolean from Standard = Standard_True)
858 returns Boolean from Standard
861 ---Purpose: Add structure to the list of immediate presentations.
862 -- @return true if structure has not been registered in this view
864 EraseImmediate ( me : mutable;
865 theStructure : Structure from Graphic3d )
866 returns Boolean from Standard
869 ---Purpose: Removes the structure from the list of immediate presentations.
870 -- @return true if structure has been registered in view
872 ClearImmediate ( me : mutable )
873 returns Boolean from Standard
876 ---Purpose: Clears list of immediate presentations.
877 -- @return true if list was not empty
879 Erase ( me : mutable;
880 AStructure : Structure from Graphic3d )
883 ---Purpose: Erases the structure <AStructure> from the view <me>.
884 ---Category: Private methods
886 Erase ( me : mutable;
887 AStructure : Structure from Graphic3d;
888 AnUpdateMode : TypeOfUpdate from Aspect )
891 ---Purpose: Erases the structure <AStructure> from the view <me>.
892 ---Category: Private methods
894 Highlight ( me : mutable;
895 AStructure : Structure from Graphic3d;
896 AMethod : TypeOfHighlightMethod from Aspect )
899 ---Purpose: Highlights the structure <AStructure> in the view <me>.
900 ---Category: Private methods
902 SetTransform ( me : mutable;
903 AStructure : Structure from Graphic3d;
904 ATrsf : Array2OfReal from TColStd )
907 ---Purpose: Transforms the structure <AStructure> in the view <me>.
908 ---Category: Private methods
910 UnHighlight ( me : mutable;
911 AStructure : Structure from Graphic3d )
914 ---Purpose: Suppress the highlighting on the structure <AStructure>
916 ---Category: Private methods
919 AStructure : Structure from Graphic3d )
920 returns Integer from Standard
923 ---Purpose: Returns an index != 0 if the structure <AStructure>
924 -- have another structure computed for the view <me>.
925 ---Category: Private methods
927 Identification ( me )
928 returns Integer from Standard
931 ---Purpose: Returns the identification number of the view <me>.
932 ---Category: Private methods
935 AStructure : Structure from Graphic3d )
936 returns Boolean from Standard
939 ---Purpose: Returns true if the structure <AStructure> is
940 -- displayed in the view <me>.
941 ---Category: Private methods
943 SetRatio ( me : mutable )
946 ---Purpose: Modifies the aspect ratio of the view <me> when the
947 -- associated window is defined or resized.
948 ---Category: Private methods
950 UpdateLights ( me : mutable )
953 ---Purpose: Updates the lights when the associated window is defined
954 -- and when the view is activated.
955 ---Category: Private methods
957 UpdatePlanes ( me : mutable )
960 ---Purpose: Updates the planes when the associated window is defined
961 -- and when the view is activated.
962 ---Category: Private methods
964 UpdateView ( me : mutable )
967 ---Purpose: Updates the associated c structure before a call to the
969 ---Category: Private methods
971 -----------------------------
972 -- Category: Internal methods
973 -----------------------------
976 returns Address from Standard
979 ---Purpose: Returns the c structure associated to <me>.
980 ---Category: Private methods
983 returns GraphicDriver from Graphic3d
986 ---Purpose: Returns the associated GraphicDriver.
987 ---Category: Internal methods
988 ---C++: return const &
990 HaveTheSameOwner ( me;
991 AStructure : Structure from Graphic3d )
992 returns Integer from Standard
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.
998 ---Category: Private methods
1000 Print (me; AnUnderLayer : Layer from Visual3d;
1001 AnOverLayer : Layer from Visual3d;
1002 hPrnDC : Handle from Aspect;
1003 showBackground : Boolean;
1005 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1006 theScaleFactor : Real from Standard = 1.0)
1007 returns Boolean from Standard is static;
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.
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.
1023 -- Warning: Works only under Windows.
1025 Print (me; hPrnDC : Handle from Aspect;
1026 showBackground : Boolean;
1028 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1029 theScaleFactor : Real from Standard = 1.0 )
1030 returns Boolean from Standard is static;
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.
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.
1046 -- Warning: Works only under Windows.
1048 ZBufferIsActivated ( me )
1049 returns Boolean from Standard
1052 ---Purpose: Returns Standard_True if the ZBuffer is activated
1053 -- in the view <me> and Standard_False if not.
1054 ---Category: Internal methods
1056 SetZBufferActivity ( me : mutable; AnActivity : Integer from Standard )
1059 ---Purpose: Activates the ZBuffer if the integer <AnActivity>
1061 -- Deactivates the ZBuffer if the integer <AnActivity>
1063 -- If the integer <AnActivity> is equal to -1 then
1064 -- - the ZBuffer is activated if
1065 -- me->Context ().Visualization () == Visual3d_TOV_SHADING
1066 -- - the ZBuffer is deactivated if
1067 -- me->Context ().Visualization () == Visual3d_TOV_WIREFRAME
1068 ---Category: Internal methods
1071 returns Layer from Visual3d;
1073 ---Purpose: Returns the underlay of the view <me>.
1074 ---Category: Private methods
1075 ---C++: return const &
1078 returns Layer from Visual3d;
1080 ---Purpose: Returns the underlay of the view <me>.
1081 ---Category: Private methods
1082 ---C++: return const &
1084 EnableDepthTest( me; enable : Boolean from Standard )
1087 ---Purpose: turns on/off opengl depth
1089 IsDepthTestEnabled( me ) returns Boolean from Standard
1092 ---Purpose: returns current state of the opengl depth testing
1094 ReadDepths( me; x,y,width,height: Integer from Standard;
1097 ---Purpose: Reads depths of shown pixels of the given rectangle
1099 FBOCreate( me : mutable; width,height: Integer from Standard )
1100 returns PtrFrameBuffer from Graphic3d
1103 ---Purpose: Generate offscreen FBO in the graphic library
1105 FBORelease( me : mutable;
1106 fboPtr : in out PtrFrameBuffer from Graphic3d )
1109 ---Purpose: Remove offscreen FBO from the graphic library
1111 FBOGetDimensions( me : mutable;
1112 fboPtr : PtrFrameBuffer from Graphic3d;
1113 width, height : out Integer from Standard;
1114 widthMax, heightMax : out Integer from Standard )
1117 ---Purpose: Read offscreen FBO configuration.
1119 FBOChangeViewport( me : mutable;
1120 fboPtr : in out PtrFrameBuffer from Graphic3d;
1121 width, height : Integer from Standard )
1124 ---Purpose: Change offscreen FBO viewport.
1126 BufferDump( me : mutable;
1127 theImage : in out PixMap from Image;
1128 theBufferType : BufferType from Graphic3d )
1129 returns Boolean from Standard
1132 ---Purpose: Dump active rendering buffer into specified memory buffer.
1134 EnableGLLight( me; enable : Boolean from Standard )
1137 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1139 IsGLLightEnabled( me ) returns Boolean from Standard
1142 ---Purpose: returns the current state of the gl lighting
1143 -- currently used in triedron displaying
1146 theFileName : CString from Standard;
1147 theFormat : ExportFormat from Graphic3d;
1148 theSortType : SortType from Graphic3d = Graphic3d_ST_BSP_Tree;
1149 thePrecision : Real from Standard = 0.005;
1150 theProgressBarFunc : Address from Standard = NULL;
1151 theProgressObject : Address from Standard = NULL )
1152 returns Boolean from Standard;
1154 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1155 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1156 -- Notice however that results may differ a lot and do not contain some elements.
1160 -- the ViewManager associated with the view
1161 myViewManager : ViewManagerPtr from Visual3d;
1163 -- the associated C structure
1164 MyCView : CView from Graphic3d;
1166 -- the context of the view : Aliasing, Depth-Cueing, Lights ...
1167 MyContext : ContextView from Visual3d;
1169 -- the associated window
1170 MyWindow : Window from Aspect;
1172 -- association Structure_COMPUTE and Structure_Computed
1173 myStructsToCompute : SequenceOfStructure from Graphic3d;
1174 myStructsComputed : SequenceOfStructure from Graphic3d;
1175 myIsInComputedMode : Boolean from Standard;
1177 -- the graphic driver used
1178 myGraphicDriver : GraphicDriver from Graphic3d;
1180 -- the background of the associated window
1181 MyBackground : Background from Aspect;
1183 -- the gradient background of the associated window
1184 MyGradientBackground : GradientBackground from Aspect;
1186 -- the displayed structures in the view
1187 myStructsDisplayed : MapOfStructure from Graphic3d;
1188 myImmediateStructures : MapOfStructure from Graphic3d;
1190 MyGTrihedron : CGraduatedTrihedron from Graphic3d;
1192 myDefaultCamera : Camera_Handle from Graphic3d;
1194 myAutoZFitIsOn : Boolean from Standard;
1195 myAutoZFitScaleFactor : Real from Standard;
1197 myStructuresUpdated : Boolean from Standard;
1201 class ViewManager from Visual3d