2 -- File: Visual3d_View.cdl
3 -- Created: Mardi 17 Septembre 1991
5 -- 05-97: CAL; Ajout du Clear sur les TOS_COMPUTED.
6 -- 10-97: CAL; Retrait des DataStructure.
7 -- 11-97: CAL; Retrait de la dependance avec math.Calcul developpe.
8 -- 11-97: CAL; Ajout de NumberOfDisplayedStructures
9 -- 05-98: CAL; Perfs. Connection entre structures COMPUTED.
10 -- 16-09-98: BGN; Points d'entree du Triedre (S3819, Phase 1)
11 -- 22-09-98: BGN; S3989 (anciennement S3819)
12 -- TypeOfTriedron* from Aspect(et pas Visual3d)
13 -- 02-12-98: S4062. Ajout des layers.
14 -- 13-09-99: GG; GER61454 Adds LightLimit() and PlaneLimit() methods
15 -- 10-11-99: GG; Add PRO19603 Redraw( area ) method
16 -- 14-01-00: GG; Add IMP140100 ViewManager() method
17 -- 25-01-00: EUG: G003
18 -- -> Add backfacing management methods
19 -- SetBackfacingModel() & BackfacingModel().
20 -- -> Change SetAnimationModeIsOn() adding degenerate flag
21 -- -> SetDegenerateModeOn() and Off() become private.
22 -- Use instead SetComputedMode() for managing
24 -- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
25 -- -> Add Print methods (works only under Windows).-
26 -- GG - RIC120302 Add NEW SetWindow method.
28 -- 30-04-02: JMB; MyDisplayedStructure is now a Map instead
29 -- 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 ---Copyright: MatraDatavision 1991,1992,1993,1994,2001
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,
67 GraphicDriver from Aspect,
69 TypeOfUpdate from Aspect,
70 TypeOfHighlightMethod from Aspect,
71 TypeOfTriedronEcho from Aspect,
72 TypeOfTriedronPosition from Aspect,
74 RenderingContext from Aspect,
75 GraphicCallbackProc from Aspect,
76 ColorScale from Aspect,
78 CRawBufferData from Image,
80 CBitFields8 from Graphic3d,
82 GraphicDriver from Graphic3d,
83 PtrFrameBuffer from Graphic3d,
84 Plotter from Graphic3d,
85 Structure from Graphic3d,
86 SequenceOfStructure from Graphic3d,
87 MapOfStructure from Graphic3d,
89 ContextView from Visual3d,
90 ClipPlane from Visual3d,
93 SetOfClipPlane from Visual3d,
94 SetOfLight from Visual3d,
95 TypeOfAnswer from Visual3d,
96 ViewMapping from Visual3d,
97 ViewOrientation from Visual3d,
98 ViewManager from Visual3d,
99 ViewManagerPtr from Visual3d,
101 TypeOfBackfacingModel from Visual3d,
103 NameOfColor from Quantity,
104 FillMethod from Aspect,
105 GradientFillMethod from Aspect,
106 ExportFormat from Graphic3d,
107 SortType from Graphic3d,
112 TransformError from Visual3d,
113 ViewDefinitionError from Visual3d
117 ----------------------------------------------
118 -- Summary of 3D Viewing --
120 -- To define a view, you must define --
122 -- The view orientation transformation --
123 -- The view mapping transformation --
124 -- The view representation. --
126 -- To activate a view, you must define --
128 -- The associated window. --
129 ----------------------------------------------
131 Create ( AManager : mutable ViewManager from Visual3d )
132 returns mutable View from Visual3d;
134 ---Purpose: Creates a view in the viewer <AManager> with a default
135 -- orientation and a default mapping.
137 Create ( AManager : mutable ViewManager from Visual3d;
138 VO : ViewOrientation from Visual3d;
139 VM : ViewMapping from Visual3d;
140 CTX : ContextView from Visual3d )
141 returns mutable View from Visual3d;
143 ---Purpose: Creates a view in the viewer <AManager> with the orientation
144 -- <VO>, the mapping <VM>, and the context<CTX>.
146 ---------------------------------------------------
147 -- Category: Methods to modify the class definition
148 ---------------------------------------------------
150 Activate ( me : mutable )
152 ---Purpose: Activates the view <me>.
153 -- Map the associated window on the screen and
154 -- post the view in this window.
155 -- Category: Methods to modify the class definition
156 -- Warning: Raises ViewDefinitionError if the associated
157 -- window isn't defined.
158 raises ViewDefinitionError from Visual3d is static;
160 Deactivate ( me : mutable )
162 ---Purpose: Deactivates the view <me>.
163 -- Unmap the associated window on the screen and
164 -- unpost the view in this window.
165 -- Category: Methods to modify the class definition
166 -- Warning: Raises ViewDefinitionError if the associated
167 -- window isn't defined.
168 raises ViewDefinitionError from Visual3d is static;
170 Destroy ( me : mutable )
173 ---Purpose: Deletes and erases the view <me>.
174 ---Category: Methods to modify the class definition
177 Redraw ( me : mutable )
180 ---Purpose: Updates screen in all cases.
181 ---Category: Methods to modify the class definition
183 Redraw ( me : mutable; x,y,width,height: Integer from Standard )
186 ---Purpose: Updates screen area in all cases.
187 -- area is given by his xy min corner and size in pixel coordinates
188 ---Category: Methods to modify the class definition
190 Redraw ( me : mutable;
191 AnUnderLayer : Layer from Visual3d;
192 AnOverLayer : Layer from Visual3d )
195 ---Purpose: Updates screen in all cases.
196 ---Category: Methods to modify the class definition
198 Redraw ( me : mutable;
199 AnUnderLayer : Layer from Visual3d;
200 AnOverLayer : Layer from Visual3d;
201 x,y,width,height: Integer from Standard )
204 ---Purpose: Updates screen area in all cases.
205 -- area is given by his xy min corner and size in pixel coordinates
206 ---Category: Methods to modify the class definition
208 Remove ( me : mutable )
211 ---Purpose: Deletes and erases the view <me>.
212 -- Warning: No more graphic operations in <me> after this call.
213 ---Category: Methods to modify the class definition
215 Resized ( me : mutable )
217 ---Purpose: Updates the view <me> after the modification
218 -- of the associated window.
219 -- Category: Methods to modify the class definition
220 -- Warning: Raises ViewDefinitionError if the associated
221 -- window isn't defined.
222 raises ViewDefinitionError from Visual3d is static;
224 SetBackground ( me : mutable;
225 ABack : Background from Aspect )
227 ---Purpose: Modifies the default window background.
228 -- Category: Methods to modify the class definition
229 -- Warning: Raises ViewDefinitionError if the associated
230 -- window isn't defined.
231 raises ViewDefinitionError from Visual3d is static;
233 SetBackgroundImage( me : mutable; FileName : CString from Standard;
234 FillStyle : FillMethod from Aspect;
235 update : Boolean from Standard )
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 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
244 update : Boolean from Standard )
247 -- Category: Methods to modify the class definition
248 -- Warning: Raises ViewDefinitionError if the associated
249 -- window isn't defined.
250 raises ViewDefinitionError from Visual3d is static;
252 SetGradientBackground ( me : mutable;
253 ABack : GradientBackground from Aspect;
254 update : Boolean from Standard )
256 ---Purpose: Modifies the gradient window background.
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 SetBgGradientStyle( me : mutable;
263 FillStyle : GradientFillMethod from Aspect;
264 update : Boolean from Standard )
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 SetBackFacingModel ( me : mutable;
273 aModel : TypeOfBackfacingModel from Visual3d
276 ---Purpose : Manages display of the back faces
278 BackFacingModel ( me )
279 returns TypeOfBackfacingModel from Visual3d is static;
281 ---Purpose : Returns current state of the back faces display
283 SetContext ( me : mutable;
284 CTX : ContextView from Visual3d )
287 ---Purpose: Sets the context <CTX> in the view <me>.
288 ---Category: Methods to modify the class definition
290 SetTransform ( me : mutable;
291 AMatrix : Array2OfReal from TColStd )
293 ---Purpose: Sets the transformation matrix that is applied
294 -- to <MyViewOrientation> field of the view <me>.
296 -- <AMatrix> is defined as a 4*4 real matrix.
298 -- -------------------
299 -- | a11 a12 a13 t1 |
300 -- | a21 a22 a23 t2 |
301 -- | a31 a32 a33 t3 |
303 -- -------------------
305 -- Category: Methods to modify the class definition
306 -- Warning: Raises TransformError if the matrix isn't a 4x4 matrix.
307 raises TransformError from Visual3d is static;
309 SetViewMapping ( me : mutable;
310 VM : ViewMapping from Visual3d )
313 ---Purpose: Modifies the mapping of the view <me>.
314 ---Category: Methods to modify the class definition
316 SetViewMappingDefault ( me : mutable )
319 ---Purpose: Saves the current mapping which will be the
320 -- reference value for the reset of the mapping
321 -- done by the ViewmappingReset method.
322 ---Category: Methods to modify the class definition
324 SetViewOrientation ( me : mutable;
325 VO : ViewOrientation from Visual3d )
328 ---Purpose: Modifies the orientation of <me>.
329 ---Category: Methods to modify the class definition
331 SetViewOrientationDefault ( me : mutable )
334 ---Purpose: Saves the current orientation which will be the
335 -- reference value for the reset of the orientation
336 -- done by the ViewOrientationReset method.
337 ---Category: Methods to modify the class definition
339 SetWindow ( me : mutable;
340 AWindow : Window from Aspect )
342 ---Purpose: Associates the window <AWindow> to the view <me>.
343 -- No new association if the window is already defined.
344 -- Category: Methods to modify the class definition
345 -- Warning: Raises ViewDefinitionError if it is impossible
346 -- to associate a view and a window.
347 -- (association already done or another problem)
348 -- Modifies the viewmapping of the associated view
349 -- when it calls the SetRatio method.
350 raises ViewDefinitionError from Visual3d is static;
352 -- After this call, each view is mapped in an unique window.
354 -- Programming example :
356 -- An example when we have 1 view and 1 window
357 -- -------------------------------------------
359 -- // Define a graphic device
360 -- Handle(Graphic3d_GraphicDevice) GD =
361 -- new Graphic3d_GraphicDevice ("dummy:0.0");
363 -- // Define a view manager
364 -- Handle(Visual3d_ViewManager) VM = new Visual3d_ViewManager (GD);
367 -- Handle(Visual3d_View) V = new Visual3d_View (VM);
369 -- // Define a window
370 -- Handle(Xw_Window) W = new Xw_Window
371 -- (GD, "Graphic View 1", 0.695, 0.695, 0.600, 0.600,
372 -- Xw_WQ_3DQUALITY, Quantity_NOC_MATRAGRAY);
374 -- // Associate the view and the window
380 -- // Activate the view
384 SetWindow ( me : mutable;
385 AWindow : Window from Aspect;
386 AContext: RenderingContext from Aspect;
387 ADisplayCB: GraphicCallbackProc from Aspect;
388 AClientData: Address from Standard
391 ---Purpose: Associates the window <AWindow> and context <AContext>
393 -- If <AContext> is not NULL the graphic context is used
394 -- directly to draw something in this view.
395 -- Otherwise an internal context is created.
396 -- If <ADisplayCB> is not NULL then a user display CB is
397 -- call at the end of the OCC graphic traversal and just
398 -- before the swap of buffers. The <aClientData> is pass
399 -- to this call back.
400 -- No new association if the window is already defined.
401 -- Category: Methods to modify the class definition
402 -- Warning: Raises ViewDefinitionError if it is impossible
403 -- to associate a view and a window.
404 -- (association already done or another problem)
405 -- Modifies the viewmapping of the associated view
406 -- when it calls the SetRatio method.
407 raises ViewDefinitionError from Visual3d is static;
409 -- After this call, each view is mapped in an unique window.
411 -- Programming example :
413 -- An example when we have 1 view and 1 widget
414 -- -------------------------------------------
416 -- // Define a graphic device
417 -- Handle(Graphic3d_GraphicDevice) GD =
418 -- new Graphic3d_GraphicDevice ("dummy:0.0");
420 -- // Define a view manager
421 -- Handle(Visual3d_ViewManager) VM = new Visual3d_ViewManager (GD);
424 -- Handle(Visual3d_View) V = new Visual3d_View (VM);
426 -- // Define a widget
427 -- Widget DA = GLwCreateMDrawingArea (Widget parent, char *name,
428 -- ArgList arglist, Cardinal argcount);
429 -- Handle(Xw_Window) W = new Xw_Window(DA);
431 -- // Define the graphic context
432 -- GLXContext CTX = glXCreateContext(...)
433 -- // Define the graphic call back and client data
434 -- Handle(Object_View) myObject = new Object_View(...);
435 -- static void DisplayCallback( Window w, XtPointer client_data,
436 -- XtPointer call_data)
438 -- // Associate the view and the widget
439 -- V->SetWindow (W, CTX, DisplayCallback, myObject);
441 -- // Activate the view
445 Update ( me : mutable )
448 ---Purpose: Updates screen in function of modifications of
450 ---Category: Methods to modify the class definition
452 Update ( me : mutable;
453 AnUnderLayer : Layer from Visual3d;
454 AnOverLayer : Layer from Visual3d )
457 ---Purpose: Updates screen in function of modifications of
459 ---Category: Methods to modify the class definition
461 ViewMappingReset ( me : mutable )
464 ---Purpose: Sets the value of the mapping to be the same as
465 -- the mapping saved by the SetViewMappingDefaut method.
466 ---Category: Methods to modify the class definition
468 ViewOrientationReset ( me : mutable )
471 ---Purpose: Sets the value of the orientation to be the same as the
472 -- orientation saved by the SetViewOrientationDefaut method.
473 ---Category: Methods to modify the class definition
475 ---------------------------------------------------
476 -- Category: Methods to modify the class definition
478 ---------------------------------------------------
480 SetAnimationModeOn ( me : mutable;
481 degenerate : Boolean from Standard = Standard_False )
484 ---Purpose: Activates animation mode with an optional degeneration
485 -- according to the TypeOfDegenerateModel of each graphic structure
486 -- When the animation mode is activated in the view,
487 -- all Graphic3d_Structure are stored in a graphic object.
488 -- Warning: only ONE view may have animation mode turned on
490 ---Category: Methods to modify the class definition
492 SetAnimationModeOff ( me : mutable )
495 ---Purpose: Deactivates the animation mode.
496 ---Category: Methods to modify the class definition
498 AnimationModeIsOn ( me )
499 returns Boolean from Standard
502 ---Purpose: Returns the activity of the animation mode.
503 ---Category: Inquire methods
505 ---------------------------------------------------
506 -- Category: Methods to modify the class definition
508 ---------------------------------------------------
510 SetDegenerateModeOn ( me : mutable )
513 ---Purpose: Activates degenerate mode.
514 -- When the degenerate mode is activated in the view,
515 -- all Graphic3d_Structure with the type TOS_COMPUTED
516 -- displayed in this view are not computed.
517 ---Category: Methods to modify the class definition
519 SetDegenerateModeOff ( me : mutable )
522 ---Purpose: Deactivates the degenerate mode.
523 ---Category: Methods to modify the class definition
525 DegenerateModeIsOn ( me )
526 returns Boolean from Standard
529 ---Purpose: Returns the activity of the degenerate mode.
530 ---Category: Inquire methods
532 SetComputedMode ( me : mutable; aMode : Boolean from Standard ) is static;
534 ---Purpose: Switches computed HLR mode in the view
535 ---Category: Methods to modify the class definition
537 ComputedMode ( me ) returns Boolean from Standard is static;
539 ---Purpose: Returns the computed HLR mode state
540 ---Category: Inquire methods
542 ---------------------------------------------------
543 -- Category: Methods to modify the class definition
545 ---------------------------------------------------
547 ZBufferTriedronSetup ( me : mutable;
548 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
549 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
550 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
551 SizeRatio : Real from Standard = 0.8;
552 AxisDiametr : Real from Standard = 0.05;
553 NbFacettes : Integer from Standard = 12)
556 ---Purpose: Customization of the ZBUFFER Triedron.
557 --- Initializes Colors of X Y and axis
558 --- Scale ratio defines decreasing of trihedron size when
559 --- its position is out of a View
561 TriedronDisplay ( me : mutable;
562 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
563 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
564 AScale : Real from Standard = 0.02;
565 AsWireframe : Boolean from Standard = Standard_True )
568 ---Purpose: Display of the Triedron.
569 --- Initialize position, color and length of Triedron axes.
570 --- The scale is a percent of the window width.
571 --- If AsWireframe is FALSE triedron is shown in shaded mode
572 --- AColor is not considered for ZBUFFER mode
575 TriedronErase ( me : mutable )
578 ---Purpose: Erases the Triedron.
581 TriedronEcho ( me : mutable;
582 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
585 ---Purpose: Highlights the echo zone of the Triedron.
588 ------------------------------------------
589 ---Category: Graduated trihedron
590 ------------------------------------------
592 GetGraduatedTrihedron(me;
594 xname : out CString from Standard;
595 yname : out CString from Standard;
596 zname : out CString from Standard;
598 xdrawname : out Boolean from Standard;
599 ydrawname : out Boolean from Standard;
600 zdrawname : out Boolean from Standard;
602 xdrawvalues : out Boolean from Standard;
603 ydrawvalues : out Boolean from Standard;
604 zdrawvalues : out Boolean from Standard;
606 drawgrid : out Boolean from Standard;
608 drawaxes : out Boolean from Standard;
609 -- Number of splits along axes --
610 nbx : out Integer from Standard;
611 nby : out Integer from Standard;
612 nbz : out Integer from Standard;
613 -- Offset for drawing values --
614 xoffset : out Integer from Standard;
615 yoffset : out Integer from Standard;
616 zoffset : out Integer from Standard;
617 -- Offset for drawing names of axes --
618 xaxisoffset : out Integer from Standard;
619 yaxisoffset : out Integer from Standard;
620 zaxisoffset : out Integer from Standard;
622 xdrawtickmarks : out Boolean from Standard;
623 ydrawtickmarks : out Boolean from Standard;
624 zdrawtickmarks : out Boolean from Standard;
625 -- Length of tickmarks --
626 xtickmarklength : out Integer from Standard;
627 ytickmarklength : out Integer from Standard;
628 ztickmarklength : out Integer from Standard;
630 gridcolor : out Color from Quantity;
632 xnamecolor : out Color from Quantity;
634 ynamecolor : out Color from Quantity;
636 znamecolor : out Color from Quantity;
637 -- X color of axis and values --
638 xcolor : out Color from Quantity;
639 -- Y color of axis and values --
640 ycolor : out Color from Quantity;
641 -- Z color of axis and values --
642 zcolor : out Color from Quantity;
643 -- Name of font for names of axes --
644 fontOfNames : out CString from Standard;
645 -- Style of names of axes --
646 styleOfNames : out FontAspect from OSD;
647 -- Size of names of axes --
648 sizeOfNames : out Integer from Standard;
649 -- Name of font for values --
650 fontOfValues : out CString from Standard;
651 -- Style of values --
652 styleOfValues : out FontAspect from OSD;
654 sizeOfValues : out Integer from Standard)
655 ---Purpose: Returns data of a graduated trihedron.
658 GraduatedTrihedronDisplay(me : mutable;
660 xname : CString from Standard;
661 yname : CString from Standard;
662 zname : CString from Standard;
664 xdrawname : Boolean from Standard;
665 ydrawname : Boolean from Standard;
666 zdrawname : Boolean from Standard;
668 xdrawvalues : Boolean from Standard;
669 ydrawvalues : Boolean from Standard;
670 zdrawvalues : Boolean from Standard;
672 drawgrid : Boolean from Standard;
674 drawaxes : Boolean from Standard;
675 -- Number of splits along axes --
676 nbx : Integer from Standard;
677 nby : Integer from Standard;
678 nbz : Integer from Standard;
679 -- Offset for drawing values --
680 xoffset : Integer from Standard;
681 yoffset : Integer from Standard;
682 zoffset : Integer from Standard;
683 -- Offset for drawing names of axes --
684 xaxisoffset : Integer from Standard;
685 yaxisoffset : Integer from Standard;
686 zaxisoffset : Integer from Standard;
688 xdrawtickmarks : Boolean from Standard;
689 ydrawtickmarks : Boolean from Standard;
690 zdrawtickmarks : Boolean from Standard;
691 -- Length of tickmarks --
692 xtickmarklength : Integer from Standard;
693 ytickmarklength : Integer from Standard;
694 ztickmarklength : Integer from Standard;
696 gridcolor : Color from Quantity;
698 xnamecolor : Color from Quantity;
700 ynamecolor : Color from Quantity;
702 znamecolor : Color from Quantity;
703 -- X color of axis and values --
704 xcolor : Color from Quantity;
705 -- Y color of axis and values --
706 ycolor : Color from Quantity;
707 -- Z color of axis and values --
708 zcolor : Color from Quantity;
709 -- Name of font for names of axes --
710 fontOfNames : CString from Standard;
711 -- Style of names of axes --
712 styleOfNames : FontAspect from OSD;
713 -- Size of names of axes --
714 sizeOfNames : Integer from Standard;
715 -- Name of font for values --
716 fontOfValues : CString from Standard;
717 -- Style of values --
718 styleOfValues : FontAspect from OSD;
720 sizeOfValues : Integer from Standard)
721 ---Purpose: Displays a graduated trihedron.
724 GraduatedTrihedronErase(me : mutable)
725 ---Purpose: Erases a graduated trihedron from the view.
728 ----------------------------
729 ---Category: Inquire methods
730 ----------------------------
733 returns Background from Aspect
736 ---Purpose: Returns the value of the default window background.
738 GradientBackground ( me )
739 returns GradientBackground from Aspect
742 ---Purpose: Returns the value of the window background.
745 returns Boolean from Standard
748 ---Purpose: Returns Standard_True if one of the structures
749 -- displayed in the view <me> contains Polygons,
750 -- Triangles or Quadrangles.
753 ASet : MapOfStructure from Graphic3d )
754 returns Boolean from Standard
757 ---Purpose: Returns Standard_True if one of the structures
758 -- in the set <ASet> contains Polygons, Triangles
762 returns ContextView from Visual3d
765 ---Purpose: Returns the current context of the view <me>.
766 ---C++: return const &
768 DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d )
771 ---Purpose: Returns the set of structures displayed in
775 returns Boolean from Standard
778 ---Purpose: Returns the activity flag of the view <me>.
781 returns Boolean from Standard
784 ---Purpose: Returns True if the window associated to the view
788 returns Boolean from Standard
791 ---Purpose: Returns Standard_True is the view <me> is deleted.
792 -- <me> is deleted after the call Remove (me).
793 ---Category: Inquire methods
796 XMin, YMin, ZMin : out Real from Standard;
797 XMax, YMax, ZMax : out Real from Standard )
800 ---Purpose: Returns the coordinates of the boundary box of all
801 -- structures displayed in the view <me>.
804 ASet : MapOfStructure from Graphic3d;
805 XMin, YMin, ZMin : out Real from Standard;
806 XMax, YMax, ZMax : out Real from Standard )
809 ---Purpose: Returns the coordinates of the boundary box of all
810 -- structures in the set <ASet>.
812 MinMaxValues ( me : mutable;
813 XMin, YMin : out Real from Standard;
814 XMax, YMax : out Real from Standard )
817 ---Purpose: Returns the coordinates of the projection of the
818 -- boundary box of all structures displayed in the view <me>.
820 MinMaxValues ( me : mutable;
821 ASet : MapOfStructure from Graphic3d;
822 XMin, YMin : out Real from Standard;
823 XMax, YMax : out Real from Standard )
826 ---Purpose: Returns the coordinates of the projection of the
827 -- boundary box of all structures in the set <ASet>.
829 NumberOfDisplayedStructures ( me )
830 returns Integer from Standard
833 ---Purpose: Returns number of displayed structures in
836 Projects ( me : mutable;
837 AX, AY, AZ : Real from Standard;
838 APX, APY, APZ : out Real from Standard )
841 ---Purpose: Returns the coordinates of the projection of the
842 -- 3d coordinates <AX>, <AY>, <AZ>.
845 returns Array2OfReal from TColStd
848 ---Purpose: Returns the transformation associated to the view <me>
849 ---C++: return const &
852 returns ViewMapping from Visual3d
855 ---Purpose: Returns the current mapping of the view <me>.
857 ViewMappingDefault ( me )
858 returns ViewMapping from Visual3d
861 ---Purpose: Returns the current reset mapping of the view <me>.
863 ViewOrientation ( me )
864 returns ViewOrientation from Visual3d
867 ---Purpose: Returns the current orientation of the view <me>.
869 ViewOrientationDefault ( me )
870 returns ViewOrientation from Visual3d
873 ---Purpose: Returns the current reset orientation of the view <me>.
876 returns Window from Aspect
878 ---Purpose: Returns the window associated to the view <me>.
879 -- Warning: Raises ViewDefinitionError if the associated
880 -- window isn't defined.
881 raises ViewDefinitionError from Visual3d is static;
883 LightLimit ( me ) returns Integer is static;
885 ---Purpose: Returns the MAX number of light associated to the view <me>.
887 PlaneLimit ( me ) returns Integer is static;
889 ---Purpose: Returns the MAX number of clipping planes
890 -- associated to the view <me>.
892 ViewManager ( me ) returns ViewManager from Visual3d is static;
894 ---Purpose: Returns the view manager handle which manage this view
896 ----------------------------
897 -- Category: Private methods
898 ----------------------------
901 AStructure : Structure from Graphic3d )
902 returns TypeOfAnswer from Visual3d
905 ---Purpose: Is it possible to display the structure
906 -- <AStructure> in the view <me> ?
907 ---Category: Private methods
909 ReCompute ( me : mutable;
910 AStructure : Structure from Graphic3d );
912 ---Purpose: Computes the new presentation of the
913 -- structure <AStructure> displayed in <me>
914 -- with the type Graphic3d_TOS_COMPUTED.
915 ---Category: Private methods
917 Compute ( me : mutable ) is static private;
919 ---Purpose: Computes the new presentation of the
920 -- Structures displayed in <me> with the type
921 -- Graphic3d_TOS_COMPUTED.
922 ---Category: Private methods
924 ChangeDisplayPriority ( me : mutable;
925 AStructure : Structure from Graphic3d;
926 OldPriority : Integer from Standard;
927 NewPriority : Integer from Standard )
930 ---Purpose: Changes the display priority of the structure <AStructure>.
931 ---Category: Private methods
933 Clear ( me : mutable;
934 AStructure : Structure from Graphic3d;
935 WithDestruction : Boolean from Standard )
938 ---Purpose: Clears the structure <AStructure> to the view <me>.
939 ---Category: Private methods
941 Connect ( me : mutable;
942 AMother : Structure from Graphic3d;
943 ADaughter : Structure from Graphic3d )
946 ---Purpose: Connects the structures <AMother> and <ADaughter>.
947 ---Category: Private methods
949 Disconnect ( me : mutable;
950 AMother : Structure from Graphic3d;
951 ADaughter : Structure from Graphic3d )
954 ---Purpose: Disconnects the structures <AMother> and <ADaughter>.
955 ---Category: Private methods
957 Display ( me : mutable;
958 AStructure : Structure from Graphic3d )
961 ---Purpose: Display the structure <AStructure> to the view <me>.
962 ---Category: Private methods
964 Display ( me : mutable;
965 AStructure : Structure from Graphic3d;
966 AnUpdateMode : TypeOfUpdate from Aspect )
969 ---Purpose: Display the structure <AStructure> to the view <me>.
970 ---Category: Private methods
972 Erase ( me : mutable;
973 AStructure : Structure from Graphic3d )
976 ---Purpose: Erases the structure <AStructure> from the view <me>.
977 ---Category: Private methods
979 Erase ( me : mutable;
980 AStructure : Structure from Graphic3d;
981 AnUpdateMode : TypeOfUpdate from Aspect )
984 ---Purpose: Erases the structure <AStructure> from the view <me>.
985 ---Category: Private methods
990 ---Purpose: Prints informations about the view <me>.
991 ---Category: Private methods
993 Highlight ( me : mutable;
994 AStructure : Structure from Graphic3d;
995 AMethod : TypeOfHighlightMethod from Aspect )
998 ---Purpose: Highlights the structure <AStructure> in the view <me>.
999 ---Category: Private methods
1001 SetTransform ( me : mutable;
1002 AStructure : Structure from Graphic3d;
1003 ATrsf : Array2OfReal from TColStd )
1006 ---Purpose: Transforms the structure <AStructure> in the view <me>.
1007 ---Category: Private methods
1009 UnHighlight ( me : mutable;
1010 AStructure : Structure from Graphic3d )
1013 ---Purpose: Suppress the highlighting on the structure <AStructure>
1014 -- in the view <me>.
1015 ---Category: Private methods
1018 AStructure : Structure from Graphic3d )
1019 returns Integer from Standard
1022 ---Purpose: Returns an index != 0 if the structure <AStructure>
1023 -- have another structure computed for the view <me>.
1024 ---Category: Private methods
1026 Identification ( me )
1027 returns Integer from Standard
1030 ---Purpose: Returns the identification number of the view <me>.
1031 ---Category: Private methods
1034 AStructure : Structure from Graphic3d )
1035 returns Boolean from Standard
1038 ---Purpose: Returns true if the structure <AStructure> is
1039 -- displayed in the view <me>.
1040 ---Category: Private methods
1042 MatrixOfMapping ( me : mutable )
1043 returns Array2OfReal from TColStd
1044 is static; -- private;
1045 ---C++: return const &
1047 ---Purpose: Returns the current matrix of mapping of the view <me>.
1048 -- Warning: Stores the current matrix of mapping.
1050 MatrixOfOrientation ( me : mutable )
1051 returns Array2OfReal from TColStd
1052 is static; -- private;
1053 ---C++: return const &
1055 ---Purpose: Returns the current matrix of orientation of the view <me>.
1056 -- Warning: Stores the current matrix of orientation.
1058 SetRatio ( me : mutable )
1061 ---Purpose: Modifies the aspect ratio of the view <me> when the
1062 -- associated window is defined or resized.
1063 ---Category: Private methods
1065 UpdateLights ( me : mutable )
1068 ---Purpose: Updates the lights when the associated window is defined
1069 -- and when the view is activated.
1070 ---Category: Private methods
1072 UpdatePlanes ( me : mutable )
1075 ---Purpose: Updates the planes when the associated window is defined
1076 -- and when the view is activated.
1077 ---Category: Private methods
1079 UpdateView ( me : mutable )
1082 ---Purpose: Updates the associated c structure before a call to the
1084 ---Category: Private methods
1086 -----------------------------
1087 -- Category: Internal methods
1088 -----------------------------
1091 returns Address from Standard
1094 ---Purpose: Returns the c structure associated to <me>.
1095 ---Category: Private methods
1097 GraphicDriver ( me )
1098 returns GraphicDriver from Aspect
1101 ---Purpose: Returns the associated GraphicDriver.
1102 ---Category: Internal methods
1104 HaveTheSameOwner ( me;
1105 AStructure : Structure from Graphic3d )
1106 returns Integer from Standard
1109 ---Purpose: Returns an index != 0 if the structure <AStructure>
1110 -- have the same owner than another structure in the
1111 -- sequence of the computed structures.
1112 ---Category: Private methods
1115 APlotter : Plotter from Graphic3d )
1118 ---Purpose: Calls the method Plot for each Structure
1119 -- displayed in <me>.
1120 ---Category: Private methods
1122 Print (me; AnUnderLayer : Layer from Visual3d;
1123 AnOverLayer : Layer from Visual3d;
1124 hPrnDC: Handle from Aspect;
1125 showBackground: Boolean;
1130 ---Purpose: print the contents of all layers of the view to the printer.
1131 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1132 -- <showBackground> : When set to FALSE then print the view without background color
1133 -- (background is white)
1134 -- else set to TRUE for printing with current background color.
1135 -- <filename>: If != NULL, then the view will be printed to a file.
1136 -- Warning: Works only under Windows.
1138 Print (me; hPrnDC: Handle from Aspect;
1139 showBackground: Boolean;
1144 ---Purpose: print the contents of the view to printer.
1145 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1146 -- <showBackground> : When set to FALSE then print the view without background color
1147 -- (background is white)
1148 -- else set to TRUE for printing with current background color.
1149 -- <filename>: If != NULL, then the view will be printed to a file.
1150 -- Warning: Works only under Windows.
1152 SetTransparency ( me : mutable;
1153 AFlag : Boolean from Standard )
1156 ---Purpose: if <AFlag> is Standard_True then the transparency
1157 -- is managed in the view <me>.
1158 -- Default Standard_False
1159 ---Category: Internal methods
1161 ZBufferIsActivated ( me )
1162 returns Boolean from Standard
1165 ---Purpose: Returns Standard_True if the ZBuffer is activated
1166 -- in the view <me> and Standard_False if not.
1167 ---Category: Internal methods
1169 SetZBufferActivity ( me : mutable; AnActivity : Integer from Standard )
1172 ---Purpose: Activates the ZBuffer if the integer <AnActivity>
1174 -- Deactivates the ZBuffer if the integer <AnActivity>
1176 -- If the integer <AnActivity> is equal to -1 then
1177 -- - the ZBuffer is activated if
1178 -- me->Context ().Visualization () == Visual3d_TOV_SHADING
1179 -- - the ZBuffer is deactivated if
1180 -- me->Context ().Visualization () == Visual3d_TOV_WIREFRAME
1181 ---Category: Internal methods
1184 returns Layer from Visual3d;
1186 ---Purpose: Returns the underlay of the view <me>.
1187 ---Category: Private methods
1188 ---C++: return const &
1191 returns Layer from Visual3d;
1193 ---Purpose: Returns the underlay of the view <me>.
1194 ---Category: Private methods
1195 ---C++: return const &
1197 EnableDepthTest( me; enable : Boolean from Standard )
1200 ---Purpose: turns on/off opengl depth
1202 IsDepthTestEnabled( me ) returns Boolean from Standard
1205 ---Purpose: returns current state of the opengl depth testing
1207 ReadDepths( me; x,y,width,height: Integer from Standard;
1210 ---Purpose: Reads depths of shown pixels of the given rectangle
1212 FBOCreate( me : mutable; width,height: Integer from Standard )
1213 returns PtrFrameBuffer from Graphic3d
1216 ---Purpose: Generate offscreen FBO in the graphic library
1218 FBORelease( me : mutable;
1219 fboPtr : in out PtrFrameBuffer from Graphic3d )
1222 ---Purpose: Remove offscreen FBO from the graphic library
1224 FBOGetDimensions( me : mutable;
1225 fboPtr : PtrFrameBuffer from Graphic3d;
1226 width, height : out Integer from Standard;
1227 widthMax, heightMax : out Integer from Standard )
1230 ---Purpose: Read offscreen FBO configuration.
1232 FBOChangeViewport( me : mutable;
1233 fboPtr : in out PtrFrameBuffer from Graphic3d;
1234 width, height : Integer from Standard )
1237 ---Purpose: Change offscreen FBO viewport.
1239 BufferDump( me : mutable;
1240 buffer : in out CRawBufferData from Image )
1241 returns Boolean from Standard
1244 ---Purpose: Dump active rendering buffer into specified memory buffer.
1246 EnableGLLight( me; enable : Boolean from Standard )
1249 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1251 IsGLLightEnabled( me ) returns Boolean from Standard
1254 ---Purpose: returns the current state of the gl lighting
1255 -- currently used in triedron displaying
1258 FileName : CString from Standard;
1259 Format : ExportFormat from Graphic3d;
1260 SortType : SortType from Graphic3d = Graphic3d_ST_BSP_Tree;
1261 Precision : Real from Standard = 0.005;
1262 ProgressBarFunc : Address from Standard = NULL;
1263 ProgressObject : Address from Standard = NULL );
1268 -- Classe : Visual3d_View
1270 -- Purpose : Declaration of the variables specific to views.
1272 -- Reminder : A view is defined by:
1276 -- - a ViewOrientation
1279 -- the associated C structure
1280 MyCView : CView from Graphic3d;
1282 -- the context of the view : Aliasing, Depth-Cueing, Lights ...
1283 MyContext : ContextView from Visual3d;
1285 -- the current mapping of the view
1286 MyViewMapping : ViewMapping from Visual3d;
1288 -- the reset mapping of the view
1289 MyViewMappingReset : ViewMapping from Visual3d;
1291 -- the current orientation of the view
1292 MyViewOrientation : ViewOrientation from Visual3d;
1294 -- the reset orientation of the view
1295 MyViewOrientationReset : ViewOrientation from Visual3d;
1297 -- the associated window
1298 MyWindow : Window from Aspect;
1300 -- the transformation
1301 MyTransformation : Array2OfReal from TColStd;
1303 -- the matrix management
1304 MyMatrixOfMapping : Array2OfReal from TColStd;
1305 MyMatrixOfOrientation : Array2OfReal from TColStd;
1307 -- association Structure_COMPUTE and Structure_Computed
1308 MyTOCOMPUTESequence : SequenceOfStructure from Graphic3d;
1309 MyCOMPUTEDSequence : SequenceOfStructure from Graphic3d;
1311 -- the graphic driver used
1312 MyGraphicDriver : GraphicDriver from Graphic3d;
1314 -- the background of the associated window
1315 MyBackground : Background from Aspect;
1317 -- the gradient background of the associated window
1318 MyGradientBackground : GradientBackground from Aspect;
1320 -- the displayed structures in the view
1321 MyDisplayedStructure : MapOfStructure from Graphic3d;
1323 -- the ViewManager associated with the view
1324 -- MyPtrViewManager : Address from Standard;
1325 MyPtrViewManager : ViewManagerPtr from Visual3d;
1328 MyCBitFields : CBitFields8 from Graphic3d;
1332 class ViewManager from Visual3d