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,
77 PrintAlgo from Aspect,
79 CRawBufferData from Image,
81 CBitFields8 from Graphic3d,
83 GraphicDriver from Graphic3d,
84 PtrFrameBuffer from Graphic3d,
85 Plotter from Graphic3d,
86 Structure from Graphic3d,
87 SequenceOfStructure from Graphic3d,
88 MapOfStructure from Graphic3d,
90 ContextView from Visual3d,
91 ClipPlane from Visual3d,
94 SetOfClipPlane from Visual3d,
95 SetOfLight from Visual3d,
96 TypeOfAnswer from Visual3d,
97 ViewMapping from Visual3d,
98 ViewOrientation from Visual3d,
99 ViewManager from Visual3d,
100 ViewManagerPtr from Visual3d,
102 TypeOfBackfacingModel from Visual3d,
104 NameOfColor from Quantity,
105 FillMethod from Aspect,
106 GradientFillMethod from Aspect,
107 ExportFormat from Graphic3d,
108 SortType from Graphic3d,
111 AsciiString from TCollection,
112 ExtendedString from TCollection,
113 CGraduatedTrihedron from Graphic3d
116 TransformError from Visual3d,
117 ViewDefinitionError from Visual3d
121 ----------------------------------------------
122 -- Summary of 3D Viewing --
124 -- To define a view, you must define --
126 -- The view orientation transformation --
127 -- The view mapping transformation --
128 -- The view representation. --
130 -- To activate a view, you must define --
132 -- The associated window. --
133 ----------------------------------------------
135 Create ( AManager : mutable ViewManager from Visual3d )
136 returns mutable View from Visual3d;
138 ---Purpose: Creates a view in the viewer <AManager> with a default
139 -- orientation and a default mapping.
141 Create ( AManager : mutable ViewManager from Visual3d;
142 VO : ViewOrientation from Visual3d;
143 VM : ViewMapping from Visual3d;
144 CTX : ContextView from Visual3d )
145 returns mutable View from Visual3d;
147 ---Purpose: Creates a view in the viewer <AManager> with the orientation
148 -- <VO>, the mapping <VM>, and the context<CTX>.
150 ---------------------------------------------------
151 -- Category: Methods to modify the class definition
152 ---------------------------------------------------
154 Activate ( me : mutable )
156 ---Purpose: Activates the view <me>.
157 -- Map the associated window on the screen and
158 -- post the view in this window.
159 -- Category: Methods to modify the class definition
160 -- Warning: Raises ViewDefinitionError if the associated
161 -- window isn't defined.
162 raises ViewDefinitionError from Visual3d is static;
164 Deactivate ( me : mutable )
166 ---Purpose: Deactivates the view <me>.
167 -- Unmap the associated window on the screen and
168 -- unpost the view in this window.
169 -- Category: Methods to modify the class definition
170 -- Warning: Raises ViewDefinitionError if the associated
171 -- window isn't defined.
172 raises ViewDefinitionError from Visual3d is static;
174 Destroy ( me : mutable )
177 ---Purpose: Deletes and erases the view <me>.
178 ---Category: Methods to modify the class definition
181 Redraw ( me : mutable )
184 ---Purpose: Updates screen in all cases.
185 ---Category: Methods to modify the class definition
187 Redraw ( me : mutable; x,y,width,height: Integer from Standard )
190 ---Purpose: Updates screen area in all cases.
191 -- area is given by his xy min corner and size in pixel coordinates
192 ---Category: Methods to modify the class definition
194 Redraw ( me : mutable;
195 AnUnderLayer : Layer from Visual3d;
196 AnOverLayer : Layer from Visual3d )
199 ---Purpose: Updates screen in all cases.
200 ---Category: Methods to modify the class definition
202 Redraw ( me : mutable;
203 AnUnderLayer : Layer from Visual3d;
204 AnOverLayer : Layer from Visual3d;
205 x,y,width,height: Integer from Standard )
208 ---Purpose: Updates screen area in all cases.
209 -- area is given by his xy min corner and size in pixel coordinates
210 ---Category: Methods to modify the class definition
212 Remove ( me : mutable )
215 ---Purpose: Deletes and erases the view <me>.
216 -- Warning: No more graphic operations in <me> after this call.
217 ---Category: Methods to modify the class definition
219 Resized ( me : mutable )
221 ---Purpose: Updates the view <me> after the modification
222 -- of the associated window.
223 -- Category: Methods to modify the class definition
224 -- Warning: Raises ViewDefinitionError if the associated
225 -- window isn't defined.
226 raises ViewDefinitionError from Visual3d is static;
228 SetBackground ( me : mutable;
229 ABack : Background from Aspect )
231 ---Purpose: Modifies the default window background.
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 SetBackgroundImage( me : mutable; FileName : CString from Standard;
238 FillStyle : FillMethod from Aspect;
239 update : Boolean from Standard )
242 -- Category: Methods to modify the class definition
243 -- Warning: Raises ViewDefinitionError if the associated
244 -- window isn't defined.
245 raises ViewDefinitionError from Visual3d is static;
247 SetBgImageStyle( me : mutable; 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 SetGradientBackground ( me : mutable;
257 ABack : GradientBackground from Aspect;
258 update : Boolean from Standard )
260 ---Purpose: Modifies the gradient window background.
261 -- Category: Methods to modify the class definition
262 -- Warning: Raises ViewDefinitionError if the associated
263 -- window isn't defined.
264 raises ViewDefinitionError from Visual3d is static;
266 SetBgGradientStyle( me : mutable;
267 FillStyle : GradientFillMethod from Aspect;
268 update : Boolean from Standard )
271 -- Category: Methods to modify the class definition
272 -- Warning: Raises ViewDefinitionError if the associated
273 -- window isn't defined.
274 raises ViewDefinitionError from Visual3d is static;
276 SetBackFacingModel ( me : mutable;
277 aModel : TypeOfBackfacingModel from Visual3d
280 ---Purpose : Manages display of the back faces
282 BackFacingModel ( me )
283 returns TypeOfBackfacingModel from Visual3d is static;
285 ---Purpose : Returns current state of the back faces display
287 SetContext ( me : mutable;
288 CTX : ContextView from Visual3d )
291 ---Purpose: Sets the context <CTX> in the view <me>.
292 ---Category: Methods to modify the class definition
294 SetTransform ( me : mutable;
295 AMatrix : Array2OfReal from TColStd )
297 ---Purpose: Sets the transformation matrix that is applied
298 -- to <MyViewOrientation> field of the view <me>.
300 -- <AMatrix> is defined as a 4*4 real matrix.
302 -- -------------------
303 -- | a11 a12 a13 t1 |
304 -- | a21 a22 a23 t2 |
305 -- | a31 a32 a33 t3 |
307 -- -------------------
309 -- Category: Methods to modify the class definition
310 -- Warning: Raises TransformError if the matrix isn't a 4x4 matrix.
311 raises TransformError from Visual3d is static;
313 SetViewMapping ( me : mutable;
314 VM : ViewMapping from Visual3d )
317 ---Purpose: Modifies the mapping of the view <me>.
318 ---Category: Methods to modify the class definition
320 SetViewMappingDefault ( me : mutable )
323 ---Purpose: Saves the current mapping which will be the
324 -- reference value for the reset of the mapping
325 -- done by the ViewmappingReset method.
326 ---Category: Methods to modify the class definition
328 SetViewOrientation ( me : mutable;
329 VO : ViewOrientation from Visual3d )
332 ---Purpose: Modifies the orientation of <me>.
333 ---Category: Methods to modify the class definition
335 SetViewOrientationDefault ( me : mutable )
338 ---Purpose: Saves the current orientation which will be the
339 -- reference value for the reset of the orientation
340 -- done by the ViewOrientationReset method.
341 ---Category: Methods to modify the class definition
343 SetWindow ( me : mutable;
344 AWindow : Window from Aspect )
346 ---Purpose: Associates the window <AWindow> to the view <me>.
347 -- No new association if the window is already defined.
348 -- Category: Methods to modify the class definition
349 -- Warning: Raises ViewDefinitionError if it is impossible
350 -- to associate a view and a window.
351 -- (association already done or another problem)
352 -- Modifies the viewmapping of the associated view
353 -- when it calls the SetRatio method.
354 raises ViewDefinitionError from Visual3d is static;
356 -- After this call, each view is mapped in an unique window.
358 -- Programming example :
360 -- An example when we have 1 view and 1 window
361 -- -------------------------------------------
363 -- // Define a graphic device
364 -- Handle(Graphic3d_GraphicDevice) GD =
365 -- new Graphic3d_GraphicDevice ("dummy:0.0");
367 -- // Define a view manager
368 -- Handle(Visual3d_ViewManager) VM = new Visual3d_ViewManager (GD);
371 -- Handle(Visual3d_View) V = new Visual3d_View (VM);
373 -- // Define a window
374 -- Handle(Xw_Window) W = new Xw_Window
375 -- (GD, "Graphic View 1", 0.695, 0.695, 0.600, 0.600,
376 -- Xw_WQ_3DQUALITY, Quantity_NOC_MATRAGRAY);
378 -- // Associate the view and the window
384 -- // Activate the view
388 SetWindow ( me : mutable;
389 AWindow : Window from Aspect;
390 AContext: RenderingContext from Aspect;
391 ADisplayCB: GraphicCallbackProc from Aspect;
392 AClientData: Address from Standard
395 ---Purpose: Associates the window <AWindow> and context <AContext>
397 -- If <AContext> is not NULL the graphic context is used
398 -- directly to draw something in this view.
399 -- Otherwise an internal context is created.
400 -- If <ADisplayCB> is not NULL then a user display CB is
401 -- call at the end of the OCC graphic traversal and just
402 -- before the swap of buffers. The <aClientData> is pass
403 -- to this call back.
404 -- No new association if the window is already defined.
405 -- Category: Methods to modify the class definition
406 -- Warning: Raises ViewDefinitionError if it is impossible
407 -- to associate a view and a window.
408 -- (association already done or another problem)
409 -- Modifies the viewmapping of the associated view
410 -- when it calls the SetRatio method.
411 raises ViewDefinitionError from Visual3d is static;
413 -- After this call, each view is mapped in an unique window.
415 -- Programming example :
417 -- An example when we have 1 view and 1 widget
418 -- -------------------------------------------
420 -- // Define a graphic device
421 -- Handle(Graphic3d_GraphicDevice) GD =
422 -- new Graphic3d_GraphicDevice ("dummy:0.0");
424 -- // Define a view manager
425 -- Handle(Visual3d_ViewManager) VM = new Visual3d_ViewManager (GD);
428 -- Handle(Visual3d_View) V = new Visual3d_View (VM);
430 -- // Define a widget
431 -- Widget DA = GLwCreateMDrawingArea (Widget parent, char *name,
432 -- ArgList arglist, Cardinal argcount);
433 -- Handle(Xw_Window) W = new Xw_Window(DA);
435 -- // Define the graphic context
436 -- GLXContext CTX = glXCreateContext(...)
437 -- // Define the graphic call back and client data
438 -- Handle(Object_View) myObject = new Object_View(...);
439 -- static void DisplayCallback( Window w, XtPointer client_data,
440 -- XtPointer call_data)
442 -- // Associate the view and the widget
443 -- V->SetWindow (W, CTX, DisplayCallback, myObject);
445 -- // Activate the view
449 Update ( me : mutable )
452 ---Purpose: Updates screen in function of modifications of
454 ---Category: Methods to modify the class definition
456 Update ( me : mutable;
457 AnUnderLayer : Layer from Visual3d;
458 AnOverLayer : Layer from Visual3d )
461 ---Purpose: Updates screen in function of modifications of
463 ---Category: Methods to modify the class definition
465 ViewMappingReset ( me : mutable )
468 ---Purpose: Sets the value of the mapping to be the same as
469 -- the mapping saved by the SetViewMappingDefaut method.
470 ---Category: Methods to modify the class definition
472 ViewOrientationReset ( me : mutable )
475 ---Purpose: Sets the value of the orientation to be the same as the
476 -- orientation saved by the SetViewOrientationDefaut method.
477 ---Category: Methods to modify the class definition
479 ---------------------------------------------------
480 -- Category: Methods to modify the class definition
482 ---------------------------------------------------
484 SetAnimationModeOn ( me : mutable;
485 degenerate : Boolean from Standard = Standard_False )
488 ---Purpose: Activates animation mode with an optional degeneration
489 -- according to the TypeOfDegenerateModel of each graphic structure
490 -- When the animation mode is activated in the view,
491 -- all Graphic3d_Structure are stored in a graphic object.
492 -- Warning: only ONE view may have animation mode turned on
494 ---Category: Methods to modify the class definition
496 SetAnimationModeOff ( me : mutable )
499 ---Purpose: Deactivates the animation mode.
500 ---Category: Methods to modify the class definition
502 AnimationModeIsOn ( me )
503 returns Boolean from Standard
506 ---Purpose: Returns the activity of the animation mode.
507 ---Category: Inquire methods
509 ---------------------------------------------------
510 -- Category: Methods to modify the class definition
512 ---------------------------------------------------
514 SetDegenerateModeOn ( me : mutable )
517 ---Purpose: Activates degenerate mode.
518 -- When the degenerate mode is activated in the view,
519 -- all Graphic3d_Structure with the type TOS_COMPUTED
520 -- displayed in this view are not computed.
521 ---Category: Methods to modify the class definition
523 SetDegenerateModeOff ( me : mutable )
526 ---Purpose: Deactivates the degenerate mode.
527 ---Category: Methods to modify the class definition
529 DegenerateModeIsOn ( me )
530 returns Boolean from Standard
533 ---Purpose: Returns the activity of the degenerate mode.
534 ---Category: Inquire methods
536 SetComputedMode ( me : mutable; aMode : Boolean from Standard ) is static;
538 ---Purpose: Switches computed HLR mode in the view
539 ---Category: Methods to modify the class definition
541 ComputedMode ( me ) returns Boolean from Standard is static;
543 ---Purpose: Returns the computed HLR mode state
544 ---Category: Inquire methods
546 ---------------------------------------------------
547 -- Category: Methods to modify the class definition
549 ---------------------------------------------------
551 ZBufferTriedronSetup ( me : mutable;
552 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
553 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
554 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
555 SizeRatio : Real from Standard = 0.8;
556 AxisDiametr : Real from Standard = 0.05;
557 NbFacettes : Integer from Standard = 12)
560 ---Purpose: Customization of the ZBUFFER Triedron.
561 --- Initializes Colors of X Y and axis
562 --- Scale ratio defines decreasing of trihedron size when
563 --- its position is out of a View
565 TriedronDisplay ( me : mutable;
566 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
567 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
568 AScale : Real from Standard = 0.02;
569 AsWireframe : Boolean from Standard = Standard_True )
572 ---Purpose: Display of the Triedron.
573 --- Initialize position, color and length of Triedron axes.
574 --- The scale is a percent of the window width.
575 --- If AsWireframe is FALSE triedron is shown in shaded mode
576 --- AColor is not considered for ZBUFFER mode
579 TriedronErase ( me : mutable )
582 ---Purpose: Erases the Triedron.
585 TriedronEcho ( me : mutable;
586 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
589 ---Purpose: Highlights the echo zone of the Triedron.
592 ------------------------------------------
593 ---Category: Graduated trihedron
594 ------------------------------------------
596 GetGraduatedTrihedron(me;
598 xname, yname, zname : out ExtendedString from TCollection;
600 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
602 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
604 drawgrid : out Boolean from Standard;
606 drawaxes : out Boolean from Standard;
607 -- Number of splits along axes --
608 nbx, nby, nbz : out Integer from Standard;
609 -- Offset for drawing values --
610 xoffset, yoffset, zoffset : out Integer from Standard;
611 -- Offset for drawing names of axes --
612 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
614 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
615 -- Length of tickmarks --
616 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
618 gridcolor : out Color from Quantity;
619 -- Colors of axis names --
620 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
621 -- Colors of axis and values --
622 xcolor, ycolor, zcolor : out Color from Quantity;
623 -- Name of font for names of axes --
624 fontOfNames : out AsciiString from TCollection;
625 -- Style of names of axes --
626 styleOfNames : out FontAspect from OSD;
627 -- Size of names of axes --
628 sizeOfNames : out Integer from Standard;
629 -- Name of font for values --
630 fontOfValues : out AsciiString from TCollection;
631 -- Style of values --
632 styleOfValues : out FontAspect from OSD;
634 sizeOfValues : out Integer from Standard)
635 returns Boolean from Standard
637 ---Purpose: Returns data of a graduated trihedron if displayed (return value is True)
639 GraduatedTrihedronDisplay(me : mutable;
641 xname, yname, zname : ExtendedString from TCollection;
643 xdrawname, ydrawname, zdrawname : Boolean from Standard;
645 xdrawvalues, ydrawvalues, zdrawvalues : Boolean from Standard;
647 drawgrid : Boolean from Standard;
649 drawaxes : Boolean from Standard;
650 -- Number of splits along axes --
651 nbx, nby, nbz : Integer from Standard;
652 -- Offset for drawing values --
653 xoffset, yoffset, zoffset : Integer from Standard;
654 -- Offset for drawing names of axes --
655 xaxisoffset, yaxisoffset, zaxisoffset : Integer from Standard;
657 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : Boolean from Standard;
658 -- Length of tickmarks --
659 xtickmarklength, ytickmarklength, ztickmarklength : Integer from Standard;
661 gridcolor : Color from Quantity;
662 -- Colors of axis names --
663 xnamecolor, ynamecolor, znamecolor : Color from Quantity;
664 -- Colors of axis and values --
665 xcolor, ycolor, zcolor : Color from Quantity;
666 -- Name of font for names of axes --
667 fontOfNames : AsciiString from TCollection;
668 -- Style of names of axes --
669 styleOfNames : FontAspect from OSD;
670 -- Size of names of axes --
671 sizeOfNames : Integer from Standard;
672 -- Name of font for values --
673 fontOfValues : AsciiString from TCollection;
674 -- Style of values --
675 styleOfValues : FontAspect from OSD;
677 sizeOfValues : Integer from Standard)
678 ---Purpose: Displays a graduated trihedron.
681 GraduatedTrihedronErase(me : mutable)
682 ---Purpose: Erases a graduated trihedron from the view.
685 ----------------------------
686 ---Category: Inquire methods
687 ----------------------------
690 returns Background from Aspect
693 ---Purpose: Returns the value of the default window background.
695 GradientBackground ( me )
696 returns GradientBackground from Aspect
699 ---Purpose: Returns the value of the window background.
702 returns Boolean from Standard
705 ---Purpose: Returns Standard_True if one of the structures
706 -- displayed in the view <me> contains Polygons,
707 -- Triangles or Quadrangles.
710 ASet : MapOfStructure from Graphic3d )
711 returns Boolean from Standard
714 ---Purpose: Returns Standard_True if one of the structures
715 -- in the set <ASet> contains Polygons, Triangles
719 returns ContextView from Visual3d
722 ---Purpose: Returns the current context of the view <me>.
723 ---C++: return const &
725 DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d )
728 ---Purpose: Returns the set of structures displayed in
732 returns Boolean from Standard
735 ---Purpose: Returns the activity flag of the view <me>.
738 returns Boolean from Standard
741 ---Purpose: Returns True if the window associated to the view
745 returns Boolean from Standard
748 ---Purpose: Returns Standard_True is the view <me> is deleted.
749 -- <me> is deleted after the call Remove (me).
750 ---Category: Inquire methods
753 XMin, YMin, ZMin : out Real from Standard;
754 XMax, YMax, ZMax : out Real from Standard )
757 ---Purpose: Returns the coordinates of the boundary box of all
758 -- structures displayed in the view <me>.
761 ASet : MapOfStructure from Graphic3d;
762 XMin, YMin, ZMin : out Real from Standard;
763 XMax, YMax, ZMax : out Real from Standard )
766 ---Purpose: Returns the coordinates of the boundary box of all
767 -- structures in the set <ASet>.
769 MinMaxValues ( me : mutable;
770 XMin, YMin : out Real from Standard;
771 XMax, YMax : out Real from Standard )
774 ---Purpose: Returns the coordinates of the projection of the
775 -- boundary box of all structures displayed in the view <me>.
777 MinMaxValues ( me : mutable;
778 ASet : MapOfStructure from Graphic3d;
779 XMin, YMin : out Real from Standard;
780 XMax, YMax : out Real from Standard )
783 ---Purpose: Returns the coordinates of the projection of the
784 -- boundary box of all structures in the set <ASet>.
786 NumberOfDisplayedStructures ( me )
787 returns Integer from Standard
790 ---Purpose: Returns number of displayed structures in
793 Projects ( me : mutable;
794 AX, AY, AZ : Real from Standard;
795 APX, APY, APZ : out Real from Standard )
798 ---Purpose: Returns the coordinates of the projection of the
799 -- 3d coordinates <AX>, <AY>, <AZ>.
802 returns Array2OfReal from TColStd
805 ---Purpose: Returns the transformation associated to the view <me>
806 ---C++: return const &
809 returns ViewMapping from Visual3d
812 ---Purpose: Returns the current mapping of the view <me>.
814 ViewMappingDefault ( me )
815 returns ViewMapping from Visual3d
818 ---Purpose: Returns the current reset mapping of the view <me>.
820 ViewOrientation ( me )
821 returns ViewOrientation from Visual3d
824 ---Purpose: Returns the current orientation of the view <me>.
826 ViewOrientationDefault ( me )
827 returns ViewOrientation from Visual3d
830 ---Purpose: Returns the current reset orientation of the view <me>.
833 returns Window from Aspect
835 ---Purpose: Returns the window associated to the view <me>.
836 -- Warning: Raises ViewDefinitionError if the associated
837 -- window isn't defined.
838 raises ViewDefinitionError from Visual3d is static;
840 LightLimit ( me ) returns Integer is static;
842 ---Purpose: Returns the MAX number of light associated to the view <me>.
844 PlaneLimit ( me ) returns Integer is static;
846 ---Purpose: Returns the MAX number of clipping planes
847 -- associated to the view <me>.
849 ViewManager ( me ) returns ViewManager from Visual3d is static;
851 ---Purpose: Returns the view manager handle which manage this view
853 ----------------------------
854 -- Category: Private methods
855 ----------------------------
858 AStructure : Structure from Graphic3d )
859 returns TypeOfAnswer from Visual3d
862 ---Purpose: Is it possible to display the structure
863 -- <AStructure> in the view <me> ?
864 ---Category: Private methods
866 ReCompute ( me : mutable;
867 AStructure : Structure from Graphic3d );
869 ---Purpose: Computes the new presentation of the
870 -- structure <AStructure> displayed in <me>
871 -- with the type Graphic3d_TOS_COMPUTED.
872 ---Category: Private methods
874 Compute ( me : mutable ) is static private;
876 ---Purpose: Computes the new presentation of the
877 -- Structures displayed in <me> with the type
878 -- Graphic3d_TOS_COMPUTED.
879 ---Category: Private methods
881 ChangeDisplayPriority ( me : mutable;
882 AStructure : Structure from Graphic3d;
883 OldPriority : Integer from Standard;
884 NewPriority : Integer from Standard )
887 ---Purpose: Changes the display priority of the structure <AStructure>.
888 ---Category: Private methods
890 Clear ( me : mutable;
891 AStructure : Structure from Graphic3d;
892 WithDestruction : Boolean from Standard )
895 ---Purpose: Clears the structure <AStructure> to the view <me>.
896 ---Category: Private methods
898 Connect ( me : mutable;
899 AMother : Structure from Graphic3d;
900 ADaughter : Structure from Graphic3d )
903 ---Purpose: Connects the structures <AMother> and <ADaughter>.
904 ---Category: Private methods
906 Disconnect ( me : mutable;
907 AMother : Structure from Graphic3d;
908 ADaughter : Structure from Graphic3d )
911 ---Purpose: Disconnects the structures <AMother> and <ADaughter>.
912 ---Category: Private methods
914 Display ( me : mutable;
915 AStructure : Structure from Graphic3d )
918 ---Purpose: Display the structure <AStructure> to the view <me>.
919 ---Category: Private methods
921 Display ( me : mutable;
922 AStructure : Structure from Graphic3d;
923 AnUpdateMode : TypeOfUpdate from Aspect )
926 ---Purpose: Display the structure <AStructure> to the view <me>.
927 ---Category: Private methods
929 Erase ( me : mutable;
930 AStructure : Structure from Graphic3d )
933 ---Purpose: Erases the structure <AStructure> from the view <me>.
934 ---Category: Private methods
936 Erase ( me : mutable;
937 AStructure : Structure from Graphic3d;
938 AnUpdateMode : TypeOfUpdate from Aspect )
941 ---Purpose: Erases the structure <AStructure> from the view <me>.
942 ---Category: Private methods
947 ---Purpose: Prints informations about the view <me>.
948 ---Category: Private methods
950 Highlight ( me : mutable;
951 AStructure : Structure from Graphic3d;
952 AMethod : TypeOfHighlightMethod from Aspect )
955 ---Purpose: Highlights the structure <AStructure> in the view <me>.
956 ---Category: Private methods
958 SetTransform ( me : mutable;
959 AStructure : Structure from Graphic3d;
960 ATrsf : Array2OfReal from TColStd )
963 ---Purpose: Transforms the structure <AStructure> in the view <me>.
964 ---Category: Private methods
966 UnHighlight ( me : mutable;
967 AStructure : Structure from Graphic3d )
970 ---Purpose: Suppress the highlighting on the structure <AStructure>
972 ---Category: Private methods
975 AStructure : Structure from Graphic3d )
976 returns Integer from Standard
979 ---Purpose: Returns an index != 0 if the structure <AStructure>
980 -- have another structure computed for the view <me>.
981 ---Category: Private methods
983 Identification ( me )
984 returns Integer from Standard
987 ---Purpose: Returns the identification number of the view <me>.
988 ---Category: Private methods
991 AStructure : Structure from Graphic3d )
992 returns Boolean from Standard
995 ---Purpose: Returns true if the structure <AStructure> is
996 -- displayed in the view <me>.
997 ---Category: Private methods
999 MatrixOfMapping ( me : mutable )
1000 returns Array2OfReal from TColStd
1001 is static; -- private;
1002 ---C++: return const &
1004 ---Purpose: Returns the current matrix of mapping of the view <me>.
1005 -- Warning: Stores the current matrix of mapping.
1007 MatrixOfOrientation ( me : mutable )
1008 returns Array2OfReal from TColStd
1009 is static; -- private;
1010 ---C++: return const &
1012 ---Purpose: Returns the current matrix of orientation of the view <me>.
1013 -- Warning: Stores the current matrix of orientation.
1015 SetRatio ( me : mutable )
1018 ---Purpose: Modifies the aspect ratio of the view <me> when the
1019 -- associated window is defined or resized.
1020 ---Category: Private methods
1022 UpdateLights ( me : mutable )
1025 ---Purpose: Updates the lights when the associated window is defined
1026 -- and when the view is activated.
1027 ---Category: Private methods
1029 UpdatePlanes ( me : mutable )
1032 ---Purpose: Updates the planes when the associated window is defined
1033 -- and when the view is activated.
1034 ---Category: Private methods
1036 UpdateView ( me : mutable )
1039 ---Purpose: Updates the associated c structure before a call to the
1041 ---Category: Private methods
1043 -----------------------------
1044 -- Category: Internal methods
1045 -----------------------------
1048 returns Address from Standard
1051 ---Purpose: Returns the c structure associated to <me>.
1052 ---Category: Private methods
1054 GraphicDriver ( me )
1055 returns GraphicDriver from Aspect
1058 ---Purpose: Returns the associated GraphicDriver.
1059 ---Category: Internal methods
1061 HaveTheSameOwner ( me;
1062 AStructure : Structure from Graphic3d )
1063 returns Integer from Standard
1066 ---Purpose: Returns an index != 0 if the structure <AStructure>
1067 -- have the same owner than another structure in the
1068 -- sequence of the computed structures.
1069 ---Category: Private methods
1072 APlotter : Plotter from Graphic3d )
1075 ---Purpose: Calls the method Plot for each Structure
1076 -- displayed in <me>.
1077 ---Category: Private methods
1079 Print (me; AnUnderLayer : Layer from Visual3d;
1080 AnOverLayer : Layer from Visual3d;
1081 hPrnDC : Handle from Aspect;
1082 showBackground : Boolean;
1084 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1085 theScaleFactor : Real from Standard = 1.0)
1086 returns Boolean from Standard is static;
1089 ---Purpose: print the contents of all layers of the view to the printer.
1090 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1091 -- <showBackground> : When set to FALSE then print the view without background color
1092 -- (background is white)
1093 -- else set to TRUE for printing with current background color.
1094 -- <filename>: If != NULL, then the view will be printed to a file.
1095 -- <printAlgo>: Select print algorithm: stretch, tile.
1096 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1097 -- printings accordingly to the scale factor selected in the printer
1098 -- properties dialog.
1099 -- Returns Standard_True if the data is passed to the printer, otherwise
1100 -- Standard_False if the print operation failed due to printer error
1101 -- or insufficient memory.
1102 -- Warning: Works only under Windows.
1104 Print (me; hPrnDC : Handle from Aspect;
1105 showBackground : Boolean;
1107 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
1108 theScaleFactor : Real from Standard = 1.0 )
1109 returns Boolean from Standard is static;
1112 ---Purpose: print the contents of the view to printer.
1113 -- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
1114 -- <showBackground> : When set to FALSE then print the view without background color
1115 -- (background is white)
1116 -- else set to TRUE for printing with current background color.
1117 -- <filename>: If != NULL, then the view will be printed to a file.
1118 -- <printAlgo>: Select print algorithm: stretch, tile.
1119 -- <theScaleFactor>: Scaling coefficient, used internally to scale the
1120 -- printings accordingly to the scale factor selected in the printer
1121 -- properties dialog.
1122 -- Returns Standard_True if the data is passed to the printer, otherwise
1123 -- Standard_False if the print operation failed due to printer error
1124 -- or insufficient memory.
1125 -- Warning: Works only under Windows.
1127 SetTransparency ( me : mutable;
1128 AFlag : Boolean from Standard )
1131 ---Purpose: if <AFlag> is Standard_True then the transparency
1132 -- is managed in the view <me>.
1133 -- Default Standard_False
1134 ---Category: Internal methods
1136 ZBufferIsActivated ( me )
1137 returns Boolean from Standard
1140 ---Purpose: Returns Standard_True if the ZBuffer is activated
1141 -- in the view <me> and Standard_False if not.
1142 ---Category: Internal methods
1144 SetZBufferActivity ( me : mutable; AnActivity : Integer from Standard )
1147 ---Purpose: Activates the ZBuffer if the integer <AnActivity>
1149 -- Deactivates the ZBuffer if the integer <AnActivity>
1151 -- If the integer <AnActivity> is equal to -1 then
1152 -- - the ZBuffer is activated if
1153 -- me->Context ().Visualization () == Visual3d_TOV_SHADING
1154 -- - the ZBuffer is deactivated if
1155 -- me->Context ().Visualization () == Visual3d_TOV_WIREFRAME
1156 ---Category: Internal methods
1159 returns Layer from Visual3d;
1161 ---Purpose: Returns the underlay of the view <me>.
1162 ---Category: Private methods
1163 ---C++: return const &
1166 returns Layer from Visual3d;
1168 ---Purpose: Returns the underlay of the view <me>.
1169 ---Category: Private methods
1170 ---C++: return const &
1172 EnableDepthTest( me; enable : Boolean from Standard )
1175 ---Purpose: turns on/off opengl depth
1177 IsDepthTestEnabled( me ) returns Boolean from Standard
1180 ---Purpose: returns current state of the opengl depth testing
1182 ReadDepths( me; x,y,width,height: Integer from Standard;
1185 ---Purpose: Reads depths of shown pixels of the given rectangle
1187 FBOCreate( me : mutable; width,height: Integer from Standard )
1188 returns PtrFrameBuffer from Graphic3d
1191 ---Purpose: Generate offscreen FBO in the graphic library
1193 FBORelease( me : mutable;
1194 fboPtr : in out PtrFrameBuffer from Graphic3d )
1197 ---Purpose: Remove offscreen FBO from the graphic library
1199 FBOGetDimensions( me : mutable;
1200 fboPtr : PtrFrameBuffer from Graphic3d;
1201 width, height : out Integer from Standard;
1202 widthMax, heightMax : out Integer from Standard )
1205 ---Purpose: Read offscreen FBO configuration.
1207 FBOChangeViewport( me : mutable;
1208 fboPtr : in out PtrFrameBuffer from Graphic3d;
1209 width, height : Integer from Standard )
1212 ---Purpose: Change offscreen FBO viewport.
1214 BufferDump( me : mutable;
1215 buffer : in out CRawBufferData from Image )
1216 returns Boolean from Standard
1219 ---Purpose: Dump active rendering buffer into specified memory buffer.
1221 EnableGLLight( me; enable : Boolean from Standard )
1224 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1226 IsGLLightEnabled( me ) returns Boolean from Standard
1229 ---Purpose: returns the current state of the gl lighting
1230 -- currently used in triedron displaying
1233 theFileName : CString from Standard;
1234 theFormat : ExportFormat from Graphic3d;
1235 theSortType : SortType from Graphic3d = Graphic3d_ST_BSP_Tree;
1236 thePrecision : Real from Standard = 0.005;
1237 theProgressBarFunc : Address from Standard = NULL;
1238 theProgressObject : Address from Standard = NULL )
1239 returns Boolean from Standard;
1241 -- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
1242 -- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
1243 -- Notice however that results may differ a lot and do not contain some elements.
1248 -- Classe : Visual3d_View
1250 -- Purpose : Declaration of the variables specific to views.
1252 -- Reminder : A view is defined by:
1256 -- - a ViewOrientation
1259 -- the associated C structure
1260 MyCView : CView from Graphic3d;
1262 -- the context of the view : Aliasing, Depth-Cueing, Lights ...
1263 MyContext : ContextView from Visual3d;
1265 -- the current mapping of the view
1266 MyViewMapping : ViewMapping from Visual3d;
1268 -- the reset mapping of the view
1269 MyViewMappingReset : ViewMapping from Visual3d;
1271 -- the current orientation of the view
1272 MyViewOrientation : ViewOrientation from Visual3d;
1274 -- the reset orientation of the view
1275 MyViewOrientationReset : ViewOrientation from Visual3d;
1277 -- the associated window
1278 MyWindow : Window from Aspect;
1280 -- the transformation
1281 MyTransformation : Array2OfReal from TColStd;
1283 -- the matrix management
1284 MyMatrixOfMapping : Array2OfReal from TColStd;
1285 MyMatrixOfOrientation : Array2OfReal from TColStd;
1287 -- association Structure_COMPUTE and Structure_Computed
1288 MyTOCOMPUTESequence : SequenceOfStructure from Graphic3d;
1289 MyCOMPUTEDSequence : SequenceOfStructure from Graphic3d;
1291 -- the graphic driver used
1292 MyGraphicDriver : GraphicDriver from Graphic3d;
1294 -- the background of the associated window
1295 MyBackground : Background from Aspect;
1297 -- the gradient background of the associated window
1298 MyGradientBackground : GradientBackground from Aspect;
1300 -- the displayed structures in the view
1301 MyDisplayedStructure : MapOfStructure from Graphic3d;
1303 -- the ViewManager associated with the view
1304 -- MyPtrViewManager : Address from Standard;
1305 MyPtrViewManager : ViewManagerPtr from Visual3d;
1308 MyCBitFields : CBitFields8 from Graphic3d;
1310 MyGTrihedron : CGraduatedTrihedron from Graphic3d;
1314 class ViewManager from Visual3d