1 -- Created on: 1992-01-15
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 -- Modified: FMN - 24/12/97 -> Suppression GEOMLITE
18 -- stt:25-02-98; S3558: ajout IfManageStandardEvent
19 -- stt:08-04-98; suppr IfManageStandardEvent
20 -- CAL - 18/08/98 -> S3892. Ajout grilles 3d.
21 -- BGN - 16-09-98; Points d'entree du Triedre (S3819, Phase 1)
22 -- 22-09-98 ; BGN : S3989 (anciennement S3819)
23 -- TypeOfTriedron* from Aspect(et pas V3d)
24 -- CAL - 21/10/98 -> Speciale. Ajout methode Tumble.
25 -- 29-OCT-98 : DCB : Adding ScreenCopy () method.
26 -- GG - 24/01/00 : -> Remove internal PixToRef() method, use Convert()
28 -- -> Rename internal RefToPix() to Convert() method.
29 -- -> Add ConvertToGrid() methods,
30 -- the Compute() internal method become private.
31 -- -> Add SetProjModel() method.
32 -- VKH - 15/11/99 : G004
33 -- -> Add method Dump()
34 -- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
35 -- -> Add Print method (works only under Windows).
37 -- -> Add EnableDepthTest() & IsDepthTestEnabled().
38 -- VSV - 28/05/02: ZBUFFER mode of Trihedron
39 -- SAV - 23/12/02 -> Added methods to set background image
40 -- NKV - 23/07/07 -> Define custom projection and model view matrixes
41 -- NKV - 08/02/07 -> Add ConvertWithProj() method
43 class View from V3d inherits TShared from MMgt
45 ---Purpose: Defines the application object VIEW for the
46 -- VIEWER application.
47 -- The methods of this class allow the editing
48 -- and inquiring the parameters linked to the view.
49 -- (Projection,Mapping,Zclipping,DepthCueing,AntiAliasing
51 -- Provides a set of services common to all types of view.
52 -- Warning: The default parameters are defined by the class
53 -- Viewer (Example : SetDefaultViewSize()).
54 -- Certain methods are mouse oriented, and it is
55 -- necessary to know the difference between the start and
56 -- the continuation of this gesture in putting the method
58 -- Example : Shifting the eye-view along the screen axes.
60 -- View->Move(10.,20.,0.,True) (Starting motion)
61 -- View->Move(15.,-5.,0.,False) (Next motion)
71 ColorScale from Aspect,
72 Array2OfReal from TColStd,
75 Structure from Graphic3d,
78 ListOfTransient from V3d,
79 ListIteratorOfListOfTransient from TColStd,
82 TypeOfOrientation from V3d,
83 TypeOfShadingModel from V3d,
84 TypeOfSurfaceDetail from V3d,
85 TextureEnv from Graphic3d,
86 TypeOfVisualization from V3d,
87 TypeOfZclipping from V3d,
88 TypeOfBackfacingModel from V3d,
89 StereoDumpOptions from V3d,
93 ContextView from Visual3d,
94 Vector from Graphic3d,
95 Vertex from Graphic3d,
96 Camera_Handle from Graphic3d,
99 BufferType from Graphic3d,
100 Background from Aspect,
101 GradientBackground from Aspect,
102 TypeOfColor from Quantity,
103 NameOfColor from Quantity,
105 Length from Quantity,
106 PlaneAngle from Quantity,
107 Parameter from Quantity,
108 Factor from Quantity,
110 Coefficient from Quantity,
112 Array2OfReal from TColStd,
113 ViewerPointer from V3d,
114 TypeOfTriedronEcho from Aspect,
115 TypeOfTriedronPosition from Aspect,
116 RenderingContext from Aspect,
117 GraphicCallbackProc from Aspect,
118 FillMethod from Aspect,
119 GradientFillMethod from Aspect,
120 FontAspect from Font,
121 AsciiString from TCollection,
122 ExtendedString from TCollection,
123 PrintAlgo from Aspect,
124 ClipPlane_Handle from Graphic3d,
125 GraduatedTrihedron from Graphic3d,
126 SequenceOfHClipPlane from Graphic3d,
127 RenderingMode from Graphic3d,
128 RenderingParams from Graphic3d,
133 BadValue from V3d, TypeMismatch from Standard,
134 MultiplyDefined from Standard,UnMapped from V3d
138 Create ( VM : Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
139 ---Purpose: Initializes the view.
141 Create (theVM : Viewer; theView : View from V3d);
142 ---Purpose: Initializes the view by copying.
144 --------------------------------------------------------
145 ---Category: Methods to modify the Status of the view
146 --------------------------------------------------------
148 SetWindow ( me : mutable ; IdWin : Window )
149 ---Purpose: Activates the view in the window specified and Map the
150 -- Window to the screen.
151 raises MultiplyDefined from Standard;
153 ---Purpose: Warning! raises MultiplyDefined from Standard
154 -- if the view is already activated in a window.
155 -- Warning: The view is centered and resized to preserve
156 -- the height/width ratio of the window.
158 SetWindow ( me : mutable ;
159 aWindow : Window from Aspect;
160 aContext : RenderingContext from Aspect;
161 aDisplayCB : GraphicCallbackProc from Aspect;
162 aClientData : Address from Standard
164 ---Purpose: Activates the view in the specified Window
165 -- If <aContext> is not NULL the graphic context is used
166 -- to draw something in this view.
167 -- Otherwise an internal graphic context is created.
168 -- If <aDisplayCB> is not NULL then a user display CB is
169 -- call at the end of the OCC graphic traversal and just
170 -- before the swap of buffers. The <aClientData> is pass
171 -- to this call back.
172 raises MultiplyDefined from Standard;
174 ---Purpose: Warning! raises MultiplyDefined from Standard
175 -- if the view is already activated in a window.
176 -- Warning: The view is centered and resized to preserve
177 -- the height/width ratio of the window.
179 SetMagnify (me: mutable; IdWin : Window;
180 aPreviousView : View from V3d;
181 x1 , y1 , x2 , y2: Integer from Standard)
186 ---Purpose: Destroys the view.
188 Update ( me ) is static;
190 ---Purpose: Deprecated, Redraw() should be used instead.
194 ---Purpose: Redisplays the view even if there has not
195 -- been any modification.
196 -- Must be called if the view is shown.
197 -- (Ex: DeIconification ) .
199 RedrawImmediate ( me );
201 ---Purpose: Updates layer of immediate presentations.
205 ---Purpose: Invalidates view content but does not redraw it.
207 Redraw ( me ;x,y,width,height: Integer from Standard);
209 ---Purpose: Redisplays the view area after esxposure.
210 -- [x,y] define the min xy area position
211 -- [width,height] the size of the area in pixel unit.
213 MustBeResized ( me : mutable )
215 ---Purpose: Must be called when the window supporting the
216 -- view changes size.
217 raises UnMapped from V3d;
218 ---Purpose: if the view is not mapped on a window.
219 -- Warning: The view is centered and resized to preserve
220 -- the height/width ratio of the window.
222 DoMapping ( me : mutable );
224 ---Purpose: Must be called when the window supporting the
225 -- view is mapped or unmapped.
227 IsEmpty ( me ) returns Boolean;
229 ---Purpose: Returns the status of the view regarding
230 -- the displayed structures inside
231 -- Returns True is The View is empty
235 ---Purpose: Updates the lights of the view. The view is redrawn.
237 AutoZFit (me : mutable);
239 ---Purpose: If automatic z-range fitting is turned on, adjusts Z-min and Z-max
240 -- projection volume planes with call to ZFitAll.
242 ZFitAll (me : mutable; theScaleFactor : Real from Standard = 1.0);
244 ---Purpose: Change Z-min and Z-max planes of projection volume to match the
245 -- displayed objects.
247 --------------------------------------------------------
248 ---Category: Methods to modify the Attributes of the view
249 --------------------------------------------------------
251 SetBackgroundColor ( me : mutable ;
252 Type : TypeOfColor; V1, V2, V3 : Parameter );
254 ---Purpose: Defines the background colour of the view
256 -- the colour definition type,
257 -- and the three corresponding values.
259 SetBackgroundColor ( me : mutable ; Color : Color from Quantity );
261 ---Purpose: Defines the background colour of the view
263 -- the colour object.
265 SetBackgroundColor ( me : mutable ; Name : NameOfColor );
267 ---Purpose: Defines the background colour of the view
269 -- the colour name in the form Quantity_NOC_xxxx .
271 SetBgGradientColors ( me : mutable ;
272 Color1 : Color from Quantity;
273 Color2 : Color from Quantity;
274 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
275 update : Boolean from Standard = Standard_False );
277 ---Purpose: Defines the gradient background colours of the view
279 -- two colour objects,
280 -- and fill method (horizontal by default)
282 SetBgGradientColors ( me : mutable ;
283 Color1 : NameOfColor;
284 Color2 : NameOfColor;
285 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
286 update : Boolean from Standard = Standard_False );
288 ---Purpose: Defines the gradient background colours of the view
290 -- two colour names in the form Quantity_NOC_xxxx,
291 -- and fill method (horizontal by default)
293 SetBgGradientStyle( me : mutable ;
294 AMethod : GradientFillMethod from Aspect = Aspect_GFM_HOR;
295 update : Boolean from Standard = Standard_False);
297 ---Purpose: Defines the gradient background fill method of the view
299 SetBackgroundImage( me : mutable; FileName : CString from Standard;
300 FillStyle : FillMethod from Aspect = Aspect_FM_CENTERED;
301 update : Boolean from Standard = Standard_False );
303 ---Purpose: Defines the background texture of the view
305 --- texture image file name,
306 --- and fill method (centered by default)
308 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
309 update : Boolean from Standard = Standard_False );
311 ---Purpose: Defines the textured background fill method of the view
313 SetAxis ( me : mutable; X,Y,Z : Coordinate ;
314 Vx,Vy,Vz : Parameter )
316 ---Purpose: Definition of an axis from its origin and
318 -- This will be the current axis for rotations and movements.
319 raises BadValue from V3d;
320 ---Purpose: Warning! raises BadValue from V3d if the vector normal is NULL. .
322 SetShadingModel ( me : mutable; Model : TypeOfShadingModel );
324 ---Purpose: Defines the shading model for the
325 -- visualisation ZBUFFER mode.
326 -- Various models are available.
328 SetSurfaceDetail(me : mutable; SurfaceDetail : TypeOfSurfaceDetail);
330 ---Purpose: select the kind of rendering for texture mapping
331 -- no texture mapping by default
333 SetTextureEnv(me : mutable; ATexture : TextureEnv from Graphic3d);
335 ---Purpose: set the environment texture to use
336 -- no environment texture by default
338 SetVisualization ( me : mutable;
339 Mode : TypeOfVisualization from V3d );
341 ---Purpose: Defines the visualisation mode in the view.
343 SetAntialiasingOn ( me : mutable );
345 ---Purpose: Activates antialiasing in the view.
347 SetAntialiasingOff ( me : mutable );
349 ---Purpose: Desactivates antialiasing in the view.
351 SetZClippingDepth ( me : mutable; Depth : Length );
353 ---Purpose: Defines the depth of the medium clipping plane.
355 SetZClippingWidth ( me : mutable; Width : Length )
357 ---Purpose: Defines the thicknes around the medium clippling plane. .
358 raises BadValue from V3d;
359 -- If the thickness is <= 0
361 SetZClippingType ( me : mutable; Type : TypeOfZclipping );
363 ---Purpose: Defines the type of ZClipping.
365 SetZCueingDepth ( me : mutable; Depth : Length );
367 ---Purpose: Defines the depth of the medium plane.
369 SetZCueingWidth ( me : mutable; Width : Length )
371 ---Purpose: Defines the thickness around the medium plane.
372 raises BadValue from V3d;
373 -- If thickness is <= 0
375 SetZCueingOn ( me : mutable );
377 ---Purpose: Activates ZCueing in the view.
379 SetZCueingOff ( me : mutable );
381 ---Purpose: Desactivates ZCueing in the view.
383 SetLightOn( me : mutable ; MyLight : Light from V3d )
385 ---Purpose: Activates MyLight in the view.
386 raises BadValue from V3d;
387 -- If No More Light can be activated in MyView .
389 SetLightOn( me : mutable )
391 ---Purpose: Activates all the lights defined in this view.
392 raises BadValue from V3d;
393 -- If No More Light can be activated in MyView .
395 SetLightOff( me : mutable ; MyLight : Light from V3d );
397 ---Purpose: Desactivate MyLight in this view.
399 SetLightOff( me : mutable );
401 ---Purpose: Deactivate all the Lights defined in this view.
403 IsActiveLight( me ; aLight: Light from V3d )
404 returns Boolean from Standard;
406 ---Purpose: Returns TRUE when the light is active in this view.
408 SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
409 returns Boolean from Standard;
410 ---Purpose: sets the immediate update mode and returns the previous one.
412 ---------------------------------------------------
414 ---------------------------------------------------
416 ZBufferTriedronSetup ( me : mutable;
417 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
418 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
419 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
420 SizeRatio : Real from Standard = 0.8;
421 AxisDiametr : Real from Standard = 0.05;
422 NbFacettes : Integer from Standard = 12)
425 ---Purpose: Customization of the ZBUFFER Triedron.
426 --- XColor,YColor,ZColor - colors of axis
427 --- SizeRatio - ratio of decreasing of the trihedron size when its phisical
428 --- position comes out of the view
429 --- AxisDiametr - diameter relatively to axis length
430 --- NbFacettes - number of facettes of cylinders and cones
432 TriedronDisplay ( me : mutable;
433 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
434 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
435 AScale : Real from Standard = 0.02;
436 AMode : TypeOfVisualization from V3d = V3d_WIREFRAME )
439 ---Purpose: Display of the Triedron.
440 --- Initialize position, color and length of Triedron axes.
441 --- The scale is a percent of the window width.
444 TriedronErase ( me : mutable )
447 ---Purpose: Erases the Triedron.
450 TriedronEcho ( me : mutable;
451 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
454 ---Purpose: Highlights the echo zone of the Triedron.
457 ---------------------------------
458 ---Category: Graduated trihedron
459 ---------------------------------
461 GetGraduatedTrihedron(me;
462 theTrigedronData: out GraduatedTrihedron from Graphic3d)
463 ---Purpose: Returns data of a graduated trihedron.
466 GraduatedTrihedronDisplay(me : mutable;
467 theTrigedronData: in GraduatedTrihedron from Graphic3d)
468 ---Purpose: Displays a graduated trihedron.
471 GraduatedTrihedronErase(me : mutable)
472 ---Purpose: Erases a graduated trihedron from the view.
475 ---------------------------------------------------
476 -- Color Scale methods
477 ---------------------------------------------------
479 SetLayerMgr(me : mutable; aMgr : LayerMgr from V3d);
481 ColorScaleDisplay(me : mutable);
483 ColorScaleErase(me : mutable);
485 ColorScaleIsDisplayed(me)
486 returns Boolean from Standard;
489 returns ColorScale from Aspect;
491 --------------------------------------------------------
492 ---Category: Methods to modify the Projection of the view
493 --------------------------------------------------------
495 SetFront(me: mutable);
497 ---Purpose: modify the Projection of the view perpendicularly to
498 -- the privileged plane of the viewer.
500 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
501 Start : Boolean = Standard_True )
503 ---Purpose: Rotates the eye about the coordinate system of
504 -- reference of the screen
505 -- for which the origin is the view point of the projection,
506 -- with a relative angular value in RADIANS with respect to
507 -- the initial position expressed by Start = Standard_True
508 raises BadValue from V3d;
509 ---Purpose: Warning! raises BadValue from V3d
510 -- If the eye, the view point, or the high point are
511 -- aligned or confused.
513 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
515 Start : Boolean = Standard_True )
517 ---Purpose: Rotates the eye about the coordinate system of
518 -- reference of the screen
519 -- for which the origin is Gravity point {X,Y,Z},
520 -- with a relative angular value in RADIANS with respect to
521 -- the initial position expressed by Start = Standard_True
522 raises BadValue from V3d;
523 ---Purpose: If the eye, the view point, or the high point are
524 -- aligned or confused.
526 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
528 Start : Boolean = Standard_True );
530 ---Purpose: Rotates the eye about one of the coordinate axes of
531 -- of the view for which the origin is the Gravity point{X,Y,Z}
532 -- with an relative angular value in RADIANS with
533 -- respect to the initial position expressed by
534 -- Start = Standard_True
536 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
537 Start : Boolean = Standard_True ) ;
539 ---Purpose: Rotates the eye about one of the coordinate axes of
540 -- of the view for which the origin is the view point of the
541 -- projection with an relative angular value in RADIANS with
542 -- respect to the initial position expressed by
543 -- Start = Standard_True
545 Rotate ( me : mutable ; Angle : PlaneAngle ;
546 Start : Boolean = Standard_True );
548 ---Purpose: Rotates the eye around the current axis a relative
549 -- angular value in RADIANS with respect to the initial
550 -- position expressed by Start = Standard_True
552 Move ( me : mutable ; Dx,Dy,Dz : Length ;
553 Start : Boolean = Standard_True )
555 ---Purpose: Movement of the eye parallel to the coordinate system
556 -- of reference of the screen a distance relative to the
557 -- initial position expressed by Start = Standard_True.
558 raises BadValue from V3d;
559 -- If the eye, the view point, or the high point are
560 -- aligned or confused.
562 Move ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
563 Start : Boolean = Standard_True )
565 ---Purpose: Movement of the eye parallel to one of the axes of the
566 -- coordinate system of reference of the view a distance
567 -- relative to the initial position expressed by
568 -- Start = Standard_True.
569 raises BadValue from V3d;
570 -- If the eye, view point, or high point are aligned or confused.
572 Move ( me : mutable ; Length : Length ;
573 Start : Boolean = Standard_True )
575 ---Purpose: Movement of the eye parllel to the current axis
576 -- a distance relative to the initial position
577 -- expressed by Start = Standard_True
578 raises BadValue from V3d;
579 -- If the eye, view point, or high point are aligned or confused.
581 Translate ( me : mutable ; Dx,Dy,Dz : Length ;
582 Start : Boolean = Standard_True )
584 ---Purpose: Movement of the ye and the view point parallel to the
585 -- frame of reference of the screen a distance relative
586 -- to the initial position expressed by
587 -- Start = Standard_True
588 raises BadValue from V3d;
589 -- If the eye, view point, or high point are aligned or confused.
591 Translate ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
592 Start : Boolean = Standard_True );
594 ---Purpose: Movement of the eye and the view point parallel to one
595 -- of the axes of the fame of reference of the view a
596 -- distance relative to the initial position
597 -- expressed by Start = Standard_True
599 Translate ( me : mutable ; Length : Length ;
600 Start : Boolean = Standard_True );
602 ---Purpose: Movement of the eye and view point parallel to
603 -- the current axis a distance relative to the initial
604 -- position expressed by Start = Standard_True
607 theXp : Integer from Standard;
608 theYp : Integer from Standard;
609 theZoomFactor : Factor from Quantity = 1)
611 ---Purpose: places the point of the view corresponding
612 -- at the pixel position x,y at the center of the window
613 -- and updates the view.
616 Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
617 Start : Boolean = Standard_True )
619 ---Purpose: Rotation of the view point around the frame of reference
620 -- of the screen for which the origin is the eye of the
621 -- projection with a relative angular value in RADIANS
622 -- with respect to the initial position expressed by
623 -- Start = Standard_True
624 raises BadValue from V3d;
625 -- If the eye, view point, or high point are aligned or confused.
627 Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
628 Start : Boolean = Standard_True )
631 ---Purpose: Rotation of the view point around one of the axes of the
632 -- frame of reference of the view for which the origin is
633 -- the eye of the projection with an angular value in
634 -- RADIANS relative to the initial position expressed by
635 -- Start = Standard_True
637 Turn ( me : mutable ; Angle : PlaneAngle ;
638 Start : Boolean = Standard_True );
640 ---Purpose: Rotation of the view point around the current axis an
641 -- angular value in RADIANS relative to the initial
642 -- position expressed by Start = Standard_True
644 SetTwist ( me : mutable ; Angle : PlaneAngle )
646 ---Purpose: Defines the angular position of the high point of
647 -- the reference frame of the view with respect to the
648 -- Y screen axis with an absolute angular value in
650 raises BadValue from V3d;
651 -- If the eye, view point, or high point are aligned or confused.
653 SetEye( me : mutable ; X,Y,Z : Coordinate )
655 ---Purpose: Defines the position of the eye..
656 raises BadValue from V3d ;
657 -- If the eye, view point, or high point are aligned or confused.
659 SetDepth( me : mutable ; Depth : Length )
661 ---Purpose: Defines the Depth of the eye from the view point
662 -- without update the projection .
663 raises BadValue from V3d ;
664 -- If the Depth is <= 0.
666 SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
668 ---Purpose: Defines the orientation of the projection.
669 raises BadValue from V3d ;
670 -- If the eye, view point, or high point are aligned or confused.
672 SetProj( me : mutable ; Orientation : TypeOfOrientation )
674 ---Purpose: Defines the orientation of the projection .
675 raises BadValue from V3d ;
676 -- If the eye, view point, or high point are aligned or confused.
679 SetAt( me : mutable ; X,Y,Z : Coordinate )
681 ---Purpose: Defines the position of the view point.
682 raises BadValue from V3d ;
683 -- If the eye, view point, or high point are aligned or confused.
685 SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
687 ---Purpose: Defines the orientation of the high point.
688 raises BadValue from V3d ;
689 -- If the eye, view point, or high point are aligned or confused.
691 SetUp( me : mutable ; Orientation : TypeOfOrientation )
693 ---Purpose: Defines the orientation(SO) of the high point.
694 raises BadValue from V3d ;
695 -- If the eye, view point, or high point are aligned or confused.
697 SetViewOrientationDefault( me : mutable );
699 ---Purpose: Saves the current state of the orientation of the view
700 -- which will be the return state at ResetViewOrientation.
702 ResetViewOrientation ( me : mutable );
704 ---Purpose: Resets the orientation of the view.
707 --------------------------------------------------------
708 ---Category: Methods to modify the Mapping of the view
709 --------------------------------------------------------
711 Panning (me : mutable;
712 theDXv : Real from Standard;
713 theDYv : Real from Standard;
714 theZoomFactor : Factor from Quantity = 1;
715 theToStart : Boolean = Standard_True);
717 ---Purpose: Translates the center of the view along "x" and "y" axes of
718 -- view projection. Can be used to perform interactive panning operation.
719 -- In that case the DXv, DXy parameters specify panning relative to the
720 -- point where the operation is started.
721 -- @param theDXv [in] the relative panning on "x" axis of view projection, in view space coordinates.
722 -- @param theDYv [in] the relative panning on "y" axis of view projection, in view space coordinates.
723 -- @param theZoomFactor [in] the zooming factor.
724 -- @param theToStart [in] pass TRUE when starting panning to remember view
725 -- state prior to panning for relative arguments. If panning is started,
726 -- passing {0, 0} for {theDXv, theDYv} will return view to initial state.
727 -- Performs update of view.
729 SetCenter (me : mutable; theXp, theYp : Integer from Standard)
731 ---Purpose: Relocates center of screen to the point, determined by
732 -- {Xp, Yp} pixel coordinates relative to the bottom-left corner of
733 -- screen. To calculate pixel coordinates for any point from world
734 -- coordinate space, it can be projected using "Project".
735 -- @param theXp [in] the x coordinate.
736 -- @param theYp [in] the y coordinate.
737 raises BadValue from V3d;
738 -- If one of the dimensions of the projection is NULL.
740 SetSize ( me : mutable; theSize : Length )
742 ---Purpose: Defines the view projection size in its maximum dimension,
743 -- keeping the inital height/width ratio unchanged.
744 raises BadValue from V3d;
745 -- If <theSize> is <= 0.0
747 SetZSize ( me : mutable ; Size : Length )
749 ---Purpose: Defines the Depth size of the view
750 -- Front Plane will be set to Size/2.
751 -- Back Plane will be set to -Size/2.
752 -- Any Object located Above the Front Plane or
753 -- behind the Back Plane will be Clipped .
754 -- NOTE than the XY Size of the View is NOT modified .
755 raises BadValue from V3d ;
756 -- If the size of the view is <= 0
758 SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
760 ---Purpose: Zooms the view by a factor relative to the initial
761 -- value expressed by Start = Standard_True
763 raises BadValue from V3d ;
764 -- If the zoom coefficient is <= 0
766 SetScale ( me : mutable ; Coef : Factor )
768 ---Purpose: Zooms the view by a factor relative to the value
769 -- initialised by SetViewMappingDefault().
771 raises BadValue from V3d ;
772 -- If the zoom coefficient is <= 0
774 SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
776 ---Purpose: Sets anisotropic (axial) scale factors <Sx>, <Sy>, <Sz> for view <me>.
777 -- Anisotropic scaling operation is performed through multiplying
778 -- the current view orientation matrix by a scaling matrix:
784 raises BadValue from V3d ;
785 -- If the one of factors <= 0
787 FitAll (me : mutable;
788 theMargin : Coefficient = 0.01;
789 theToUpdate : Boolean from Standard = Standard_True);
791 ---Purpose: Adjust view parameters to fit the displayed scene, respecting height / width ratio.
792 -- The Z clipping range (depth range) is fitted if AutoZFit flag is TRUE.
793 -- Throws program error exception if margin coefficient is < 0 or >= 1.
795 -- @param theMargin [in] the margin coefficient for view borders.
796 -- @param theToUpdate [in] flag to perform view update.
798 DepthFitAll( me : mutable ; Aspect : Coefficient = 0.01;
799 Margin : Coefficient = 0.01 );
801 ---Purpose: Adjusts the viewing volume so as not to clip the displayed objects by front and back
802 -- and back clipping planes. Also sets depth value automatically depending on the
803 -- calculated Z size and Aspect parameter.
804 -- NOTE than the original XY size of the view is NOT modified .
806 FitAll (me : mutable;
807 theMinXv : Real from Standard;
808 theMinYv : Real from Standard;
809 theMaxXv : Real from Standard;
810 theMaxYv : Real from Standard)
812 ---Purpose: Centers the defined projection window so that it occupies
813 -- the maximum space while respecting the initial
814 -- height/width ratio.
815 -- NOTE than the original Z size of the view is NOT modified .
816 raises BadValue from V3d;
817 -- If the defined projection window has zero size.
819 WindowFit (me : mutable; theMinXp, theMinYp, theMaxXp, theMaxYp : Integer)
821 ---Purpose: Centers the defined PIXEL window so that it occupies
822 -- the maximum space while respecting the initial height/width ratio.
823 -- NOTE than the original Z size of the view is NOT modified.
824 -- @param theMinXp [in] pixel coordinates of minimal corner on x screen axis.
825 -- @param theMinYp [in] pixel coordinates of minimal corner on y screen axis.
826 -- @param theMaxXp [in] pixel coordinates of maximal corner on x screen axis.
827 -- @param theMaxYp [in] pixel coordinates of maximal corner on y screen axis.
829 SetViewMappingDefault( me : mutable );
831 ---Purpose: Saves the current view mapping. This will be the
832 -- state returned from ResetViewmapping.
834 ResetViewMapping ( me : mutable );
836 ---Purpose: Resets the centering of the view.
839 Reset ( me : mutable; update : Boolean from Standard = Standard_True );
841 ---Purpose: Resets the centering and the orientation of the view
843 ---------------------------------------------------
844 ---Category: Inquire methods
845 ---------------------------------------------------
847 Convert( me ; Vp : Integer ) returns Length
849 ---Purpose : Converts the PIXEL value
850 -- to a value in the projection plane.
851 raises UnMapped from V3d;
852 -- If the view is not mapped on the window.
854 Convert( me ; Xp,Yp : Integer ; Xv,Yv : out Coordinate )
856 ---Purpose : Converts the point PIXEL into a point projected
857 -- in the reference frame of the projection plane.
858 raises UnMapped from V3d;
859 -- If the view is not mapped on the window.
861 Convert( me ; Vv : Length ) returns Integer
863 ---Purpose : Converts tha value of the projection plane into
865 raises UnMapped from V3d;
866 -- If the view is not mapped on the window.
868 Convert( me ; Xv,Yv : Coordinate ; Xp,Yp : out Integer )
870 ---Purpose : Converts the point defined in the reference frame
871 -- of the projection plane into a point PIXEL.
872 raises UnMapped from V3d;
873 -- If the view is not mapped on the window.
875 Convert( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate)
877 ---Purpose : Converts the projected point into a point
878 -- in the reference frame of the view corresponding
879 -- to the intersection with the projection plane
880 -- of the eye/view point vector.
881 raises UnMapped from V3d;
882 -- If the view is not mapped on the window.
884 ConvertWithProj( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate ; Vx,Vy,Vz : out Parameter)
886 ---Purpose : Converts the projected point into a point
887 -- in the reference frame of the view corresponding
888 -- to the intersection with the projection plane
889 -- of the eye/view point vector and returns the
890 -- projection ray for further computations.
891 raises UnMapped from V3d;
892 -- If the view is not mapped on the window.
894 ConvertToGrid( me ; Xp,Yp : Integer ; Xg,Yg,Zg : out Coordinate)
896 ---Purpose : Converts the projected point into the nearest grid point
897 -- in the reference frame of the view corresponding
898 -- to the intersection with the projection plane
899 -- of the eye/view point vector and display the grid marker.
900 -- Warning: When the grid is not active the result is identical to the above Convert() method.
902 -- 1) Enable the grid echo display
903 -- myViewer->SetGridEcho(Standard_True);
904 -- 2) When application receive a move event:
905 -- 2.1) Check if any object is detected
906 -- if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
907 -- 2.2) Check if the grid is active
908 -- if( myViewer->Grid()->IsActive() ) {
909 -- 2.3) Display the grid echo and gets the grid point
910 -- myView->ConvertToGrid(x,y,X,Y,Z);
911 -- myView->Viewer()->ShowGridEcho (myView, Graphic3d_Vertex (X,Y,Z));
912 -- myView->RedrawImmediate();
913 -- 2.4) Else this is the standard case
914 -- } else myView->Convert(x,y,X,Y,Z);
915 raises UnMapped from V3d;
916 -- If the view is not mapped on the window.
918 ConvertToGrid( me ; X,Y,Z : Coordinate ; Xg,Yg,Zg : out Coordinate)
920 ---Purpose : Converts the point into the nearest grid point
921 -- and display the grid marker.
922 ---Warning: When the grid is not active the result is identical
923 -- to the previous point.
924 raises UnMapped from V3d;
925 -- If the view is not mapped on the window.
927 Convert( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
929 ---Purpose : Projects the point defined in the reference frame of
930 -- the view into the projected point in the associated window.
932 -- RefToPix( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
933 -- ---Purpose : Projects the point defined in the reference frame of
934 -- -- the view into the projected point in the associated window.
935 -- Obsolete : Use Convert(X,Y,Z,Xp,Yp);
937 -- PixToRef( me ; Xp,Yp : Integer; X,Y,Z : out Coordinate) ;
938 -- ---Purpose : Converts the projected point in the associated window of
939 -- -- the view into the point defined in the reference frame.
940 -- Obsolete : Use Convert(Xp,Yp,X,Y,Z);
942 Project( me ; X,Y,Z : Coordinate; Xp,Yp : out Coordinate) ;
944 ---Purpose : Converts the point defined in the user space of
945 -- the view to the projected view plane point at z 0.
947 BackgroundColor( me; Type : TypeOfColor ; V1, V2, V3 : out Parameter) ;
949 ---Purpose: Returns the Background color values of the view
950 -- depending of the color Type.
952 BackgroundColor( me ) returns Color from Quantity;
954 ---Purpose: Returns the Background color object of the view.
956 GradientBackgroundColors( me;
957 Color1 : out Color from Quantity;
958 Color2 : out Color from Quantity) ;
960 ---Purpose: Returns the gradient background colour objects of the view.
962 GradientBackground ( me ) returns GradientBackground from Aspect;
964 ---Purpose: Returns the gradient background of the view.
966 Scale ( me ) returns Factor ;
968 ---Purpose: Returns the current value of the zoom expressed with
969 -- respect to SetViewMappingDefault().
971 AxialScale ( me ; Sx, Sy, Sz : out Real from Standard ) ;
973 ---Purpose: Returns the current values of the anisotropic (axial) scale factors.
975 Size ( me; Width, Height : out Length );
977 ---Purpose: Returns the height and width of the view.
979 ZSize ( me ) returns Real ;
981 ---Purpose: Returns the Depth of the view .
983 Eye( me ; X,Y,Z : out Coordinate );
985 ---Purpose: Returns the position of the eye.
987 FocalReferencePoint (me ; X,Y,Z : out Coordinate );
989 ---Purpose: Returns the position of point which emanating the
992 ProjReferenceAxe( me ; Xpix,Ypix : Integer ;
993 XP,YP,ZP,VX,VY,VZ : out Coordinate );
995 ---Purpose: Returns the coordinate of the point (Xpix,Ypix)
996 -- in the view (XP,YP,ZP), and the projection vector of the
997 -- view passing by the point (for PerspectiveView).
999 Depth( me ) returns Length ;
1001 ---Purpose: Returns the Distance between the Eye and View Point.
1003 Proj( me ; Vx,Vy,Vz : out Parameter );
1005 ---Purpose: Returns the projection vector.
1007 At( me ; X,Y,Z : out Coordinate );
1009 ---Purpose: Returns the position of the view point.
1011 Up( me ; Vx,Vy,Vz : out Parameter );
1013 ---Purpose: Returns the vector giving the position of the high point.
1015 Twist( me ) returns PlaneAngle ;
1017 ---Purpose: Returns in RADIANS the orientation of the view around
1018 -- the visual axis measured from the Y axis of the screen.
1020 ShadingModel ( me ) returns TypeOfShadingModel ;
1022 ---Purpose: Returns the current shading model.
1024 SurfaceDetail(me) returns TypeOfSurfaceDetail;
1026 -- purpose: returns the current SurfaceDetail mode
1028 TextureEnv(me) returns TextureEnv from Graphic3d;
1030 -- purpose: return the current environment texture used
1032 Visualization ( me ) returns TypeOfVisualization from V3d;
1034 ---Purpose: Returns the current visualisation mode.
1036 Antialiasing ( me ) returns Boolean;
1038 ---Purpose: Indicates if the antialiasing is active (True) or
1039 -- inactive (False).
1041 ZCueing ( me; Depth, Width : out Length ) returns Boolean ;
1043 ---Purpose: Returns activity and information on the Zcueing.
1044 -- <Depth> : Depth of plane.
1045 -- <Width> : Thickness around the plane.
1047 ZClipping ( me; Depth, Width : out Length ) returns TypeOfZclipping;
1049 ---Purpose: Returns current information on the ZClipping.
1050 -- <Depth> : Depth of plane.
1051 -- <Width> : Thickness around the plane.
1052 -- <TypeOfZclipping> : "BACK"
1057 IfMoreLights( me ) returns Boolean;
1059 ---Purpose: Returns True if One light more can be
1060 -- activated in this View.
1062 InitActiveLights(me: mutable);
1064 ---Purpose: initializes an iteration on the active Lights.
1066 MoreActiveLights (me) returns Boolean from Standard;
1068 ---Purpose: returns true if there are more active Light(s) to return.
1070 NextActiveLights (me: mutable);
1072 ---Purpose : Go to the next active Light
1073 -- (if there is not, ActiveLight will raise an exception)
1075 ActiveLight(me) returns Light from V3d;
1078 Viewer ( me ) returns Viewer from V3d;
1080 ---Purpose: Returns the viewer in which the view has been created.
1082 IfWindow ( me ) returns Boolean;
1084 ---Purpose: Returns True if MyView is associated with a window .
1086 Window ( me ) returns Window from Aspect
1088 ---Purpose: Returns the Aspect Window associated with the view.
1089 raises BadValue from V3d;
1090 -- If MyView is not associated with a window
1092 Type( me ) returns TypeOfView from V3d;
1094 ---Purpose: Returns the Type of the View
1097 theDXp : Integer from Standard;
1098 theDYp : Integer from Standard;
1099 theZoomFactor : Factor from Quantity = 1;
1100 theToStart : Boolean = Standard_True);
1102 ---Purpose: Translates the center of the view along "x" and "y" axes of
1103 -- view projection. Can be used to perform interactive panning operation.
1104 -- In that case the DXp, DXp parameters specify panning relative to the
1105 -- point where the operation is started.
1106 -- @param theDXp [in] the relative panning on "x" axis of view projection, in pixels.
1107 -- @param theDYp [in] the relative panning on "y" axis of view projection, in pixels.
1108 -- @param theZoomFactor [in] the zooming factor.
1109 -- @param theToStart [in] pass TRUE when starting panning to remember view
1110 -- state prior to panning for relative arguments. Passing 0 for relative
1111 -- panning parameter should return view panning to initial state.
1112 -- Performs update of view.
1115 theXp1 : Integer from Standard;
1116 theYp1 : Integer from Standard;
1117 theXp2 : Integer from Standard;
1118 theYp2 : Integer from Standard)
1121 ---Purpose: Zoom the view according to a zoom factor computed
1122 -- from the distance between the 2 mouse position.
1123 -- @param theXp1 [in] the x coordinate of first mouse position, in pixels.
1124 -- @param theYp1 [in] the y coordinate of first mouse position, in pixels.
1125 -- @param theXp2 [in] the x coordinate of second mouse position, in pixels.
1126 -- @param theYp2 [in] the y coordinate of second mouse position, in pixels.
1128 StartZoomAtPoint (me : mutable;
1129 theXp : Integer from Standard;
1130 theYp : Integer from Standard);
1132 ---Purpose: Defines starting point for ZoomAtPoint view operation.
1133 -- @param theXp [in] the x mouse coordinate, in pixels.
1134 -- @param theYp [in] the y mouse coordinate, in pixels.
1136 ZoomAtPoint(me : mutable;
1137 theMouseStartX : Integer from Standard;
1138 theMouseStartY : Integer from Standard;
1139 theMouseEndX : Integer from Standard;
1140 theMouseEndY : Integer from Standard);
1142 ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
1144 AxialScale ( me: mutable; Dx, Dy: Integer from Standard; Axis: TypeOfAxe from V3d );
1146 ---Purpose: Performs anisotropic scaling of <me> view along the given <Axis>.
1147 -- The scale factor is calculated on a basis of
1148 -- the mouse pointer displacement <Dx,Dy>.
1149 -- The calculated scale factor is then passed to SetAxialScale(Sx, Sy, Sz) method.
1151 StartRotation(me : mutable ; X,Y :Integer from Standard;
1152 zRotationThreshold: Ratio from Quantity = 0.0);
1154 ---Purpose: Begin the rotation of the view around the screen axis
1155 -- according to the mouse position <X,Y>.
1156 -- Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
1157 -- factor is > 0 soon the distance from the start point and the center
1158 -- of the view is > (medium viewSize * <zRotationThreshold> ).
1159 -- Generally a value of 0.4 is usable to rotate around XY screen axis
1160 -- inside the circular threshold area and to rotate around Z screen axis
1161 -- outside this area.
1163 Rotation(me:mutable; X,Y :Integer from Standard);
1165 ---Purpose: Continues the rotation of the view
1166 -- with an angle computed from the last and new mouse position <X,Y>.
1168 FitAll ( me : mutable ; aWindow: Window from Aspect;
1169 Umin, Vmin, Umax, Vmax : Coordinate )
1172 ---Purpose: Change the scale factor and position of the view
1173 -- such as the bounding box <Umin, Vmin, Umax, Vmax> is contains
1177 -----------------------------------------
1178 ---Category: Private or Protected methods
1179 -----------------------------------------
1181 SetFocale( me : mutable ; Focale : Length )
1182 ---Purpose: Change View Plane Distance for Perspective Views
1183 raises TypeMismatch from Standard
1184 ---Purpose: Warning! raises TypeMismatch from Standard if the view
1185 -- is not a perspective view.
1188 Focale( me ) returns Length;
1189 ---Purpose: Returns the View Plane Distance for Perspective Views
1191 View ( me) returns View from Visual3d is static ;
1193 ---Purpose: Returns the associated Visual3d view.
1195 ScreenAxis( myclass ; Vpn,Vup : Dir from gp ;
1196 Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
1197 returns Boolean is private ;
1198 ---Purpose: Determines the screen axes in the reference
1199 -- framework of the view.
1202 TrsPoint( myclass ; V : Vertex from Graphic3d ;
1203 Matrix : Array2OfReal from TColStd )
1204 returns Vertex from Graphic3d is private ;
1205 ---Purpose: Transforms the Vertex V according to the matrice Matrix .
1207 ImmediateUpdate (me) is static protected;
1210 SetComputedMode ( me : mutable; aMode : Boolean from Standard )
1213 ---Purpose: Switches computed HLR mode in the view
1214 ---Category: Methods to modify the class definition
1217 returns Boolean from Standard
1220 ---Purpose: Returns the computed HLR mode state
1221 ---Category: Inquire methods
1223 MinMax ( me; Umin,Vmin, Umax,Vmax : out Coordinate ) returns Integer
1224 ---Purpose: Returns the objects number and the projection window
1225 -- of the objects contained in the view.
1228 MinMax ( me; Xmin,Ymin,Zmin, Xmax,Ymax,Zmax : out Coordinate )
1230 ---Purpose: Returns the objects number and the box encompassing
1231 -- the objects contained in the view
1234 Gravity ( me; X,Y,Z : out Coordinate )
1235 ---Purpose: Returns the Objects number and the gravity center
1236 -- of ALL viewable points in the view
1239 Init(me: mutable) is private;
1241 ---Category: for compatibility.
1243 WindowFitAll ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer);
1244 ---Purpose: idem than WindowFit
1246 Compute ( me; AVertex : Vertex from Graphic3d )
1247 returns Vertex from Graphic3d
1250 ---Purpose: Returns a new vertex when the grid is activated.
1252 SetGrid ( me : mutable;
1253 aPlane: Ax3 from gp;
1254 aGrid : Grid from Aspect )
1257 ---Purpose: Defines or Updates the definition of the
1259 ---Category: Methods to modify the class definition
1261 SetGridGraphicValues ( me : mutable;
1262 aGrid : Grid from Aspect )
1265 ---Purpose: Defines or Updates the graphic definition of the
1267 ---Category: Methods to modify the class definition
1269 SetGridActivity ( me : mutable;
1270 aFlag : Boolean from Standard )
1273 ---Purpose: Defines or Updates the activity of the
1275 ---Category: Methods to modify the class definition
1278 theFile : CString from Standard;
1279 theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB )
1280 returns Boolean from Standard;
1282 ---Purpose: dump the full contents of the view at the same
1283 -- scale in the file <theFile>. The file name
1284 -- extension must be one of ".png",".bmp",".jpg",".gif".
1285 -- Returns FALSE when the dump has failed
1287 Print (me; hPrnDC: Handle from Aspect = 0;
1288 showDialog: Boolean = Standard_True;
1289 showBackground : Boolean = Standard_True;
1290 filename: CString = NULL;
1291 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH)
1292 returns Boolean from Standard is static;
1295 ---Purpose: print the contents of the view to printer with preview.
1296 -- <hPrnDC> : If you have already an PrinterDeviceContext (HDC),
1297 -- then you can pass it to the print routines.
1298 -- If you don't have an PrinterDeviceContext, then this parameter should
1300 -- <showDialog> : If hPrnDC == NULL, then you can force the print routines to
1301 -- open a Print Dialog box.
1302 -- If you want to do this, then set showDialog to TRUE
1303 -- If you don't want to see a dialog (only possible, if you have a hPrnDC
1304 -- or the dialog box was opened once before) then set <showDialog> to FALSE.
1305 -- <showBackground> : When set to FALSE then print the view without background color
1306 -- (background is white)
1307 -- else set to TRUE for printing with current background color.
1308 -- <filename>: If != NULL, then the view will be printed to a file.
1309 -- <printAlgorithm>: If you want to select the print algorithm, then you can
1310 -- specify one of existing algorithms: Aspect_PA_STRETCH, Aspect_PA_TILE.
1311 -- Returns Standard_True if the data is passed to the printer, otherwise
1312 -- Standard_False if the print operation failed. This might be related to
1313 -- insufficient memory or some internal errors. All this errors are
1314 -- indicated by the message boxes (on level of OpenGl_GraphicDriver).
1315 -- Warning: This function can reuse FBO assigned to the
1316 -- view on level of OpenGl_GraphicDriver; Please take it into account if
1317 -- you use it for your purposes;
1318 -- Warning: Works only under Windows.
1320 ToPixMap (me : mutable;
1321 theImage : in out PixMap from Image;
1322 theWidth : Integer from Standard;
1323 theHeight : Integer from Standard;
1324 theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB;
1325 theToKeepAspect : Boolean from Standard = Standard_True;
1326 theStereoOptions : StereoDumpOptions from V3d = V3d_SDO_MONO)
1327 returns Boolean from Standard;
1329 ---Purpose : Dumps the full contents of the view
1330 -- to a pixmap of pixel size <theWidth> * <theHeight> and
1331 -- buffer type <theBufferType>. If <theToKeepAspect> is true
1332 -- the aspect ratio of view will be kept if <theWidth> and <theHeight>
1333 -- define another ratio.
1334 -- Pixmap will be automatically (re)allocated when needed.
1335 -- When dumping stereographic camera - the corresponding
1336 -- middle-point monographic projection will be used for dumping by default.
1337 -- <theStereoOptions> flags are to be used for dumping then left or
1338 -- right eye projections.
1340 SetBackFacingModel ( me : mutable;
1341 aModel : TypeOfBackfacingModel from V3d = V3d_TOBM_AUTOMATIC)
1344 ---Purpose : Manages display of the back faces
1345 -- When <aModel> is TOBM_AUTOMATIC the object backfaces
1346 -- are displayed only for surface objects and
1347 -- never displayed for solid objects.
1348 -- this was the previous mode.
1349 -- <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces
1350 -- are always displayed both for surfaces or solids.
1351 -- <aModel> is TOBM_NEVER_DISPLAYED the object backfaces
1352 -- are never displayed.
1354 BackFacingModel ( me )
1355 returns TypeOfBackfacingModel from V3d
1358 ---Purpose : Returns current state of the back faces display
1360 EnableDepthTest( me; enable : Boolean from Standard = Standard_True )
1363 ---Purpose: turns on/off opengl depth testing
1365 IsDepthTestEnabled( me ) returns Boolean from Standard
1368 ---Purpose: returns the current state of the depth testing
1370 EnableGLLight( me; enable : Boolean from Standard = Standard_True )
1373 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1375 IsGLLightEnabled( me ) returns Boolean from Standard
1378 ---Purpose: returns the current state of the gl lighting
1379 -- currently used in triedron displaying
1381 AddClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
1382 ---Purpose: Adds clip plane to the view. The composition of clip planes truncates the
1383 -- rendering space to convex volume. Number of supported clip planes can be consulted
1384 -- by PlaneLimit method of associated Visual3d_View. Please be aware that the planes
1385 -- which exceed the limit are ignored during rendering.
1386 -- @param thePlane [in] the clip plane to be added to view.
1388 RemoveClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
1389 ---Purpose: Removes clip plane from the view.
1390 -- @param thePlane [in] the clip plane to be removed from view.
1392 SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d);
1393 ---Purpose: Sets sequence of clip planes to the view. The planes that have been set
1394 -- before are removed from the view. The composition of clip planes
1395 -- truncates the rendering space to convex volume. Number of supported
1396 -- clip planes can be consulted by PlaneLimit method of associated
1397 -- Visual3d_View. Please be aware that the planes which exceed the limit
1398 -- are ignored during rendering.
1399 -- @param thePlanes [in] the clip planes to set.
1401 GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
1402 ---C++: return const&
1403 ---Purpose: Get clip planes.
1404 -- @return sequence clip planes that have been set for the view
1406 SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
1408 ---Purpose: Change camera used by view.
1410 Camera (me) returns Camera_Handle from Graphic3d is static;
1412 ---C++: return const&
1413 ---Purpose: Returns camera object of the view.
1414 -- @return: handle to camera object, or NULL if 3D view does not use
1415 -- the camera approach.
1418 theCamera : Camera_Handle from Graphic3d;
1419 theBox : Box from Bnd;
1420 theMargin : Real from Standard;
1421 theResolution : Real from Standard = 0.0;
1422 theToEnlargeIfLine : Boolean from Standard = Standard_True)
1423 returns Boolean from Standard is protected;
1425 ---Purpose: Transform camera eye, center and scale to fit in the
1426 -- passed bounding box specified in WCS.
1427 -- @param theCamera [in] the camera.
1428 -- @param theBox [in] the bounding box.
1429 -- @param theMargin [in] the margin coefficient for view borders.
1430 -- @param theResolution [in] the minimum size of projection of
1431 -- bounding box in Xv or Yv direction when it considered to
1432 -- be a thin plane or point (without a volume).
1433 -- In this case only the center of camera is adjusted.
1434 -- @param theToEnlargeIfLine [in] if passed TRUE - in cases when the
1435 -- whole bounding box projected into thin line going along
1436 -- Z-axis of screen, the view plane is enlarged such that
1437 -- we see the whole line on rotation, otherwise only the
1438 -- center of camera is adjusted.
1439 -- @return TRUE if the fit all operation can be done.
1442 theCamera : Camera_Handle from Graphic3d;
1443 theSizeXv : Real from Standard;
1444 theSizeYv : Real from Standard) is protected;
1446 ---Purpose: Scales camera to fit the view frame of defined width and height
1447 -- keeping the aspect. For orthogonal camera the method changes scale,
1448 -- for perspective adjusts Eye location about the Center point.
1449 -- @param theSizeXv [in] size of viewport frame on "x" axis.
1450 -- @param theSizeYv [in] size of viewport frame on "y" axis.
1453 theCamera : Camera_Handle from Graphic3d;
1454 theDXv : Real from Standard;
1455 theDYv : Real from Standard) is protected;
1457 -- Purpose: Translates camera eye and center along the view plane.
1458 -- @param theCamera [in] the camera to translate.
1459 -- @param theDXv [in] the translation in "x" direction.
1460 -- @param theDYv [in] the translation in "y" direction.
1462 RenderingParams (me) returns RenderingParams from Graphic3d is static;
1463 ---C++: return const &
1465 ---Purpose: Returns current rendering parameters and effect settings.
1467 ChangeRenderingParams (me : mutable) returns RenderingParams from Graphic3d is static;
1470 ---Purpose: Returns reference to current rendering parameters and effect settings.
1472 IsCullingEnabled (me) returns Boolean from Standard is static;
1474 ---Purpose: @return flag value of objects culling mechanism
1476 SetFrustumCulling (me : mutable; theMode : Boolean from Standard) is static;
1478 ---Purpose: Turn on/off automatic culling of objects outside frustrum (ON by default)
1482 myOldMouseX : Real is protected;
1483 myOldMouseY : Real is protected;
1484 myCamStartOpUp : Dir from gp is protected;
1485 myCamStartOpEye : Pnt from gp is protected;
1486 myCamStartOpBnd : Real[6] is protected;
1487 myCamStartOpCenter : Pnt from gp is protected;
1488 myCamera : Camera_Handle from Graphic3d is protected;
1490 MyViewer : ViewerPointer from V3d ;
1491 MyActiveLights: ListOfTransient from V3d;
1493 MyView : View from Visual3d is protected ;
1494 MyViewContext : ContextView from Visual3d ;
1495 MyBackground: Background from Aspect ;
1496 MyGradientBackground: GradientBackground from Aspect ;
1497 MyDefaultViewAxis: Vector from Graphic3d ;
1498 MyDefaultViewPoint: Vertex from Graphic3d ;
1500 MyWindow: Window from Aspect;
1502 myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
1504 sx,sy: Integer from Standard;
1505 rx,ry: Real from Standard;
1506 gx,gy,gz: Real from Standard;
1507 myComputedMode: Boolean from Standard;
1508 SwitchSetFront: Boolean from Standard;
1509 MyZoomAtPointX, MyZoomAtPointY : Integer from Standard;
1512 MyGrid : Grid from Aspect;
1513 MyPlane : Ax3 from gp;
1515 --MyColorScale : ColorScale from V3d;
1516 MyLayerMgr : LayerMgr from V3d;
1518 -- the transformation between XoY and the grid plane
1519 MyTrsf : Array2OfReal from TColStd;
1522 MyGridEchoStructure : Structure from Graphic3d;
1523 MyGridEchoGroup : Group from Graphic3d;
1525 myImmediateUpdate: Boolean from Standard is protected;
1527 myXscreenAxis : Vector from Graphic3d;
1528 myYscreenAxis : Vector from Graphic3d;
1529 myZscreenAxis : Vector from Graphic3d;
1530 myViewAxis : Vector from Graphic3d;
1531 myGravityReferencePoint : Vertex from Graphic3d;
1535 SetViewOn from class Viewer from V3d ( me : mutable ),
1536 SetViewOn from class Viewer from V3d ( me : mutable ; View : View from V3d ),
1537 SetViewOff from class Viewer from V3d ( me : mutable ),
1538 SetViewOff from class Viewer from V3d ( me : mutable ; View : View from V3d )