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,
110 AsciiString from TCollection,
111 ExtendedString from TCollection,
112 CGraduatedTrihedron from Graphic3d
115 TransformError from Visual3d,
116 ViewDefinitionError from Visual3d
120 ----------------------------------------------
121 -- Summary of 3D Viewing --
123 -- To define a view, you must define --
125 -- The view orientation transformation --
126 -- The view mapping transformation --
127 -- The view representation. --
129 -- To activate a view, you must define --
131 -- The associated window. --
132 ----------------------------------------------
134 Create ( AManager : mutable ViewManager from Visual3d )
135 returns mutable View from Visual3d;
137 ---Purpose: Creates a view in the viewer <AManager> with a default
138 -- orientation and a default mapping.
140 Create ( AManager : mutable ViewManager from Visual3d;
141 VO : ViewOrientation from Visual3d;
142 VM : ViewMapping from Visual3d;
143 CTX : ContextView from Visual3d )
144 returns mutable View from Visual3d;
146 ---Purpose: Creates a view in the viewer <AManager> with the orientation
147 -- <VO>, the mapping <VM>, and the context<CTX>.
149 ---------------------------------------------------
150 -- Category: Methods to modify the class definition
151 ---------------------------------------------------
153 Activate ( me : mutable )
155 ---Purpose: Activates the view <me>.
156 -- Map the associated window on the screen and
157 -- post 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 Deactivate ( me : mutable )
165 ---Purpose: Deactivates the view <me>.
166 -- Unmap the associated window on the screen and
167 -- unpost the view in this window.
168 -- Category: Methods to modify the class definition
169 -- Warning: Raises ViewDefinitionError if the associated
170 -- window isn't defined.
171 raises ViewDefinitionError from Visual3d is static;
173 Destroy ( me : mutable )
176 ---Purpose: Deletes and erases the view <me>.
177 ---Category: Methods to modify the class definition
180 Redraw ( me : mutable )
183 ---Purpose: Updates screen in all cases.
184 ---Category: Methods to modify the class definition
186 Redraw ( me : mutable; x,y,width,height: Integer from Standard )
189 ---Purpose: Updates screen area in all cases.
190 -- area is given by his xy min corner and size in pixel coordinates
191 ---Category: Methods to modify the class definition
193 Redraw ( me : mutable;
194 AnUnderLayer : Layer from Visual3d;
195 AnOverLayer : Layer from Visual3d )
198 ---Purpose: Updates screen in all cases.
199 ---Category: Methods to modify the class definition
201 Redraw ( me : mutable;
202 AnUnderLayer : Layer from Visual3d;
203 AnOverLayer : Layer from Visual3d;
204 x,y,width,height: Integer from Standard )
207 ---Purpose: Updates screen area in all cases.
208 -- area is given by his xy min corner and size in pixel coordinates
209 ---Category: Methods to modify the class definition
211 Remove ( me : mutable )
214 ---Purpose: Deletes and erases the view <me>.
215 -- Warning: No more graphic operations in <me> after this call.
216 ---Category: Methods to modify the class definition
218 Resized ( me : mutable )
220 ---Purpose: Updates the view <me> after the modification
221 -- of the associated window.
222 -- Category: Methods to modify the class definition
223 -- Warning: Raises ViewDefinitionError if the associated
224 -- window isn't defined.
225 raises ViewDefinitionError from Visual3d is static;
227 SetBackground ( me : mutable;
228 ABack : Background from Aspect )
230 ---Purpose: Modifies the default window background.
231 -- Category: Methods to modify the class definition
232 -- Warning: Raises ViewDefinitionError if the associated
233 -- window isn't defined.
234 raises ViewDefinitionError from Visual3d is static;
236 SetBackgroundImage( me : mutable; FileName : CString from Standard;
237 FillStyle : FillMethod from Aspect;
238 update : Boolean from Standard )
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 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
247 update : Boolean from Standard )
250 -- Category: Methods to modify the class definition
251 -- Warning: Raises ViewDefinitionError if the associated
252 -- window isn't defined.
253 raises ViewDefinitionError from Visual3d is static;
255 SetGradientBackground ( me : mutable;
256 ABack : GradientBackground from Aspect;
257 update : Boolean from Standard )
259 ---Purpose: Modifies the gradient window background.
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 SetBgGradientStyle( me : mutable;
266 FillStyle : GradientFillMethod from Aspect;
267 update : Boolean from Standard )
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 SetBackFacingModel ( me : mutable;
276 aModel : TypeOfBackfacingModel from Visual3d
279 ---Purpose : Manages display of the back faces
281 BackFacingModel ( me )
282 returns TypeOfBackfacingModel from Visual3d is static;
284 ---Purpose : Returns current state of the back faces display
286 SetContext ( me : mutable;
287 CTX : ContextView from Visual3d )
290 ---Purpose: Sets the context <CTX> in the view <me>.
291 ---Category: Methods to modify the class definition
293 SetTransform ( me : mutable;
294 AMatrix : Array2OfReal from TColStd )
296 ---Purpose: Sets the transformation matrix that is applied
297 -- to <MyViewOrientation> field of the view <me>.
299 -- <AMatrix> is defined as a 4*4 real matrix.
301 -- -------------------
302 -- | a11 a12 a13 t1 |
303 -- | a21 a22 a23 t2 |
304 -- | a31 a32 a33 t3 |
306 -- -------------------
308 -- Category: Methods to modify the class definition
309 -- Warning: Raises TransformError if the matrix isn't a 4x4 matrix.
310 raises TransformError from Visual3d is static;
312 SetViewMapping ( me : mutable;
313 VM : ViewMapping from Visual3d )
316 ---Purpose: Modifies the mapping of the view <me>.
317 ---Category: Methods to modify the class definition
319 SetViewMappingDefault ( me : mutable )
322 ---Purpose: Saves the current mapping which will be the
323 -- reference value for the reset of the mapping
324 -- done by the ViewmappingReset method.
325 ---Category: Methods to modify the class definition
327 SetViewOrientation ( me : mutable;
328 VO : ViewOrientation from Visual3d )
331 ---Purpose: Modifies the orientation of <me>.
332 ---Category: Methods to modify the class definition
334 SetViewOrientationDefault ( me : mutable )
337 ---Purpose: Saves the current orientation which will be the
338 -- reference value for the reset of the orientation
339 -- done by the ViewOrientationReset method.
340 ---Category: Methods to modify the class definition
342 SetWindow ( me : mutable;
343 AWindow : Window from Aspect )
345 ---Purpose: Associates the window <AWindow> to the view <me>.
346 -- No new association if the window is already defined.
347 -- Category: Methods to modify the class definition
348 -- Warning: Raises ViewDefinitionError if it is impossible
349 -- to associate a view and a window.
350 -- (association already done or another problem)
351 -- Modifies the viewmapping of the associated view
352 -- when it calls the SetRatio method.
353 raises ViewDefinitionError from Visual3d is static;
355 -- After this call, each view is mapped in an unique window.
357 -- Programming example :
359 -- An example when we have 1 view and 1 window
360 -- -------------------------------------------
362 -- // Define a graphic device
363 -- Handle(Graphic3d_GraphicDevice) GD =
364 -- new Graphic3d_GraphicDevice ("dummy:0.0");
366 -- // Define a view manager
367 -- Handle(Visual3d_ViewManager) VM = new Visual3d_ViewManager (GD);
370 -- Handle(Visual3d_View) V = new Visual3d_View (VM);
372 -- // Define a window
373 -- Handle(Xw_Window) W = new Xw_Window
374 -- (GD, "Graphic View 1", 0.695, 0.695, 0.600, 0.600,
375 -- Xw_WQ_3DQUALITY, Quantity_NOC_MATRAGRAY);
377 -- // Associate the view and the window
383 -- // Activate the view
387 SetWindow ( me : mutable;
388 AWindow : Window from Aspect;
389 AContext: RenderingContext from Aspect;
390 ADisplayCB: GraphicCallbackProc from Aspect;
391 AClientData: Address from Standard
394 ---Purpose: Associates the window <AWindow> and context <AContext>
396 -- If <AContext> is not NULL the graphic context is used
397 -- directly to draw something in this view.
398 -- Otherwise an internal context is created.
399 -- If <ADisplayCB> is not NULL then a user display CB is
400 -- call at the end of the OCC graphic traversal and just
401 -- before the swap of buffers. The <aClientData> is pass
402 -- to this call back.
403 -- No new association if the window is already defined.
404 -- Category: Methods to modify the class definition
405 -- Warning: Raises ViewDefinitionError if it is impossible
406 -- to associate a view and a window.
407 -- (association already done or another problem)
408 -- Modifies the viewmapping of the associated view
409 -- when it calls the SetRatio method.
410 raises ViewDefinitionError from Visual3d is static;
412 -- After this call, each view is mapped in an unique window.
414 -- Programming example :
416 -- An example when we have 1 view and 1 widget
417 -- -------------------------------------------
419 -- // Define a graphic device
420 -- Handle(Graphic3d_GraphicDevice) GD =
421 -- new Graphic3d_GraphicDevice ("dummy:0.0");
423 -- // Define a view manager
424 -- Handle(Visual3d_ViewManager) VM = new Visual3d_ViewManager (GD);
427 -- Handle(Visual3d_View) V = new Visual3d_View (VM);
429 -- // Define a widget
430 -- Widget DA = GLwCreateMDrawingArea (Widget parent, char *name,
431 -- ArgList arglist, Cardinal argcount);
432 -- Handle(Xw_Window) W = new Xw_Window(DA);
434 -- // Define the graphic context
435 -- GLXContext CTX = glXCreateContext(...)
436 -- // Define the graphic call back and client data
437 -- Handle(Object_View) myObject = new Object_View(...);
438 -- static void DisplayCallback( Window w, XtPointer client_data,
439 -- XtPointer call_data)
441 -- // Associate the view and the widget
442 -- V->SetWindow (W, CTX, DisplayCallback, myObject);
444 -- // Activate the view
448 Update ( me : mutable )
451 ---Purpose: Updates screen in function of modifications of
453 ---Category: Methods to modify the class definition
455 Update ( me : mutable;
456 AnUnderLayer : Layer from Visual3d;
457 AnOverLayer : Layer from Visual3d )
460 ---Purpose: Updates screen in function of modifications of
462 ---Category: Methods to modify the class definition
464 ViewMappingReset ( me : mutable )
467 ---Purpose: Sets the value of the mapping to be the same as
468 -- the mapping saved by the SetViewMappingDefaut method.
469 ---Category: Methods to modify the class definition
471 ViewOrientationReset ( me : mutable )
474 ---Purpose: Sets the value of the orientation to be the same as the
475 -- orientation saved by the SetViewOrientationDefaut method.
476 ---Category: Methods to modify the class definition
478 ---------------------------------------------------
479 -- Category: Methods to modify the class definition
481 ---------------------------------------------------
483 SetAnimationModeOn ( me : mutable;
484 degenerate : Boolean from Standard = Standard_False )
487 ---Purpose: Activates animation mode with an optional degeneration
488 -- according to the TypeOfDegenerateModel of each graphic structure
489 -- When the animation mode is activated in the view,
490 -- all Graphic3d_Structure are stored in a graphic object.
491 -- Warning: only ONE view may have animation mode turned on
493 ---Category: Methods to modify the class definition
495 SetAnimationModeOff ( me : mutable )
498 ---Purpose: Deactivates the animation mode.
499 ---Category: Methods to modify the class definition
501 AnimationModeIsOn ( me )
502 returns Boolean from Standard
505 ---Purpose: Returns the activity of the animation mode.
506 ---Category: Inquire methods
508 ---------------------------------------------------
509 -- Category: Methods to modify the class definition
511 ---------------------------------------------------
513 SetDegenerateModeOn ( me : mutable )
516 ---Purpose: Activates degenerate mode.
517 -- When the degenerate mode is activated in the view,
518 -- all Graphic3d_Structure with the type TOS_COMPUTED
519 -- displayed in this view are not computed.
520 ---Category: Methods to modify the class definition
522 SetDegenerateModeOff ( me : mutable )
525 ---Purpose: Deactivates the degenerate mode.
526 ---Category: Methods to modify the class definition
528 DegenerateModeIsOn ( me )
529 returns Boolean from Standard
532 ---Purpose: Returns the activity of the degenerate mode.
533 ---Category: Inquire methods
535 SetComputedMode ( me : mutable; aMode : Boolean from Standard ) is static;
537 ---Purpose: Switches computed HLR mode in the view
538 ---Category: Methods to modify the class definition
540 ComputedMode ( me ) returns Boolean from Standard is static;
542 ---Purpose: Returns the computed HLR mode state
543 ---Category: Inquire methods
545 ---------------------------------------------------
546 -- Category: Methods to modify the class definition
548 ---------------------------------------------------
550 ZBufferTriedronSetup ( me : mutable;
551 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
552 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
553 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
554 SizeRatio : Real from Standard = 0.8;
555 AxisDiametr : Real from Standard = 0.05;
556 NbFacettes : Integer from Standard = 12)
559 ---Purpose: Customization of the ZBUFFER Triedron.
560 --- Initializes Colors of X Y and axis
561 --- Scale ratio defines decreasing of trihedron size when
562 --- its position is out of a View
564 TriedronDisplay ( me : mutable;
565 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
566 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
567 AScale : Real from Standard = 0.02;
568 AsWireframe : Boolean from Standard = Standard_True )
571 ---Purpose: Display of the Triedron.
572 --- Initialize position, color and length of Triedron axes.
573 --- The scale is a percent of the window width.
574 --- If AsWireframe is FALSE triedron is shown in shaded mode
575 --- AColor is not considered for ZBUFFER mode
578 TriedronErase ( me : mutable )
581 ---Purpose: Erases the Triedron.
584 TriedronEcho ( me : mutable;
585 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
588 ---Purpose: Highlights the echo zone of the Triedron.
591 ------------------------------------------
592 ---Category: Graduated trihedron
593 ------------------------------------------
595 GetGraduatedTrihedron(me;
597 xname, yname, zname : out ExtendedString from TCollection;
599 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
601 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
603 drawgrid : out Boolean from Standard;
605 drawaxes : out Boolean from Standard;
606 -- Number of splits along axes --
607 nbx, nby, nbz : out Integer from Standard;
608 -- Offset for drawing values --
609 xoffset, yoffset, zoffset : out Integer from Standard;
610 -- Offset for drawing names of axes --
611 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
613 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
614 -- Length of tickmarks --
615 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
617 gridcolor : out Color from Quantity;
618 -- Colors of axis names --
619 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
620 -- Colors of axis and values --
621 xcolor, ycolor, zcolor : out Color from Quantity;
622 -- Name of font for names of axes --
623 fontOfNames : out AsciiString from TCollection;
624 -- Style of names of axes --
625 styleOfNames : out FontAspect from OSD;
626 -- Size of names of axes --
627 sizeOfNames : out Integer from Standard;
628 -- Name of font for values --
629 fontOfValues : out AsciiString from TCollection;
630 -- Style of values --
631 styleOfValues : out FontAspect from OSD;
633 sizeOfValues : out Integer from Standard)
634 returns Boolean from Standard
636 ---Purpose: Returns data of a graduated trihedron if displayed (return value is True)
638 GraduatedTrihedronDisplay(me : mutable;
640 xname, yname, zname : ExtendedString from TCollection;
642 xdrawname, ydrawname, zdrawname : Boolean from Standard;
644 xdrawvalues, ydrawvalues, zdrawvalues : Boolean from Standard;
646 drawgrid : Boolean from Standard;
648 drawaxes : Boolean from Standard;
649 -- Number of splits along axes --
650 nbx, nby, nbz : Integer from Standard;
651 -- Offset for drawing values --
652 xoffset, yoffset, zoffset : Integer from Standard;
653 -- Offset for drawing names of axes --
654 xaxisoffset, yaxisoffset, zaxisoffset : Integer from Standard;
656 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : Boolean from Standard;
657 -- Length of tickmarks --
658 xtickmarklength, ytickmarklength, ztickmarklength : Integer from Standard;
660 gridcolor : Color from Quantity;
661 -- Colors of axis names --
662 xnamecolor, ynamecolor, znamecolor : Color from Quantity;
663 -- Colors of axis and values --
664 xcolor, ycolor, zcolor : Color from Quantity;
665 -- Name of font for names of axes --
666 fontOfNames : AsciiString from TCollection;
667 -- Style of names of axes --
668 styleOfNames : FontAspect from OSD;
669 -- Size of names of axes --
670 sizeOfNames : Integer from Standard;
671 -- Name of font for values --
672 fontOfValues : AsciiString from TCollection;
673 -- Style of values --
674 styleOfValues : FontAspect from OSD;
676 sizeOfValues : Integer from Standard)
677 ---Purpose: Displays a graduated trihedron.
680 GraduatedTrihedronErase(me : mutable)
681 ---Purpose: Erases a graduated trihedron from the view.
684 ----------------------------
685 ---Category: Inquire methods
686 ----------------------------
689 returns Background from Aspect
692 ---Purpose: Returns the value of the default window background.
694 GradientBackground ( me )
695 returns GradientBackground from Aspect
698 ---Purpose: Returns the value of the window background.
701 returns Boolean from Standard
704 ---Purpose: Returns Standard_True if one of the structures
705 -- displayed in the view <me> contains Polygons,
706 -- Triangles or Quadrangles.
709 ASet : MapOfStructure from Graphic3d )
710 returns Boolean from Standard
713 ---Purpose: Returns Standard_True if one of the structures
714 -- in the set <ASet> contains Polygons, Triangles
718 returns ContextView from Visual3d
721 ---Purpose: Returns the current context of the view <me>.
722 ---C++: return const &
724 DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d )
727 ---Purpose: Returns the set of structures displayed in
731 returns Boolean from Standard
734 ---Purpose: Returns the activity flag of the view <me>.
737 returns Boolean from Standard
740 ---Purpose: Returns True if the window associated to the view
744 returns Boolean from Standard
747 ---Purpose: Returns Standard_True is the view <me> is deleted.
748 -- <me> is deleted after the call Remove (me).
749 ---Category: Inquire methods
752 XMin, YMin, ZMin : out Real from Standard;
753 XMax, YMax, ZMax : out Real from Standard )
756 ---Purpose: Returns the coordinates of the boundary box of all
757 -- structures displayed in the view <me>.
760 ASet : MapOfStructure from Graphic3d;
761 XMin, YMin, ZMin : out Real from Standard;
762 XMax, YMax, ZMax : out Real from Standard )
765 ---Purpose: Returns the coordinates of the boundary box of all
766 -- structures in the set <ASet>.
768 MinMaxValues ( me : mutable;
769 XMin, YMin : out Real from Standard;
770 XMax, YMax : out Real from Standard )
773 ---Purpose: Returns the coordinates of the projection of the
774 -- boundary box of all structures displayed in the view <me>.
776 MinMaxValues ( me : mutable;
777 ASet : MapOfStructure from Graphic3d;
778 XMin, YMin : out Real from Standard;
779 XMax, YMax : out Real from Standard )
782 ---Purpose: Returns the coordinates of the projection of the
783 -- boundary box of all structures in the set <ASet>.
785 NumberOfDisplayedStructures ( me )
786 returns Integer from Standard
789 ---Purpose: Returns number of displayed structures in
792 Projects ( me : mutable;
793 AX, AY, AZ : Real from Standard;
794 APX, APY, APZ : out Real from Standard )
797 ---Purpose: Returns the coordinates of the projection of the
798 -- 3d coordinates <AX>, <AY>, <AZ>.
801 returns Array2OfReal from TColStd
804 ---Purpose: Returns the transformation associated to the view <me>
805 ---C++: return const &
808 returns ViewMapping from Visual3d
811 ---Purpose: Returns the current mapping of the view <me>.
813 ViewMappingDefault ( me )
814 returns ViewMapping from Visual3d
817 ---Purpose: Returns the current reset mapping of the view <me>.
819 ViewOrientation ( me )
820 returns ViewOrientation from Visual3d
823 ---Purpose: Returns the current orientation of the view <me>.
825 ViewOrientationDefault ( me )
826 returns ViewOrientation from Visual3d
829 ---Purpose: Returns the current reset orientation of the view <me>.
832 returns Window from Aspect
834 ---Purpose: Returns the window associated to the view <me>.
835 -- Warning: Raises ViewDefinitionError if the associated
836 -- window isn't defined.
837 raises ViewDefinitionError from Visual3d is static;
839 LightLimit ( me ) returns Integer is static;
841 ---Purpose: Returns the MAX number of light associated to the view <me>.
843 PlaneLimit ( me ) returns Integer is static;
845 ---Purpose: Returns the MAX number of clipping planes
846 -- associated to the view <me>.
848 ViewManager ( me ) returns ViewManager from Visual3d is static;
850 ---Purpose: Returns the view manager handle which manage this view
852 ----------------------------
853 -- Category: Private methods
854 ----------------------------
857 AStructure : Structure from Graphic3d )
858 returns TypeOfAnswer from Visual3d
861 ---Purpose: Is it possible to display the structure
862 -- <AStructure> in the view <me> ?
863 ---Category: Private methods
865 ReCompute ( me : mutable;
866 AStructure : Structure from Graphic3d );
868 ---Purpose: Computes the new presentation of the
869 -- structure <AStructure> displayed in <me>
870 -- with the type Graphic3d_TOS_COMPUTED.
871 ---Category: Private methods
873 Compute ( me : mutable ) is static private;
875 ---Purpose: Computes the new presentation of the
876 -- Structures displayed in <me> with the type
877 -- Graphic3d_TOS_COMPUTED.
878 ---Category: Private methods
880 ChangeDisplayPriority ( me : mutable;
881 AStructure : Structure from Graphic3d;
882 OldPriority : Integer from Standard;
883 NewPriority : Integer from Standard )
886 ---Purpose: Changes the display priority of the structure <AStructure>.
887 ---Category: Private methods
889 Clear ( me : mutable;
890 AStructure : Structure from Graphic3d;
891 WithDestruction : Boolean from Standard )
894 ---Purpose: Clears the structure <AStructure> to the view <me>.
895 ---Category: Private methods
897 Connect ( me : mutable;
898 AMother : Structure from Graphic3d;
899 ADaughter : Structure from Graphic3d )
902 ---Purpose: Connects the structures <AMother> and <ADaughter>.
903 ---Category: Private methods
905 Disconnect ( me : mutable;
906 AMother : Structure from Graphic3d;
907 ADaughter : Structure from Graphic3d )
910 ---Purpose: Disconnects the structures <AMother> and <ADaughter>.
911 ---Category: Private methods
913 Display ( me : mutable;
914 AStructure : Structure from Graphic3d )
917 ---Purpose: Display the structure <AStructure> to the view <me>.
918 ---Category: Private methods
920 Display ( me : mutable;
921 AStructure : Structure from Graphic3d;
922 AnUpdateMode : TypeOfUpdate from Aspect )
925 ---Purpose: Display the structure <AStructure> to the view <me>.
926 ---Category: Private methods
928 Erase ( me : mutable;
929 AStructure : Structure from Graphic3d )
932 ---Purpose: Erases the structure <AStructure> from the view <me>.
933 ---Category: Private methods
935 Erase ( me : mutable;
936 AStructure : Structure from Graphic3d;
937 AnUpdateMode : TypeOfUpdate from Aspect )
940 ---Purpose: Erases the structure <AStructure> from the view <me>.
941 ---Category: Private methods
946 ---Purpose: Prints informations about the view <me>.
947 ---Category: Private methods
949 Highlight ( me : mutable;
950 AStructure : Structure from Graphic3d;
951 AMethod : TypeOfHighlightMethod from Aspect )
954 ---Purpose: Highlights the structure <AStructure> in the view <me>.
955 ---Category: Private methods
957 SetTransform ( me : mutable;
958 AStructure : Structure from Graphic3d;
959 ATrsf : Array2OfReal from TColStd )
962 ---Purpose: Transforms the structure <AStructure> in the view <me>.
963 ---Category: Private methods
965 UnHighlight ( me : mutable;
966 AStructure : Structure from Graphic3d )
969 ---Purpose: Suppress the highlighting on the structure <AStructure>
971 ---Category: Private methods
974 AStructure : Structure from Graphic3d )
975 returns Integer from Standard
978 ---Purpose: Returns an index != 0 if the structure <AStructure>
979 -- have another structure computed for the view <me>.
980 ---Category: Private methods
982 Identification ( me )
983 returns Integer from Standard
986 ---Purpose: Returns the identification number of the view <me>.
987 ---Category: Private methods
990 AStructure : Structure from Graphic3d )
991 returns Boolean from Standard
994 ---Purpose: Returns true if the structure <AStructure> is
995 -- displayed in the view <me>.
996 ---Category: Private methods
998 MatrixOfMapping ( me : mutable )
999 returns Array2OfReal from TColStd
1000 is static; -- private;
1001 ---C++: return const &
1003 ---Purpose: Returns the current matrix of mapping of the view <me>.
1004 -- Warning: Stores the current matrix of mapping.
1006 MatrixOfOrientation ( me : mutable )
1007 returns Array2OfReal from TColStd
1008 is static; -- private;
1009 ---C++: return const &
1011 ---Purpose: Returns the current matrix of orientation of the view <me>.
1012 -- Warning: Stores the current matrix of orientation.
1014 SetRatio ( me : mutable )
1017 ---Purpose: Modifies the aspect ratio of the view <me> when the
1018 -- associated window is defined or resized.
1019 ---Category: Private methods
1021 UpdateLights ( me : mutable )
1024 ---Purpose: Updates the lights when the associated window is defined
1025 -- and when the view is activated.
1026 ---Category: Private methods
1028 UpdatePlanes ( me : mutable )
1031 ---Purpose: Updates the planes when the associated window is defined
1032 -- and when the view is activated.
1033 ---Category: Private methods
1035 UpdateView ( me : mutable )
1038 ---Purpose: Updates the associated c structure before a call to the
1040 ---Category: Private methods
1042 -----------------------------
1043 -- Category: Internal methods
1044 -----------------------------
1047 returns Address from Standard
1050 ---Purpose: Returns the c structure associated to <me>.
1051 ---Category: Private methods
1053 GraphicDriver ( me )
1054 returns GraphicDriver from Aspect
1057 ---Purpose: Returns the associated GraphicDriver.
1058 ---Category: Internal methods
1060 HaveTheSameOwner ( me;
1061 AStructure : Structure from Graphic3d )
1062 returns Integer from Standard
1065 ---Purpose: Returns an index != 0 if the structure <AStructure>
1066 -- have the same owner than another structure in the
1067 -- sequence of the computed structures.
1068 ---Category: Private methods
1071 APlotter : Plotter from Graphic3d )
1074 ---Purpose: Calls the method Plot for each Structure
1075 -- displayed in <me>.
1076 ---Category: Private methods
1078 Print (me; AnUnderLayer : Layer from Visual3d;
1079 AnOverLayer : Layer from Visual3d;
1080 hPrnDC: Handle from Aspect;
1081 showBackground: Boolean;
1086 ---Purpose: print the contents of all layers of the view to the printer.
1087 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1088 -- <showBackground> : When set to FALSE then print the view without background color
1089 -- (background is white)
1090 -- else set to TRUE for printing with current background color.
1091 -- <filename>: If != NULL, then the view will be printed to a file.
1092 -- Warning: Works only under Windows.
1094 Print (me; hPrnDC: Handle from Aspect;
1095 showBackground: Boolean;
1100 ---Purpose: print the contents of the view to printer.
1101 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1102 -- <showBackground> : When set to FALSE then print the view without background color
1103 -- (background is white)
1104 -- else set to TRUE for printing with current background color.
1105 -- <filename>: If != NULL, then the view will be printed to a file.
1106 -- Warning: Works only under Windows.
1108 SetTransparency ( me : mutable;
1109 AFlag : Boolean from Standard )
1112 ---Purpose: if <AFlag> is Standard_True then the transparency
1113 -- is managed in the view <me>.
1114 -- Default Standard_False
1115 ---Category: Internal methods
1117 ZBufferIsActivated ( me )
1118 returns Boolean from Standard
1121 ---Purpose: Returns Standard_True if the ZBuffer is activated
1122 -- in the view <me> and Standard_False if not.
1123 ---Category: Internal methods
1125 SetZBufferActivity ( me : mutable; AnActivity : Integer from Standard )
1128 ---Purpose: Activates the ZBuffer if the integer <AnActivity>
1130 -- Deactivates the ZBuffer if the integer <AnActivity>
1132 -- If the integer <AnActivity> is equal to -1 then
1133 -- - the ZBuffer is activated if
1134 -- me->Context ().Visualization () == Visual3d_TOV_SHADING
1135 -- - the ZBuffer is deactivated if
1136 -- me->Context ().Visualization () == Visual3d_TOV_WIREFRAME
1137 ---Category: Internal methods
1140 returns Layer from Visual3d;
1142 ---Purpose: Returns the underlay of the view <me>.
1143 ---Category: Private methods
1144 ---C++: return const &
1147 returns Layer from Visual3d;
1149 ---Purpose: Returns the underlay of the view <me>.
1150 ---Category: Private methods
1151 ---C++: return const &
1153 EnableDepthTest( me; enable : Boolean from Standard )
1156 ---Purpose: turns on/off opengl depth
1158 IsDepthTestEnabled( me ) returns Boolean from Standard
1161 ---Purpose: returns current state of the opengl depth testing
1163 ReadDepths( me; x,y,width,height: Integer from Standard;
1166 ---Purpose: Reads depths of shown pixels of the given rectangle
1168 FBOCreate( me : mutable; width,height: Integer from Standard )
1169 returns PtrFrameBuffer from Graphic3d
1172 ---Purpose: Generate offscreen FBO in the graphic library
1174 FBORelease( me : mutable;
1175 fboPtr : in out PtrFrameBuffer from Graphic3d )
1178 ---Purpose: Remove offscreen FBO from the graphic library
1180 FBOGetDimensions( me : mutable;
1181 fboPtr : PtrFrameBuffer from Graphic3d;
1182 width, height : out Integer from Standard;
1183 widthMax, heightMax : out Integer from Standard )
1186 ---Purpose: Read offscreen FBO configuration.
1188 FBOChangeViewport( me : mutable;
1189 fboPtr : in out PtrFrameBuffer from Graphic3d;
1190 width, height : Integer from Standard )
1193 ---Purpose: Change offscreen FBO viewport.
1195 BufferDump( me : mutable;
1196 buffer : in out CRawBufferData from Image )
1197 returns Boolean from Standard
1200 ---Purpose: Dump active rendering buffer into specified memory buffer.
1202 EnableGLLight( me; enable : Boolean from Standard )
1205 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1207 IsGLLightEnabled( me ) returns Boolean from Standard
1210 ---Purpose: returns the current state of the gl lighting
1211 -- currently used in triedron displaying
1214 FileName : CString from Standard;
1215 Format : ExportFormat from Graphic3d;
1216 SortType : SortType from Graphic3d = Graphic3d_ST_BSP_Tree;
1217 Precision : Real from Standard = 0.005;
1218 ProgressBarFunc : Address from Standard = NULL;
1219 ProgressObject : Address from Standard = NULL );
1224 -- Classe : Visual3d_View
1226 -- Purpose : Declaration of the variables specific to views.
1228 -- Reminder : A view is defined by:
1232 -- - a ViewOrientation
1235 -- the associated C structure
1236 MyCView : CView from Graphic3d;
1238 -- the context of the view : Aliasing, Depth-Cueing, Lights ...
1239 MyContext : ContextView from Visual3d;
1241 -- the current mapping of the view
1242 MyViewMapping : ViewMapping from Visual3d;
1244 -- the reset mapping of the view
1245 MyViewMappingReset : ViewMapping from Visual3d;
1247 -- the current orientation of the view
1248 MyViewOrientation : ViewOrientation from Visual3d;
1250 -- the reset orientation of the view
1251 MyViewOrientationReset : ViewOrientation from Visual3d;
1253 -- the associated window
1254 MyWindow : Window from Aspect;
1256 -- the transformation
1257 MyTransformation : Array2OfReal from TColStd;
1259 -- the matrix management
1260 MyMatrixOfMapping : Array2OfReal from TColStd;
1261 MyMatrixOfOrientation : Array2OfReal from TColStd;
1263 -- association Structure_COMPUTE and Structure_Computed
1264 MyTOCOMPUTESequence : SequenceOfStructure from Graphic3d;
1265 MyCOMPUTEDSequence : SequenceOfStructure from Graphic3d;
1267 -- the graphic driver used
1268 MyGraphicDriver : GraphicDriver from Graphic3d;
1270 -- the background of the associated window
1271 MyBackground : Background from Aspect;
1273 -- the gradient background of the associated window
1274 MyGradientBackground : GradientBackground from Aspect;
1276 -- the displayed structures in the view
1277 MyDisplayedStructure : MapOfStructure from Graphic3d;
1279 -- the ViewManager associated with the view
1280 -- MyPtrViewManager : Address from Standard;
1281 MyPtrViewManager : ViewManagerPtr from Visual3d;
1284 MyCBitFields : CBitFields8 from Graphic3d;
1286 MyGTrihedron : CGraduatedTrihedron from Graphic3d;
1290 class ViewManager from Visual3d