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 TypeOfBackfacingModel from V3d,
100 StereoDumpOptions from V3d,
104 ContextView from Visual3d,
105 Vector from Graphic3d,
106 Vertex from Graphic3d,
107 Camera_Handle from Graphic3d,
110 BufferType from Graphic3d,
111 Background from Aspect,
112 GradientBackground from Aspect,
113 TypeOfColor from Quantity,
114 NameOfColor from Quantity,
116 Length from Quantity,
117 PlaneAngle from Quantity,
118 Parameter from Quantity,
119 Factor from Quantity,
121 Coefficient from Quantity,
123 Array2OfReal from TColStd,
124 ViewerPointer from V3d,
125 TypeOfTriedronEcho from Aspect,
126 TypeOfTriedronPosition from Aspect,
127 RenderingContext from Aspect,
128 GraphicCallbackProc from Aspect,
129 FillMethod from Aspect,
130 GradientFillMethod from Aspect,
131 FontAspect from Font,
132 AsciiString from TCollection,
133 ExtendedString from TCollection,
134 PrintAlgo from Aspect,
135 ClipPlane_Handle from Graphic3d,
136 SequenceOfHClipPlane from Graphic3d,
137 RenderingMode from Graphic3d,
138 RenderingParams from Graphic3d,
143 BadValue from V3d, TypeMismatch from Standard,
144 MultiplyDefined from Standard,UnMapped from V3d
148 Create ( VM : Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
149 ---Purpose: Initializes the view.
151 Create (theVM : Viewer; theView : View from V3d);
152 ---Purpose: Initializes the view by copying.
154 --------------------------------------------------------
155 ---Category: Methods to modify the Status of the view
156 --------------------------------------------------------
158 SetWindow ( me : mutable ; IdWin : Window )
159 ---Purpose: Activates the view in the window specified and Map the
160 -- Window to the screen.
161 raises MultiplyDefined from Standard;
163 ---Purpose: Warning! raises MultiplyDefined from Standard
164 -- if the view is already activated in a window.
165 -- Warning: The view is centered and resized to preserve
166 -- the height/width ratio of the window.
168 SetWindow ( me : mutable ;
169 aWindow : Window from Aspect;
170 aContext : RenderingContext from Aspect;
171 aDisplayCB : GraphicCallbackProc from Aspect;
172 aClientData : Address from Standard
174 ---Purpose: Activates the view in the specified Window
175 -- If <aContext> is not NULL the graphic context is used
176 -- to draw something in this view.
177 -- Otherwise an internal graphic context is created.
178 -- If <aDisplayCB> is not NULL then a user display CB is
179 -- call at the end of the OCC graphic traversal and just
180 -- before the swap of buffers. The <aClientData> is pass
181 -- to this call back.
182 raises MultiplyDefined from Standard;
184 ---Purpose: Warning! raises MultiplyDefined from Standard
185 -- if the view is already activated in a window.
186 -- Warning: The view is centered and resized to preserve
187 -- the height/width ratio of the window.
189 SetMagnify (me: mutable; IdWin : Window;
190 aPreviousView : View from V3d;
191 x1 , y1 , x2 , y2: Integer from Standard)
196 ---Purpose: Destroys the view.
198 Update ( me ) is static;
200 ---Purpose: Deprecated, Redraw() should be used instead.
204 ---Purpose: Redisplays the view even if there has not
205 -- been any modification.
206 -- Must be called if the view is shown.
207 -- (Ex: DeIconification ) .
209 RedrawImmediate ( me );
211 ---Purpose: Updates layer of immediate presentations.
215 ---Purpose: Invalidates view content but does not redraw it.
217 Redraw ( me ;x,y,width,height: Integer from Standard);
219 ---Purpose: Redisplays the view area after esxposure.
220 -- [x,y] define the min xy area position
221 -- [width,height] the size of the area in pixel unit.
223 MustBeResized ( me : mutable )
225 ---Purpose: Must be called when the window supporting the
226 -- view changes size.
227 raises UnMapped from V3d;
228 ---Purpose: if the view is not mapped on a window.
229 -- Warning: The view is centered and resized to preserve
230 -- the height/width ratio of the window.
232 DoMapping ( me : mutable );
234 ---Purpose: Must be called when the window supporting the
235 -- view is mapped or unmapped.
237 IsEmpty ( me ) returns Boolean;
239 ---Purpose: Returns the status of the view regarding
240 -- the displayed structures inside
241 -- Returns True is The View is empty
245 ---Purpose: Updates the lights of the view. The view is redrawn.
247 AutoZFit (me : mutable);
249 ---Purpose: If automatic z-range fitting is turned on, adjusts Z-min and Z-max
250 -- projection volume planes with call to ZFitAll.
252 ZFitAll (me : mutable; theScaleFactor : Real from Standard = 1.0);
254 ---Purpose: Change Z-min and Z-max planes of projection volume to match the
255 -- displayed objects.
257 --------------------------------------------------------
258 ---Category: Methods to modify the Attributes of the view
259 --------------------------------------------------------
261 SetBackgroundColor ( me : mutable ;
262 Type : TypeOfColor; V1, V2, V3 : Parameter );
264 ---Purpose: Defines the background colour of the view
266 -- the colour definition type,
267 -- and the three corresponding values.
269 SetBackgroundColor ( me : mutable ; Color : Color from Quantity );
271 ---Purpose: Defines the background colour of the view
273 -- the colour object.
275 SetBackgroundColor ( me : mutable ; Name : NameOfColor );
277 ---Purpose: Defines the background colour of the view
279 -- the colour name in the form Quantity_NOC_xxxx .
281 SetBgGradientColors ( me : mutable ;
282 Color1 : Color from Quantity;
283 Color2 : Color from Quantity;
284 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
285 update : Boolean from Standard = Standard_False );
287 ---Purpose: Defines the gradient background colours of the view
289 -- two colour objects,
290 -- and fill method (horizontal by default)
292 SetBgGradientColors ( me : mutable ;
293 Color1 : NameOfColor;
294 Color2 : NameOfColor;
295 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
296 update : Boolean from Standard = Standard_False );
298 ---Purpose: Defines the gradient background colours of the view
300 -- two colour names in the form Quantity_NOC_xxxx,
301 -- and fill method (horizontal by default)
303 SetBgGradientStyle( me : mutable ;
304 AMethod : GradientFillMethod from Aspect = Aspect_GFM_HOR;
305 update : Boolean from Standard = Standard_False);
307 ---Purpose: Defines the gradient background fill method of the view
309 SetBackgroundImage( me : mutable; FileName : CString from Standard;
310 FillStyle : FillMethod from Aspect = Aspect_FM_CENTERED;
311 update : Boolean from Standard = Standard_False );
313 ---Purpose: Defines the background texture of the view
315 --- texture image file name,
316 --- and fill method (centered by default)
318 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
319 update : Boolean from Standard = Standard_False );
321 ---Purpose: Defines the textured background fill method of the view
323 SetAxis ( me : mutable; X,Y,Z : Coordinate ;
324 Vx,Vy,Vz : Parameter )
326 ---Purpose: Definition of an axis from its origin and
328 -- This will be the current axis for rotations and movements.
329 raises BadValue from V3d;
330 ---Purpose: Warning! raises BadValue from V3d if the vector normal is NULL. .
332 SetShadingModel ( me : mutable; Model : TypeOfShadingModel );
334 ---Purpose: Defines the shading model for the
335 -- visualisation ZBUFFER mode.
336 -- Various models are available.
338 SetSurfaceDetail(me : mutable; SurfaceDetail : TypeOfSurfaceDetail);
340 ---Purpose: select the kind of rendering for texture mapping
341 -- no texture mapping by default
343 SetTextureEnv(me : mutable; ATexture : TextureEnv from Graphic3d);
345 ---Purpose: set the environment texture to use
346 -- no environment texture by default
348 SetVisualization ( me : mutable;
349 Mode : TypeOfVisualization from V3d );
351 ---Purpose: Defines the visualisation mode in the view.
353 SetAntialiasingOn ( me : mutable );
355 ---Purpose: Activates antialiasing in the view.
357 SetAntialiasingOff ( me : mutable );
359 ---Purpose: Desactivates antialiasing in the view.
361 SetZClippingDepth ( me : mutable; Depth : Length );
363 ---Purpose: Defines the depth of the medium clipping plane.
365 SetZClippingWidth ( me : mutable; Width : Length )
367 ---Purpose: Defines the thicknes around the medium clippling plane. .
368 raises BadValue from V3d;
369 -- If the thickness is <= 0
371 SetZClippingType ( me : mutable; Type : TypeOfZclipping );
373 ---Purpose: Defines the type of ZClipping.
375 SetZCueingDepth ( me : mutable; Depth : Length );
377 ---Purpose: Defines the depth of the medium plane.
379 SetZCueingWidth ( me : mutable; Width : Length )
381 ---Purpose: Defines the thickness around the medium plane.
382 raises BadValue from V3d;
383 -- If thickness is <= 0
385 SetZCueingOn ( me : mutable );
387 ---Purpose: Activates ZCueing in the view.
389 SetZCueingOff ( me : mutable );
391 ---Purpose: Desactivates ZCueing in the view.
393 SetLightOn( me : mutable ; MyLight : Light from V3d )
395 ---Purpose: Activates MyLight in the view.
396 raises BadValue from V3d;
397 -- If No More Light can be activated in MyView .
399 SetLightOn( me : mutable )
401 ---Purpose: Activates all the lights defined in this view.
402 raises BadValue from V3d;
403 -- If No More Light can be activated in MyView .
405 SetLightOff( me : mutable ; MyLight : Light from V3d );
407 ---Purpose: Desactivate MyLight in this view.
409 SetLightOff( me : mutable );
411 ---Purpose: Deactivate all the Lights defined in this view.
413 IsActiveLight( me ; aLight: Light from V3d )
414 returns Boolean from Standard;
416 ---Purpose: Returns TRUE when the light is active in this view.
418 SetTransparency( me : mutable ; AnActivity : Boolean = Standard_False);
420 ---Purpose: Activate/Deactivate the transparency in this view.
422 SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
423 returns Boolean from Standard;
424 ---Purpose: sets the immediate update mode and returns the previous one.
426 ---------------------------------------------------
428 ---------------------------------------------------
430 ZBufferTriedronSetup ( me : mutable;
431 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
432 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
433 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
434 SizeRatio : Real from Standard = 0.8;
435 AxisDiametr : Real from Standard = 0.05;
436 NbFacettes : Integer from Standard = 12)
439 ---Purpose: Customization of the ZBUFFER Triedron.
440 --- XColor,YColor,ZColor - colors of axis
441 --- SizeRatio - ratio of decreasing of the trihedron size when its phisical
442 --- position comes out of the view
443 --- AxisDiametr - diameter relatively to axis length
444 --- NbFacettes - number of facettes of cylinders and cones
446 TriedronDisplay ( me : mutable;
447 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
448 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
449 AScale : Real from Standard = 0.02;
450 AMode : TypeOfVisualization from V3d = V3d_WIREFRAME )
453 ---Purpose: Display of the Triedron.
454 --- Initialize position, color and length of Triedron axes.
455 --- The scale is a percent of the window width.
458 TriedronErase ( me : mutable )
461 ---Purpose: Erases the Triedron.
464 TriedronEcho ( me : mutable;
465 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
468 ---Purpose: Highlights the echo zone of the Triedron.
471 ---------------------------------
472 ---Category: Graduated trihedron
473 ---------------------------------
475 GetGraduatedTrihedron(me;
477 xname, yname, zname : out ExtendedString from TCollection;
479 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
481 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
483 drawgrid : out Boolean from Standard;
485 drawaxes : out Boolean from Standard;
486 -- Number of splits along axes --
487 nbx, nby, nbz : out Integer from Standard;
488 -- Offset for drawing values --
489 xoffset, yoffset, zoffset : out Integer from Standard;
490 -- Offset for drawing names of axes --
491 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
493 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
494 -- Length of tickmarks --
495 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
497 gridcolor : out Color from Quantity;
498 -- Colors of axis names --
499 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
500 -- Colors of axis and values --
501 xcolor, ycolor, zcolor : out Color from Quantity;
502 -- Name of font for names of axes --
503 fontOfNames : out AsciiString from TCollection;
504 -- Style of names of axes --
505 styleOfNames : out FontAspect from Font;
506 -- Size of names of axes --
507 sizeOfNames : out Integer from Standard;
508 -- Name of font for values --
509 fontOfValues : out AsciiString from TCollection;
510 -- Style of values --
511 styleOfValues : out FontAspect from Font;
513 sizeOfValues : out Integer from Standard)
514 ---Purpose: Returns data of a graduated trihedron.
517 GraduatedTrihedronDisplay(me : mutable;
519 xname : ExtendedString from TCollection = "X";
520 yname : ExtendedString from TCollection = "Y";
521 zname : ExtendedString from TCollection = "Z";
523 xdrawname : Boolean from Standard = Standard_True;
524 ydrawname : Boolean from Standard = Standard_True;
525 zdrawname : Boolean from Standard = Standard_True;
527 xdrawvalues : Boolean from Standard = Standard_True;
528 ydrawvalues : Boolean from Standard = Standard_True;
529 zdrawvalues : Boolean from Standard = Standard_True;
531 drawgrid : Boolean from Standard = Standard_True;
533 drawaxes : Boolean from Standard = Standard_True;
534 -- Number of splits along axes --
535 nbx : Integer from Standard = 3;
536 nby : Integer from Standard = 3;
537 nbz : Integer from Standard = 3;
538 -- Offset for drawing values --
539 xoffset : Integer from Standard = 10;
540 yoffset : Integer from Standard = 10;
541 zoffset : Integer from Standard = 10;
542 -- Offset for drawing names of axes --
543 xaxisoffset : Integer from Standard = 30;
544 yaxisoffset : Integer from Standard = 30;
545 zaxisoffset : Integer from Standard = 30;
547 xdrawtickmarks : Boolean from Standard = Standard_True;
548 ydrawtickmarks : Boolean from Standard = Standard_True;
549 zdrawtickmarks : Boolean from Standard = Standard_True;
550 -- Length of tickmarks --
551 xtickmarklength : Integer from Standard = 10;
552 ytickmarklength : Integer from Standard = 10;
553 ztickmarklength : Integer from Standard = 10;
555 gridcolor : Color from Quantity = Quantity_NOC_WHITE;
557 xnamecolor : Color from Quantity = Quantity_NOC_RED;
559 ynamecolor : Color from Quantity = Quantity_NOC_GREEN;
561 znamecolor : Color from Quantity = Quantity_NOC_BLUE1;
562 -- X color of axis and values --
563 xcolor : Color from Quantity = Quantity_NOC_RED;
564 -- Y color of axis and values --
565 ycolor : Color from Quantity = Quantity_NOC_GREEN;
566 -- Z color of axis and values --
567 zcolor : Color from Quantity = Quantity_NOC_BLUE1;
568 -- Name of font for names of axes --
569 fontOfNames : AsciiString from TCollection = "Arial";
570 -- Style of names of axes --
571 styleOfNames : FontAspect from Font = Font_FA_Bold;
572 -- Size of names of axes --
573 sizeOfNames : Integer from Standard = 12;
574 -- Name of font for values --
575 fontOfValues : AsciiString from TCollection = "Arial";
576 -- Style of values --
577 styleOfValues : FontAspect from Font = Font_FA_Regular;
579 sizeOfValues : Integer from Standard = 12)
580 ---Purpose: Displays a graduated trihedron.
583 GraduatedTrihedronErase(me : mutable)
584 ---Purpose: Erases a graduated trihedron from the view.
587 ---------------------------------------------------
588 -- Color Scale methods
589 ---------------------------------------------------
591 SetLayerMgr(me : mutable; aMgr : LayerMgr from V3d);
593 ColorScaleDisplay(me : mutable);
595 ColorScaleErase(me : mutable);
597 ColorScaleIsDisplayed(me)
598 returns Boolean from Standard;
601 returns ColorScale from Aspect;
603 --------------------------------------------------------
604 ---Category: Methods to modify the Projection of the view
605 --------------------------------------------------------
607 SetFront(me: mutable);
609 ---Purpose: modify the Projection of the view perpendicularly to
610 -- the privileged plane of the viewer.
612 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
613 Start : Boolean = Standard_True )
615 ---Purpose: Rotates the eye about the coordinate system of
616 -- reference of the screen
617 -- for which the origin is the view point of the projection,
618 -- with a relative angular value in RADIANS with respect to
619 -- the initial position expressed by Start = Standard_True
620 raises BadValue from V3d;
621 ---Purpose: Warning! raises BadValue from V3d
622 -- If the eye, the view point, or the high point are
623 -- aligned or confused.
625 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
627 Start : Boolean = Standard_True )
629 ---Purpose: Rotates the eye about the coordinate system of
630 -- reference of the screen
631 -- for which the origin is Gravity point {X,Y,Z},
632 -- with a relative angular value in RADIANS with respect to
633 -- the initial position expressed by Start = Standard_True
634 raises BadValue from V3d;
635 ---Purpose: If the eye, the view point, or the high point are
636 -- aligned or confused.
638 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
640 Start : Boolean = Standard_True );
642 ---Purpose: Rotates the eye about one of the coordinate axes of
643 -- of the view for which the origin is the Gravity point{X,Y,Z}
644 -- with an relative angular value in RADIANS with
645 -- respect to the initial position expressed by
646 -- Start = Standard_True
648 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
649 Start : Boolean = Standard_True ) ;
651 ---Purpose: Rotates the eye about one of the coordinate axes of
652 -- of the view for which the origin is the view point of the
653 -- projection with an relative angular value in RADIANS with
654 -- respect to the initial position expressed by
655 -- Start = Standard_True
657 Rotate ( me : mutable ; Angle : PlaneAngle ;
658 Start : Boolean = Standard_True );
660 ---Purpose: Rotates the eye around the current axis a relative
661 -- angular value in RADIANS with respect to the initial
662 -- position expressed by Start = Standard_True
664 Move ( me : mutable ; Dx,Dy,Dz : Length ;
665 Start : Boolean = Standard_True )
667 ---Purpose: Movement of the eye parallel to the coordinate system
668 -- of reference of the screen a distance relative to the
669 -- initial position expressed by Start = Standard_True.
670 raises BadValue from V3d;
671 -- If the eye, the view point, or the high point are
672 -- aligned or confused.
674 Move ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
675 Start : Boolean = Standard_True )
677 ---Purpose: Movement of the eye parallel to one of the axes of the
678 -- coordinate system of reference of the view a distance
679 -- relative to the initial position expressed by
680 -- Start = Standard_True.
681 raises BadValue from V3d;
682 -- If the eye, view point, or high point are aligned or confused.
684 Move ( me : mutable ; Length : Length ;
685 Start : Boolean = Standard_True )
687 ---Purpose: Movement of the eye parllel to the current axis
688 -- a distance relative to the initial position
689 -- expressed by Start = Standard_True
690 raises BadValue from V3d;
691 -- If the eye, view point, or high point are aligned or confused.
693 Translate ( me : mutable ; Dx,Dy,Dz : Length ;
694 Start : Boolean = Standard_True )
696 ---Purpose: Movement of the ye and the view point parallel to the
697 -- frame of reference of the screen a distance relative
698 -- to the initial position expressed by
699 -- Start = Standard_True
700 raises BadValue from V3d;
701 -- If the eye, view point, or high point are aligned or confused.
703 Translate ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
704 Start : Boolean = Standard_True );
706 ---Purpose: Movement of the eye and the view point parallel to one
707 -- of the axes of the fame of reference of the view a
708 -- distance relative to the initial position
709 -- expressed by Start = Standard_True
711 Translate ( me : mutable ; Length : Length ;
712 Start : Boolean = Standard_True );
714 ---Purpose: Movement of the eye and view point parallel to
715 -- the current axis a distance relative to the initial
716 -- position expressed by Start = Standard_True
719 theXp : Integer from Standard;
720 theYp : Integer from Standard;
721 theZoomFactor : Factor from Quantity = 1)
723 ---Purpose: places the point of the view corresponding
724 -- at the pixel position x,y at the center of the window
725 -- and updates the view.
728 Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
729 Start : Boolean = Standard_True )
731 ---Purpose: Rotation of the view point around the frame of reference
732 -- of the screen for which the origin is the eye of the
733 -- projection with a relative angular value in RADIANS
734 -- with respect to the initial position expressed by
735 -- Start = Standard_True
736 raises BadValue from V3d;
737 -- If the eye, view point, or high point are aligned or confused.
739 Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
740 Start : Boolean = Standard_True )
743 ---Purpose: Rotation of the view point around one of the axes of the
744 -- frame of reference of the view for which the origin is
745 -- the eye of the projection with an angular value in
746 -- RADIANS relative to the initial position expressed by
747 -- Start = Standard_True
749 Turn ( me : mutable ; Angle : PlaneAngle ;
750 Start : Boolean = Standard_True );
752 ---Purpose: Rotation of the view point around the current axis an
753 -- angular value in RADIANS relative to the initial
754 -- position expressed by Start = Standard_True
756 SetTwist ( me : mutable ; Angle : PlaneAngle )
758 ---Purpose: Defines the angular position of the high point of
759 -- the reference frame of the view with respect to the
760 -- Y screen axis with an absolute angular value in
762 raises BadValue from V3d;
763 -- If the eye, view point, or high point are aligned or confused.
765 SetEye( me : mutable ; X,Y,Z : Coordinate )
767 ---Purpose: Defines the position of the eye..
768 raises BadValue from V3d ;
769 -- If the eye, view point, or high point are aligned or confused.
771 SetDepth( me : mutable ; Depth : Length )
773 ---Purpose: Defines the Depth of the eye from the view point
774 -- without update the projection .
775 raises BadValue from V3d ;
776 -- If the Depth is <= 0.
778 SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
780 ---Purpose: Defines the orientation of the projection.
781 raises BadValue from V3d ;
782 -- If the eye, view point, or high point are aligned or confused.
784 SetProj( me : mutable ; Orientation : TypeOfOrientation )
786 ---Purpose: Defines the orientation of the projection .
787 raises BadValue from V3d ;
788 -- If the eye, view point, or high point are aligned or confused.
791 SetAt( me : mutable ; X,Y,Z : Coordinate )
793 ---Purpose: Defines the position of the view point.
794 raises BadValue from V3d ;
795 -- If the eye, view point, or high point are aligned or confused.
797 SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
799 ---Purpose: Defines the orientation of the high point.
800 raises BadValue from V3d ;
801 -- If the eye, view point, or high point are aligned or confused.
803 SetUp( me : mutable ; Orientation : TypeOfOrientation )
805 ---Purpose: Defines the orientation(SO) of the high point.
806 raises BadValue from V3d ;
807 -- If the eye, view point, or high point are aligned or confused.
809 SetViewOrientationDefault( me : mutable );
811 ---Purpose: Saves the current state of the orientation of the view
812 -- which will be the return state at ResetViewOrientation.
814 ResetViewOrientation ( me : mutable );
816 ---Purpose: Resets the orientation of the view.
819 --------------------------------------------------------
820 ---Category: Methods to modify the Mapping of the view
821 --------------------------------------------------------
823 Panning (me : mutable;
824 theDXv : Real from Standard;
825 theDYv : Real from Standard;
826 theZoomFactor : Factor from Quantity = 1;
827 theToStart : Boolean = Standard_True);
829 ---Purpose: Translates the center of the view along "x" and "y" axes of
830 -- view projection. Can be used to perform interactive panning operation.
831 -- In that case the DXv, DXy parameters specify panning relative to the
832 -- point where the operation is started.
833 -- @param theDXv [in] the relative panning on "x" axis of view projection, in view space coordinates.
834 -- @param theDYv [in] the relative panning on "y" axis of view projection, in view space coordinates.
835 -- @param theZoomFactor [in] the zooming factor.
836 -- @param theToStart [in] pass TRUE when starting panning to remember view
837 -- state prior to panning for relative arguments. If panning is started,
838 -- passing {0, 0} for {theDXv, theDYv} will return view to initial state.
839 -- Performs update of view.
841 SetCenter (me : mutable; theXp, theYp : Integer from Standard)
843 ---Purpose: Relocates center of screen to the point, determined by
844 -- {Xp, Yp} pixel coordinates relative to the bottom-left corner of
845 -- screen. To calculate pixel coordinates for any point from world
846 -- coordinate space, it can be projected using "Project".
847 -- @param theXp [in] the x coordinate.
848 -- @param theYp [in] the y coordinate.
849 raises BadValue from V3d;
850 -- If one of the dimensions of the projection is NULL.
852 SetSize ( me : mutable; theSize : Length )
854 ---Purpose: Defines the view projection size in its maximum dimension,
855 -- keeping the inital height/width ratio unchanged.
856 raises BadValue from V3d;
857 -- If <theSize> is <= 0.0
859 SetZSize ( me : mutable ; Size : Length )
861 ---Purpose: Defines the Depth size of the view
862 -- Front Plane will be set to Size/2.
863 -- Back Plane will be set to -Size/2.
864 -- Any Object located Above the Front Plane or
865 -- behind the Back Plane will be Clipped .
866 -- NOTE than the XY Size of the View is NOT modified .
867 raises BadValue from V3d ;
868 -- If the size of the view is <= 0
870 SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
872 ---Purpose: Zooms the view by a factor relative to the initial
873 -- value expressed by Start = Standard_True
875 raises BadValue from V3d ;
876 -- If the zoom coefficient is <= 0
878 SetScale ( me : mutable ; Coef : Factor )
880 ---Purpose: Zooms the view by a factor relative to the value
881 -- initialised by SetViewMappingDefault().
883 raises BadValue from V3d ;
884 -- If the zoom coefficient is <= 0
886 SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
888 ---Purpose: Sets anisotropic (axial) scale factors <Sx>, <Sy>, <Sz> for view <me>.
889 -- Anisotropic scaling operation is performed through multiplying
890 -- the current view orientation matrix by a scaling matrix:
896 raises BadValue from V3d ;
897 -- If the one of factors <= 0
899 FitAll (me : mutable;
900 theMargin : Coefficient = 0.01;
901 theToUpdate : Boolean from Standard = Standard_True);
903 ---Purpose: Adjust view parameters to fit the displayed scene, respecting height / width ratio.
904 -- The Z clipping range (depth range) is fitted if AutoZFit flag is TRUE.
905 -- Throws program error exception if margin coefficient is < 0 or >= 1.
907 -- @param theMargin [in] the margin coefficient for view borders.
908 -- @param theToUpdate [in] flag to perform view update.
910 DepthFitAll( me : mutable ; Aspect : Coefficient = 0.01;
911 Margin : Coefficient = 0.01 );
913 ---Purpose: Adjusts the viewing volume so as not to clip the displayed objects by front and back
914 -- and back clipping planes. Also sets depth value automatically depending on the
915 -- calculated Z size and Aspect parameter.
916 -- NOTE than the original XY size of the view is NOT modified .
918 FitAll (me : mutable;
919 theMinXv : Real from Standard;
920 theMinYv : Real from Standard;
921 theMaxXv : Real from Standard;
922 theMaxYv : Real from Standard)
924 ---Purpose: Centers the defined projection window so that it occupies
925 -- the maximum space while respecting the initial
926 -- height/width ratio.
927 -- NOTE than the original Z size of the view is NOT modified .
928 raises BadValue from V3d;
929 -- If the defined projection window has zero size.
931 WindowFit (me : mutable; theMinXp, theMinYp, theMaxXp, theMaxYp : Integer)
933 ---Purpose: Centers the defined PIXEL window so that it occupies
934 -- the maximum space while respecting the initial height/width ratio.
935 -- NOTE than the original Z size of the view is NOT modified.
936 -- @param theMinXp [in] pixel coordinates of minimal corner on x screen axis.
937 -- @param theMinYp [in] pixel coordinates of minimal corner on y screen axis.
938 -- @param theMaxXp [in] pixel coordinates of maximal corner on x screen axis.
939 -- @param theMaxYp [in] pixel coordinates of maximal corner on y screen axis.
941 SetViewMappingDefault( me : mutable );
943 ---Purpose: Saves the current view mapping. This will be the
944 -- state returned from ResetViewmapping.
946 ResetViewMapping ( me : mutable );
948 ---Purpose: Resets the centering of the view.
951 Reset ( me : mutable; update : Boolean from Standard = Standard_True );
953 ---Purpose: Resets the centering and the orientation of the view
955 ---------------------------------------------------
956 ---Category: Inquire methods
957 ---------------------------------------------------
959 Convert( me ; Vp : Integer ) returns Length
961 ---Purpose : Converts the PIXEL value
962 -- to a value in the projection plane.
963 raises UnMapped from V3d;
964 -- If the view is not mapped on the window.
966 Convert( me ; Xp,Yp : Integer ; Xv,Yv : out Coordinate )
968 ---Purpose : Converts the point PIXEL into a point projected
969 -- in the reference frame of the projection plane.
970 raises UnMapped from V3d;
971 -- If the view is not mapped on the window.
973 Convert( me ; Vv : Length ) returns Integer
975 ---Purpose : Converts tha value of the projection plane into
977 raises UnMapped from V3d;
978 -- If the view is not mapped on the window.
980 Convert( me ; Xv,Yv : Coordinate ; Xp,Yp : out Integer )
982 ---Purpose : Converts the point defined in the reference frame
983 -- of the projection plane into a point PIXEL.
984 raises UnMapped from V3d;
985 -- If the view is not mapped on the window.
987 Convert( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate)
989 ---Purpose : Converts the projected point into a point
990 -- in the reference frame of the view corresponding
991 -- to the intersection with the projection plane
992 -- of the eye/view point vector.
993 raises UnMapped from V3d;
994 -- If the view is not mapped on the window.
996 ConvertWithProj( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate ; Vx,Vy,Vz : out Parameter)
998 ---Purpose : Converts the projected point into a point
999 -- in the reference frame of the view corresponding
1000 -- to the intersection with the projection plane
1001 -- of the eye/view point vector and returns the
1002 -- projection ray for further computations.
1003 raises UnMapped from V3d;
1004 -- If the view is not mapped on the window.
1006 ConvertToGrid( me ; Xp,Yp : Integer ; Xg,Yg,Zg : out Coordinate)
1008 ---Purpose : Converts the projected point into the nearest grid point
1009 -- in the reference frame of the view corresponding
1010 -- to the intersection with the projection plane
1011 -- of the eye/view point vector and display the grid marker.
1012 -- Warning: When the grid is not active the result is identical to the above Convert() method.
1014 -- 1) Enable the grid echo display
1015 -- myViewer->SetGridEcho(Standard_True);
1016 -- 2) When application receive a move event:
1017 -- 2.1) Check if any object is detected
1018 -- if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
1019 -- 2.2) Check if the grid is active
1020 -- if( myViewer->Grid()->IsActive() ) {
1021 -- 2.3) Display the grid echo and gets the grid point
1022 -- myView->ConvertToGrid(x,y,X,Y,Z);
1023 -- myView->Viewer()->ShowGridEcho (myView, Graphic3d_Vertex (X,Y,Z));
1024 -- myView->RedrawImmediate();
1025 -- 2.4) Else this is the standard case
1026 -- } else myView->Convert(x,y,X,Y,Z);
1027 raises UnMapped from V3d;
1028 -- If the view is not mapped on the window.
1030 ConvertToGrid( me ; X,Y,Z : Coordinate ; Xg,Yg,Zg : out Coordinate)
1032 ---Purpose : Converts the point into the nearest grid point
1033 -- and display the grid marker.
1034 ---Warning: When the grid is not active the result is identical
1035 -- to the previous point.
1036 raises UnMapped from V3d;
1037 -- If the view is not mapped on the window.
1039 Convert( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1041 ---Purpose : Projects the point defined in the reference frame of
1042 -- the view into the projected point in the associated window.
1044 -- RefToPix( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1045 -- ---Purpose : Projects the point defined in the reference frame of
1046 -- -- the view into the projected point in the associated window.
1047 -- Obsolete : Use Convert(X,Y,Z,Xp,Yp);
1049 -- PixToRef( me ; Xp,Yp : Integer; X,Y,Z : out Coordinate) ;
1050 -- ---Purpose : Converts the projected point in the associated window of
1051 -- -- the view into the point defined in the reference frame.
1052 -- Obsolete : Use Convert(Xp,Yp,X,Y,Z);
1054 Project( me ; X,Y,Z : Coordinate; Xp,Yp : out Coordinate) ;
1056 ---Purpose : Converts the point defined in the user space of
1057 -- the view to the projected view plane point at z 0.
1059 BackgroundColor( me; Type : TypeOfColor ; V1, V2, V3 : out Parameter) ;
1061 ---Purpose: Returns the Background color values of the view
1062 -- depending of the color Type.
1064 BackgroundColor( me ) returns Color from Quantity;
1066 ---Purpose: Returns the Background color object of the view.
1068 GradientBackgroundColors( me;
1069 Color1 : out Color from Quantity;
1070 Color2 : out Color from Quantity) ;
1072 ---Purpose: Returns the gradient background colour objects of the view.
1074 GradientBackground ( me ) returns GradientBackground from Aspect;
1076 ---Purpose: Returns the gradient background of the view.
1078 Scale ( me ) returns Factor ;
1080 ---Purpose: Returns the current value of the zoom expressed with
1081 -- respect to SetViewMappingDefault().
1083 AxialScale ( me ; Sx, Sy, Sz : out Real from Standard ) ;
1085 ---Purpose: Returns the current values of the anisotropic (axial) scale factors.
1087 Size ( me; Width, Height : out Length );
1089 ---Purpose: Returns the height and width of the view.
1091 ZSize ( me ) returns Real ;
1093 ---Purpose: Returns the Depth of the view .
1095 Eye( me ; X,Y,Z : out Coordinate );
1097 ---Purpose: Returns the position of the eye.
1099 FocalReferencePoint (me ; X,Y,Z : out Coordinate );
1101 ---Purpose: Returns the position of point which emanating the
1104 ProjReferenceAxe( me ; Xpix,Ypix : Integer ;
1105 XP,YP,ZP,VX,VY,VZ : out Coordinate );
1107 ---Purpose: Returns the coordinate of the point (Xpix,Ypix)
1108 -- in the view (XP,YP,ZP), and the projection vector of the
1109 -- view passing by the point (for PerspectiveView).
1111 Depth( me ) returns Length ;
1113 ---Purpose: Returns the Distance between the Eye and View Point.
1115 Proj( me ; Vx,Vy,Vz : out Parameter );
1117 ---Purpose: Returns the projection vector.
1119 At( me ; X,Y,Z : out Coordinate );
1121 ---Purpose: Returns the position of the view point.
1123 Up( me ; Vx,Vy,Vz : out Parameter );
1125 ---Purpose: Returns the vector giving the position of the high point.
1127 Twist( me ) returns PlaneAngle ;
1129 ---Purpose: Returns in RADIANS the orientation of the view around
1130 -- the visual axis measured from the Y axis of the screen.
1132 ShadingModel ( me ) returns TypeOfShadingModel ;
1134 ---Purpose: Returns the current shading model.
1136 SurfaceDetail(me) returns TypeOfSurfaceDetail;
1138 -- purpose: returns the current SurfaceDetail mode
1140 TextureEnv(me) returns TextureEnv from Graphic3d;
1142 -- purpose: return the current environment texture used
1144 Transparency(me) returns Boolean from Standard;
1146 ---Purpose: Returns the transparency activity.
1148 Visualization ( me ) returns TypeOfVisualization from V3d;
1150 ---Purpose: Returns the current visualisation mode.
1152 Antialiasing ( me ) returns Boolean;
1154 ---Purpose: Indicates if the antialiasing is active (True) or
1155 -- inactive (False).
1157 ZCueing ( me; Depth, Width : out Length ) returns Boolean ;
1159 ---Purpose: Returns activity and information on the Zcueing.
1160 -- <Depth> : Depth of plane.
1161 -- <Width> : Thickness around the plane.
1163 ZClipping ( me; Depth, Width : out Length ) returns TypeOfZclipping;
1165 ---Purpose: Returns current information on the ZClipping.
1166 -- <Depth> : Depth of plane.
1167 -- <Width> : Thickness around the plane.
1168 -- <TypeOfZclipping> : "BACK"
1173 IfMoreLights( me ) returns Boolean;
1175 ---Purpose: Returns True if One light more can be
1176 -- activated in this View.
1178 InitActiveLights(me: mutable);
1180 ---Purpose: initializes an iteration on the active Lights.
1182 MoreActiveLights (me) returns Boolean from Standard;
1184 ---Purpose: returns true if there are more active Light(s) to return.
1186 NextActiveLights (me: mutable);
1188 ---Purpose : Go to the next active Light
1189 -- (if there is not, ActiveLight will raise an exception)
1191 ActiveLight(me) returns Light from V3d;
1194 Viewer ( me ) returns Viewer from V3d;
1196 ---Purpose: Returns the viewer in which the view has been created.
1198 IfWindow ( me ) returns Boolean;
1200 ---Purpose: Returns True if MyView is associated with a window .
1202 Window ( me ) returns Window from Aspect
1204 ---Purpose: Returns the Aspect Window associated with the view.
1205 raises BadValue from V3d;
1206 -- If MyView is not associated with a window
1208 Type( me ) returns TypeOfView from V3d;
1210 ---Purpose: Returns the Type of the View
1213 theDXp : Integer from Standard;
1214 theDYp : Integer from Standard;
1215 theZoomFactor : Factor from Quantity = 1;
1216 theToStart : Boolean = Standard_True);
1218 ---Purpose: Translates the center of the view along "x" and "y" axes of
1219 -- view projection. Can be used to perform interactive panning operation.
1220 -- In that case the DXp, DXp parameters specify panning relative to the
1221 -- point where the operation is started.
1222 -- @param theDXp [in] the relative panning on "x" axis of view projection, in pixels.
1223 -- @param theDYp [in] the relative panning on "y" axis of view projection, in pixels.
1224 -- @param theZoomFactor [in] the zooming factor.
1225 -- @param theToStart [in] pass TRUE when starting panning to remember view
1226 -- state prior to panning for relative arguments. Passing 0 for relative
1227 -- panning parameter should return view panning to initial state.
1228 -- Performs update of view.
1231 theXp1 : Integer from Standard;
1232 theYp1 : Integer from Standard;
1233 theXp2 : Integer from Standard;
1234 theYp2 : Integer from Standard)
1237 ---Purpose: Zoom the view according to a zoom factor computed
1238 -- from the distance between the 2 mouse position.
1239 -- @param theXp1 [in] the x coordinate of first mouse position, in pixels.
1240 -- @param theYp1 [in] the y coordinate of first mouse position, in pixels.
1241 -- @param theXp2 [in] the x coordinate of second mouse position, in pixels.
1242 -- @param theYp2 [in] the y coordinate of second mouse position, in pixels.
1244 StartZoomAtPoint (me : mutable;
1245 theXp : Integer from Standard;
1246 theYp : Integer from Standard);
1248 ---Purpose: Defines starting point for ZoomAtPoint view operation.
1249 -- @param theXp [in] the x mouse coordinate, in pixels.
1250 -- @param theYp [in] the y mouse coordinate, in pixels.
1252 ZoomAtPoint(me : mutable;
1253 theMouseStartX : Integer from Standard;
1254 theMouseStartY : Integer from Standard;
1255 theMouseEndX : Integer from Standard;
1256 theMouseEndY : Integer from Standard);
1258 ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
1260 AxialScale ( me: mutable; Dx, Dy: Integer from Standard; Axis: TypeOfAxe from V3d );
1262 ---Purpose: Performs anisotropic scaling of <me> view along the given <Axis>.
1263 -- The scale factor is calculated on a basis of
1264 -- the mouse pointer displacement <Dx,Dy>.
1265 -- The calculated scale factor is then passed to SetAxialScale(Sx, Sy, Sz) method.
1267 StartRotation(me : mutable ; X,Y :Integer from Standard;
1268 zRotationThreshold: Ratio from Quantity = 0.0);
1270 ---Purpose: Begin the rotation of the view around the screen axis
1271 -- according to the mouse position <X,Y>.
1272 -- Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
1273 -- factor is > 0 soon the distance from the start point and the center
1274 -- of the view is > (medium viewSize * <zRotationThreshold> ).
1275 -- Generally a value of 0.4 is usable to rotate around XY screen axis
1276 -- inside the circular threshold area and to rotate around Z screen axis
1277 -- outside this area.
1279 Rotation(me:mutable; X,Y :Integer from Standard);
1281 ---Purpose: Continues the rotation of the view
1282 -- with an angle computed from the last and new mouse position <X,Y>.
1284 FitAll ( me : mutable ; aWindow: Window from Aspect;
1285 Umin, Vmin, Umax, Vmax : Coordinate )
1288 ---Purpose: Change the scale factor and position of the view
1289 -- such as the bounding box <Umin, Vmin, Umax, Vmax> is contains
1293 -----------------------------------------
1294 ---Category: Private or Protected methods
1295 -----------------------------------------
1297 SetFocale( me : mutable ; Focale : Length )
1298 ---Purpose: Change View Plane Distance for Perspective Views
1299 raises TypeMismatch from Standard
1300 ---Purpose: Warning! raises TypeMismatch from Standard if the view
1301 -- is not a perspective view.
1304 Focale( me ) returns Length;
1305 ---Purpose: Returns the View Plane Distance for Perspective Views
1307 View ( me) returns View from Visual3d is static ;
1309 ---Purpose: Returns the associated Visual3d view.
1311 ScreenAxis( myclass ; Vpn,Vup : Dir from gp ;
1312 Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
1313 returns Boolean is private ;
1314 ---Purpose: Determines the screen axes in the reference
1315 -- framework of the view.
1318 TrsPoint( myclass ; V : Vertex from Graphic3d ;
1319 Matrix : Array2OfReal from TColStd )
1320 returns Vertex from Graphic3d is private ;
1321 ---Purpose: Transforms the Vertex V according to the matrice Matrix .
1323 ImmediateUpdate (me) is static protected;
1326 SetComputedMode ( me : mutable; aMode : Boolean from Standard )
1329 ---Purpose: Switches computed HLR mode in the view
1330 ---Category: Methods to modify the class definition
1333 returns Boolean from Standard
1336 ---Purpose: Returns the computed HLR mode state
1337 ---Category: Inquire methods
1339 MinMax ( me; Umin,Vmin, Umax,Vmax : out Coordinate ) returns Integer
1340 ---Purpose: Returns the objects number and the projection window
1341 -- of the objects contained in the view.
1344 MinMax ( me; Xmin,Ymin,Zmin, Xmax,Ymax,Zmax : out Coordinate )
1346 ---Purpose: Returns the objects number and the box encompassing
1347 -- the objects contained in the view
1350 Gravity ( me; X,Y,Z : out Coordinate ) returns Integer
1351 ---Purpose: Returns the Objects number and the gravity center
1352 -- of ALL viewable points in the view
1355 Init(me: mutable) is private;
1357 ---Category: for compatibility.
1359 WindowFitAll ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer);
1360 ---Purpose: idem than WindowFit
1362 Compute ( me; AVertex : Vertex from Graphic3d )
1363 returns Vertex from Graphic3d
1366 ---Purpose: Returns a new vertex when the grid is activated.
1368 SetGrid ( me : mutable;
1369 aPlane: Ax3 from gp;
1370 aGrid : Grid from Aspect )
1373 ---Purpose: Defines or Updates the definition of the
1375 ---Category: Methods to modify the class definition
1377 SetGridGraphicValues ( me : mutable;
1378 aGrid : Grid from Aspect )
1381 ---Purpose: Defines or Updates the graphic definition of the
1383 ---Category: Methods to modify the class definition
1385 SetGridActivity ( me : mutable;
1386 aFlag : Boolean from Standard )
1389 ---Purpose: Defines or Updates the activity of the
1391 ---Category: Methods to modify the class definition
1394 theFile : CString from Standard;
1395 theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB )
1396 returns Boolean from Standard;
1398 ---Purpose: dump the full contents of the view at the same
1399 -- scale in the file <theFile>. The file name
1400 -- extension must be one of ".png",".bmp",".jpg",".gif".
1401 -- Returns FALSE when the dump has failed
1403 Print (me; hPrnDC: Handle from Aspect = 0;
1404 showDialog: Boolean = Standard_True;
1405 showBackground : Boolean = Standard_True;
1406 filename: CString = NULL;
1407 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH)
1408 returns Boolean from Standard is static;
1411 ---Purpose: print the contents of the view to printer with preview.
1412 -- <hPrnDC> : If you have already an PrinterDeviceContext (HDC),
1413 -- then you can pass it to the print routines.
1414 -- If you don't have an PrinterDeviceContext, then this parameter should
1416 -- <showDialog> : If hPrnDC == NULL, then you can force the print routines to
1417 -- open a Print Dialog box.
1418 -- If you want to do this, then set showDialog to TRUE
1419 -- If you don't want to see a dialog (only possible, if you have a hPrnDC
1420 -- or the dialog box was opened once before) then set <showDialog> to FALSE.
1421 -- <showBackground> : When set to FALSE then print the view without background color
1422 -- (background is white)
1423 -- else set to TRUE for printing with current background color.
1424 -- <filename>: If != NULL, then the view will be printed to a file.
1425 -- <printAlgorithm>: If you want to select the print algorithm, then you can
1426 -- specify one of existing algorithms: Aspect_PA_STRETCH, Aspect_PA_TILE.
1427 -- Returns Standard_True if the data is passed to the printer, otherwise
1428 -- Standard_False if the print operation failed. This might be related to
1429 -- insufficient memory or some internal errors. All this errors are
1430 -- indicated by the message boxes (on level of OpenGl_GraphicDriver).
1431 -- Warning: This function can reuse FBO assigned to the
1432 -- view on level of OpenGl_GraphicDriver; Please take it into account if
1433 -- you use it for your purposes;
1434 -- Warning: Works only under Windows.
1436 ToPixMap (me : mutable;
1437 theImage : in out PixMap from Image;
1438 theWidth : Integer from Standard;
1439 theHeight : Integer from Standard;
1440 theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB;
1441 theToKeepAspect : Boolean from Standard = Standard_True;
1442 theStereoOptions : StereoDumpOptions from V3d = V3d_SDO_MONO)
1443 returns Boolean from Standard;
1445 ---Purpose : Dumps the full contents of the view
1446 -- to a pixmap of pixel size <theWidth> * <theHeight> and
1447 -- buffer type <theBufferType>. If <theToKeepAspect> is true
1448 -- the aspect ratio of view will be kept if <theWidth> and <theHeight>
1449 -- define another ratio.
1450 -- Pixmap will be automatically (re)allocated when needed.
1451 -- When dumping stereographic camera - the corresponding
1452 -- middle-point monographic projection will be used for dumping by default.
1453 -- <theStereoOptions> flags are to be used for dumping then left or
1454 -- right eye projections.
1456 SetBackFacingModel ( me : mutable;
1457 aModel : TypeOfBackfacingModel from V3d = V3d_TOBM_AUTOMATIC)
1460 ---Purpose : Manages display of the back faces
1461 -- When <aModel> is TOBM_AUTOMATIC the object backfaces
1462 -- are displayed only for surface objects and
1463 -- never displayed for solid objects.
1464 -- this was the previous mode.
1465 -- <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces
1466 -- are always displayed both for surfaces or solids.
1467 -- <aModel> is TOBM_NEVER_DISPLAYED the object backfaces
1468 -- are never displayed.
1470 BackFacingModel ( me )
1471 returns TypeOfBackfacingModel from V3d
1474 ---Purpose : Returns current state of the back faces display
1476 EnableDepthTest( me; enable : Boolean from Standard = Standard_True )
1479 ---Purpose: turns on/off opengl depth testing
1481 IsDepthTestEnabled( me ) returns Boolean from Standard
1484 ---Purpose: returns the current state of the depth testing
1486 EnableGLLight( me; enable : Boolean from Standard = Standard_True )
1489 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1491 IsGLLightEnabled( me ) returns Boolean from Standard
1494 ---Purpose: returns the current state of the gl lighting
1495 -- currently used in triedron displaying
1497 AddClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
1498 ---Purpose: Adds clip plane to the view. The composition of clip planes truncates the
1499 -- rendering space to convex volume. Number of supported clip planes can be consulted
1500 -- by PlaneLimit method of associated Visual3d_View. Please be aware that the planes
1501 -- which exceed the limit are ignored during rendering.
1502 -- @param thePlane [in] the clip plane to be added to view.
1504 RemoveClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
1505 ---Purpose: Removes clip plane from the view.
1506 -- @param thePlane [in] the clip plane to be removed from view.
1508 SetClipPlanes (me : mutable; thePlanes : SequenceOfHClipPlane from Graphic3d);
1509 ---Purpose: Sets sequence of clip planes to the view. The planes that have been set
1510 -- before are removed from the view. The composition of clip planes
1511 -- truncates the rendering space to convex volume. Number of supported
1512 -- clip planes can be consulted by PlaneLimit method of associated
1513 -- Visual3d_View. Please be aware that the planes which exceed the limit
1514 -- are ignored during rendering.
1515 -- @param thePlanes [in] the clip planes to set.
1517 GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
1518 ---C++: return const&
1519 ---Purpose: Get clip planes.
1520 -- @return sequence clip planes that have been set for the view
1522 SetCamera (me : mutable; theCamera : Camera_Handle from Graphic3d) is static;
1524 ---Purpose: Change camera used by view.
1526 Camera (me) returns Camera_Handle from Graphic3d is static;
1528 ---C++: return const&
1529 ---Purpose: Returns camera object of the view.
1530 -- @return: handle to camera object, or NULL if 3D view does not use
1531 -- the camera approach.
1534 theCamera : Camera_Handle from Graphic3d;
1535 theBox : Box from Bnd;
1536 theMargin : Real from Standard;
1537 theResolution : Real from Standard = 0.0;
1538 theToEnlargeIfLine : Boolean from Standard = Standard_True)
1539 returns Boolean from Standard is protected;
1541 ---Purpose: Transform camera eye, center and scale to fit in the
1542 -- passed bounding box specified in WCS.
1543 -- @param theCamera [in] the camera.
1544 -- @param theBox [in] the bounding box.
1545 -- @param theMargin [in] the margin coefficient for view borders.
1546 -- @param theResolution [in] the minimum size of projection of
1547 -- bounding box in Xv or Yv direction when it considered to
1548 -- be a thin plane or point (without a volume).
1549 -- In this case only the center of camera is adjusted.
1550 -- @param theToEnlargeIfLine [in] if passed TRUE - in cases when the
1551 -- whole bounding box projected into thin line going along
1552 -- Z-axis of screen, the view plane is enlarged such that
1553 -- we see the whole line on rotation, otherwise only the
1554 -- center of camera is adjusted.
1555 -- @return TRUE if the fit all operation can be done.
1558 theCamera : Camera_Handle from Graphic3d;
1559 theSizeXv : Real from Standard;
1560 theSizeYv : Real from Standard) is protected;
1562 ---Purpose: Scales camera to fit the view frame of defined width and height
1563 -- keeping the aspect. For orthogonal camera the method changes scale,
1564 -- for perspective adjusts Eye location about the Center point.
1565 -- @param theSizeXv [in] size of viewport frame on "x" axis.
1566 -- @param theSizeYv [in] size of viewport frame on "y" axis.
1569 theCamera : Camera_Handle from Graphic3d;
1570 theDXv : Real from Standard;
1571 theDYv : Real from Standard) is protected;
1573 -- Purpose: Translates camera eye and center along the view plane.
1574 -- @param theCamera [in] the camera to translate.
1575 -- @param theDXv [in] the translation in "x" direction.
1576 -- @param theDYv [in] the translation in "y" direction.
1578 RenderingParams (me) returns RenderingParams from Graphic3d is static;
1579 ---C++: return const &
1581 ---Purpose: Returns current rendering parameters and effect settings.
1583 ChangeRenderingParams (me : mutable) returns RenderingParams from Graphic3d is static;
1586 ---Purpose: Returns reference to current rendering parameters and effect settings.
1588 IsCullingEnabled (me) returns Boolean from Standard is static;
1590 ---Purpose: @return flag value of objects culling mechanism
1592 SetFrustumCulling (me : mutable; theMode : Boolean from Standard) is static;
1594 ---Purpose: Turn on/off automatic culling of objects outside frustrum (ON by default)
1598 myOldMouseX : Real is protected;
1599 myOldMouseY : Real is protected;
1600 myCamStartOpUp : Dir from gp is protected;
1601 myCamStartOpEye : Pnt from gp is protected;
1602 myCamStartOpBnd : Real[6] is protected;
1603 myCamStartOpCenter : Pnt from gp is protected;
1604 myCamera : Camera_Handle from Graphic3d is protected;
1606 MyViewer : ViewerPointer from V3d ;
1607 MyActiveLights: ListOfTransient from V3d;
1609 MyView : View from Visual3d is protected ;
1610 MyViewContext : ContextView from Visual3d ;
1611 MyBackground: Background from Aspect ;
1612 MyGradientBackground: GradientBackground from Aspect ;
1613 MyDefaultViewAxis: Vector from Graphic3d ;
1614 MyDefaultViewPoint: Vertex from Graphic3d ;
1616 MyWindow: Window from Aspect;
1618 myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
1620 sx,sy: Integer from Standard;
1621 rx,ry: Real from Standard;
1622 gx,gy,gz: Real from Standard;
1623 myComputedMode: Boolean from Standard;
1624 SwitchSetFront: Boolean from Standard;
1625 MyZoomAtPointX, MyZoomAtPointY : Integer from Standard;
1628 MyGrid : Grid from Aspect;
1629 MyPlane : Ax3 from gp;
1631 --MyColorScale : ColorScale from V3d;
1632 MyLayerMgr : LayerMgr from V3d;
1634 -- the transformation between XoY and the grid plane
1635 MyTrsf : Array2OfReal from TColStd;
1638 MyGridEchoStructure : Structure from Graphic3d;
1639 MyGridEchoGroup : Group from Graphic3d;
1641 MyTransparencyFlag : Boolean from Standard;
1642 myImmediateUpdate: Boolean from Standard is protected;
1644 myXscreenAxis : Vector from Graphic3d;
1645 myYscreenAxis : Vector from Graphic3d;
1646 myZscreenAxis : Vector from Graphic3d;
1647 myViewAxis : Vector from Graphic3d;
1648 myGravityReferencePoint : Vertex from Graphic3d;
1649 myCamProjectionShift : Pnt from gp;
1653 SetViewOn from class Viewer from V3d ( me : mutable ),
1654 SetViewOn from class Viewer from V3d ( me : mutable ; View : View from V3d ),
1655 SetViewOff from class Viewer from V3d ( me : mutable ),
1656 SetViewOff from class Viewer from V3d ( me : mutable ; View : View from V3d )