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 -- CQO - 24/12/97 -> BUC50037
19 -- stt:25-02-98; S3558: ajout IfManageStandardEvent
20 -- stt:08-04-98; suppr IfManageStandardEvent
21 -- CAL - 18/08/98 -> S3892. Ajout grilles 3d.
22 -- BGN - 16-09-98; Points d'entree du Triedre (S3819, Phase 1)
23 -- 22-09-98 ; BGN : S3989 (anciennement S3819)
24 -- TypeOfTriedron* from Aspect(et pas V3d)
25 -- CAL - 21/10/98 -> Speciale. Ajout methode Tumble.
26 -- 29-OCT-98 : DCB : Adding ScreenCopy () method.
27 -- GG - 10/11/99 : PRO19603 Adding Redraw( area ) method
28 -- GG - 15/12/99 : GER61351 Adding SetBackgroundColor()
29 -- and BackgroundColor() methods
30 -- GG - 24/01/00 : -> Remove internal PixToRef() method, use Convert()
32 -- -> Rename internal RefToPix() to Convert() method.
33 -- -> Add ConvertToGrid() methods,
34 -- the Compute() internal method become private.
35 -- -> Add SetProjModel() method.
36 -- VKH - 15/11/99 : G004
37 -- -> Add method Dump()
39 -- -> Add Transparency() method
40 -- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
41 -- -> Add Print method (works only under Windows).
43 -- -> Add IsActiveLight() & IsActivePlane() methods
45 -- -> Add ToPixMap() method
46 -- GG - RIC120302 Add NEW SetWindow method.
48 -- -> Add EnableDepthTest() & IsDepthTestEnabled().
49 -- VSV - 28/05/02: ZBUFFER mode of Trihedron
50 -- SAV - 23/12/02 -> Added methods to set background image
51 -- NKV - 23/07/07 -> Define custom projection and model view matrixes
52 -- NKV - 08/02/07 -> Add ConvertWithProj() method
54 class View from V3d inherits TShared from MMgt
56 ---Purpose: Defines the application object VIEW for the
57 -- VIEWER application.
58 -- The methods of this class allow the editing
59 -- and inquiring the parameters linked to the view.
60 -- (Projection,Mapping,Zclipping,DepthCueing,AntiAliasing
62 -- Provides a set of services common to all types of view.
63 -- Warning: The default parameters are defined by the class
64 -- Viewer (Example : SetDefaultViewSize()).
65 -- Certain methods are mouse oriented, and it is
66 -- necessary to know the difference between the start and
67 -- the continuation of this gesture in putting the method
69 -- Example : Shifting the eye-view along the screen axes.
71 -- View->Move(10.,20.,0.,True) (Starting motion)
72 -- View->Move(15.,-5.,0.,False) (Next motion)
82 ColorScale from Aspect,
83 Array2OfReal from TColStd,
86 Structure from Graphic3d,
89 ListOfTransient from V3d,
90 ListIteratorOfListOfTransient from TColStd,
93 TypeOfOrientation from V3d,
94 TypeOfShadingModel from V3d,
95 TypeOfSurfaceDetail from V3d,
96 TextureEnv from Graphic3d,
97 TypeOfVisualization from V3d,
98 TypeOfZclipping from V3d,
99 TypeOfProjectionModel from V3d,
100 TypeOfBackfacingModel from V3d,
101 StereoDumpOptions from V3d,
105 ContextView from Visual3d,
106 Vector from Graphic3d,
107 Vertex from Graphic3d,
108 Plotter from Graphic3d,
109 Camera_Handle from Graphic3d,
112 BufferType from Graphic3d,
113 Background from Aspect,
114 GradientBackground from Aspect,
115 TypeOfColor from Quantity,
116 NameOfColor from Quantity,
118 Length from Quantity,
119 PlaneAngle from Quantity,
120 Parameter from Quantity,
121 Factor from Quantity,
123 Coefficient from Quantity,
125 Array2OfReal from TColStd,
126 ViewerPointer from V3d,
127 TypeOfTriedronEcho from Aspect,
128 TypeOfTriedronPosition from Aspect,
129 RenderingContext from Aspect,
130 GraphicCallbackProc from Aspect,
131 FillMethod from Aspect,
132 GradientFillMethod from Aspect,
133 FontAspect from Font,
134 AsciiString from TCollection,
135 ExtendedString from TCollection,
136 PrintAlgo from Aspect,
137 ClipPlane_Handle from Graphic3d,
138 SequenceOfHClipPlane from Graphic3d,
139 RenderingMode from Graphic3d,
140 RenderingParams from Graphic3d,
144 BadValue from V3d, TypeMismatch from Standard,
145 MultiplyDefined from Standard,UnMapped from V3d
149 Create ( VM : Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
150 ---Purpose: Initializes the view.
152 Create (theVM : Viewer; theView : View from V3d);
153 ---Purpose: Initializes the view by copying.
155 --------------------------------------------------------
156 ---Category: Methods to modify the Status of the view
157 --------------------------------------------------------
159 SetWindow ( me : mutable ; IdWin : Window )
160 ---Purpose: Activates the view in the window specified and Map the
161 -- Window to the screen.
162 raises MultiplyDefined from Standard;
164 ---Purpose: Warning! raises MultiplyDefined from Standard
165 -- if the view is already activated in a window.
166 -- Warning: The view is centered and resized to preserve
167 -- the height/width ratio of the window.
169 SetWindow ( me : mutable ;
170 aWindow : Window from Aspect;
171 aContext : RenderingContext from Aspect;
172 aDisplayCB : GraphicCallbackProc from Aspect;
173 aClientData : Address from Standard
175 ---Purpose: Activates the view in the specified Window
176 -- If <aContext> is not NULL the graphic context is used
177 -- to draw something in this view.
178 -- Otherwise an internal graphic context is created.
179 -- If <aDisplayCB> is not NULL then a user display CB is
180 -- call at the end of the OCC graphic traversal and just
181 -- before the swap of buffers. The <aClientData> is pass
182 -- to this call back.
183 raises MultiplyDefined from Standard;
185 ---Purpose: Warning! raises MultiplyDefined from Standard
186 -- if the view is already activated in a window.
187 -- Warning: The view is centered and resized to preserve
188 -- the height/width ratio of the window.
190 SetMagnify (me: mutable; IdWin : Window;
191 aPreviousView : View from V3d;
192 x1 , y1 , x2 , y2: Integer from Standard)
197 ---Purpose: Destroys the view.
199 Update ( me ) is static;
201 ---Purpose: Deprecated, Redraw() should be used instead.
205 ---Purpose: Redisplays the view even if there has not
206 -- been any modification.
207 -- Must be called if the view is shown.
208 -- (Ex: DeIconification ) .
210 RedrawImmediate ( me );
212 ---Purpose: Updates layer of immediate presentations.
216 ---Purpose: Invalidates view content but does not redraw it.
218 Redraw ( me ;x,y,width,height: Integer from Standard);
220 ---Purpose: Redisplays the view area after esxposure.
221 -- [x,y] define the min xy area position
222 -- [width,height] the size of the area in pixel unit.
224 MustBeResized ( me : mutable )
226 ---Purpose: Must be called when the window supporting the
227 -- view changes size.
228 raises UnMapped from V3d;
229 ---Purpose: if the view is not mapped on a window.
230 -- Warning: The view is centered and resized to preserve
231 -- the height/width ratio of the window.
233 DoMapping ( me : mutable );
235 ---Purpose: Must be called when the window supporting the
236 -- view is mapped or unmapped.
238 IsEmpty ( me ) returns Boolean;
240 ---Purpose: Returns the status of the view regarding
241 -- the displayed structures inside
242 -- Returns True is The View is empty
246 ---Purpose: Updates the lights of the view. The view is redrawn.
248 --------------------------------------------------------
249 ---Category: Methods to modify the Attributes of the view
250 --------------------------------------------------------
252 SetBackgroundColor ( me : mutable ;
253 Type : TypeOfColor; V1, V2, V3 : Parameter );
255 ---Purpose: Defines the background colour of the view
257 -- the colour definition type,
258 -- and the three corresponding values.
260 SetBackgroundColor ( me : mutable ; Color : Color from Quantity );
262 ---Purpose: Defines the background colour of the view
264 -- the colour object.
266 SetBackgroundColor ( me : mutable ; Name : NameOfColor );
268 ---Purpose: Defines the background colour of the view
270 -- the colour name in the form Quantity_NOC_xxxx .
272 SetBgGradientColors ( me : mutable ;
273 Color1 : Color from Quantity;
274 Color2 : Color from Quantity;
275 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
276 update : Boolean from Standard = Standard_False );
278 ---Purpose: Defines the gradient background colours of the view
280 -- two colour objects,
281 -- and fill method (horizontal by default)
283 SetBgGradientColors ( me : mutable ;
284 Color1 : NameOfColor;
285 Color2 : NameOfColor;
286 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
287 update : Boolean from Standard = Standard_False );
289 ---Purpose: Defines the gradient background colours of the view
291 -- two colour names in the form Quantity_NOC_xxxx,
292 -- and fill method (horizontal by default)
294 SetBgGradientStyle( me : mutable ;
295 AMethod : GradientFillMethod from Aspect = Aspect_GFM_HOR;
296 update : Boolean from Standard = Standard_False);
298 ---Purpose: Defines the gradient background fill method of the view
300 SetBackgroundImage( me : mutable; FileName : CString from Standard;
301 FillStyle : FillMethod from Aspect = Aspect_FM_CENTERED;
302 update : Boolean from Standard = Standard_False );
304 ---Purpose: Defines the background texture of the view
306 --- texture image file name,
307 --- and fill method (centered by default)
309 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
310 update : Boolean from Standard = Standard_False );
312 ---Purpose: Defines the textured background fill method of the view
314 SetAxis ( me : mutable; X,Y,Z : Coordinate ;
315 Vx,Vy,Vz : Parameter )
317 ---Purpose: Definition of an axis from its origin and
319 -- This will be the current axis for rotations and movements.
320 raises BadValue from V3d;
321 ---Purpose: Warning! raises BadValue from V3d if the vector normal is NULL. .
323 SetShadingModel ( me : mutable; Model : TypeOfShadingModel );
325 ---Purpose: Defines the shading model for the
326 -- visualisation ZBUFFER mode.
327 -- Various models are available.
329 SetSurfaceDetail(me : mutable; SurfaceDetail : TypeOfSurfaceDetail);
331 ---Purpose: select the kind of rendering for texture mapping
332 -- no texture mapping by default
334 SetTextureEnv(me : mutable; ATexture : TextureEnv from Graphic3d);
336 ---Purpose: set the environment texture to use
337 -- no environment texture by default
339 SetVisualization ( me : mutable;
340 Mode : TypeOfVisualization from V3d );
342 ---Purpose: Defines the visualisation mode in the view.
344 SetAntialiasingOn ( me : mutable );
346 ---Purpose: Activates antialiasing in the view.
348 SetAntialiasingOff ( me : mutable );
350 ---Purpose: Desactivates antialiasing in the view.
352 SetZClippingDepth ( me : mutable; Depth : Length );
354 ---Purpose: Defines the depth of the medium clipping plane.
356 SetZClippingWidth ( me : mutable; Width : Length )
358 ---Purpose: Defines the thicknes around the medium clippling plane. .
359 raises BadValue from V3d;
360 -- If the thickness is <= 0
362 SetZClippingType ( me : mutable; Type : TypeOfZclipping );
364 ---Purpose: Defines the type of ZClipping.
366 SetZCueingDepth ( me : mutable; Depth : Length );
368 ---Purpose: Defines the depth of the medium plane.
370 SetZCueingWidth ( me : mutable; Width : Length )
372 ---Purpose: Defines the thickness around the medium plane.
373 raises BadValue from V3d;
374 -- If thickness is <= 0
376 SetZCueingOn ( me : mutable );
378 ---Purpose: Activates ZCueing in the view.
380 SetZCueingOff ( me : mutable );
382 ---Purpose: Desactivates ZCueing in the view.
384 SetLightOn( me : mutable ; MyLight : Light from V3d )
386 ---Purpose: Activates MyLight in the view.
387 raises BadValue from V3d;
388 -- If No More Light can be activated in MyView .
390 SetLightOn( me : mutable )
392 ---Purpose: Activates all the lights defined in this view.
393 raises BadValue from V3d;
394 -- If No More Light can be activated in MyView .
396 SetLightOff( me : mutable ; MyLight : Light from V3d );
398 ---Purpose: Desactivate MyLight in this view.
400 SetLightOff( me : mutable );
402 ---Purpose: Deactivate all the Lights defined in this view.
404 IsActiveLight( me ; aLight: Light from V3d )
405 returns Boolean from Standard;
407 ---Purpose: Returns TRUE when the light is active in this view.
409 SetTransparency( me : mutable ; AnActivity : Boolean = Standard_False);
411 ---Purpose: Activate/Deactivate the transparency in this view.
413 SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
414 returns Boolean from Standard;
415 ---Purpose: sets the immediate update mode and returns the previous one.
417 SetAutoZFitMode (me : mutable;
419 theScaleFactor : Real from Standard = 1.0);
421 ---Purpose: Sets the automatic z-fit mode and its parameters.
422 -- The auto z-fit has extra parameters which can controlled from application level
423 -- to ensure that the size of viewing volume will be sufficiently large to cover
424 -- the depth of unmanaged objects, for example, transformation persistent ones.
425 -- @param theScaleFactor [in] the scale factor for Z-range.
426 -- The range between Z-min, Z-max projection volume planes
427 -- evaluated by z fitting method will be scaled using this coefficient.
428 -- Program error exception is thrown if negative or zero value
431 AutoZFitMode (me) returns Boolean;
433 ---Purpose: returns TRUE if automatic z-fit mode is turned on.
435 AutoZFitScaleFactor (me) returns Real from Standard;
437 ---Purpose: returns scale factor parameter of automatic z-fit mode.
439 ---------------------------------------------------
441 ---------------------------------------------------
443 ZBufferTriedronSetup ( me : mutable;
444 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
445 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
446 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
447 SizeRatio : Real from Standard = 0.8;
448 AxisDiametr : Real from Standard = 0.05;
449 NbFacettes : Integer from Standard = 12)
452 ---Purpose: Customization of the ZBUFFER Triedron.
453 --- XColor,YColor,ZColor - colors of axis
454 --- SizeRatio - ratio of decreasing of the trihedron size when its phisical
455 --- position comes out of the view
456 --- AxisDiametr - diameter relatively to axis length
457 --- NbFacettes - number of facettes of cylinders and cones
459 TriedronDisplay ( me : mutable;
460 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
461 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
462 AScale : Real from Standard = 0.02;
463 AMode : TypeOfVisualization from V3d = V3d_WIREFRAME )
466 ---Purpose: Display of the Triedron.
467 --- Initialize position, color and length of Triedron axes.
468 --- The scale is a percent of the window width.
471 TriedronErase ( me : mutable )
474 ---Purpose: Erases the Triedron.
477 TriedronEcho ( me : mutable;
478 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
481 ---Purpose: Highlights the echo zone of the Triedron.
484 ---------------------------------
485 ---Category: Graduated trihedron
486 ---------------------------------
488 GetGraduatedTrihedron(me;
490 xname, yname, zname : out ExtendedString from TCollection;
492 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
494 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
496 drawgrid : out Boolean from Standard;
498 drawaxes : out Boolean from Standard;
499 -- Number of splits along axes --
500 nbx, nby, nbz : out Integer from Standard;
501 -- Offset for drawing values --
502 xoffset, yoffset, zoffset : out Integer from Standard;
503 -- Offset for drawing names of axes --
504 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
506 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
507 -- Length of tickmarks --
508 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
510 gridcolor : out Color from Quantity;
511 -- Colors of axis names --
512 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
513 -- Colors of axis and values --
514 xcolor, ycolor, zcolor : out Color from Quantity;
515 -- Name of font for names of axes --
516 fontOfNames : out AsciiString from TCollection;
517 -- Style of names of axes --
518 styleOfNames : out FontAspect from Font;
519 -- Size of names of axes --
520 sizeOfNames : out Integer from Standard;
521 -- Name of font for values --
522 fontOfValues : out AsciiString from TCollection;
523 -- Style of values --
524 styleOfValues : out FontAspect from Font;
526 sizeOfValues : out Integer from Standard)
527 ---Purpose: Returns data of a graduated trihedron.
530 GraduatedTrihedronDisplay(me : mutable;
532 xname : ExtendedString from TCollection = "X";
533 yname : ExtendedString from TCollection = "Y";
534 zname : ExtendedString from TCollection = "Z";
536 xdrawname : Boolean from Standard = Standard_True;
537 ydrawname : Boolean from Standard = Standard_True;
538 zdrawname : Boolean from Standard = Standard_True;
540 xdrawvalues : Boolean from Standard = Standard_True;
541 ydrawvalues : Boolean from Standard = Standard_True;
542 zdrawvalues : Boolean from Standard = Standard_True;
544 drawgrid : Boolean from Standard = Standard_True;
546 drawaxes : Boolean from Standard = Standard_True;
547 -- Number of splits along axes --
548 nbx : Integer from Standard = 3;
549 nby : Integer from Standard = 3;
550 nbz : Integer from Standard = 3;
551 -- Offset for drawing values --
552 xoffset : Integer from Standard = 10;
553 yoffset : Integer from Standard = 10;
554 zoffset : Integer from Standard = 10;
555 -- Offset for drawing names of axes --
556 xaxisoffset : Integer from Standard = 30;
557 yaxisoffset : Integer from Standard = 30;
558 zaxisoffset : Integer from Standard = 30;
560 xdrawtickmarks : Boolean from Standard = Standard_True;
561 ydrawtickmarks : Boolean from Standard = Standard_True;
562 zdrawtickmarks : Boolean from Standard = Standard_True;
563 -- Length of tickmarks --
564 xtickmarklength : Integer from Standard = 10;
565 ytickmarklength : Integer from Standard = 10;
566 ztickmarklength : Integer from Standard = 10;
568 gridcolor : Color from Quantity = Quantity_NOC_WHITE;
570 xnamecolor : Color from Quantity = Quantity_NOC_RED;
572 ynamecolor : Color from Quantity = Quantity_NOC_GREEN;
574 znamecolor : Color from Quantity = Quantity_NOC_BLUE1;
575 -- X color of axis and values --
576 xcolor : Color from Quantity = Quantity_NOC_RED;
577 -- Y color of axis and values --
578 ycolor : Color from Quantity = Quantity_NOC_GREEN;
579 -- Z color of axis and values --
580 zcolor : Color from Quantity = Quantity_NOC_BLUE1;
581 -- Name of font for names of axes --
582 fontOfNames : AsciiString from TCollection = "Arial";
583 -- Style of names of axes --
584 styleOfNames : FontAspect from Font = Font_FA_Bold;
585 -- Size of names of axes --
586 sizeOfNames : Integer from Standard = 12;
587 -- Name of font for values --
588 fontOfValues : AsciiString from TCollection = "Arial";
589 -- Style of values --
590 styleOfValues : FontAspect from Font = Font_FA_Regular;
592 sizeOfValues : Integer from Standard = 12)
593 ---Purpose: Displays a graduated trihedron.
596 GraduatedTrihedronErase(me : mutable)
597 ---Purpose: Erases a graduated trihedron from the view.
600 ---------------------------------------------------
601 -- Color Scale methods
602 ---------------------------------------------------
604 SetLayerMgr(me : mutable; aMgr : LayerMgr from V3d);
606 ColorScaleDisplay(me : mutable);
608 ColorScaleErase(me : mutable);
610 ColorScaleIsDisplayed(me)
611 returns Boolean from Standard;
614 returns ColorScale from Aspect;
616 --------------------------------------------------------
617 ---Category: Methods to modify the Projection of the view
618 --------------------------------------------------------
620 SetFront(me: mutable);
622 ---Purpose: modify the Projection of the view perpendicularly to
623 -- the privileged plane of the viewer.
625 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
626 Start : Boolean = Standard_True )
628 ---Purpose: Rotates the eye about the coordinate system of
629 -- reference of the screen
630 -- for which the origin is the view point of the projection,
631 -- with a relative angular value in RADIANS with respect to
632 -- the initial position expressed by Start = Standard_True
633 raises BadValue from V3d;
634 ---Purpose: Warning! raises BadValue from V3d
635 -- If the eye, the view point, or the high point are
636 -- aligned or confused.
638 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
640 Start : Boolean = Standard_True )
642 ---Purpose: Rotates the eye about the coordinate system of
643 -- reference of the screen
644 -- for which the origin is Gravity point {X,Y,Z},
645 -- with a relative angular value in RADIANS with respect to
646 -- the initial position expressed by Start = Standard_True
647 raises BadValue from V3d;
648 ---Purpose: If the eye, the view point, or the high point are
649 -- aligned or confused.
651 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
653 Start : Boolean = Standard_True );
655 ---Purpose: Rotates the eye about one of the coordinate axes of
656 -- of the view for which the origin is the Gravity point{X,Y,Z}
657 -- with an relative angular value in RADIANS with
658 -- respect to the initial position expressed by
659 -- Start = Standard_True
661 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
662 Start : Boolean = Standard_True ) ;
664 ---Purpose: Rotates the eye about one of the coordinate axes of
665 -- of the view for which the origin is the view point of the
666 -- projection with an relative angular value in RADIANS with
667 -- respect to the initial position expressed by
668 -- Start = Standard_True
670 Rotate ( me : mutable ; Angle : PlaneAngle ;
671 Start : Boolean = Standard_True );
673 ---Purpose: Rotates the eye around the current axis a relative
674 -- angular value in RADIANS with respect to the initial
675 -- position expressed by Start = Standard_True
677 Move ( me : mutable ; Dx,Dy,Dz : Length ;
678 Start : Boolean = Standard_True )
680 ---Purpose: Movement of the eye parallel to the coordinate system
681 -- of reference of the screen a distance relative to the
682 -- initial position expressed by Start = Standard_True.
683 raises BadValue from V3d;
684 -- If the eye, the view point, or the high point are
685 -- aligned or confused.
687 Move ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
688 Start : Boolean = Standard_True )
690 ---Purpose: Movement of the eye parallel to one of the axes of the
691 -- coordinate system of reference of the view a distance
692 -- relative to the initial position expressed by
693 -- Start = Standard_True.
694 raises BadValue from V3d;
695 -- If the eye, view point, or high point are aligned or confused.
697 Move ( me : mutable ; Length : Length ;
698 Start : Boolean = Standard_True )
700 ---Purpose: Movement of the eye parllel to the current axis
701 -- a distance relative to the initial position
702 -- expressed by Start = Standard_True
703 raises BadValue from V3d;
704 -- If the eye, view point, or high point are aligned or confused.
706 Translate ( me : mutable ; Dx,Dy,Dz : Length ;
707 Start : Boolean = Standard_True )
709 ---Purpose: Movement of the ye and the view point parallel to the
710 -- frame of reference of the screen a distance relative
711 -- to the initial position expressed by
712 -- Start = Standard_True
713 raises BadValue from V3d;
714 -- If the eye, view point, or high point are aligned or confused.
716 Translate ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
717 Start : Boolean = Standard_True );
719 ---Purpose: Movement of the eye and the view point parallel to one
720 -- of the axes of the fame of reference of the view a
721 -- distance relative to the initial position
722 -- expressed by Start = Standard_True
724 Translate ( me : mutable ; Length : Length ;
725 Start : Boolean = Standard_True );
727 ---Purpose: Movement of the eye and view point parallel to
728 -- the current axis a distance relative to the initial
729 -- position expressed by Start = Standard_True
732 theXp : Integer from Standard;
733 theYp : Integer from Standard;
734 theZoomFactor : Factor from Quantity = 1)
736 ---Purpose: places the point of the view corresponding
737 -- at the pixel position x,y at the center of the window
738 -- and updates the view.
741 Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
742 Start : Boolean = Standard_True )
744 ---Purpose: Rotation of the view point around the frame of reference
745 -- of the screen for which the origin is the eye of the
746 -- projection with a relative angular value in RADIANS
747 -- with respect to the initial position expressed by
748 -- Start = Standard_True
749 raises BadValue from V3d;
750 -- If the eye, view point, or high point are aligned or confused.
752 Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
753 Start : Boolean = Standard_True )
756 ---Purpose: Rotation of the view point around one of the axes of the
757 -- frame of reference of the view for which the origin is
758 -- the eye of the projection with an angular value in
759 -- RADIANS relative to the initial position expressed by
760 -- Start = Standard_True
762 Turn ( me : mutable ; Angle : PlaneAngle ;
763 Start : Boolean = Standard_True );
765 ---Purpose: Rotation of the view point around the current axis an
766 -- angular value in RADIANS relative to the initial
767 -- position expressed by Start = Standard_True
769 SetTwist ( me : mutable ; Angle : PlaneAngle )
771 ---Purpose: Defines the angular position of the high point of
772 -- the reference frame of the view with respect to the
773 -- Y screen axis with an absolute angular value in
775 raises BadValue from V3d;
776 -- If the eye, view point, or high point are aligned or confused.
778 SetEye( me : mutable ; X,Y,Z : Coordinate )
780 ---Purpose: Defines the position of the eye..
781 raises BadValue from V3d ;
782 -- If the eye, view point, or high point are aligned or confused.
784 SetDepth( me : mutable ; Depth : Length )
786 ---Purpose: Defines the Depth of the eye from the view point
787 -- without update the projection .
788 raises BadValue from V3d ;
789 -- If the Depth is <= 0.
791 SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
793 ---Purpose: Defines the orientation of the projection.
794 raises BadValue from V3d ;
795 -- If the eye, view point, or high point are aligned or confused.
797 SetProj( me : mutable ; Orientation : TypeOfOrientation )
799 ---Purpose: Defines the orientation of the projection .
800 raises BadValue from V3d ;
801 -- If the eye, view point, or high point are aligned or confused.
804 SetAt( me : mutable ; X,Y,Z : Coordinate )
806 ---Purpose: Defines the position of the view point.
807 raises BadValue from V3d ;
808 -- If the eye, view point, or high point are aligned or confused.
810 SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
812 ---Purpose: Defines the orientation of the high point.
813 raises BadValue from V3d ;
814 -- If the eye, view point, or high point are aligned or confused.
816 SetUp( me : mutable ; Orientation : TypeOfOrientation )
818 ---Purpose: Defines the orientation(SO) of the high point.
819 raises BadValue from V3d ;
820 -- If the eye, view point, or high point are aligned or confused.
822 SetViewOrientationDefault( me : mutable );
824 ---Purpose: Saves the current state of the orientation of the view
825 -- which will be the return state at ResetViewOrientation.
827 ResetViewOrientation ( me : mutable );
829 ---Purpose: Resets the orientation of the view.
832 --------------------------------------------------------
833 ---Category: Methods to modify the Mapping of the view
834 --------------------------------------------------------
836 Panning (me : mutable;
837 theDXv : Real from Standard;
838 theDYv : Real from Standard;
839 theZoomFactor : Factor from Quantity = 1;
840 theToStart : Boolean = Standard_True);
842 ---Purpose: Translates the center of the view along "x" and "y" axes of
843 -- view projection. Can be used to perform interactive panning operation.
844 -- In that case the DXv, DXy parameters specify panning relative to the
845 -- point where the operation is started.
846 -- @param theDXv [in] the relative panning on "x" axis of view projection, in view space coordinates.
847 -- @param theDYv [in] the relative panning on "y" axis of view projection, in view space coordinates.
848 -- @param theZoomFactor [in] the zooming factor.
849 -- @param theToStart [in] pass TRUE when starting panning to remember view
850 -- state prior to panning for relative arguments. If panning is started,
851 -- passing {0, 0} for {theDXv, theDYv} will return view to initial state.
852 -- Performs update of view.
854 SetCenter (me : mutable; theXp, theYp : Integer from Standard)
856 ---Purpose: Relocates center of screen to the point, determined by
857 -- {Xp, Yp} pixel coordinates relative to the bottom-left corner of
858 -- screen. To calculate pixel coordinates for any point from world
859 -- coordinate space, it can be projected using "Project".
860 -- @param theXp [in] the x coordinate.
861 -- @param theYp [in] the y coordinate.
862 raises BadValue from V3d;
863 -- If one of the dimensions of the projection is NULL.
865 SetSize ( me : mutable; theSize : Length )
867 ---Purpose: Defines the view projection size in its maximum dimension,
868 -- keeping the inital height/width ratio unchanged.
869 raises BadValue from V3d;
870 -- If <theSize> is <= 0.0
872 SetZSize ( me : mutable ; Size : Length )
874 ---Purpose: Defines the Depth size of the view
875 -- Front Plane will be set to Size/2.
876 -- Back Plane will be set to -Size/2.
877 -- Any Object located Above the Front Plane or
878 -- behind the Back Plane will be Clipped .
879 -- NOTE than the XY Size of the View is NOT modified .
880 raises BadValue from V3d ;
881 -- If the size of the view is <= 0
883 SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
885 ---Purpose: Zooms the view by a factor relative to the initial
886 -- value expressed by Start = Standard_True
888 raises BadValue from V3d ;
889 -- If the zoom coefficient is <= 0
891 SetScale ( me : mutable ; Coef : Factor )
893 ---Purpose: Zooms the view by a factor relative to the value
894 -- initialised by SetViewMappingDefault().
896 raises BadValue from V3d ;
897 -- If the zoom coefficient is <= 0
899 SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
901 ---Purpose: Sets anisotropic (axial) scale factors <Sx>, <Sy>, <Sz> for view <me>.
902 -- Anisotropic scaling operation is performed through multiplying
903 -- the current view orientation matrix by a scaling matrix:
909 raises BadValue from V3d ;
910 -- If the one of factors <= 0
912 FitAll (me : mutable;
913 theMargin : Coefficient = 0.01;
914 theToUpdate : Boolean from Standard = Standard_True);
916 ---Purpose: Adjust view parameters to fit the displayed scene, respecting height / width ratio.
917 -- The Z clipping range (depth range) is fitted if AutoZFit flag is TRUE.
918 -- Throws program error exception if margin coefficient is < 0 or >= 1.
920 -- @param theMargin [in] the margin coefficient for view borders.
921 -- @param theToUpdate [in] flag to perform view update.
923 ZFitAll (me : mutable; theScaleFactor : Real from Standard = 1.0);
925 ---Purpose: Change Z-min and Z-max planes of projection volume to match the
926 -- displayed objects. The methods ensures that view volume will
927 -- be close by depth range to the displayed objects. Fitting assumes that
928 -- for orthogonal projection the view volume contains the displayed objects
929 -- completely. For zoomed perspective view, the view volume is adjusted such
930 -- that it contains the objects or their parts, located in front of the camera.
931 -- @param theScaleFactor [in] the scale factor for Z-range.
932 -- The range between Z-min, Z-max projection volume planes
933 -- evaluated by z fitting method will be scaled using this coefficient.
934 -- Program error exception is thrown if negative or zero value is passed.
936 AutoZFit (me : mutable);
938 ---Purpose: If automatic z-range fitting is turned on, adjusts Z-min and Z-max
939 -- projection volume planes with call to ZFitAll.
941 DepthFitAll( me : mutable ; Aspect : Coefficient = 0.01;
942 Margin : Coefficient = 0.01 );
944 ---Purpose: Adjusts the viewing volume so as not to clip the displayed objects by front and back
945 -- and back clipping planes. Also sets depth value automatically depending on the
946 -- calculated Z size and Aspect parameter.
947 -- NOTE than the original XY size of the view is NOT modified .
949 FitAll (me : mutable;
950 theMinXv : Real from Standard;
951 theMinYv : Real from Standard;
952 theMaxXv : Real from Standard;
953 theMaxYv : Real from Standard)
955 ---Purpose: Centers the defined projection window so that it occupies
956 -- the maximum space while respecting the initial
957 -- height/width ratio.
958 -- NOTE than the original Z size of the view is NOT modified .
959 raises BadValue from V3d;
960 -- If the defined projection window has zero size.
962 WindowFit (me : mutable; theMinXp, theMinYp, theMaxXp, theMaxYp : Integer)
964 ---Purpose: Centers the defined PIXEL window so that it occupies
965 -- the maximum space while respecting the initial height/width ratio.
966 -- NOTE than the original Z size of the view is NOT modified.
967 -- @param theMinXp [in] pixel coordinates of minimal corner on x screen axis.
968 -- @param theMinYp [in] pixel coordinates of minimal corner on y screen axis.
969 -- @param theMaxXp [in] pixel coordinates of maximal corner on x screen axis.
970 -- @param theMaxYp [in] pixel coordinates of maximal corner on y screen axis.
972 SetViewMappingDefault( me : mutable );
974 ---Purpose: Saves the current view mapping. This will be the
975 -- state returned from ResetViewmapping.
977 ResetViewMapping ( me : mutable );
979 ---Purpose: Resets the centering of the view.
982 Reset ( me : mutable; update : Boolean from Standard = Standard_True );
984 ---Purpose: Resets the centering and the orientation of the view
986 ---------------------------------------------------
987 ---Category: Inquire methods
988 ---------------------------------------------------
990 Convert( me ; Vp : Integer ) returns Length
992 ---Purpose : Converts the PIXEL value
993 -- to a value in the projection plane.
994 raises UnMapped from V3d;
995 -- If the view is not mapped on the window.
997 Convert( me ; Xp,Yp : Integer ; Xv,Yv : out Coordinate )
999 ---Purpose : Converts the point PIXEL into a point projected
1000 -- in the reference frame of the projection plane.
1001 raises UnMapped from V3d;
1002 -- If the view is not mapped on the window.
1004 Convert( me ; Vv : Length ) returns Integer
1006 ---Purpose : Converts tha value of the projection plane into
1008 raises UnMapped from V3d;
1009 -- If the view is not mapped on the window.
1011 Convert( me ; Xv,Yv : Coordinate ; Xp,Yp : out Integer )
1013 ---Purpose : Converts the point defined in the reference frame
1014 -- of the projection plane into a point PIXEL.
1015 raises UnMapped from V3d;
1016 -- If the view is not mapped on the window.
1018 Convert( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate)
1020 ---Purpose : Converts the projected point into a point
1021 -- in the reference frame of the view corresponding
1022 -- to the intersection with the projection plane
1023 -- of the eye/view point vector.
1024 raises UnMapped from V3d;
1025 -- If the view is not mapped on the window.
1027 ConvertWithProj( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate ; Vx,Vy,Vz : out Parameter)
1029 ---Purpose : Converts the projected point into a point
1030 -- in the reference frame of the view corresponding
1031 -- to the intersection with the projection plane
1032 -- of the eye/view point vector and returns the
1033 -- projection ray for further computations.
1034 raises UnMapped from V3d;
1035 -- If the view is not mapped on the window.
1037 ConvertToGrid( me ; Xp,Yp : Integer ; Xg,Yg,Zg : out Coordinate)
1039 ---Purpose : Converts the projected point into the nearest grid point
1040 -- in the reference frame of the view corresponding
1041 -- to the intersection with the projection plane
1042 -- of the eye/view point vector and display the grid marker.
1043 -- Warning: When the grid is not active the result is identical to the above Convert() method.
1045 -- 1) Enable the grid echo display
1046 -- myViewer->SetGridEcho(Standard_True);
1047 -- 2) When application receive a move event:
1048 -- 2.1) Check if any object is detected
1049 -- if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
1050 -- 2.2) Check if the grid is active
1051 -- if( myViewer->Grid()->IsActive() ) {
1052 -- 2.3) Display the grid echo and gets the grid point
1053 -- myView->ConvertToGrid(x,y,X,Y,Z);
1054 -- myView->Viewer()->ShowGridEcho (myView, Graphic3d_Vertex (X,Y,Z));
1055 -- myView->RedrawImmediate();
1056 -- 2.4) Else this is the standard case
1057 -- } else myView->Convert(x,y,X,Y,Z);
1058 raises UnMapped from V3d;
1059 -- If the view is not mapped on the window.
1061 ConvertToGrid( me ; X,Y,Z : Coordinate ; Xg,Yg,Zg : out Coordinate)
1063 ---Purpose : Converts the point into the nearest grid point
1064 -- and display the grid marker.
1065 ---Warning: When the grid is not active the result is identical
1066 -- to the previous point.
1067 raises UnMapped from V3d;
1068 -- If the view is not mapped on the window.
1070 Convert( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1072 ---Purpose : Projects the point defined in the reference frame of
1073 -- the view into the projected point in the associated window.
1075 -- RefToPix( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1076 -- ---Purpose : Projects the point defined in the reference frame of
1077 -- -- the view into the projected point in the associated window.
1078 -- Obsolete : Use Convert(X,Y,Z,Xp,Yp);
1080 -- PixToRef( me ; Xp,Yp : Integer; X,Y,Z : out Coordinate) ;
1081 -- ---Purpose : Converts the projected point in the associated window of
1082 -- -- the view into the point defined in the reference frame.
1083 -- Obsolete : Use Convert(Xp,Yp,X,Y,Z);
1085 Project( me ; X,Y,Z : Coordinate; Xp,Yp : out Coordinate) ;
1087 ---Purpose : Converts the point defined in the user space of
1088 -- the view to the projected view plane point at z 0.
1090 BackgroundColor( me; Type : TypeOfColor ; V1, V2, V3 : out Parameter) ;
1092 ---Purpose: Returns the Background color values of the view
1093 -- depending of the color Type.
1095 BackgroundColor( me ) returns Color from Quantity;
1097 ---Purpose: Returns the Background color object of the view.
1099 GradientBackgroundColors( me;
1100 Color1 : out Color from Quantity;
1101 Color2 : out Color from Quantity) ;
1103 ---Purpose: Returns the gradient background colour objects of the view.
1105 GradientBackground ( me ) returns GradientBackground from Aspect;
1107 ---Purpose: Returns the gradient background of the view.
1109 Scale ( me ) returns Factor ;
1111 ---Purpose: Returns the current value of the zoom expressed with
1112 -- respect to SetViewMappingDefault().
1114 AxialScale ( me ; Sx, Sy, Sz : out Real from Standard ) ;
1116 ---Purpose: Returns the current values of the anisotropic (axial) scale factors.
1118 Size ( me; Width, Height : out Length );
1120 ---Purpose: Returns the height and width of the view.
1122 ZSize ( me ) returns Real ;
1124 ---Purpose: Returns the Depth of the view .
1126 Eye( me ; X,Y,Z : out Coordinate );
1128 ---Purpose: Returns the position of the eye.
1130 FocalReferencePoint (me ; X,Y,Z : out Coordinate );
1132 ---Purpose: Returns the position of point which emanating the
1135 ProjReferenceAxe( me ; Xpix,Ypix : Integer ;
1136 XP,YP,ZP,VX,VY,VZ : out Coordinate );
1138 ---Purpose: Returns the coordinate of the point (Xpix,Ypix)
1139 -- in the view (XP,YP,ZP), and the projection vector of the
1140 -- view passing by the point (for PerspectiveView).
1142 Depth( me ) returns Length ;
1144 ---Purpose: Returns the Distance between the Eye and View Point.
1146 Proj( me ; Vx,Vy,Vz : out Parameter );
1148 ---Purpose: Returns the projection vector.
1150 At( me ; X,Y,Z : out Coordinate );
1152 ---Purpose: Returns the position of the view point.
1154 Up( me ; Vx,Vy,Vz : out Parameter );
1156 ---Purpose: Returns the vector giving the position of the high point.
1158 Twist( me ) returns PlaneAngle ;
1160 ---Purpose: Returns in RADIANS the orientation of the view around
1161 -- the visual axis measured from the Y axis of the screen.
1163 ShadingModel ( me ) returns TypeOfShadingModel ;
1165 ---Purpose: Returns the current shading model.
1167 SurfaceDetail(me) returns TypeOfSurfaceDetail;
1169 -- purpose: returns the current SurfaceDetail mode
1171 TextureEnv(me) returns TextureEnv from Graphic3d;
1173 -- purpose: return the current environment texture used
1175 Transparency(me) returns Boolean from Standard;
1177 ---Purpose: Returns the transparency activity.
1179 Visualization ( me ) returns TypeOfVisualization from V3d;
1181 ---Purpose: Returns the current visualisation mode.
1183 Antialiasing ( me ) returns Boolean;
1185 ---Purpose: Indicates if the antialiasing is active (True) or
1186 -- inactive (False).
1188 ZCueing ( me; Depth, Width : out Length ) returns Boolean ;
1190 ---Purpose: Returns activity and information on the Zcueing.
1191 -- <Depth> : Depth of plane.
1192 -- <Width> : Thickness around the plane.
1194 ZClipping ( me; Depth, Width : out Length ) returns TypeOfZclipping;
1196 ---Purpose: Returns current information on the ZClipping.
1197 -- <Depth> : Depth of plane.
1198 -- <Width> : Thickness around the plane.
1199 -- <TypeOfZclipping> : "BACK"
1204 IfMoreLights( me ) returns Boolean;
1206 ---Purpose: Returns True if One light more can be
1207 -- activated in this View.
1209 InitActiveLights(me: mutable);
1211 ---Purpose: initializes an iteration on the active Lights.
1213 MoreActiveLights (me) returns Boolean from Standard;
1215 ---Purpose: returns true if there are more active Light(s) to return.
1217 NextActiveLights (me: mutable);
1219 ---Purpose : Go to the next active Light
1220 -- (if there is not, ActiveLight will raise an exception)
1222 ActiveLight(me) returns Light from V3d;
1225 Viewer ( me ) returns Viewer from V3d;
1227 ---Purpose: Returns the viewer in which the view has been created.
1229 IfWindow ( me ) returns Boolean;
1231 ---Purpose: Returns True if MyView is associated with a window .
1233 Window ( me ) returns Window from Aspect
1235 ---Purpose: Returns the Aspect Window associated with the view.
1236 raises BadValue from V3d;
1237 -- If MyView is not associated with a window
1239 Type( me ) returns TypeOfView from V3d;
1241 ---Purpose: Returns the Type of the View
1244 theDXp : Integer from Standard;
1245 theDYp : Integer from Standard;
1246 theZoomFactor : Factor from Quantity = 1;
1247 theToStart : Boolean = Standard_True);
1249 ---Purpose: Translates the center of the view along "x" and "y" axes of
1250 -- view projection. Can be used to perform interactive panning operation.
1251 -- In that case the DXp, DXp parameters specify panning relative to the
1252 -- point where the operation is started.
1253 -- @param theDXp [in] the relative panning on "x" axis of view projection, in pixels.
1254 -- @param theDYp [in] the relative panning on "y" axis of view projection, in pixels.
1255 -- @param theZoomFactor [in] the zooming factor.
1256 -- @param theToStart [in] pass TRUE when starting panning to remember view
1257 -- state prior to panning for relative arguments. Passing 0 for relative
1258 -- panning parameter should return view panning to initial state.
1259 -- Performs update of view.
1262 theXp1 : Integer from Standard;
1263 theYp1 : Integer from Standard;
1264 theXp2 : Integer from Standard;
1265 theYp2 : Integer from Standard)
1268 ---Purpose: Zoom the view according to a zoom factor computed
1269 -- from the distance between the 2 mouse position.
1270 -- @param theXp1 [in] the x coordinate of first mouse position, in pixels.
1271 -- @param theYp1 [in] the y coordinate of first mouse position, in pixels.
1272 -- @param theXp2 [in] the x coordinate of second mouse position, in pixels.
1273 -- @param theYp2 [in] the y coordinate of second mouse position, in pixels.
1275 StartZoomAtPoint (me : mutable;
1276 theXp : Integer from Standard;
1277 theYp : Integer from Standard);
1279 ---Purpose: Defines starting point for ZoomAtPoint view operation.
1280 -- @param theXp [in] the x mouse coordinate, in pixels.
1281 -- @param theYp [in] the y mouse coordinate, in pixels.
1283 ZoomAtPoint(me : mutable;
1284 theMouseStartX : Integer from Standard;
1285 theMouseStartY : Integer from Standard;
1286 theMouseEndX : Integer from Standard;
1287 theMouseEndY : Integer from Standard);
1289 ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
1291 AxialScale ( me: mutable; Dx, Dy: Integer from Standard; Axis: TypeOfAxe from V3d );
1293 ---Purpose: Performs anisotropic scaling of <me> view along the given <Axis>.
1294 -- The scale factor is calculated on a basis of
1295 -- the mouse pointer displacement <Dx,Dy>.
1296 -- The calculated scale factor is then passed to SetAxialScale(Sx, Sy, Sz) method.
1298 StartRotation(me : mutable ; X,Y :Integer from Standard;
1299 zRotationThreshold: Ratio from Quantity = 0.0);
1301 ---Purpose: Begin the rotation of the view around the screen axis
1302 -- according to the mouse position <X,Y>.
1303 -- Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
1304 -- factor is > 0 soon the distance from the start point and the center
1305 -- of the view is > (medium viewSize * <zRotationThreshold> ).
1306 -- Generally a value of 0.4 is usable to rotate around XY screen axis
1307 -- inside the circular threshold area and to rotate around Z screen axis
1308 -- outside this area.
1310 Rotation(me:mutable; X,Y :Integer from Standard);
1312 ---Purpose: Continues the rotation of the view
1313 -- with an angle computed from the last and new mouse position <X,Y>.
1315 FitAll ( me : mutable ; aWindow: Window from Aspect;
1316 Umin, Vmin, Umax, Vmax : Coordinate )
1319 ---Purpose: Change the scale factor and position of the view
1320 -- such as the bounding box <Umin, Vmin, Umax, Vmax> is contains
1324 -----------------------------------------
1325 ---Category: Private or Protected methods
1326 -----------------------------------------
1328 SetFocale( me : mutable ; Focale : Length )
1329 ---Purpose: Change View Plane Distance for Perspective Views
1330 raises TypeMismatch from Standard
1331 ---Purpose: Warning! raises TypeMismatch from Standard if the view
1332 -- is not a perspective view.
1335 Focale( me ) returns Length;
1336 ---Purpose: Returns the View Plane Distance for Perspective Views
1338 View ( me) returns View from Visual3d is static ;
1340 ---Purpose: Returns the associated Visual3d view.
1342 ScreenAxis( myclass ; Vpn,Vup : Dir from gp ;
1343 Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
1344 returns Boolean is private ;
1345 ---Purpose: Determines the screen axes in the reference
1346 -- framework of the view.
1349 TrsPoint( myclass ; V : Vertex from Graphic3d ;
1350 Matrix : Array2OfReal from TColStd )
1351 returns Vertex from Graphic3d is private ;
1352 ---Purpose: Transforms the Vertex V according to the matrice Matrix .
1354 ImmediateUpdate (me) is static protected;
1357 SetComputedMode ( me : mutable; aMode : Boolean from Standard )
1360 ---Purpose: Switches computed HLR mode in the view
1361 ---Category: Methods to modify the class definition
1364 returns Boolean from Standard
1367 ---Purpose: Returns the computed HLR mode state
1368 ---Category: Inquire methods
1370 MinMax ( me; Umin,Vmin, Umax,Vmax : out Coordinate ) returns Integer
1371 ---Purpose: Returns the objects number and the projection window
1372 -- of the objects contained in the view.
1375 MinMax ( me; Xmin,Ymin,Zmin, Xmax,Ymax,Zmax : out Coordinate )
1377 ---Purpose: Returns the objects number and the box encompassing
1378 -- the objects contained in the view
1381 Gravity ( me; X,Y,Z : out Coordinate ) returns Integer
1382 ---Purpose: Returns the Objects number and the gravity center
1383 -- of ALL viewable points in the view
1386 Init(me: mutable) is private;
1388 ---Category: for compatibility.
1390 WindowFitAll ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer);
1391 ---Purpose: idem than WindowFit
1393 SetPlotter ( me : mutable; aPlotter : Plotter from Graphic3d )
1394 ---Purpose: Set a plotter for plotting the contents of the view
1398 Plot ( me : mutable )
1399 ---Purpose: Create a 2D View for plotting the contents of the view
1400 raises BadValue from V3d;
1401 -- if the plotter is undefined.
1403 Compute ( me; AVertex : Vertex from Graphic3d )
1404 returns Vertex from Graphic3d
1407 ---Purpose: Returns a new vertex when the grid is activated.
1409 SetGrid ( me : mutable;
1410 aPlane: Ax3 from gp;
1411 aGrid : Grid from Aspect )
1414 ---Purpose: Defines or Updates the definition of the
1416 ---Category: Methods to modify the class definition
1418 SetGridGraphicValues ( me : mutable;
1419 aGrid : Grid from Aspect )
1422 ---Purpose: Defines or Updates the graphic definition of the
1424 ---Category: Methods to modify the class definition
1426 SetGridActivity ( me : mutable;
1427 aFlag : Boolean from Standard )
1430 ---Purpose: Defines or Updates the activity of the
1432 ---Category: Methods to modify the class definition
1435 theFile : CString from Standard;
1436 theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB )
1437 returns Boolean from Standard;
1439 ---Purpose: dump the full contents of the view at the same
1440 -- scale in the file <theFile>. The file name
1441 -- extension must be one of ".png",".bmp",".jpg",".gif".
1442 -- Returns FALSE when the dump has failed
1444 Print (me; hPrnDC: Handle from Aspect = 0;
1445 showDialog: Boolean = Standard_True;
1446 showBackground : Boolean = Standard_True;
1447 filename: CString = NULL;
1448 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH)
1449 returns Boolean from Standard is static;
1452 ---Purpose: print the contents of the view to printer with preview.
1453 -- <hPrnDC> : If you have already an PrinterDeviceContext (HDC),
1454 -- then you can pass it to the print routines.
1455 -- If you don't have an PrinterDeviceContext, then this parameter should
1457 -- <showDialog> : If hPrnDC == NULL, then you can force the print routines to
1458 -- open a Print Dialog box.
1459 -- If you want to do this, then set showDialog to TRUE
1460 -- If you don't want to see a dialog (only possible, if you have a hPrnDC
1461 -- or the dialog box was opened once before) then set <showDialog> to FALSE.
1462 -- <showBackground> : When set to FALSE then print the view without background color
1463 -- (background is white)
1464 -- else set to TRUE for printing with current background color.
1465 -- <filename>: If != NULL, then the view will be printed to a file.
1466 -- <printAlgorithm>: If you want to select the print algorithm, then you can
1467 -- specify one of existing algorithms: Aspect_PA_STRETCH, Aspect_PA_TILE.
1468 -- Returns Standard_True if the data is passed to the printer, otherwise
1469 -- Standard_False if the print operation failed. This might be related to
1470 -- insufficient memory or some internal errors. All this errors are
1471 -- indicated by the message boxes (on level of OpenGl_GraphicDriver).
1472 -- Warning: This function can reuse FBO assigned to the
1473 -- view on level of OpenGl_GraphicDriver; Please take it into account if
1474 -- you use it for your purposes;
1475 -- Warning: Works only under Windows.
1477 ToPixMap (me : mutable;
1478 theImage : in out PixMap from Image;
1479 theWidth : Integer from Standard;
1480 theHeight : Integer from Standard;
1481 theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB;
1482 theToKeepAspect : Boolean from Standard = Standard_True;
1483 theStereoOptions : StereoDumpOptions from V3d = V3d_SDO_MONO)
1484 returns Boolean from Standard;
1486 ---Purpose : Dumps the full contents of the view
1487 -- to a pixmap of pixel size <theWidth> * <theHeight> and
1488 -- buffer type <theBufferType>. If <theToKeepAspect> is true
1489 -- the aspect ratio of view will be kept if <theWidth> and <theHeight>
1490 -- define another ratio.
1491 -- Pixmap will be automatically (re)allocated when needed.
1492 -- When dumping stereographic camera - the corresponding
1493 -- middle-point monographic projection will be used for dumping by default.
1494 -- <theStereoOptions> flags are to be used for dumping then left or
1495 -- right eye projections.
1497 SetProjModel( me : mutable;
1498 amOdel: TypeOfProjectionModel from V3d = V3d_TPM_SCREEN )
1501 ---Purpose : Manages projection model
1504 returns TypeOfProjectionModel from V3d
1507 ---Purpose : Returns the current projection model
1509 SetBackFacingModel ( me : mutable;
1510 aModel : TypeOfBackfacingModel from V3d = V3d_TOBM_AUTOMATIC)
1513 ---Purpose : Manages display of the back faces
1514 -- When <aModel> is TOBM_AUTOMATIC the object backfaces
1515 -- are displayed only for surface objects and
1516 -- never displayed for solid objects.
1517 -- this was the previous mode.
1518 -- <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces
1519 -- are always displayed both for surfaces or solids.
1520 -- <aModel> is TOBM_NEVER_DISPLAYED the object backfaces
1521 -- are never displayed.
1523 BackFacingModel ( me )
1524 returns TypeOfBackfacingModel from V3d
1527 ---Purpose : Returns current state of the back faces display
1529 EnableDepthTest( me; enable : Boolean from Standard = Standard_True )
1532 ---Purpose: turns on/off opengl depth testing
1534 IsDepthTestEnabled( me ) returns Boolean from Standard
1537 ---Purpose: returns the current state of the depth testing
1539 EnableGLLight( me; enable : Boolean from Standard = Standard_True )
1542 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1544 IsGLLightEnabled( me ) returns Boolean from Standard
1547 ---Purpose: returns the current state of the gl lighting
1548 -- currently used in triedron displaying
1550 AddClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
1551 ---Purpose: Adds clip plane to the view. The composition of clip planes truncates the
1552 -- rendering space to convex volume. Number of supported clip planes can be consulted
1553 -- by PlaneLimit method of associated Visual3d_View. Please be aware that the planes
1554 -- which exceed the limit are ignored during rendering.
1555 -- @param thePlane [in] the clip plane to be added to view.
1557 RemoveClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
1558 ---Purpose: Removes clip plane from the view.
1559 -- @param thePlane [in] the clip plane to be removed from view.
1561 SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d);
1562 ---Purpose: Sets sequence of clip planes to the view. The planes that have been set
1563 -- before are removed from the view. The composition of clip planes
1564 -- truncates the rendering space to convex volume. Number of supported
1565 -- clip planes can be consulted by PlaneLimit method of associated
1566 -- Visual3d_View. Please be aware that the planes which exceed the limit
1567 -- are ignored during rendering.
1568 -- @param thePlanes [in] the clip planes to set.
1570 GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
1571 ---C++: return const&
1572 ---Purpose: Get clip planes.
1573 -- @return sequence clip planes that have been set for the view
1575 SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
1577 ---Purpose: Change camera used by view.
1579 Camera (me) returns Camera_Handle from Graphic3d is static;
1581 ---C++: return const&
1582 ---Purpose: Returns camera object of the view.
1583 -- @return: handle to camera object, or NULL if 3D view does not use
1584 -- the camera approach.
1587 theCamera : Camera_Handle from Graphic3d;
1588 theMinCorner : XYZ from gp;
1589 theMaxCorner : XYZ from gp;
1590 theMargin : Real from Standard;
1591 theResolution : Real from Standard = 0.0;
1592 theToEnlargeIfLine : Boolean from Standard = Standard_True)
1593 returns Boolean from Standard is protected;
1595 ---Purpose: Transform camera eye, center and scale to fit in the
1596 -- passed bounding box specified in WCS.
1597 -- @param theCamera [in] the camera.
1598 -- @param theMinCorner [in] the minimal corner of bounding box.
1599 -- @param theMaxCorner [in] the maximal corner of bounding box.
1600 -- @param theMargin [in] the margin coefficient for view borders.
1601 -- @param theResolution [in] the minimum size of projection of
1602 -- bounding box in Xv or Yv direction when it considered to
1603 -- be a thin plane or point (without a volume).
1604 -- In this case only the center of camera is adjusted.
1605 -- @param theToEnlargeIfLine [in] if passed TRUE - in cases when the
1606 -- whole bounding box projected into thin line going along
1607 -- Z-axis of screen, the view plane is enlarged such that
1608 -- we see the whole line on rotation, otherwise only the
1609 -- center of camera is adjusted.
1610 -- @return TRUE if the fit all operation can be done.
1613 theCamera : Camera_Handle from Graphic3d;
1614 theSizeXv : Real from Standard;
1615 theSizeYv : Real from Standard) is protected;
1617 ---Purpose: Scales camera to fit the view frame of defined width and height
1618 -- keeping the aspect. For orthogonal camera the method changes scale,
1619 -- for perspective adjusts Eye location about the Center point.
1620 -- @param theSizeXv [in] size of viewport frame on "x" axis.
1621 -- @param theSizeYv [in] size of viewport frame on "y" axis.
1624 theCamera : Camera_Handle from Graphic3d;
1625 theDXv : Real from Standard;
1626 theDYv : Real from Standard) is protected;
1628 -- Purpose: Translates camera eye and center along the view plane.
1629 -- @param theCamera [in] the camera to translate.
1630 -- @param theDXv [in] the translation in "x" direction.
1631 -- @param theDYv [in] the translation in "y" direction.
1633 RenderingParams (me) returns RenderingParams from Graphic3d is static;
1634 ---C++: return const &
1636 ---Purpose: Returns current rendering parameters and effect settings.
1638 ChangeRenderingParams (me : mutable) returns RenderingParams from Graphic3d is static;
1641 ---Purpose: Returns reference to current rendering parameters and effect settings.
1645 myOldMouseX : Real is protected;
1646 myOldMouseY : Real is protected;
1647 myCamStartOpUp : Dir from gp is protected;
1648 myCamStartOpEye : Pnt from gp is protected;
1649 myCamStartOpBnd : Real[6] is protected;
1650 myCamStartOpCenter : Pnt from gp is protected;
1651 myCamera : Camera_Handle from Graphic3d is protected;
1653 MyViewer : ViewerPointer from V3d ;
1654 MyActiveLights: ListOfTransient from V3d;
1656 MyView : View from Visual3d is protected ;
1657 MyViewContext : ContextView from Visual3d ;
1658 MyBackground: Background from Aspect ;
1659 MyGradientBackground: GradientBackground from Aspect ;
1660 MyDefaultViewAxis: Vector from Graphic3d ;
1661 MyDefaultViewPoint: Vertex from Graphic3d ;
1663 MyWindow: Window from Aspect;
1665 MyPlotter: Plotter from Graphic3d;
1667 myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
1669 sx,sy: Integer from Standard;
1670 rx,ry: Real from Standard;
1671 gx,gy,gz: Real from Standard;
1672 myComputedMode: Boolean from Standard;
1673 SwitchSetFront: Boolean from Standard;
1674 MyZoomAtPointX, MyZoomAtPointY : Integer from Standard;
1677 MyGrid : Grid from Aspect;
1678 MyPlane : Ax3 from gp;
1680 --MyColorScale : ColorScale from V3d;
1681 MyLayerMgr : LayerMgr from V3d;
1683 MyProjModel : TypeOfProjectionModel from V3d is protected;
1685 -- the transformation between XoY and the grid plane
1686 MyTrsf : Array2OfReal from TColStd;
1689 MyGridEchoStructure : Structure from Graphic3d;
1690 MyGridEchoGroup : Group from Graphic3d;
1692 MyTransparencyFlag : Boolean from Standard;
1693 myImmediateUpdate: Boolean from Standard is protected;
1695 myXscreenAxis : Vector from Graphic3d;
1696 myYscreenAxis : Vector from Graphic3d;
1697 myZscreenAxis : Vector from Graphic3d;
1698 myViewAxis : Vector from Graphic3d;
1699 myGravityReferencePoint : Vertex from Graphic3d;
1700 myCamProjectionShift : Pnt from gp;
1701 myAutoZFitIsOn : Boolean from Standard;
1702 myAutoZFitScaleFactor : Real from Standard;
1706 SetViewOn from class Viewer from V3d ( me : mutable ),
1707 SetViewOn from class Viewer from V3d ( me : mutable ; View : View from V3d ),
1708 SetViewOff from class Viewer from V3d ( me : mutable ),
1709 SetViewOff from class Viewer from V3d ( me : mutable ; View : View from V3d )