1 -- Created on: 1992-01-15
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
21 -- Modified: FMN - 24/12/97 -> Suppression GEOMLITE
22 -- CQO - 24/12/97 -> BUC50037
23 -- stt:25-02-98; S3558: ajout IfManageStandardEvent
24 -- stt:08-04-98; suppr IfManageStandardEvent
25 -- CAL - 18/08/98 -> S3892. Ajout grilles 3d.
26 -- BGN - 16-09-98; Points d'entree du Triedre (S3819, Phase 1)
27 -- 22-09-98 ; BGN : S3989 (anciennement S3819)
28 -- TypeOfTriedron* from Aspect(et pas V3d)
29 -- CAL - 21/10/98 -> Speciale. Ajout methode Tumble.
30 -- 29-OCT-98 : DCB : Adding ScreenCopy () method.
31 -- GG - 10/11/99 : PRO19603 Adding Redraw( area ) method
32 -- GG - 15/12/99 : GER61351 Adding SetBackgroundColor()
33 -- and BackgroundColor() methods
34 -- GG - 24/01/00 : -> Remove internal PixToRef() method, use Convert()
36 -- -> Rename internal RefToPix() to Convert() method.
37 -- -> Add ConvertToGrid() methods,
38 -- the Compute() internal method become private.
39 -- -> Add SetProjModel() method.
40 -- VKH - 15/11/99 : G004
41 -- -> Add method Dump()
43 -- -> Add Transparency() method
44 -- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
45 -- -> Add Print method (works only under Windows).
47 -- -> Add IsActiveLight() & IsActivePlane() methods
49 -- -> Add ToPixMap() method
50 -- GG - RIC120302 Add NEW SetWindow method.
52 -- -> Add EnableDepthTest() & IsDepthTestEnabled().
53 -- VSV - 28/05/02: ZBUFFER mode of Trihedron
54 -- SAV - 23/12/02 -> Added methods to set background image
55 -- NKV - 23/07/07 -> Define custom projection and model view matrixes
56 -- NKV - 08/02/07 -> Add ConvertWithProj() method
58 class View from V3d inherits TShared from MMgt
60 ---Purpose: Defines the application object VIEW for the
61 -- VIEWER application.
62 -- The methods of this class allow the editing
63 -- and inquiring the parameters linked to the view.
64 -- (Projection,Mapping,Zclipping,DepthCueing,AntiAliasing
66 -- Warning: The default parameters are defined by the class
67 -- Viewer (Example : SetDefaultViewSize()).
68 -- Certain methods are mouse oriented, and it is
69 -- necessary to know the difference between the start and
70 -- the continuation of this gesture in putting the method
72 -- Example : Shifting the eye-view along the screen axes.
74 -- View->Move(10.,20.,0.,True) (Starting motion)
75 -- View->Move(15.,-5.,0.,False) (Next motion)
83 ColorScale from Aspect,
84 Array2OfReal from TColStd,
87 Structure from Graphic3d,
90 ListOfTransient from V3d,
91 ListIteratorOfListOfTransient from TColStd,
94 TypeOfOrientation from V3d,
95 TypeOfShadingModel from V3d,
96 TypeOfSurfaceDetail from V3d,
97 TextureEnv from Graphic3d,
98 TypeOfVisualization from V3d,
99 TypeOfZclipping from V3d,
100 TypeOfProjectionModel from V3d,
101 TypeOfBackfacingModel from V3d,
105 ViewMapping from Visual3d,
106 ViewOrientation from Visual3d,
107 ContextView from Visual3d,
108 Vector from Graphic3d,
109 Vertex from Graphic3d,
110 Plotter from Graphic3d,
113 BufferType from Graphic3d,
114 Background from Aspect,
115 GradientBackground from Aspect,
116 TypeOfColor from Quantity,
117 NameOfColor from Quantity,
119 Length from Quantity,
120 PlaneAngle from Quantity,
121 Parameter from Quantity,
122 Factor from Quantity,
124 Coefficient from Quantity,
126 Array2OfReal from TColStd,
127 ViewerPointer from V3d,
128 TransientManager from Visual3d,
129 TypeOfTriedronEcho from Aspect,
130 TypeOfTriedronPosition from Aspect,
131 RenderingContext from Aspect,
132 GraphicCallbackProc from Aspect,
133 FillMethod from Aspect,
134 GradientFillMethod from Aspect,
135 FontAspect from Font,
136 AsciiString from TCollection,
137 ExtendedString from TCollection,
138 PrintAlgo from Aspect,
139 ClipPlane_Handle from Graphic3d,
140 SetOfHClipPlane from Graphic3d
143 BadValue from V3d, TypeMismatch from Standard,
144 MultiplyDefined from Standard,UnMapped from V3d
148 Create ( VM : mutable Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
149 ---Purpose: Initialises the view.
151 Create ( VM : mutable Viewer ; V : View from V3d; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
152 ---Purpose: Initialises 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 Redraw ( me ;x,y,width,height: Integer from Standard);
211 ---Purpose: Redisplays the view area after esxposure.
212 -- [x,y] define the min xy area position
213 -- [width,height] the size of the area in pixel unit.
215 MustBeResized ( me : mutable )
217 ---Purpose: Must be called when the window supporting the
218 -- view changes size.
219 raises UnMapped from V3d;
220 ---Purpose: if the view is not mapped on a window.
221 -- Warning: The view is centered and resized to preserve
222 -- the height/width ratio of the window.
224 DoMapping ( me : mutable );
226 ---Purpose: Must be called when the window supporting the
227 -- view is mapped or unmapped.
229 IsEmpty ( me ) returns Boolean;
231 ---Purpose: Returns the status of the view regarding
232 -- the displayed structures inside
233 -- Returns True is The View is empty
237 ---Purpose: Updates the lights of the view. The view is redrawn.
239 --------------------------------------------------------
240 ---Category: Methods to modify the Attributes of the view
241 --------------------------------------------------------
243 SetBackgroundColor ( me : mutable ;
244 Type : TypeOfColor; V1, V2, V3 : Parameter );
246 ---Purpose: Defines the background colour of the view
248 -- the colour definition type,
249 -- and the three corresponding values.
251 SetBackgroundColor ( me : mutable ; Color : Color from Quantity );
253 ---Purpose: Defines the background colour of the view
255 -- the colour object.
257 SetBackgroundColor ( me : mutable ; Name : NameOfColor );
259 ---Purpose: Defines the background colour of the view
261 -- the colour name in the form Quantity_NOC_xxxx .
263 SetBgGradientColors ( me : mutable ;
264 Color1 : Color from Quantity;
265 Color2 : Color from Quantity;
266 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
267 update : Boolean from Standard = Standard_False );
269 ---Purpose: Defines the gradient background colours of the view
271 -- two colour objects,
272 -- and fill method (horizontal by default)
274 SetBgGradientColors ( me : mutable ;
275 Color1 : NameOfColor;
276 Color2 : NameOfColor;
277 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
278 update : Boolean from Standard = Standard_False );
280 ---Purpose: Defines the gradient background colours of the view
282 -- two colour names in the form Quantity_NOC_xxxx,
283 -- and fill method (horizontal by default)
285 SetBgGradientStyle( me : mutable ;
286 AMethod : GradientFillMethod from Aspect = Aspect_GFM_HOR;
287 update : Boolean from Standard = Standard_False);
289 ---Purpose: Defines the gradient background fill method of the view
291 SetBackgroundImage( me : mutable; FileName : CString from Standard;
292 FillStyle : FillMethod from Aspect = Aspect_FM_CENTERED;
293 update : Boolean from Standard = Standard_False );
295 ---Purpose: Defines the background texture of the view
297 --- texture image file name,
298 --- and fill method (centered by default)
300 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
301 update : Boolean from Standard = Standard_False );
303 ---Purpose: Defines the textured background fill method of the view
305 SetAxis ( me : mutable; X,Y,Z : Coordinate ;
306 Vx,Vy,Vz : Parameter )
308 ---Purpose: Definition of an axis from its origin and
310 -- This will be the current axis for rotations and movements.
311 raises BadValue from V3d;
312 ---Purpose: Warning! raises BadValue from V3d if the vector normal is NULL. .
314 SetShadingModel ( me : mutable; Model : TypeOfShadingModel );
316 ---Purpose: Defines the shading model for the
317 -- visualisation ZBUFFER mode.
318 -- Various models are available.
320 SetSurfaceDetail(me : mutable; SurfaceDetail : TypeOfSurfaceDetail);
322 ---Purpose: select the kind of rendering for texture mapping
323 -- no texture mapping by default
325 SetTextureEnv(me : mutable; ATexture : TextureEnv from Graphic3d);
327 ---Purpose: set the environment texture to use
328 -- no environment texture by default
330 SetVisualization ( me : mutable;
331 Mode : TypeOfVisualization from V3d );
333 ---Purpose: Defines the visualisation mode in the view.
335 SetAntialiasingOn ( me : mutable );
337 ---Purpose: Activates antialiasing in the view.
339 SetAntialiasingOff ( me : mutable );
341 ---Purpose: Desactivates antialiasing in the view.
343 SetZClippingDepth ( me : mutable; Depth : Length );
345 ---Purpose: Defines the depth of the medium clipping plane.
347 SetZClippingWidth ( me : mutable; Width : Length )
349 ---Purpose: Defines the thicknes around the medium clippling plane. .
350 raises BadValue from V3d;
351 -- If the thickness is <= 0
353 SetZClippingType ( me : mutable; Type : TypeOfZclipping );
355 ---Purpose: Defines the type of ZClipping.
357 SetZCueingDepth ( me : mutable; Depth : Length );
359 ---Purpose: Defines the depth of the medium plane.
361 SetZCueingWidth ( me : mutable; Width : Length )
363 ---Purpose: Defines the thickness around the medium plane.
364 raises BadValue from V3d;
365 -- If thickness is <= 0
367 SetZCueingOn ( me : mutable );
369 ---Purpose: Activates ZCueing in the view.
371 SetZCueingOff ( me : mutable );
373 ---Purpose: Desactivates ZCueing in the view.
375 SetLightOn( me : mutable ; MyLight : Light from V3d )
377 ---Purpose: Activates MyLight in the view.
378 raises BadValue from V3d;
379 -- If No More Light can be activated in MyView .
381 SetLightOn( me : mutable )
383 ---Purpose: Activates all the lights defined in this view.
384 raises BadValue from V3d;
385 -- If No More Light can be activated in MyView .
387 SetLightOff( me : mutable ; MyLight : Light from V3d );
389 ---Purpose: Desactivate MyLight in this view.
391 SetLightOff( me : mutable );
393 ---Purpose: Deactivate all the Lights defined in this view.
395 IsActiveLight( me ; aLight: Light from V3d )
396 returns Boolean from Standard;
398 ---Purpose: Returns TRUE when the light is active in this view.
400 SetTransparency( me : mutable ; AnActivity : Boolean = Standard_False);
402 ---Purpose: Activate/Deactivate the transparency in this view.
404 SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
405 returns Boolean from Standard;
406 ---Purpose: sets the immediate update mode and returns the previous one.
409 ---------------------------------------------------
411 ---------------------------------------------------
413 ZBufferTriedronSetup ( me : mutable;
414 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
415 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
416 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
417 SizeRatio : Real from Standard = 0.8;
418 AxisDiametr : Real from Standard = 0.05;
419 NbFacettes : Integer from Standard = 12)
422 ---Purpose: Customization of the ZBUFFER Triedron.
423 --- XColor,YColor,ZColor - colors of axis
424 --- SizeRatio - ratio of decreasing of the trihedron size when its phisical
425 --- position comes out of the view
426 --- AxisDiametr - diameter relatively to axis length
427 --- NbFacettes - number of facettes of cylinders and cones
429 TriedronDisplay ( me : mutable;
430 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
431 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
432 AScale : Real from Standard = 0.02;
433 AMode : TypeOfVisualization from V3d = V3d_WIREFRAME )
436 ---Purpose: Display of the Triedron.
437 --- Initialize position, color and length of Triedron axes.
438 --- The scale is a percent of the window width.
441 TriedronErase ( me : mutable )
444 ---Purpose: Erases the Triedron.
447 TriedronEcho ( me : mutable;
448 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
451 ---Purpose: Highlights the echo zone of the Triedron.
454 ---------------------------------
455 ---Category: Graduated trihedron
456 ---------------------------------
458 GetGraduatedTrihedron(me;
460 xname, yname, zname : out ExtendedString from TCollection;
462 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
464 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
466 drawgrid : out Boolean from Standard;
468 drawaxes : out Boolean from Standard;
469 -- Number of splits along axes --
470 nbx, nby, nbz : out Integer from Standard;
471 -- Offset for drawing values --
472 xoffset, yoffset, zoffset : out Integer from Standard;
473 -- Offset for drawing names of axes --
474 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
476 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
477 -- Length of tickmarks --
478 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
480 gridcolor : out Color from Quantity;
481 -- Colors of axis names --
482 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
483 -- Colors of axis and values --
484 xcolor, ycolor, zcolor : out Color from Quantity;
485 -- Name of font for names of axes --
486 fontOfNames : out AsciiString from TCollection;
487 -- Style of names of axes --
488 styleOfNames : out FontAspect from Font;
489 -- Size of names of axes --
490 sizeOfNames : out Integer from Standard;
491 -- Name of font for values --
492 fontOfValues : out AsciiString from TCollection;
493 -- Style of values --
494 styleOfValues : out FontAspect from Font;
496 sizeOfValues : out Integer from Standard)
497 ---Purpose: Returns data of a graduated trihedron.
500 GraduatedTrihedronDisplay(me : mutable;
502 xname : ExtendedString from TCollection = "X";
503 yname : ExtendedString from TCollection = "Y";
504 zname : ExtendedString from TCollection = "Z";
506 xdrawname : Boolean from Standard = Standard_True;
507 ydrawname : Boolean from Standard = Standard_True;
508 zdrawname : Boolean from Standard = Standard_True;
510 xdrawvalues : Boolean from Standard = Standard_True;
511 ydrawvalues : Boolean from Standard = Standard_True;
512 zdrawvalues : Boolean from Standard = Standard_True;
514 drawgrid : Boolean from Standard = Standard_True;
516 drawaxes : Boolean from Standard = Standard_True;
517 -- Number of splits along axes --
518 nbx : Integer from Standard = 3;
519 nby : Integer from Standard = 3;
520 nbz : Integer from Standard = 3;
521 -- Offset for drawing values --
522 xoffset : Integer from Standard = 10;
523 yoffset : Integer from Standard = 10;
524 zoffset : Integer from Standard = 10;
525 -- Offset for drawing names of axes --
526 xaxisoffset : Integer from Standard = 30;
527 yaxisoffset : Integer from Standard = 30;
528 zaxisoffset : Integer from Standard = 30;
530 xdrawtickmarks : Boolean from Standard = Standard_True;
531 ydrawtickmarks : Boolean from Standard = Standard_True;
532 zdrawtickmarks : Boolean from Standard = Standard_True;
533 -- Length of tickmarks --
534 xtickmarklength : Integer from Standard = 10;
535 ytickmarklength : Integer from Standard = 10;
536 ztickmarklength : Integer from Standard = 10;
538 gridcolor : Color from Quantity = Quantity_NOC_WHITE;
540 xnamecolor : Color from Quantity = Quantity_NOC_RED;
542 ynamecolor : Color from Quantity = Quantity_NOC_GREEN;
544 znamecolor : Color from Quantity = Quantity_NOC_BLUE1;
545 -- X color of axis and values --
546 xcolor : Color from Quantity = Quantity_NOC_RED;
547 -- Y color of axis and values --
548 ycolor : Color from Quantity = Quantity_NOC_GREEN;
549 -- Z color of axis and values --
550 zcolor : Color from Quantity = Quantity_NOC_BLUE1;
551 -- Name of font for names of axes --
552 fontOfNames : AsciiString from TCollection = "Arial";
553 -- Style of names of axes --
554 styleOfNames : FontAspect from Font = Font_FA_Bold;
555 -- Size of names of axes --
556 sizeOfNames : Integer from Standard = 12;
557 -- Name of font for values --
558 fontOfValues : AsciiString from TCollection = "Arial";
559 -- Style of values --
560 styleOfValues : FontAspect from Font = Font_FA_Regular;
562 sizeOfValues : Integer from Standard = 12)
563 ---Purpose: Displays a graduated trihedron.
566 GraduatedTrihedronErase(me : mutable)
567 ---Purpose: Erases a graduated trihedron from the view.
570 ---------------------------------------------------
571 -- Color Scale methods
572 ---------------------------------------------------
574 SetLayerMgr(me : mutable; aMgr : LayerMgr from V3d);
576 ColorScaleDisplay(me : mutable);
578 ColorScaleErase(me : mutable);
580 ColorScaleIsDisplayed(me)
581 returns Boolean from Standard;
584 returns ColorScale from Aspect;
586 --------------------------------------------------------
587 ---Category: Methods to modify the Projection of the view
588 --------------------------------------------------------
590 SetFront(me: mutable);
592 ---Purpose: modify the Projection of the view perpendicularly to
593 -- the privileged plane of the viewer.
595 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
596 Start : Boolean = Standard_True )
598 ---Purpose: Rotates the eye about the coordinate system of
599 -- reference of the screen
600 -- for which the origin is the view point of the projection,
601 -- with a relative angular value in RADIANS with respect to
602 -- the initial position expressed by Start = Standard_True
603 raises BadValue from V3d;
604 ---Purpose: Warning! raises BadValue from V3d
605 -- If the eye, the view point, or the high point are
606 -- aligned or confused.
608 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
610 Start : Boolean = Standard_True )
612 ---Purpose: Rotates the eye about the coordinate system of
613 -- reference of the screen
614 -- for which the origin is Gravity point {X,Y,Z},
615 -- with a relative angular value in RADIANS with respect to
616 -- the initial position expressed by Start = Standard_True
617 raises BadValue from V3d;
618 ---Purpose: If the eye, the view point, or the high point are
619 -- aligned or confused.
621 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
623 Start : Boolean = Standard_True );
625 ---Purpose: Rotates the eye about one of the coordinate axes of
626 -- of the view for which the origin is the Gravity point{X,Y,Z}
627 -- with an relative angular value in RADIANS with
628 -- respect to the initial position expressed by
629 -- Start = Standard_True
631 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
632 Start : Boolean = Standard_True ) ;
634 ---Purpose: Rotates the eye about one of the coordinate axes of
635 -- of the view for which the origin is the view point of the
636 -- projection with an relative angular value in RADIANS with
637 -- respect to the initial position expressed by
638 -- Start = Standard_True
640 Rotate ( me : mutable ; Angle : PlaneAngle ;
641 Start : Boolean = Standard_True );
643 ---Purpose: Rotates the eye around the current axis a relative
644 -- angular value in RADIANS with respect to the initial
645 -- position expressed by Start = Standard_True
647 Move ( me : mutable ; Dx,Dy,Dz : Length ;
648 Start : Boolean = Standard_True )
650 ---Purpose: Movement of the eye parallel to the coordinate system
651 -- of reference of the screen a distance relative to the
652 -- initial position expressed by Start = Standard_True.
653 raises BadValue from V3d;
654 -- If the eye, the view point, or the high point are
655 -- aligned or confused.
657 Move ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
658 Start : Boolean = Standard_True )
660 ---Purpose: Movement of the eye parallel to one of the axes of the
661 -- coordinate system of reference of the view a distance
662 -- relative to the initial position expressed by
663 -- Start = Standard_True.
664 raises BadValue from V3d;
665 -- If the eye, view point, or high point are aligned or confused.
667 Move ( me : mutable ; Length : Length ;
668 Start : Boolean = Standard_True )
670 ---Purpose: Movement of the eye parllel to the current axis
671 -- a distance relative to the initial position
672 -- expressed by Start = Standard_True
673 raises BadValue from V3d;
674 -- If the eye, view point, or high point are aligned or confused.
676 Translate ( me : mutable ; Dx,Dy,Dz : Length ;
677 Start : Boolean = Standard_True )
679 ---Purpose: Movement of the ye and the view point parallel to the
680 -- frame of reference of the screen a distance relative
681 -- to the initial position expressed by
682 -- Start = Standard_True
683 raises BadValue from V3d;
684 -- If the eye, view point, or high point are aligned or confused.
686 Translate ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
687 Start : Boolean = Standard_True );
689 ---Purpose: Movement of the eye and the view point parallel to one
690 -- of the axes of the fame of reference of the view a
691 -- distance relative to the initial position
692 -- expressed by Start = Standard_True
694 Translate ( me : mutable ; Length : Length ;
695 Start : Boolean = Standard_True );
697 ---Purpose: Movement of the eye and view point parallel to
698 -- the current axis a distance relative to the initial
699 -- position expressed by Start = Standard_True
701 Place (me: mutable; x,y: Integer from Standard;
702 aZoomFactor: Factor from Quantity = 1)
704 ---Purpose: places the point of the view corresponding
705 -- at the pixel position x,y at the center of the window
706 -- and updates the view.
709 Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
710 Start : Boolean = Standard_True )
712 ---Purpose: Rotation of the view point around the frame of reference
713 -- of the screen for which the origin is the eye of the
714 -- projection with a relative angular value in RADIANS
715 -- with respect to the initial position expressed by
716 -- Start = Standard_True
717 raises BadValue from V3d;
718 -- If the eye, view point, or high point are aligned or confused.
720 Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
721 Start : Boolean = Standard_True )
724 ---Purpose: Rotation of the view point around one of the axes of the
725 -- frame of reference of the view for which the origin is
726 -- the eye of the projection with an angular value in
727 -- RADIANS relative to the initial position expressed by
728 -- Start = Standard_True
730 Turn ( me : mutable ; Angle : PlaneAngle ;
731 Start : Boolean = Standard_True );
733 ---Purpose: Rotation of the view point around the current axis an
734 -- angular value in RADIANS relative to the initial
735 -- position expressed by Start = Standard_True
737 SetTwist ( me : mutable ; Angle : PlaneAngle )
739 ---Purpose: Defines the angular position of the high point of
740 -- the reference frame of the view with respect to the
741 -- Y screen axis with an absolute angular value in
743 raises BadValue from V3d;
744 -- If the eye, view point, or high point are aligned or confused.
746 SetEye( me : mutable ; X,Y,Z : Coordinate )
748 ---Purpose: Defines the position of the eye..
749 raises BadValue from V3d ;
750 -- If the eye, view point, or high point are aligned or confused.
752 SetDepth( me : mutable ; Depth : Length )
754 ---Purpose: Defines the Depth of the eye from the view point
755 -- without update the projection .
756 raises BadValue from V3d ;
757 -- If the Depth is <= 0.
759 SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
761 ---Purpose: Defines the orientation of the projection.
762 raises BadValue from V3d ;
763 -- If the eye, view point, or high point are aligned or confused.
765 SetProj( me : mutable ; Orientation : TypeOfOrientation )
767 ---Purpose: Defines the orientation of the projection .
768 raises BadValue from V3d ;
769 -- If the eye, view point, or high point are aligned or confused.
772 SetAt( me : mutable ; X,Y,Z : Coordinate )
774 ---Purpose: Defines the position of the view point.
775 raises BadValue from V3d ;
776 -- If the eye, view point, or high point are aligned or confused.
778 SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
780 ---Purpose: Defines the orientation of the high point.
781 raises BadValue from V3d ;
782 -- If the eye, view point, or high point are aligned or confused.
784 SetUp( me : mutable ; Orientation : TypeOfOrientation )
786 ---Purpose: Defines the orientation(SO) of the high point.
787 raises BadValue from V3d ;
788 -- If the eye, view point, or high point are aligned or confused.
790 SetViewOrientation ( me : mutable; VO : ViewOrientation from Visual3d );
792 ---Purpose: Modifies the orientation of the view.
794 SetViewOrientationDefault( me : mutable );
796 ---Purpose: Saves the current state of the orientation of the view
797 -- which will be the return state at ResetViewOrientation.
799 ResetViewOrientation ( me : mutable );
801 ---Purpose: Resets the orientation of the view.
804 --------------------------------------------------------
805 ---Category: Methods to modify the Mapping of the view
806 --------------------------------------------------------
808 Panning ( me : mutable ; Dx , Dy : Length ;
809 aZoomFactor : Factor from Quantity = 1;
810 Start : Boolean = Standard_True )
812 ---Purpose: translates the center of the view and zooms the view.
814 raises BadValue from V3d ;
816 SetCenter ( me : mutable ; Xc , Yc : Coordinate )
818 ---Purpose: Defines the centre of the view.
820 raises BadValue from V3d ;
821 -- If one of the dimensions of the projection is NULL.
823 SetCenter ( me : mutable ; X,Y: Integer from Standard)
825 ---Purpose: Defines the centre of the view from a pixel position.
827 raises BadValue from V3d ;
828 -- If one of the dimensions of the projection is NULL.
830 SetSize ( me : mutable ; Size : Length )
832 ---Purpose: Defines the size of the view while preserving the
833 -- center and height/width ratio of the window supporting
835 -- NOTE than the Depth of the View is NOT modified .
836 raises BadValue from V3d ;
837 -- If the size of the view is <= 0
839 SetZSize ( me : mutable ; Size : Length )
841 ---Purpose: Defines the Depth size of the view
842 -- Front Plane will be set to Size/2.
843 -- Back Plane will be set to -Size/2.
844 -- Any Object located Above the Front Plane or
845 -- behind the Back Plane will be Clipped .
846 -- NOTE than the XY Size of the View is NOT modified .
847 raises BadValue from V3d ;
848 -- If the size of the view is <= 0
850 SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
852 ---Purpose: Zooms the view by a factor relative to the initial
853 -- value expressed by Start = Standard_True
855 raises BadValue from V3d ;
856 -- If the zoom coefficient is <= 0
858 SetScale ( me : mutable ; Coef : Factor )
860 ---Purpose: Zooms the view by a factor relative to the value
861 -- initialised by SetViewMappingDefault().
863 raises BadValue from V3d ;
864 -- If the zoom coefficient is <= 0
866 SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
868 ---Purpose: Sets anisotropic (axial) scale factors <Sx>, <Sy>, <Sz> for view <me>.
869 -- Anisotropic scaling operation is performed through multiplying
870 -- the current view orientation matrix by a scaling matrix:
876 raises BadValue from V3d ;
877 -- If the one of factors <= 0
879 FitAll ( me : mutable ; Coef : Coefficient = 0.01;
880 FitZ: Boolean from Standard = Standard_False; update : Boolean from Standard = Standard_True )
882 ---Purpose: Automatic zoom/panning. Objects in the view are visualised
883 -- so as to occupy the maximum space while respecting the
884 -- margin coefficient and the initial height /width ratio.
885 -- NOTE than the original Z size of the view is NOT modified .
886 raises BadValue from V3d ;
887 -- If the margin coefficient is <0 ou >= 1 or
890 ZFitAll ( me : mutable ; Coef : Coefficient = 1.0 )
892 ---Purpose: Automatic Depth Panning. Objects visible in the view are
893 -- visualised so as to occupy the maximum Z amount of space
894 -- while respecting the margin coefficient .
895 -- NOTE than the original XY size of the view is NOT modified .
896 raises BadValue from V3d ;
897 -- If the margin coefficient is <0 ou or
898 -- If No Objects are displayed in the view
900 DepthFitAll( me : mutable ; Aspect : Coefficient = 0.01;
901 Margin : Coefficient = 0.01 );
903 ---Purpose: Adjusts the viewing volume so as not to clip the displayed objects by front and back
904 -- and back clipping planes. Also sets depth value automatically depending on the
905 -- calculated Z size and Aspect parameter.
906 -- NOTE than the original XY size of the view is NOT modified .
908 FitAll ( me : mutable ; Umin, Vmin, Umax, Vmax : Coordinate )
910 ---Purpose: Centres the defined projection window so that it occupies
911 -- the maximum space while respecting the initial
912 -- height/width ratio.
913 -- NOTE than the original Z size of the view is NOT modified .
914 raises BadValue from V3d;
915 -- If the defined projection window has zero size.
918 WindowFit ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer)
920 ---Purpose: Centres the defined PIXEL window so that it occupies
921 -- the maximum space while respecting the initial
922 -- height/width ratio.
923 -- NOTE than the original Z size of the view is NOT modified .
924 raises BadValue from V3d
925 -- If the defined projection window has zero size.
928 SetViewingVolume ( me : mutable ; Left, Right, Bottom, Top, ZNear, ZFar : Real from Standard)
930 ---Purpose: Sets Z and XY size of the view according to given values
931 -- with respecting the initial view depth (eye position).
932 -- Width/heigth aspect ratio should be preserved by the caller
933 -- of this method similarly to SetSize() to avoid unexpected
934 -- visual results like non-uniform scaling of objects in the view.
935 raises BadValue from V3d;
936 -- If the ZNear<0, ZFar<0 or ZNear>=Zfar.
938 SetViewMapping ( me : mutable; VM : ViewMapping from Visual3d );
940 ---Purpose: Modifies the mapping of the view.
942 SetViewMappingDefault( me : mutable );
944 ---Purpose: Saves the current view mapping. This will be the
945 -- state returned from ResetViewmapping.
947 ResetViewMapping ( me : mutable );
949 ---Purpose: Resets the centring of the view.
952 Reset ( me : mutable; update : Boolean from Standard = Standard_True );
954 ---Purpose: Resets the centring and the orientation of the view
956 ---------------------------------------------------
957 ---Category: Inquire methods
958 ---------------------------------------------------
960 Convert( me ; Vp : Integer ) returns Length
962 ---Purpose : Converts the PIXEL value
963 -- to a value in the projection plane.
964 raises UnMapped from V3d;
965 -- If the view is not mapped on the window.
967 Convert( me ; Xp,Yp : Integer ; Xv,Yv : out Coordinate )
969 ---Purpose : Converts the point PIXEL into a point projected
970 -- in the reference frame of the projection plane.
971 raises UnMapped from V3d;
972 -- If the view is not mapped on the window.
974 Convert( me ; Vv : Length ) returns Integer
976 ---Purpose : Converts tha value of the projection plane into
978 raises UnMapped from V3d;
979 -- If the view is not mapped on the window.
981 Convert( me ; Xv,Yv : Coordinate ; Xp,Yp : out Integer )
983 ---Purpose : Converts the point defined in the reference frame
984 -- of the projection plane into a point PIXEL.
985 raises UnMapped from V3d;
986 -- If the view is not mapped on the window.
988 Convert( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate)
990 ---Purpose : Converts the projected point into a point
991 -- in the reference frame of the view corresponding
992 -- to the intersection with the projection plane
993 -- of the eye/view point vector.
994 raises UnMapped from V3d;
995 -- If the view is not mapped on the window.
997 ConvertWithProj( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate ; Vx,Vy,Vz : out Parameter)
999 ---Purpose : Converts the projected point into a point
1000 -- in the reference frame of the view corresponding
1001 -- to the intersection with the projection plane
1002 -- of the eye/view point vector and returns the
1003 -- projection ray for further computations.
1004 raises UnMapped from V3d;
1005 -- If the view is not mapped on the window.
1007 ConvertToGrid( me ; Xp,Yp : Integer ; Xg,Yg,Zg : out Coordinate)
1009 ---Purpose : Converts the projected point into the nearest grid point
1010 -- in the reference frame of the view corresponding
1011 -- to the intersection with the projection plane
1012 -- of the eye/view point vector and display the grid marker.
1013 -- Warning: When the grid is not active the result is identical
1014 -- to the above Convert() method.
1016 -- 1) Enable the grid echo display
1017 -- myViewer->SetGridEcho(Standard_True);
1018 -- 2) When application receive a move event :
1019 -- 2.1) Check if any object is detected
1020 -- if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
1021 -- 2.2) Check if the grid is active
1022 -- if( myViewer->Grid()->IsActive() ) {
1023 -- 2.3) Display the grid echo and gets the grid point
1024 -- myView->ConvertToGrid(x,y,X,Y,Z);
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 Center ( me; Xc,Yc : out Coordinate );
1089 ---Purpose: Returns the centre of the view.
1091 Size ( me; Width, Height : out Length );
1093 ---Purpose: Returns the height and width of the view.
1095 ZSize ( me ) returns Real ;
1097 ---Purpose: Returns the Depth of the view .
1099 Eye( me ; X,Y,Z : out Coordinate );
1101 ---Purpose: Returns the position of the eye.
1103 FocalReferencePoint (me ; X,Y,Z : out Coordinate );
1105 ---Purpose: Returns the position of point which emanating the
1108 ProjReferenceAxe( me ; Xpix,Ypix : Integer ;
1109 XP,YP,ZP,VX,VY,VZ : out Coordinate );
1111 ---Purpose: Returns the coordinate of the point (Xpix,Ypix)
1112 -- in the view (XP,YP,ZP), and the projection vector of the
1113 -- view passing by the point (for PerspectiveView).
1115 Depth( me ) returns Length ;
1117 ---Purpose: Returns the Distance between the Eye and View Point.
1119 Proj( me ; Vx,Vy,Vz : out Parameter );
1121 ---Purpose: Returns the projection vector.
1123 At( me ; X,Y,Z : out Coordinate );
1125 ---Purpose: Returns the position of the view point.
1127 Up( me ; Vx,Vy,Vz : out Parameter );
1129 ---Purpose: Returns the vector giving the position of the high point.
1131 Twist( me ) returns PlaneAngle ;
1133 ---Purpose: Returns in RADIANS the orientation of the view around
1134 -- the visual axis measured from the Y axis of the screen.
1136 ShadingModel ( me ) returns TypeOfShadingModel ;
1138 ---Purpose: Returns the current shading model.
1140 SurfaceDetail(me) returns TypeOfSurfaceDetail;
1142 -- purpose: returns the current SurfaceDetail mode
1144 TextureEnv(me) returns TextureEnv from Graphic3d;
1146 -- purpose: return the current environment texture used
1148 Transparency(me) returns Boolean from Standard;
1150 ---Purpose: Returns the transparency activity.
1152 Visualization ( me ) returns TypeOfVisualization from V3d;
1154 ---Purpose: Returns the current visualisation mode.
1156 Antialiasing ( me ) returns Boolean;
1158 ---Purpose: Indicates if the antialiasing is active (True) or
1159 -- inactive (False).
1161 ZCueing ( me; Depth, Width : out Length ) returns Boolean ;
1163 ---Purpose: Returns activity and information on the Zcueing.
1164 -- <Depth> : Depth of plane.
1165 -- <Width> : Thickness around the plane.
1167 ZClipping ( me; Depth, Width : out Length ) returns TypeOfZclipping;
1169 ---Purpose: Returns current information on the ZClipping.
1170 -- <Depth> : Depth of plane.
1171 -- <Width> : Thickness around the plane.
1172 -- <TypeOfZclipping> : "BACK"
1177 IfMoreLights( me ) returns Boolean;
1179 ---Purpose: Returns True if One light more can be
1180 -- activated in this View.
1182 InitActiveLights(me: mutable);
1184 ---Purpose: initializes an iteration on the active Lights.
1186 MoreActiveLights (me) returns Boolean from Standard;
1188 ---Purpose: returns true if there are more active Light(s) to return.
1190 NextActiveLights (me: mutable);
1192 ---Purpose : Go to the next active Light
1193 -- (if there is not, ActiveLight will raise an exception)
1195 ActiveLight(me) returns mutable Light from V3d;
1198 Viewer ( me ) returns mutable Viewer from V3d;
1200 ---Purpose: Returns the viewer in which the view has been created.
1202 IfWindow ( me ) returns Boolean;
1204 ---Purpose: Returns True if MyView is associated with a window .
1206 Window ( me ) returns mutable Window from Aspect
1208 ---Purpose: Returns the Aspect Window associated with the view.
1209 raises BadValue from V3d;
1210 -- If MyView is not associated with a window
1212 Type( me ) returns TypeOfView from V3d;
1214 ---Purpose: Returns the Type of the View
1216 Pan ( me : mutable; Dx, Dy: Integer from Standard;
1217 aZoomFactor: Factor from Quantity = 1);
1219 ---Purpose: translates the center of the view and zooms the view.
1220 -- and updates the view.
1222 Zoom ( me : mutable; X1 , Y1 , X2 , Y2 : Integer from Standard)
1225 ---Purpose: Zoom the view according to a zoom factor computed
1226 -- from the distance between the 2 mouse position <X1,Y1>,<X2,Y2>
1228 Zoom ( me: mutable; X,Y: Integer from Standard)
1231 ---Purpose: Zoom the view according to a zoom factor computed
1232 -- from the distance between the last and new mouse position <X,Y>
1234 StartZoomAtPoint(me : mutable;
1235 xpix, ypix : Integer from Standard);
1237 ---Purpose: Defines the point (pixel) of zooming (for the method ZoomAtPoint()).
1239 ZoomAtPoint(me : mutable;
1240 mouseStartX, mouseStartY, mouseEndX, mouseEndY : Integer from Standard);
1242 ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
1244 AxialScale ( me: mutable; Dx, Dy: Integer from Standard; Axis: TypeOfAxe from V3d );
1246 ---Purpose: Performs anisotropic scaling of <me> view along the given <Axis>.
1247 -- The scale factor is calculated on a basis of
1248 -- the mouse pointer displacement <Dx,Dy>.
1249 -- The calculated scale factor is then passed to SetAxialScale(Sx, Sy, Sz) method.
1251 StartRotation(me : mutable ; X,Y :Integer from Standard;
1252 zRotationThreshold: Ratio from Quantity = 0.0);
1254 ---Purpose: Begin the rotation of the view arround the screen axis
1255 -- according to the mouse position <X,Y>.
1256 -- Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
1257 -- factor is > 0 soon the distance from the start point and the center
1258 -- of the view is > (medium viewSize * <zRotationThreshold> ).
1259 -- Generally a value of 0.4 is usable to rotate around XY screen axis
1260 -- inside the circular treshold area and to rotate around Z screen axis
1261 -- outside this area.
1263 Rotation(me:mutable; X,Y :Integer from Standard);
1265 ---Purpose: Continues the rotation of the view
1266 -- with an angle computed from the last and new mouse position <X,Y>.
1268 FitAll ( me : mutable ; aWindow: Window from Aspect;
1269 Umin, Vmin, Umax, Vmax : Coordinate )
1272 ---Purpose: Change the scale factor and position of the view
1273 -- such as the bounding box <Umin, Vmin, Umax, Vmax> is contains
1277 -----------------------------------------
1278 ---Category: Private or Protected methods
1279 -----------------------------------------
1281 SetFocale( me : mutable ; Focale : Length )
1282 ---Purpose: Change View Plane Distance for Perspective Views
1283 raises TypeMismatch from Standard
1284 ---Purpose: Warning! raises TypeMismatch from Standard if the view
1285 -- is not a perspective view.
1288 Focale( me ) returns Length;
1289 ---Purpose: Returns the View Plane Distance for Perspective Views
1291 View ( me) returns mutable View from Visual3d is static ;
1293 ---Purpose: Returns the associated Visual3d view.
1295 ViewMapping ( me ) returns ViewMapping from Visual3d is static;
1297 ---Purpose: Returns the current mapping of the view.
1299 ViewOrientation ( me ) returns ViewOrientation from Visual3d is static;
1301 ---Purpose: Returns the current orientation of the view.
1303 ScreenAxis( myclass ; Vpn,Vup : Vector from Graphic3d ;
1304 Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
1305 returns Boolean is private ;
1306 ---Purpose: Determines the screen axes in the reference
1307 -- framework of the view.
1309 InitMatrix ( myclass ; Matrix : out Array2OfReal from TColStd ) is private ;
1312 Left, Right : Array2OfReal from TColStd ;
1313 Matrix : out Array2OfReal from TColStd )
1314 returns Boolean from Standard is private ;
1316 RotAxis( myclass ; Vrp : Vertex from Graphic3d ;
1317 Axe : Vector from Graphic3d ; Angle : PlaneAngle ;
1318 Matrix : out Array2OfReal from TColStd ) is private ;
1319 ---Purpose: Determines the rotation matrice around an axis
1320 -- for a given angle.
1322 TrsPoint( myclass ; P : Vertex from Graphic3d ;
1323 Matrix : Array2OfReal from TColStd )
1324 returns Vertex from Graphic3d is private ;
1325 ---Purpose: Transforms the point P according to the matrice Matrix .
1327 TrsPoint( myclass ; V : Vector from Graphic3d ;
1328 Matrix : Array2OfReal from TColStd )
1329 returns Vector from Graphic3d is private ;
1330 ---Purpose: Transforms the vector V according to the matrice Matrix .
1332 ImmediateUpdate (me) is static protected;
1335 -----------------------------------------
1336 ---Category: TransientManager methods
1337 -----------------------------------------
1339 TransientManagerBeginDraw(me; DoubleBuffer: Boolean = Standard_False;
1340 RetainMode : Boolean = Standard_False)
1342 ---Purpose: Begins any graphics in the view <aView>
1343 -- Redraw any structured graphics in the back buffer before
1344 -- if <DoubleBuffer> is TRUE.
1345 -- Restore the front buffer from the back before
1346 -- if <DoubleBuffer> is FALSE.
1347 -- if <RetainMode> is TRUE.
1348 -- the graphic managed itself exposure,resizing ...
1349 -- if <RetainMode> is FALSE.
1350 -- the application must managed itself exposure,resizing ...
1352 returns Boolean from Standard;
1354 TransientManagerClearDraw(me);
1356 ---Purpose: Clear all transient graphics in the view <aView>
1359 TransientManagerBeginAddDraw(me)
1361 ---Purpose: Begins any add graphics in the view <aView>
1362 -- Redraw any structured graphics in the back buffer before
1363 -- the application must managed itself exposure,resizing ...
1364 -- Warning: Returns TRUE if transient drawing is enabled in
1365 -- the associated view.
1366 -- Returns FALSE ,if nothing works because something
1367 -- is wrong for the transient principle :
1369 returns Boolean from Standard;
1371 SetComputedMode ( me : mutable; aMode : Boolean from Standard )
1374 ---Purpose: Switches computed HLR mode in the view
1375 ---Category: Methods to modify the class definition
1378 returns Boolean from Standard
1381 ---Purpose: Returns the computed HLR mode state
1382 ---Category: Inquire methods
1384 MinMax ( me; Umin,Vmin, Umax,Vmax : out Coordinate ) returns Integer
1385 ---Purpose: Returns the objects number and the projection window
1386 -- of the objects contained in the view.
1389 MinMax ( me; Xmin,Ymin,Zmin, Xmax,Ymax,Zmax : out Coordinate )
1391 ---Purpose: Returns the objects number and the box encompassing
1392 -- the objects contained in the view
1395 Gravity ( me; X,Y,Z : out Coordinate ) returns Integer
1396 ---Purpose: Returns the Objects number and the gravity center
1397 -- of ALL viewable points in the view
1400 Init(me: mutable) is private;
1402 ---Category: for compatibility.
1404 WindowFitAll ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer);
1405 ---Purpose: idem than WindowFit
1407 SetPlotter ( me : mutable; aPlotter : Plotter from Graphic3d )
1408 ---Purpose: Set a plotter for plotting the contents of the view
1412 Plot ( me : mutable )
1413 ---Purpose: Create a 2D View for plotting the contents of the view
1414 raises BadValue from V3d;
1415 -- if the plotter is undefined.
1417 Compute ( me; AVertex : Vertex from Graphic3d )
1418 returns Vertex from Graphic3d
1421 ---Purpose: Returns a new vertex when the grid is activated.
1423 SetGrid ( me : mutable;
1424 aPlane: Ax3 from gp;
1425 aGrid : Grid from Aspect )
1428 ---Purpose: Defines or Updates the definition of the
1430 ---Category: Methods to modify the class definition
1432 SetGridGraphicValues ( me : mutable;
1433 aGrid : Grid from Aspect )
1436 ---Purpose: Defines or Updates the graphic definition of the
1438 ---Category: Methods to modify the class definition
1440 SetGridActivity ( me : mutable;
1441 aFlag : Boolean from Standard )
1444 ---Purpose: Defines or Updates the activity of the
1446 ---Category: Methods to modify the class definition
1449 theFile : CString from Standard;
1450 theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB )
1451 returns Boolean from Standard;
1453 ---Purpose: dump the full contents of the view at the same
1454 -- scale in the file <theFile>. The file name
1455 -- extension must be one of ".png",".bmp",".jpg",".gif".
1456 -- Returns FALSE when the dump has failed
1458 Print (me; hPrnDC: Handle from Aspect = 0;
1459 showDialog: Boolean = Standard_True;
1460 showBackground : Boolean = Standard_True;
1461 filename: CString = NULL;
1462 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH)
1463 returns Boolean from Standard is static;
1466 ---Purpose: print the contents of the view to printer with preview.
1467 -- <hPrnDC> : If you have already an PrinterDeviceContext (HDC),
1468 -- then you can pass it to the print routines.
1469 -- If you don't have an PrinterDeviceContext, then this parameter should
1471 -- <showDialog> : If hPrnDC == NULL, then you can force the print routines to
1472 -- open a Print Dialog box.
1473 -- If you want to do this, then set showDialog to TRUE
1474 -- If you don't want to see a dialog (only possible, if you have a hPrnDC
1475 -- or the dialog box was opened once before) then set <showDialog> to FALSE.
1476 -- <showBackground> : When set to FALSE then print the view without background color
1477 -- (background is white)
1478 -- else set to TRUE for printing with current background color.
1479 -- <filename>: If != NULL, then the view will be printed to a file.
1480 -- <printAlgorithm>: If you want to select the print algorithm, then you can
1481 -- specify one of existing algorithms: Aspect_PA_STRETCH, Aspect_PA_TILE.
1482 -- Returns Standard_True if the data is passed to the printer, otherwise
1483 -- Standard_False if the print operation failed. This might be related to
1484 -- insufficient memory or some internal errors. All this errors are
1485 -- indicated by the message boxes (on level of OpenGl_GraphicDriver).
1486 -- Warning: This function can reuse FBO assigned to the
1487 -- view on level of OpenGl_GraphicDriver; Please take it into account if
1488 -- you use it for your purposes;
1489 -- Warning: Works only under Windows.
1491 ToPixMap ( me : mutable;
1492 theImage : in out PixMap from Image;
1493 theWidth : Integer from Standard;
1494 theHeight : Integer from Standard;
1495 theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB;
1496 theForceCentered : Boolean from Standard = Standard_True )
1497 returns Boolean from Standard;
1499 ---Purpose : dump the full contents of the view
1500 -- to a pixmap of pixel size <theWidth>*<theHeight> and
1501 -- buffer type <theBufferType>. If <theForceCentered> is true
1502 -- view scene will be centered.
1503 -- Pixmap will be automatically (re)allocated when needed.
1505 SetProjModel( me : mutable;
1506 amOdel: TypeOfProjectionModel from V3d = V3d_TPM_SCREEN )
1509 ---Purpose : Manages projection model
1512 returns TypeOfProjectionModel from V3d
1515 ---Purpose : Returns the current projection model
1517 SetBackFacingModel ( me : mutable;
1518 aModel : TypeOfBackfacingModel from V3d = V3d_TOBM_AUTOMATIC)
1521 ---Purpose : Manages display of the back faces
1522 -- When <aModel> is TOBM_AUTOMATIC the object backfaces
1523 -- are displayed only for surface objects and
1524 -- never displayed for solid objects.
1525 -- this was the previous mode.
1526 -- <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces
1527 -- are always displayed both for surfaces or solids.
1528 -- <aModel> is TOBM_NEVER_DISPLAYED the object backfaces
1529 -- are never displayed.
1531 BackFacingModel ( me )
1532 returns TypeOfBackfacingModel from V3d
1535 ---Purpose : Returns current state of the back faces display
1537 EnableDepthTest( me; enable : Boolean from Standard = Standard_True )
1540 ---Purpose: turns on/off opengl depth testing
1542 IsDepthTestEnabled( me ) returns Boolean from Standard
1545 ---Purpose: returns the current state of the depth testing
1547 EnableGLLight( me; enable : Boolean from Standard = Standard_True )
1550 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1552 IsGLLightEnabled( me ) returns Boolean from Standard
1555 ---Purpose: returns the current state of the gl lighting
1556 -- currently used in triedron displaying
1558 AddClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
1559 ---Purpose: Adds clip plane to the view. The composition of clip planes truncates the
1560 -- rendering space to convex volume. Number of supported clip planes can be consulted
1561 -- by PlaneLimit method of associated Visual3d_View. Please be aware that the planes
1562 -- which exceed the limit are igonred during rendering.
1563 -- @param thePlane [in] the clip plane to be added to view.
1565 RemoveClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
1566 ---Purpose: Removes clip plane from the view.
1567 -- @param thePlane [in] the clip plane to be removed from view.
1569 SetClipPlanes (me : mutable; thePlanes : SetOfHClipPlane from Graphic3d);
1570 ---Purpose: Set clip planes to the view. The planes that have been set
1571 -- before are removed from the view. The composition of clip planes
1572 -- truncates the rendering space to convex volume. Number of supported
1573 -- clip planes can be consulted by PlaneLimit method of associated
1574 -- Visual3d_View. Please be aware that the planes which exceed the limit
1575 -- are igonred during rendering.
1576 -- @param thePlanes [in] the clip planes to set.
1578 GetClipPlanes (me) returns SetOfHClipPlane from Graphic3d;
1579 ---C++: return const&
1580 ---Purpose: Get clip planes.
1581 -- @return sequence clip planes that have been set for the view
1583 SetRaytracingMode (me : mutable) is static;
1585 ---Purpose: enables OpenCL-based ray-tracing mode
1587 SetRasterizationMode (me : mutable) is static;
1589 ---Purpose: enables OpenGL-based rasterization mode
1591 EnableRaytracedShadows (me : mutable) is static;
1593 ---Purpose: enables sharp shadows in OpenCL-based ray-tracing mode
1595 EnableRaytracedReflections (me : mutable) is static;
1597 ---Purpose: enables specular reflections in OpenCL-based ray-tracing mode
1599 EnableRaytracedAntialiasing (me : mutable) is static;
1601 ---Purpose: enables antialiasing in OpenCL-based ray-tracing mode
1603 DisableRaytracedShadows (me : mutable) is static;
1605 ---Purpose: disables sharp shadows in OpenCL-based ray-tracing mode
1607 DisableRaytracedReflections (me : mutable) is static;
1609 ---Purpose: disables specular reflections in OpenCL-based ray-tracing mode
1611 DisableRaytracedAntialiasing (me : mutable) is static;
1613 ---Purpose: disables antialiasing in OpenCL-based ray-tracing mode
1617 MyType : TypeOfView from V3d is protected ;
1618 MyViewer : ViewerPointer from V3d ;
1619 MyActiveLights: ListOfTransient from V3d;
1621 MyView : View from Visual3d is protected ;
1622 MyViewMapping : ViewMapping from Visual3d is protected ;
1623 MyViewOrientation : ViewOrientation from Visual3d ;
1624 MyViewContext : ContextView from Visual3d ;
1625 MyBackground: Background from Aspect ;
1626 MyGradientBackground: GradientBackground from Aspect ;
1627 MyDefaultViewAxis: Vector from Graphic3d ;
1628 MyDefaultViewPoint: Vertex from Graphic3d ;
1630 MyWindow: Window from Aspect;
1632 MyPlotter: Plotter from Graphic3d;
1634 myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
1636 sx,sy: Integer from Standard;
1637 rx,ry: Real from Standard;
1638 gx,gy,gz: Real from Standard;
1639 myComputedMode: Boolean from Standard;
1640 SwitchSetFront: Boolean from Standard;
1641 MyZoomAtPointX, MyZoomAtPointY : Integer from Standard;
1644 MyGrid : Grid from Aspect;
1645 MyPlane : Ax3 from gp;
1647 --MyColorScale : ColorScale from V3d;
1648 MyLayerMgr : LayerMgr from V3d;
1650 MyProjModel : TypeOfProjectionModel from V3d is protected;
1652 -- the transformation between XoY and the grid plane
1653 MyTrsf : Array2OfReal from TColStd;
1656 MyGridEchoStructure : Structure from Graphic3d;
1657 MyGridEchoGroup : Group from Graphic3d;
1659 MyTransparencyFlag : Boolean from Standard;
1660 myImmediateUpdate: Boolean from Standard is protected;
1663 SetViewOn from class Viewer from V3d ( me : mutable ),
1664 SetViewOn from class Viewer from V3d ( me : mutable ; View : View from V3d ),
1665 SetViewOff from class Viewer from V3d ( me : mutable ),
1666 SetViewOff from class Viewer from V3d ( me : mutable ; View : View from V3d )