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 -- EUG - 25/01/00 : G003
41 -- -> Add methods SetAnimationMode() and
43 -- -> Add methods SetComputedMode() and
45 -- Warning : SetDegenerateModeOn() and Off()
47 -- -> Add methods SetBackFacingModel() and
49 -- VKH - 15/11/99 : G004
50 -- -> Add method Dump()
52 -- -> Add Transparency() method
53 -- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
54 -- -> Add Print method (works only under Windows).
56 -- -> Add IsActiveLight() & IsActivePlane() methods
58 -- -> Add ToPixMap() method
59 -- GG - RIC120302 Add NEW SetWindow method.
61 -- -> Add EnableDepthTest() & IsDepthTestEnabled().
62 -- VSV - 28/05/02: ZBUFFER mode of Trihedron
63 -- SAV - 23/12/02 -> Added methods to set background image
64 -- NKV - 23/07/07 -> Define custom projection and model view matrixes
65 -- NKV - 08/02/07 -> Add ConvertWithProj() method
67 deferred class View from V3d
69 ---Purpose: Defines the application object VIEW for the
70 -- VIEWER application.
71 -- The methods of this class allow the editing
72 -- and inquiring the parameters linked to the view.
73 -- (Projection,Mapping,Zclipping,DepthCueing,AntiAliasing
75 -- Warning: The default parameters are defined by the class
76 -- Viewer (Example : SetDefaultViewSize()).
77 -- Certain methods are mouse oriented, and it is
78 -- necessary to know the difference between the start and
79 -- the continuation of this gesture in putting the method
81 -- Example : Shifting the eye-view along the screen axes.
83 -- View->Move(10.,20.,0.,True) (Starting motion)
84 -- View->Move(15.,-5.,0.,False) (Next motion)
97 ColorScale from Aspect,
98 Array2OfReal from TColStd,
101 Structure from Graphic3d,
102 Group from Graphic3d,
104 ListOfTransient from V3d,
105 ListIteratorOfListOfTransient from TColStd,
108 TypeOfOrientation from V3d,
109 TypeOfShadingModel from V3d,
110 TypeOfSurfaceDetail from V3d,
111 TextureEnv from Graphic3d,
112 TypeOfVisualization from V3d,
113 TypeOfZclipping from V3d,
114 TypeOfProjectionModel from V3d,
115 TypeOfBackfacingModel from V3d,
120 ViewMapping from Visual3d,
121 ViewOrientation from Visual3d,
122 ContextView from Visual3d,
123 Vector from Graphic3d,
124 Vertex from Graphic3d,
125 Plotter from Graphic3d,
128 TypeOfImage from Image,
129 Background from Aspect,
130 GradientBackground from Aspect,
131 PlotterDriver from PlotMgt,
132 TypeOfColor from Quantity,
133 NameOfColor from Quantity,
135 Length from Quantity,
136 PlaneAngle from Quantity,
137 Parameter from Quantity,
138 Factor from Quantity,
140 Coefficient from Quantity,
142 Array2OfReal from TColStd,
143 ViewerPointer from V3d,
144 TransientManager from Visual3d,
145 TypeOfTriedronEcho from Aspect,
146 TypeOfTriedronPosition from Aspect,
147 FormatOfSheetPaper from Aspect,
148 RenderingContext from Aspect,
149 GraphicCallbackProc from Aspect,
150 FillMethod from Aspect,
151 GradientFillMethod from Aspect,
153 AsciiString from TCollection,
154 ExtendedString from TCollection,
155 PrintAlgo from Aspect
159 BadValue from Viewer, TypeMismatch from Standard,
160 MultiplyDefined from Standard,UnMapped from V3d
164 Initialize ( VM : mutable Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
165 ---Purpose: Initialises the view.
167 Initialize ( VM : mutable Viewer ; V : View from V3d; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
168 ---Purpose: Initialises the view by copying.
170 --------------------------------------------------------
171 ---Category: Methods to modify the Status of the view
172 --------------------------------------------------------
174 SetWindow ( me : mutable ; IdWin : Window )
175 ---Purpose: Activates the view in the window specified and Map the
176 -- Window to the screen.
177 raises MultiplyDefined from Standard;
179 ---Purpose: Warning! raises MultiplyDefined from Standard
180 -- if the view is already activated in a window.
181 -- Warning: The view is centered and resized to preserve
182 -- the height/width ratio of the window.
184 SetWindow ( me : mutable ;
185 aWindow : Window from Aspect;
186 aContext : RenderingContext from Aspect;
187 aDisplayCB : GraphicCallbackProc from Aspect;
188 aClientData : Address from Standard
190 ---Purpose: Activates the view in the specified Window
191 -- If <aContext> is not NULL the graphic context is used
192 -- to draw something in this view.
193 -- Otherwise an internal graphic context is created.
194 -- If <aDisplayCB> is not NULL then a user display CB is
195 -- call at the end of the OCC graphic traversal and just
196 -- before the swap of buffers. The <aClientData> is pass
197 -- to this call back.
198 raises MultiplyDefined from Standard;
200 ---Purpose: Warning! raises MultiplyDefined from Standard
201 -- if the view is already activated in a window.
202 -- Warning: The view is centered and resized to preserve
203 -- the height/width ratio of the window.
205 SetMagnify (me: mutable; IdWin : Window;
206 aPreviousView : View from V3d;
207 x1 , y1 , x2 , y2: Integer from Standard)
212 ---Purpose: Destroys the view.
214 Update ( me ) is redefined static;
216 ---Purpose: Deprecated, Redraw() should be used instead.
220 ---Purpose: Redisplays the view even if there has not
221 -- been any modification.
222 -- Must be called if the view is shown.
223 -- (Ex: DeIconification ) .
225 Redraw ( me ;x,y,width,height: Integer from Standard);
227 ---Purpose: Redisplays the view area after esxposure.
228 -- [x,y] define the min xy area position
229 -- [width,height] the size of the area in pixel unit.
231 MustBeResized ( me : mutable )
233 ---Purpose: Must be called when the window supporting the
234 -- view changes size.
235 raises UnMapped from V3d;
236 ---Purpose: if the view is not mapped on a window.
237 -- Warning: The view is centered and resized to preserve
238 -- the height/width ratio of the window.
240 DoMapping ( me : mutable );
242 ---Purpose: Must be called when the window supporting the
243 -- view is mapped or unmapped.
245 IsEmpty ( me ) returns Boolean;
247 ---Purpose: Returns the status of the view regarding
248 -- the displayed structures inside
249 -- Returns True is The View is empty
253 ---Purpose: Updates the lights of the view. The view is redrawn.
255 --------------------------------------------------------
256 ---Category: Methods to modify the Attributes of the view
257 --------------------------------------------------------
259 SetBackgroundColor ( me : mutable ;
260 Type : TypeOfColor; V1, V2, V3 : Parameter );
262 ---Purpose: Defines the background colour of the view
264 -- the colour definition type,
265 -- and the three corresponding values.
267 SetBackgroundColor ( me : mutable ; Color : Color from Quantity );
269 ---Purpose: Defines the background colour of the view
271 -- the colour object.
273 SetBackgroundColor ( me : mutable ; Name : NameOfColor );
275 ---Purpose: Defines the background colour of the view
277 -- the colour name in the form Quantity_NOC_xxxx .
279 SetBgGradientColors ( me : mutable ;
280 Color1 : Color from Quantity;
281 Color2 : Color from Quantity;
282 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
283 update : Boolean from Standard = Standard_False );
285 ---Purpose: Defines the gradient background colours of the view
287 -- two colour objects,
288 -- and fill method (horizontal by default)
290 SetBgGradientColors ( me : mutable ;
291 Color1 : NameOfColor;
292 Color2 : NameOfColor;
293 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
294 update : Boolean from Standard = Standard_False );
296 ---Purpose: Defines the gradient background colours of the view
298 -- two colour names in the form Quantity_NOC_xxxx,
299 -- and fill method (horizontal by default)
301 SetBgGradientStyle( me : mutable ;
302 AMethod : GradientFillMethod from Aspect = Aspect_GFM_HOR;
303 update : Boolean from Standard = Standard_False);
305 ---Purpose: Defines the gradient background fill method of the view
307 SetBackgroundImage( me : mutable; FileName : CString from Standard;
308 FillStyle : FillMethod from Aspect = Aspect_FM_CENTERED;
309 update : Boolean from Standard = Standard_False );
311 ---Purpose: Defines the background texture of the view
313 --- texture image file name,
314 --- and fill method (centered by default)
316 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
317 update : Boolean from Standard = Standard_False );
319 ---Purpose: Defines the textured background fill method of the view
321 SetAxis ( me : mutable; X,Y,Z : Coordinate ;
322 Vx,Vy,Vz : Parameter )
324 ---Purpose: Definition of an axis from its origin and
326 -- This will be the current axis for rotations and movements.
327 raises BadValue from Viewer;
328 ---Purpose: Warning! raises BadValue from Viewer if the vector normal is NULL. .
330 SetShadingModel ( me : mutable; Model : TypeOfShadingModel );
332 ---Purpose: Defines the shading model for the
333 -- visualisation ZBUFFER mode.
334 -- Various models are available.
336 SetSurfaceDetail(me : mutable; SurfaceDetail : TypeOfSurfaceDetail);
338 ---Purpose: select the kind of rendering for texture mapping
339 -- no texture mapping by default
341 SetTextureEnv(me : mutable; ATexture : TextureEnv from Graphic3d);
343 ---Purpose: set the environment texture to use
344 -- no environment texture by default
346 SetVisualization ( me : mutable;
347 Mode : TypeOfVisualization from V3d );
349 ---Purpose: Defines the visualisation mode in the view.
351 SetAntialiasingOn ( me : mutable );
353 ---Purpose: Activates antialiasing in the view.
355 SetAntialiasingOff ( me : mutable );
357 ---Purpose: Desactivates antialiasing in the view.
359 SetZClippingDepth ( me : mutable; Depth : Length );
361 ---Purpose: Defines the depth of the medium clipping plane.
363 SetZClippingWidth ( me : mutable; Width : Length )
365 ---Purpose: Defines the thicknes around the medium clippling plane. .
366 raises BadValue from Viewer;
367 -- If the thickness is <= 0
369 SetZClippingType ( me : mutable; Type : TypeOfZclipping );
371 ---Purpose: Defines the type of ZClipping.
373 SetZCueingDepth ( me : mutable; Depth : Length );
375 ---Purpose: Defines the depth of the medium plane.
377 SetZCueingWidth ( me : mutable; Width : Length )
379 ---Purpose: Defines the thickness around the medium plane.
380 raises BadValue from Viewer;
381 -- If thickness is <= 0
383 SetZCueingOn ( me : mutable );
385 ---Purpose: Activates ZCueing in the view.
387 SetZCueingOff ( me : mutable );
389 ---Purpose: Desactivates ZCueing in the view.
391 SetLightOn( me : mutable ; MyLight : Light from V3d )
393 ---Purpose: Activates MyLight in the view.
394 raises BadValue from Viewer;
395 -- If No More Light can be activated in MyView .
397 SetLightOn( me : mutable )
399 ---Purpose: Activates all the lights defined in this view.
400 raises BadValue from Viewer;
401 -- If No More Light can be activated in MyView .
403 SetLightOff( me : mutable ; MyLight : Light from V3d );
405 ---Purpose: Desactivate MyLight in this view.
407 SetLightOff( me : mutable );
409 ---Purpose: Deactivate all the Lights defined in this view.
411 IsActiveLight( me ; aLight: Light from V3d )
412 returns Boolean from Standard;
414 ---Purpose: Returns TRUE when the light is active in this view.
416 SetTransparency( me : mutable ; AnActivity : Boolean = Standard_False);
418 ---Purpose: Activate/Deactivate the transparency in this view.
420 SetPlaneOn( me : mutable ; MyPlane : Plane from V3d )
422 ---Purpose: Activates the clipping plane in this view.
423 raises BadValue from Viewer ;
424 ---Purpose: If No More Plane can be activated in MyView .
426 SetPlaneOn( me : mutable )
428 ---Purpose: Activate all the clipping planes defined in
430 raises BadValue from Viewer;
431 ---Purpose: If No More Plane can be activated in MyView .
433 SetPlaneOff( me : mutable ; MyPlane : Plane from V3d );
435 ---Purpose: Desactivates the clipping plane defined
438 SetPlaneOff( me : mutable );
440 ---Purpose: Deactivate all clipping planes defined
443 IsActivePlane( me ; aPlane: Plane from V3d )
444 returns Boolean from Standard;
446 ---Purpose: Returns TRUE when the plane is active in this view.
448 ---------------------------------------------------
450 ---------------------------------------------------
452 ZBufferTriedronSetup ( me : mutable;
453 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
454 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
455 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
456 SizeRatio : Real from Standard = 0.8;
457 AxisDiametr : Real from Standard = 0.05;
458 NbFacettes : Integer from Standard = 12)
461 ---Purpose: Customization of the ZBUFFER Triedron.
462 --- XColor,YColor,ZColor - colors of axis
463 --- SizeRatio - ratio of decreasing of the trihedron size when its phisical
464 --- position comes out of the view
465 --- AxisDiametr - diameter relatively to axis length
466 --- NbFacettes - number of facettes of cylinders and cones
468 TriedronDisplay ( me : mutable;
469 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
470 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
471 AScale : Real from Standard = 0.02;
472 AMode : TypeOfVisualization from V3d = V3d_WIREFRAME )
475 ---Purpose: Display of the Triedron.
476 --- Initialize position, color and length of Triedron axes.
477 --- The scale is a percent of the window width.
480 TriedronErase ( me : mutable )
483 ---Purpose: Erases the Triedron.
486 TriedronEcho ( me : mutable;
487 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
490 ---Purpose: Highlights the echo zone of the Triedron.
493 ---------------------------------
494 ---Category: Graduated trihedron
495 ---------------------------------
497 GetGraduatedTrihedron(me;
499 xname, yname, zname : out ExtendedString from TCollection;
501 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
503 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
505 drawgrid : out Boolean from Standard;
507 drawaxes : out Boolean from Standard;
508 -- Number of splits along axes --
509 nbx, nby, nbz : out Integer from Standard;
510 -- Offset for drawing values --
511 xoffset, yoffset, zoffset : out Integer from Standard;
512 -- Offset for drawing names of axes --
513 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
515 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
516 -- Length of tickmarks --
517 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
519 gridcolor : out Color from Quantity;
520 -- Colors of axis names --
521 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
522 -- Colors of axis and values --
523 xcolor, ycolor, zcolor : out Color from Quantity;
524 -- Name of font for names of axes --
525 fontOfNames : out AsciiString from TCollection;
526 -- Style of names of axes --
527 styleOfNames : out FontAspect from OSD;
528 -- Size of names of axes --
529 sizeOfNames : out Integer from Standard;
530 -- Name of font for values --
531 fontOfValues : out AsciiString from TCollection;
532 -- Style of values --
533 styleOfValues : out FontAspect from OSD;
535 sizeOfValues : out Integer from Standard)
536 ---Purpose: Returns data of a graduated trihedron.
539 GraduatedTrihedronDisplay(me : mutable;
541 xname : ExtendedString from TCollection = "X";
542 yname : ExtendedString from TCollection = "Y";
543 zname : ExtendedString from TCollection = "Z";
545 xdrawname : Boolean from Standard = Standard_True;
546 ydrawname : Boolean from Standard = Standard_True;
547 zdrawname : Boolean from Standard = Standard_True;
549 xdrawvalues : Boolean from Standard = Standard_True;
550 ydrawvalues : Boolean from Standard = Standard_True;
551 zdrawvalues : Boolean from Standard = Standard_True;
553 drawgrid : Boolean from Standard = Standard_True;
555 drawaxes : Boolean from Standard = Standard_True;
556 -- Number of splits along axes --
557 nbx : Integer from Standard = 3;
558 nby : Integer from Standard = 3;
559 nbz : Integer from Standard = 3;
560 -- Offset for drawing values --
561 xoffset : Integer from Standard = 10;
562 yoffset : Integer from Standard = 10;
563 zoffset : Integer from Standard = 10;
564 -- Offset for drawing names of axes --
565 xaxisoffset : Integer from Standard = 30;
566 yaxisoffset : Integer from Standard = 30;
567 zaxisoffset : Integer from Standard = 30;
569 xdrawtickmarks : Boolean from Standard = Standard_True;
570 ydrawtickmarks : Boolean from Standard = Standard_True;
571 zdrawtickmarks : Boolean from Standard = Standard_True;
572 -- Length of tickmarks --
573 xtickmarklength : Integer from Standard = 10;
574 ytickmarklength : Integer from Standard = 10;
575 ztickmarklength : Integer from Standard = 10;
577 gridcolor : Color from Quantity = Quantity_NOC_WHITE;
579 xnamecolor : Color from Quantity = Quantity_NOC_RED;
581 ynamecolor : Color from Quantity = Quantity_NOC_GREEN;
583 znamecolor : Color from Quantity = Quantity_NOC_BLUE1;
584 -- X color of axis and values --
585 xcolor : Color from Quantity = Quantity_NOC_RED;
586 -- Y color of axis and values --
587 ycolor : Color from Quantity = Quantity_NOC_GREEN;
588 -- Z color of axis and values --
589 zcolor : Color from Quantity = Quantity_NOC_BLUE1;
590 -- Name of font for names of axes --
591 fontOfNames : AsciiString from TCollection = "Arial";
592 -- Style of names of axes --
593 styleOfNames : FontAspect from OSD = OSD_FA_Bold;
594 -- Size of names of axes --
595 sizeOfNames : Integer from Standard = 12;
596 -- Name of font for values --
597 fontOfValues : AsciiString from TCollection = "Arial";
598 -- Style of values --
599 styleOfValues : FontAspect from OSD = OSD_FA_Regular;
601 sizeOfValues : Integer from Standard = 12)
602 ---Purpose: Displays a graduated trihedron.
605 GraduatedTrihedronErase(me : mutable)
606 ---Purpose: Erases a graduated trihedron from the view.
609 ---------------------------------------------------
610 -- Color Scale methods
611 ---------------------------------------------------
613 SetLayerMgr(me : mutable; aMgr : LayerMgr from V3d);
615 ColorScaleDisplay(me : mutable);
617 ColorScaleErase(me : mutable);
619 ColorScaleIsDisplayed(me)
620 returns Boolean from Standard;
623 returns ColorScale from Aspect;
625 --------------------------------------------------------
626 ---Category: Methods to modify the Projection of the view
627 --------------------------------------------------------
629 SetFront(me: mutable);
631 ---Purpose: modify the Projection of the view perpendicularly to
632 -- the privileged plane of the viewer.
634 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
635 Start : Boolean = Standard_True )
637 ---Purpose: Rotates the eye about the coordinate system of
638 -- reference of the screen
639 -- for which the origin is the view point of the projection,
640 -- with a relative angular value in RADIANS with respect to
641 -- the initial position expressed by Start = Standard_True
642 raises BadValue from Viewer;
643 ---Purpose: Warning! raises BadValue from Viewer
644 -- If the eye, the view point, or the high point are
645 -- aligned or confused.
647 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
649 Start : Boolean = Standard_True )
651 ---Purpose: Rotates the eye about the coordinate system of
652 -- reference of the screen
653 -- for which the origin is Gravity point {X,Y,Z},
654 -- with a relative angular value in RADIANS with respect to
655 -- the initial position expressed by Start = Standard_True
656 raises BadValue from Viewer;
657 ---Purpose: If the eye, the view point, or the high point are
658 -- aligned or confused.
660 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
662 Start : Boolean = Standard_True );
664 ---Purpose: Rotates the eye about one of the coordinate axes of
665 -- of the view for which the origin is the Gravity point{X,Y,Z}
666 -- with an relative angular value in RADIANS with
667 -- respect to the initial position expressed by
668 -- Start = Standard_True
670 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
671 Start : Boolean = Standard_True ) ;
673 ---Purpose: Rotates the eye about one of the coordinate axes of
674 -- of the view for which the origin is the view point of the
675 -- projection with an relative angular value in RADIANS with
676 -- respect to the initial position expressed by
677 -- Start = Standard_True
679 Rotate ( me : mutable ; Angle : PlaneAngle ;
680 Start : Boolean = Standard_True );
682 ---Purpose: Rotates the eye around the current axis a relative
683 -- angular value in RADIANS with respect to the initial
684 -- position expressed by Start = Standard_True
686 Move ( me : mutable ; Dx,Dy,Dz : Length ;
687 Start : Boolean = Standard_True )
689 ---Purpose: Movement of the eye parallel to the coordinate system
690 -- of reference of the screen a distance relative to the
691 -- initial position expressed by Start = Standard_True.
692 raises BadValue from Viewer;
693 -- If the eye, the view point, or the high point are
694 -- aligned or confused.
696 Move ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
697 Start : Boolean = Standard_True )
699 ---Purpose: Movement of the eye parallel to one of the axes of the
700 -- coordinate system of reference of the view a distance
701 -- relative to the initial position expressed by
702 -- Start = Standard_True.
703 raises BadValue from Viewer;
704 -- If the eye, view point, or high point are aligned or confused.
706 Move ( me : mutable ; Length : Length ;
707 Start : Boolean = Standard_True )
709 ---Purpose: Movement of the eye parllel to the current axis
710 -- a distance relative to the initial position
711 -- expressed by Start = Standard_True
712 raises BadValue from Viewer;
713 -- If the eye, view point, or high point are aligned or confused.
715 Translate ( me : mutable ; Dx,Dy,Dz : Length ;
716 Start : Boolean = Standard_True )
718 ---Purpose: Movement of the ye and the view point parallel to the
719 -- frame of reference of the screen a distance relative
720 -- to the initial position expressed by
721 -- Start = Standard_True
722 raises BadValue from Viewer;
723 -- If the eye, view point, or high point are aligned or confused.
725 Translate ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
726 Start : Boolean = Standard_True );
728 ---Purpose: Movement of the eye and the view point parallel to one
729 -- of the axes of the fame of reference of the view a
730 -- distance relative to the initial position
731 -- expressed by Start = Standard_True
733 Translate ( me : mutable ; Length : Length ;
734 Start : Boolean = Standard_True );
736 ---Purpose: Movement of the eye and view point parallel to
737 -- the current axis a distance relative to the initial
738 -- position expressed by Start = Standard_True
740 Place (me: mutable; x,y: Integer from Standard;
741 aZoomFactor: Factor from Quantity = 1)
743 ---Purpose: places the point of the view corresponding
744 -- at the pixel position x,y at the center of the window
745 -- and updates the view.
748 Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
749 Start : Boolean = Standard_True )
751 ---Purpose: Rotation of the view point around the frame of reference
752 -- of the screen for which the origin is the eye of the
753 -- projection with a relative angular value in RADIANS
754 -- with respect to the initial position expressed by
755 -- Start = Standard_True
756 raises BadValue from Viewer;
757 -- If the eye, view point, or high point are aligned or confused.
759 Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
760 Start : Boolean = Standard_True )
763 ---Purpose: Rotation of the view point around one of the axes of the
764 -- frame of reference of the view for which the origin is
765 -- the eye of the projection with an angular value in
766 -- RADIANS relative to the initial position expressed by
767 -- Start = Standard_True
769 Turn ( me : mutable ; Angle : PlaneAngle ;
770 Start : Boolean = Standard_True );
772 ---Purpose: Rotation of the view point around the current axis an
773 -- angular value in RADIANS relative to the initial
774 -- position expressed by Start = Standard_True
776 SetTwist ( me : mutable ; Angle : PlaneAngle )
778 ---Purpose: Defines the angular position of the high point of
779 -- the reference frame of the view with respect to the
780 -- Y screen axis with an absolute angular value in
782 raises BadValue from Viewer;
783 -- If the eye, view point, or high point are aligned or confused.
785 SetEye( me : mutable ; X,Y,Z : Coordinate )
787 ---Purpose: Defines the position of the eye..
788 raises BadValue from Viewer ;
789 -- If the eye, view point, or high point are aligned or confused.
791 SetDepth( me : mutable ; Depth : Length )
793 ---Purpose: Defines the Depth of the eye from the view point
794 -- without update the projection .
795 raises BadValue from Viewer ;
796 -- If the Depth is <= 0.
798 SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
800 ---Purpose: Defines the orientation of the projection.
801 raises BadValue from Viewer ;
802 -- If the eye, view point, or high point are aligned or confused.
804 SetProj( me : mutable ; Orientation : TypeOfOrientation )
806 ---Purpose: Defines the orientation of the projection .
807 raises BadValue from Viewer ;
808 -- If the eye, view point, or high point are aligned or confused.
811 SetAt( me : mutable ; X,Y,Z : Coordinate )
813 ---Purpose: Defines the position of the view point.
814 raises BadValue from Viewer ;
815 -- If the eye, view point, or high point are aligned or confused.
817 SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
819 ---Purpose: Defines the orientation of the high point.
820 raises BadValue from Viewer ;
821 -- If the eye, view point, or high point are aligned or confused.
823 SetUp( me : mutable ; Orientation : TypeOfOrientation )
825 ---Purpose: Defines the orientation(SO) of the high point.
826 raises BadValue from Viewer ;
827 -- If the eye, view point, or high point are aligned or confused.
829 SetViewOrientation ( me : mutable; VO : ViewOrientation from Visual3d );
831 ---Purpose: Modifies the orientation of the view.
833 SetViewOrientationDefault( me : mutable );
835 ---Purpose: Saves the current state of the orientation of the view
836 -- which will be the return state at ResetViewOrientation.
838 ResetViewOrientation ( me : mutable );
840 ---Purpose: Resets the orientation of the view.
843 --------------------------------------------------------
844 ---Category: Methods to modify the Mapping of the view
845 --------------------------------------------------------
847 Panning ( me : mutable ; Dx , Dy : Length ;
848 aZoomFactor : Factor from Quantity = 1;
849 Start : Boolean = Standard_True )
851 ---Purpose: translates the center of the view and zooms the view.
853 raises BadValue from Viewer ;
855 SetCenter ( me : mutable ; Xc , Yc : Coordinate )
857 ---Purpose: Defines the centre of the view.
859 raises BadValue from Viewer ;
860 -- If one of the dimensions of the projection is NULL.
862 SetCenter ( me : mutable ; X,Y: Integer from Standard)
864 ---Purpose: Defines the centre of the view from a pixel position.
866 raises BadValue from Viewer ;
867 -- If one of the dimensions of the projection is NULL.
869 SetSize ( me : mutable ; Size : Length )
871 ---Purpose: Defines the size of the view while preserving the
872 -- center and height/width ratio of the window supporting
874 -- NOTE than the Depth of the View is NOT modified .
875 raises BadValue from Viewer ;
876 -- If the size of the view is <= 0
878 SetZSize ( me : mutable ; Size : Length )
880 ---Purpose: Defines the Depth size of the view
881 -- Front Plane will be set to Size/2.
882 -- Back Plane will be set to -Size/2.
883 -- Any Object located Above the Front Plane or
884 -- behind the Back Plane will be Clipped .
885 -- NOTE than the XY Size of the View is NOT modified .
886 raises BadValue from Viewer ;
887 -- If the size of the view is <= 0
889 SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
891 ---Purpose: Zooms the view by a factor relative to the initial
892 -- value expressed by Start = Standard_True
894 raises BadValue from Viewer ;
895 -- If the zoom coefficient is <= 0
897 SetScale ( me : mutable ; Coef : Factor )
899 ---Purpose: Zooms the view by a factor relative to the value
900 -- initialised by SetViewMappingDefault().
902 raises BadValue from Viewer ;
903 -- If the zoom coefficient is <= 0
905 SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
907 ---Purpose: Sets anisotropic (axial) scale factors <Sx>, <Sy>, <Sz> for view <me>.
908 -- Anisotropic scaling operation is performed through multiplying
909 -- the current view orientation matrix by a scaling matrix:
915 raises BadValue from Viewer ;
916 -- If the one of factors <= 0
918 FitAll ( me : mutable ; Coef : Coefficient = 0.01;
919 FitZ: Boolean from Standard = Standard_False; update : Boolean from Standard = Standard_True )
921 ---Purpose: Automatic zoom/panning. Objects in the view are visualised
922 -- so as to occupy the maximum space while respecting the
923 -- margin coefficient and the initial height /width ratio.
924 -- NOTE than the original Z size of the view is NOT modified .
925 raises BadValue from Viewer ;
926 -- If the margin coefficient is <0 ou >= 1 or
929 ZFitAll ( me : mutable ; Coef : Coefficient = 1.0 )
931 ---Purpose: Automatic Depth Panning. Objects visible in the view are
932 -- visualised so as to occupy the maximum Z amount of space
933 -- while respecting the margin coefficient .
934 -- NOTE than the original XY size of the view is NOT modified .
935 raises BadValue from Viewer ;
936 -- If the margin coefficient is <0 ou or
937 -- If No Objects are displayed in the view
939 DepthFitAll( me : mutable ; Aspect : Coefficient = 0.01;
940 Margin : Coefficient = 0.01 );
942 ---Purpose: Adjusts the viewing volume so as not to clip the displayed objects by front and back
943 -- and back clipping planes. Also sets depth value automatically depending on the
944 -- calculated Z size and Aspect parameter.
945 -- NOTE than the original XY size of the view is NOT modified .
947 FitAll ( me : mutable ; Umin, Vmin, Umax, Vmax : Coordinate )
949 ---Purpose: Centres the defined projection window so that it occupies
950 -- the maximum space while respecting the initial
951 -- height/width ratio.
952 -- NOTE than the original Z size of the view is NOT modified .
953 raises BadValue from Viewer;
954 -- If the defined projection window has zero size.
957 WindowFit ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer)
959 ---Purpose: Centres the defined PIXEL window so that it occupies
960 -- the maximum space while respecting the initial
961 -- height/width ratio.
962 -- NOTE than the original Z size of the view is NOT modified .
963 raises BadValue from Viewer
964 -- If the defined projection window has zero size.
967 SetViewingVolume ( me : mutable ; Left, Right, Bottom, Top, ZNear, ZFar : Real from Standard)
969 ---Purpose: Sets Z and XY size of the view according to given values
970 -- with respecting the initial view depth (eye position)
971 raises BadValue from Viewer;
972 -- If the ZNear<0, ZFar<0 or ZNear>=Zfar.
974 SetViewMapping ( me : mutable; VM : ViewMapping from Visual3d );
976 ---Purpose: Modifies the mapping of the view.
978 SetViewMappingDefault( me : mutable );
980 ---Purpose: Saves the current view mapping. This will be the
981 -- state returned from ResetViewmapping.
983 ResetViewMapping ( me : mutable );
985 ---Purpose: Resets the centring of the view.
988 Reset ( me : mutable; update : Boolean from Standard = Standard_True );
990 ---Purpose: Resets the centring and the orientation of the view
992 ---------------------------------------------------
993 ---Category: Inquire methods
994 ---------------------------------------------------
996 Convert( me ; Vp : Integer ) returns Length
998 ---Purpose : Converts the PIXEL value
999 -- to a value in the projection plane.
1000 raises UnMapped from V3d;
1001 -- If the view is not mapped on the window.
1003 Convert( me ; Xp,Yp : Integer ; Xv,Yv : out Coordinate )
1005 ---Purpose : Converts the point PIXEL into a point projected
1006 -- in the reference frame of the projection plane.
1007 raises UnMapped from V3d;
1008 -- If the view is not mapped on the window.
1010 Convert( me ; Vv : Length ) returns Integer
1012 ---Purpose : Converts tha value of the projection plane into
1014 raises UnMapped from V3d;
1015 -- If the view is not mapped on the window.
1017 Convert( me ; Xv,Yv : Coordinate ; Xp,Yp : out Integer )
1019 ---Purpose : Converts the point defined in the reference frame
1020 -- of the projection plane into a point PIXEL.
1021 raises UnMapped from V3d;
1022 -- If the view is not mapped on the window.
1024 Convert( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate)
1026 ---Purpose : Converts the projected point into a point
1027 -- in the reference frame of the view corresponding
1028 -- to the intersection with the projection plane
1029 -- of the eye/view point vector.
1030 raises UnMapped from V3d;
1031 -- If the view is not mapped on the window.
1033 ConvertWithProj( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate ; Vx,Vy,Vz : out Parameter)
1035 ---Purpose : Converts the projected point into a point
1036 -- in the reference frame of the view corresponding
1037 -- to the intersection with the projection plane
1038 -- of the eye/view point vector and returns the
1039 -- projection ray for further computations.
1040 raises UnMapped from V3d;
1041 -- If the view is not mapped on the window.
1043 ConvertToGrid( me ; Xp,Yp : Integer ; Xg,Yg,Zg : out Coordinate)
1045 ---Purpose : Converts the projected point into the nearest grid point
1046 -- in the reference frame of the view corresponding
1047 -- to the intersection with the projection plane
1048 -- of the eye/view point vector and display the grid marker.
1049 -- Warning: When the grid is not active the result is identical
1050 -- to the above Convert() method.
1052 -- 1) Enable the grid echo display
1053 -- myViewer->SetGridEcho(Standard_True);
1054 -- 2) When application receive a move event :
1055 -- 2.1) Check if any object is detected
1056 -- if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
1057 -- 2.2) Check if the grid is active
1058 -- if( myViewer->Grid()->IsActive() ) {
1059 -- 2.3) Display the grid echo and gets the grid point
1060 -- myView->ConvertToGrid(x,y,X,Y,Z);
1061 -- 2.4) Else this is the standard case
1062 -- } else myView->Convert(x,y,X,Y,Z);
1063 raises UnMapped from V3d;
1064 -- If the view is not mapped on the window.
1066 ConvertToGrid( me ; X,Y,Z : Coordinate ; Xg,Yg,Zg : out Coordinate)
1068 ---Purpose : Converts the point into the nearest grid point
1069 -- and display the grid marker.
1070 ---Warning: When the grid is not active the result is identical
1071 -- to the previous point.
1072 raises UnMapped from V3d;
1073 -- If the view is not mapped on the window.
1075 Convert( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1077 ---Purpose : Projects the point defined in the reference frame of
1078 -- the view into the projected point in the associated window.
1080 -- RefToPix( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1081 -- ---Purpose : Projects the point defined in the reference frame of
1082 -- -- the view into the projected point in the associated window.
1083 -- Obsolete : Use Convert(X,Y,Z,Xp,Yp);
1085 -- PixToRef( me ; Xp,Yp : Integer; X,Y,Z : out Coordinate) ;
1086 -- ---Purpose : Converts the projected point in the associated window of
1087 -- -- the view into the point defined in the reference frame.
1088 -- Obsolete : Use Convert(Xp,Yp,X,Y,Z);
1090 Project( me ; X,Y,Z : Coordinate; Xp,Yp : out Coordinate) ;
1092 ---Purpose : Converts the point defined in the user space of
1093 -- the view to the projected view plane point at z 0.
1095 BackgroundColor( me; Type : TypeOfColor ; V1, V2, V3 : out Parameter) ;
1097 ---Purpose: Returns the Background color values of the view
1098 -- depending of the color Type.
1100 BackgroundColor( me ) returns Color from Quantity;
1102 ---Purpose: Returns the Background color object of the view.
1104 GradientBackgroundColors( me;
1105 Color1 : out Color from Quantity;
1106 Color2 : out Color from Quantity) ;
1108 ---Purpose: Returns the gradient background colour objects of the view.
1110 GradientBackground ( me ) returns GradientBackground from Aspect;
1112 ---Purpose: Returns the gradient background of the view.
1114 Scale ( me ) returns Factor ;
1116 ---Purpose: Returns the current value of the zoom expressed with
1117 -- respect to SetViewMappingDefault().
1119 AxialScale ( me ; Sx, Sy, Sz : out Real from Standard ) ;
1121 ---Purpose: Returns the current values of the anisotropic (axial) scale factors.
1123 Center ( me; Xc,Yc : out Coordinate );
1125 ---Purpose: Returns the centre of the view.
1127 Size ( me; Width, Height : out Length );
1129 ---Purpose: Returns the height and width of the view.
1131 ZSize ( me ) returns Real ;
1133 ---Purpose: Returns the Depth of the view .
1135 Eye( me ; X,Y,Z : out Coordinate );
1137 ---Purpose: Returns the position of the eye.
1139 FocalReferencePoint (me ; X,Y,Z : out Coordinate );
1141 ---Purpose: Returns the position of point which emanating the
1144 ProjReferenceAxe( me ; Xpix,Ypix : Integer ;
1145 XP,YP,ZP,VX,VY,VZ : out Coordinate );
1147 ---Purpose: Returns the coordinate of the point (Xpix,Ypix)
1148 -- in the view (XP,YP,ZP), and the projection vector of the
1149 -- view passing by the point (for PerspectiveView).
1151 Depth( me ) returns Length ;
1153 ---Purpose: Returns the Distance between the Eye and View Point.
1155 Proj( me ; Vx,Vy,Vz : out Parameter );
1157 ---Purpose: Returns the projection vector.
1159 At( me ; X,Y,Z : out Coordinate );
1161 ---Purpose: Returns the position of the view point.
1163 Up( me ; Vx,Vy,Vz : out Parameter );
1165 ---Purpose: Returns the vector giving the position of the high point.
1167 Twist( me ) returns PlaneAngle ;
1169 ---Purpose: Returns in RADIANS the orientation of the view around
1170 -- the visual axis measured from the Y axis of the screen.
1172 ShadingModel ( me ) returns TypeOfShadingModel ;
1174 ---Purpose: Returns the current shading model.
1176 SurfaceDetail(me) returns TypeOfSurfaceDetail;
1178 -- purpose: returns the current SurfaceDetail mode
1180 TextureEnv(me) returns TextureEnv from Graphic3d;
1182 -- purpose: return the current environment texture used
1184 Transparency(me) returns Boolean from Standard;
1186 ---Purpose: Returns the transparency activity.
1188 Visualization ( me ) returns TypeOfVisualization from V3d;
1190 ---Purpose: Returns the current visualisation mode.
1192 Antialiasing ( me ) returns Boolean;
1194 ---Purpose: Indicates if the antialiasing is active (True) or
1195 -- inactive (False).
1197 ZCueing ( me; Depth, Width : out Length ) returns Boolean ;
1199 ---Purpose: Returns activity and information on the Zcueing.
1200 -- <Depth> : Depth of plane.
1201 -- <Width> : Thickness around the plane.
1203 ZClipping ( me; Depth, Width : out Length ) returns TypeOfZclipping;
1205 ---Purpose: Returns current information on the ZClipping.
1206 -- <Depth> : Depth of plane.
1207 -- <Width> : Thickness around the plane.
1208 -- <TypeOfZclipping> : "BACK"
1213 IfMoreLights( me ) returns Boolean;
1215 ---Purpose: Returns True if One light more can be
1216 -- activated in this View.
1218 InitActiveLights(me: mutable);
1220 ---Purpose: initializes an iteration on the active Lights.
1222 MoreActiveLights (me) returns Boolean from Standard;
1224 ---Purpose: returns true if there are more active Light(s) to return.
1226 NextActiveLights (me: mutable);
1228 ---Purpose : Go to the next active Light
1229 -- (if there is not, ActiveLight will raise an exception)
1231 ActiveLight(me) returns mutable Light from V3d;
1234 IfMorePlanes( me ) returns Boolean;
1236 ---Purpose: Returns True if One clipping plane more can be
1237 -- activated in this View.
1239 InitActivePlanes(me: mutable);
1241 ---Purpose: initializes an iteration on the active Planes.
1243 MoreActivePlanes (me) returns Boolean from Standard;
1245 ---Purpose: returns true if there are more active Plane(s) to return.
1247 NextActivePlanes (me: mutable);
1249 ---Purpose : Go to the next active Plane
1250 -- (if there is not, ActivePlane will raise an exception)
1252 ActivePlane(me) returns mutable Plane from V3d;
1255 Viewer ( me ) returns mutable Viewer from V3d;
1257 ---Purpose: Returns the viewer in which the view has been created.
1259 IfWindow ( me ) returns Boolean;
1261 ---Purpose: Returns True if MyView is associated with a window .
1263 Window ( me ) returns mutable Window from Aspect
1265 ---Purpose: Returns the Aspect Window associated with the view.
1266 raises BadValue from Viewer;
1267 -- If MyView is not associated with a window
1269 Type( me ) returns TypeOfView from V3d;
1271 ---Purpose: Returns the Type of the View
1273 Pan ( me : mutable; Dx, Dy: Integer from Standard;
1274 aZoomFactor: Factor from Quantity = 1);
1276 ---Purpose: translates the center of the view and zooms the view.
1277 -- and updates the view.
1279 Zoom ( me : mutable; X1 , Y1 , X2 , Y2 : Integer from Standard)
1282 ---Purpose: Zoom the view according to a zoom factor computed
1283 -- from the distance between the 2 mouse position <X1,Y1>,<X2,Y2>
1285 Zoom ( me: mutable; X,Y: Integer from Standard)
1288 ---Purpose: Zoom the view according to a zoom factor computed
1289 -- from the distance between the last and new mouse position <X,Y>
1291 StartZoomAtPoint(me : mutable;
1292 xpix, ypix : Integer from Standard);
1294 ---Purpose: Defines the point (pixel) of zooming (for the method ZoomAtPoint()).
1296 ZoomAtPoint(me : mutable;
1297 mouseStartX, mouseStartY, mouseEndX, mouseEndY : Integer from Standard);
1299 ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
1301 AxialScale ( me: mutable; Dx, Dy: Integer from Standard; Axis: TypeOfAxe from V3d );
1303 ---Purpose: Performs anisotropic scaling of <me> view along the given <Axis>.
1304 -- The scale factor is calculated on a basis of
1305 -- the mouse pointer displacement <Dx,Dy>.
1306 -- The calculated scale factor is then passed to SetAxialScale(Sx, Sy, Sz) method.
1308 StartRotation(me : mutable ; X,Y :Integer from Standard;
1309 zRotationThreshold: Ratio from Quantity = 0.0);
1311 ---Purpose: Begin the rotation of the view arround the screen axis
1312 -- according to the mouse position <X,Y>.
1313 -- Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
1314 -- factor is > 0 soon the distance from the start point and the center
1315 -- of the view is > (medium viewSize * <zRotationThreshold> ).
1316 -- Generally a value of 0.4 is usable to rotate around XY screen axis
1317 -- inside the circular treshold area and to rotate around Z screen axis
1318 -- outside this area.
1320 Rotation(me:mutable; X,Y :Integer from Standard);
1322 ---Purpose: Continues the rotation of the view
1323 -- with an angle computed from the last and new mouse position <X,Y>.
1325 FitAll ( me : mutable ; aWindow: Window from Aspect;
1326 Umin, Vmin, Umax, Vmax : Coordinate )
1329 ---Purpose: Change the scale factor and position of the view
1330 -- such as the bounding box <Umin, Vmin, Umax, Vmax> is contains
1334 -----------------------------------------
1335 ---Category: Private or Protected methods
1336 -----------------------------------------
1338 SetFocale( me : mutable ; Focale : Length )
1339 ---Purpose: Change View Plane Distance for Perspective Views
1340 raises TypeMismatch from Standard
1341 ---Purpose: Warning! raises TypeMismatch from Standard if the view
1342 -- is not a perspective view.
1345 Focale( me ) returns Length;
1346 ---Purpose: Returns the View Plane Distance for Perspective Views
1348 View ( me) returns mutable View from Visual3d is static ;
1350 ---Purpose: Returns the associated Visual3d view.
1352 ViewMapping ( me ) returns ViewMapping from Visual3d is static;
1354 ---Purpose: Returns the current mapping of the view.
1356 ViewOrientation ( me ) returns ViewOrientation from Visual3d is static;
1358 ---Purpose: Returns the current orientation of the view.
1360 ScreenAxis( myclass ; Vpn,Vup : Vector from Graphic3d ;
1361 Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
1362 returns Boolean is private ;
1363 ---Purpose: Determines the screen axes in the reference
1364 -- framework of the view.
1366 InitMatrix ( myclass ; Matrix : out Array2OfReal from TColStd ) is private ;
1369 Left, Right : Array2OfReal from TColStd ;
1370 Matrix : out Array2OfReal from TColStd )
1371 returns Boolean from Standard is private ;
1373 RotAxis( myclass ; Vrp : Vertex from Graphic3d ;
1374 Axe : Vector from Graphic3d ; Angle : PlaneAngle ;
1375 Matrix : out Array2OfReal from TColStd ) is private ;
1376 ---Purpose: Determines the rotation matrice around an axis
1377 -- for a given angle.
1379 TrsPoint( myclass ; P : Vertex from Graphic3d ;
1380 Matrix : Array2OfReal from TColStd )
1381 returns Vertex from Graphic3d is private ;
1382 ---Purpose: Transforms the point P according to the matrice Matrix .
1384 TrsPoint( myclass ; V : Vector from Graphic3d ;
1385 Matrix : Array2OfReal from TColStd )
1386 returns Vector from Graphic3d is private ;
1387 ---Purpose: Transforms the vector V according to the matrice Matrix .
1389 -----------------------------------------
1390 ---Category: TransientManager methods
1391 -----------------------------------------
1393 TransientManagerBeginDraw(me; DoubleBuffer: Boolean = Standard_False;
1394 RetainMode : Boolean = Standard_False)
1396 ---Purpose: Begins any graphics in the view <aView>
1397 -- Redraw any structured graphics in the back buffer before
1398 -- if <DoubleBuffer> is TRUE.
1399 -- Restore the front buffer from the back before
1400 -- if <DoubleBuffer> is FALSE.
1401 -- if <RetainMode> is TRUE.
1402 -- the graphic managed itself exposure,resizing ...
1403 -- if <RetainMode> is FALSE.
1404 -- the application must managed itself exposure,resizing ...
1406 returns Boolean from Standard;
1408 TransientManagerClearDraw(me);
1410 ---Purpose: Clear all transient graphics in the view <aView>
1413 TransientManagerBeginAddDraw(me)
1415 ---Purpose: Begins any add graphics in the view <aView>
1416 -- Redraw any structured graphics in the back buffer before
1417 -- the application must managed itself exposure,resizing ...
1418 -- Warning: Returns TRUE if transient drawing is enabled in
1419 -- the associated view.
1420 -- Returns FALSE ,if nothing works because something
1421 -- is wrong for the transient principle :
1423 returns Boolean from Standard;
1425 ---------------------------------------------------
1426 -- Category: Methods to modify the class definition
1428 ---------------------------------------------------
1430 SetAnimationModeOn ( me : mutable )
1433 ---Purpose: Activates animation mode.
1434 -- When the animation mode is activated in the view,
1435 -- all Graphic3d_Structure are stored in a graphic object.
1436 ---Category: Methods to modify the class definition
1438 SetAnimationModeOff ( me : mutable )
1441 ---Purpose: Deactivates the animation mode.
1442 ---Category: Methods to modify the class definition
1444 AnimationModeIsOn ( me )
1445 returns Boolean from Standard
1448 ---Purpose: Returns the activity of the animation mode.
1449 ---Category: Inquire methods
1451 SetAnimationMode ( me : mutable;
1452 anAnimationFlag : Boolean from Standard = Standard_True;
1453 aDegenerationFlag : Boolean from Standard = Standard_False
1456 ---Purpose : Enable/Disable animation/degeneration mode
1457 ---Category : Methods to modify the class definition
1459 AnimationMode ( me; isDegenerate: out Boolean from Standard )
1460 returns Boolean from Standard
1463 ---Purpose : Returns the animation and degenerate status.
1464 ---Category: Inquire methods
1466 ---------------------------------------------------
1467 -- Category: Methods to modify the class definition
1469 ---------------------------------------------------
1471 SetDegenerateModeOn ( me : mutable )
1474 ---Purpose: Activates degenerate mode.
1475 -- When the degenerate mode is activated in the view,
1476 -- all Graphic3d_Structure with the type TOS_COMPUTED
1477 -- displayed in this view are not computed.
1478 -- Warning: Obsolete method , use SetComputedMode()
1479 ---Category: Methods to modify the class definition
1481 SetDegenerateModeOff ( me : mutable )
1484 ---Purpose: Deactivates the degenerate mode.
1485 -- Category: Methods to modify the class definition
1486 -- Warning: if the computed mode has been disabled in the
1487 -- viewer the mode will remain degenerated.
1488 -- Warning: Obsolete method , use SetComputedMode()
1490 DegenerateModeIsOn ( me )
1491 returns Boolean from Standard
1494 ---Purpose: Returns the activity of the degenerate mode.
1495 ---Category: Inquire methods
1497 SetComputedMode ( me : mutable; aMode : Boolean from Standard )
1500 ---Purpose: Switches computed HLR mode in the view
1501 ---Category: Methods to modify the class definition
1504 returns Boolean from Standard
1507 ---Purpose: Returns the computed HLR mode state
1508 ---Category: Inquire methods
1510 MinMax ( me; Umin,Vmin, Umax,Vmax : out Coordinate ) returns Integer
1511 ---Purpose: Returns the objects number and the projection window
1512 -- of the objects contained in the view.
1515 MinMax ( me; Xmin,Ymin,Zmin, Xmax,Ymax,Zmax : out Coordinate )
1517 ---Purpose: Returns the objects number and the box encompassing
1518 -- the objects contained in the view
1521 Gravity ( me; X,Y,Z : out Coordinate ) returns Integer
1522 ---Purpose: Returns the Objects number and the gravity center
1523 -- of ALL viewable points in the view
1526 Init(me: mutable) is private;
1528 ---Category: for compatibility.
1530 WindowFitAll ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer);
1531 ---Purpose: idem than WindowFit
1533 SetPlotter ( me : mutable; aPlotter : Plotter from Graphic3d )
1534 ---Purpose: Set a plotter for plotting the contents of the view
1538 Plot ( me : mutable )
1539 ---Purpose: Create a 2D View for plotting the contents of the view
1540 raises BadValue from Viewer;
1541 -- if the plotter is undefined.
1543 Compute ( me; AVertex : Vertex from Graphic3d )
1544 returns Vertex from Graphic3d
1547 ---Purpose: Returns a new vertex when the grid is activated.
1549 SetGrid ( me : mutable;
1550 aPlane: Ax3 from gp;
1551 aGrid : Grid from Aspect )
1554 ---Purpose: Defines or Updates the definition of the
1556 ---Category: Methods to modify the class definition
1558 SetGridGraphicValues ( me : mutable;
1559 aGrid : Grid from Aspect )
1562 ---Purpose: Defines or Updates the graphic definition of the
1564 ---Category: Methods to modify the class definition
1566 SetGridActivity ( me : mutable;
1567 aFlag : Boolean from Standard )
1570 ---Purpose: Defines or Updates the activity of the
1572 ---Category: Methods to modify the class definition
1574 Tumble ( me : mutable;
1575 NbImages : Integer from Standard = 314;
1576 AnimationMode : Boolean from Standard = Standard_False )
1577 returns Real from Standard
1580 ---Purpose: Animates the view <me>
1581 -- Returns the number of images per second
1582 -- if <AnimationMode> is Standard_True, the animation mode
1585 ScreenCopy (me : mutable;
1586 aPlotterDriver : PlotterDriver from PlotMgt;
1587 fWhiteBackground : Boolean from Standard = Standard_True;
1588 aScale : Factor from Quantity = 1.0
1590 ---Purpose: dump the view
1593 theFile: CString from Standard;
1594 theBufferType : TypeOfImage from Image = Image_TOI_RGB )
1595 returns Boolean from Standard;
1597 ---Purpose: dump the full contents of the view at the same
1598 -- scale in the file <theFile>. The file name
1599 -- extension must be one of ".png",".bmp",".jpg",".gif".
1600 -- Returns FALSE when the dump has failed
1603 theFile : CString from Standard;
1604 theFormat : FormatOfSheetPaper from Aspect;
1605 theBufferType : TypeOfImage from Image = Image_TOI_RGB )
1606 returns Boolean from Standard;
1608 ---Purpose: dump the full contents of the view with a
1609 -- different scale according to the required sheet
1610 -- paper size (format) and the ratio
1611 -- width/height of the view.
1612 -- and returns FALSE when the dump has failed
1613 -- Warning : the file name extension must be one of
1614 -- ".png",".bmp",".jpg",".gif"
1615 -- but make becarefull about the time to dump and
1616 -- resulting file size especially for the A0 format.
1617 -- NOTE that you can use after any standard system utility
1618 -- for editing or sending the image file to a laser printer.
1619 -- (i.e: Microsoft Photo Editor on Windows system
1620 -- or Image Viewer on SUN system)
1622 Print (me; hPrnDC: Handle from Aspect = NULL;
1623 showDialog: Boolean = Standard_True;
1624 showBackground : Boolean = Standard_True;
1625 filename: CString = NULL;
1626 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH)
1627 returns Boolean from Standard is static;
1630 ---Purpose: print the contents of the view to printer with preview.
1631 -- <hPrnDC> : If you have already an PrinterDeviceContext (HDC),
1632 -- then you can pass it to the print routines.
1633 -- If you don't have an PrinterDeviceContext, then this parameter should
1635 -- <showDialog> : If hPrnDC == NULL, then you can force the print routines to
1636 -- open a Print Dialog box.
1637 -- If you want to do this, then set showDialog to TRUE
1638 -- If you don't want to see a dialog (only possible, if you have a hPrnDC
1639 -- or the dialog box was opened once before) then set <showDialog> to FALSE.
1640 -- <showBackground> : When set to FALSE then print the view without background color
1641 -- (background is white)
1642 -- else set to TRUE for printing with current background color.
1643 -- <filename>: If != NULL, then the view will be printed to a file.
1644 -- <printAlgorithm>: If you want to select the print algorithm, then you can
1645 -- specify one of existing algorithms: Aspect_PA_STRETCH, Aspect_PA_TILE.
1646 -- Returns Standard_True if the data is passed to the printer, otherwise
1647 -- Standard_False if the print operation failed. This might be related to
1648 -- insufficient memory or some internal errors. All this errors are
1649 -- indicated by the message boxes (on level of OpenGl_GraphicDriver).
1650 -- Warning: This function can reuse FBO assigned to the
1651 -- view on level of OpenGl_GraphicDriver; Please take it into account if
1652 -- you use it for your purposes;
1653 -- Warning: Works only under Windows.
1655 ToPixMap ( me : mutable;
1656 theWidth : Integer from Standard;
1657 theHeight : Integer from Standard;
1658 theBufferType : TypeOfImage from Image = Image_TOI_RGB;
1659 theForceCentered : Boolean from Standard = Standard_True )
1660 returns PixMap from Image;
1662 ---Purpose : dump the full contents of the view
1663 -- to a pixmap of pixel size <theWidth>*<theHeight> and
1664 -- buffer type <theBufferType>. If <theForceCentered> is true
1665 -- view scene will be centered.
1667 SetProjModel( me : mutable;
1668 amOdel: TypeOfProjectionModel from V3d = V3d_TPM_SCREEN )
1671 ---Purpose : Manages projection model
1674 returns TypeOfProjectionModel from V3d
1677 ---Purpose : Returns the current projection model
1679 SetBackFacingModel ( me : mutable;
1680 aModel : TypeOfBackfacingModel from V3d = V3d_TOBM_AUTOMATIC)
1683 ---Purpose : Manages display of the back faces
1684 -- When <aModel> is TOBM_AUTOMATIC the object backfaces
1685 -- are displayed only for surface objects and
1686 -- never displayed for solid objects.
1687 -- this was the previous mode.
1688 -- <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces
1689 -- are always displayed both for surfaces or solids.
1690 -- <aModel> is TOBM_NEVER_DISPLAYED the object backfaces
1691 -- are never displayed.
1693 BackFacingModel ( me )
1694 returns TypeOfBackfacingModel from V3d
1697 ---Purpose : Returns current state of the back faces display
1699 EnableDepthTest( me; enable : Boolean from Standard = Standard_True )
1702 ---Purpose: turns on/off opengl depth testing
1704 IsDepthTestEnabled( me ) returns Boolean from Standard
1707 ---Purpose: returns the current state of the depth testing
1709 EnableGLLight( me; enable : Boolean from Standard = Standard_True )
1712 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1714 IsGLLightEnabled( me ) returns Boolean from Standard
1717 ---Purpose: returns the current state of the gl lighting
1718 -- currently used in triedron displaying
1723 MyType : TypeOfView from V3d is protected ;
1724 MyViewer : ViewerPointer from V3d ;
1725 MyActiveLights: ListOfTransient from V3d;
1726 MyActivePlanes: ListOfTransient from V3d;
1728 MyView : View from Visual3d is protected ;
1729 MyViewMapping : ViewMapping from Visual3d is protected ;
1730 MyViewOrientation : ViewOrientation from Visual3d ;
1731 MyViewContext : ContextView from Visual3d ;
1732 MyBackground: Background from Aspect ;
1733 MyGradientBackground: GradientBackground from Aspect ;
1734 MyDefaultViewAxis: Vector from Graphic3d ;
1735 MyDefaultViewPoint: Vertex from Graphic3d ;
1737 MyWindow: Window from Aspect;
1739 MyPlotter: Plotter from Graphic3d;
1741 myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
1742 myActivePlanesIterator: ListIteratorOfListOfTransient from TColStd;
1744 sx,sy: Integer from Standard;
1745 rx,ry: Real from Standard;
1746 gx,gy,gz: Real from Standard;
1747 myComputedMode: Boolean from Standard;
1748 SwitchSetFront: Boolean from Standard;
1749 MyZoomAtPointX, MyZoomAtPointY : Integer from Standard;
1752 MyGrid : Grid from Aspect;
1753 MyPlane : Ax3 from gp;
1755 --MyColorScale : ColorScale from V3d;
1756 MyLayerMgr : LayerMgr from V3d;
1758 -- the transformation between XoY and the grid plane
1759 MyTrsf : Array2OfReal from TColStd;
1762 MyGridEchoStructure : Structure from Graphic3d;
1763 MyGridEchoGroup : Group from Graphic3d;
1765 MyProjModel : TypeOfProjectionModel from V3d is protected;
1766 MyAnimationFlags : Integer from Standard;
1768 MyTransparencyFlag : Boolean from Standard;
1771 SetViewOn from class Viewer from V3d ( me : mutable ),
1772 SetViewOn from class Viewer from V3d ( me : mutable ; View : View from V3d ),
1773 SetViewOff from class Viewer from V3d ( me : mutable ),
1774 SetViewOff from class Viewer from V3d ( me : mutable ; View : View from V3d )