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: Updates the display of the view.
217 -- Must be called to update the view
218 -- when the update mode is deferred (WAIT) .
222 ---Purpose: Redisplays the view even if there has not
223 -- been any modification.
224 -- Must be called if the view is shown.
225 -- (Ex: DeIconification ) .
227 Redraw ( me ;x,y,width,height: Integer from Standard);
229 ---Purpose: Redisplays the view area after esxposure.
230 -- [x,y] define the min xy area position
231 -- [width,height] the size of the area in pixel unit.
233 MustBeResized ( me : mutable )
235 ---Purpose: Must be called when the window supporting the
236 -- view changes size.
237 raises UnMapped from V3d;
238 ---Purpose: if the view is not mapped on a window.
239 -- Warning: The view is centered and resized to preserve
240 -- the height/width ratio of the window.
242 DoMapping ( me : mutable );
244 ---Purpose: Must be called when the window supporting the
245 -- view is mapped or unmapped.
247 IsEmpty ( me ) returns Boolean;
249 ---Purpose: Returns the status of the view regarding
250 -- the displayed structures inside
251 -- Returns True is The View is empty
255 ---Purpose: Updates the lights of the view. The view is redrawn.
257 --------------------------------------------------------
258 ---Category: Methods to modify the Attributes of the view
259 --------------------------------------------------------
261 SetBackgroundColor ( me : mutable ;
262 Type : TypeOfColor; V1, V2, V3 : Parameter );
264 ---Purpose: Defines the background colour of the view
266 -- the colour definition type,
267 -- and the three corresponding values.
269 SetBackgroundColor ( me : mutable ; Color : Color from Quantity );
271 ---Purpose: Defines the background colour of the view
273 -- the colour object.
275 SetBackgroundColor ( me : mutable ; Name : NameOfColor );
277 ---Purpose: Defines the background colour of the view
279 -- the colour name in the form Quantity_NOC_xxxx .
281 SetBgGradientColors ( me : mutable ;
282 Color1 : Color from Quantity;
283 Color2 : Color from Quantity;
284 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
285 update : Boolean from Standard = Standard_False );
287 ---Purpose: Defines the gradient background colours of the view
289 -- two colour objects,
290 -- and fill method (horizontal by default)
292 SetBgGradientColors ( me : mutable ;
293 Color1 : NameOfColor;
294 Color2 : NameOfColor;
295 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
296 update : Boolean from Standard = Standard_False );
298 ---Purpose: Defines the gradient background colours of the view
300 -- two colour names in the form Quantity_NOC_xxxx,
301 -- and fill method (horizontal by default)
303 SetBgGradientStyle( me : mutable ;
304 AMethod : GradientFillMethod from Aspect = Aspect_GFM_HOR;
305 update : Boolean from Standard = Standard_False);
307 ---Purpose: Defines the gradient background fill method of the view
309 SetBackgroundImage( me : mutable; FileName : CString from Standard;
310 FillStyle : FillMethod from Aspect = Aspect_FM_CENTERED;
311 update : Boolean from Standard = Standard_False );
313 ---Purpose: Defines the background texture of the view
315 --- texture image file name,
316 --- and fill method (centered by default)
318 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
319 update : Boolean from Standard = Standard_False );
321 ---Purpose: Defines the textured background fill method of the view
323 SetAxis ( me : mutable; X,Y,Z : Coordinate ;
324 Vx,Vy,Vz : Parameter )
326 ---Purpose: Definition of an axis from its origin and
328 -- This will be the current axis for rotations and movements.
329 raises BadValue from Viewer;
330 ---Purpose: Warning! raises BadValue from Viewer if the vector normal is NULL. .
332 SetShadingModel ( me : mutable; Model : TypeOfShadingModel );
334 ---Purpose: Defines the shading model for the
335 -- visualisation ZBUFFER mode.
336 -- Various models are available.
338 SetSurfaceDetail(me : mutable; SurfaceDetail : TypeOfSurfaceDetail);
340 ---Purpose: select the kind of rendering for texture mapping
341 -- no texture mapping by default
343 SetTextureEnv(me : mutable; ATexture : TextureEnv from Graphic3d);
345 ---Purpose: set the environment texture to use
346 -- no environment texture by default
348 SetVisualization ( me : mutable;
349 Mode : TypeOfVisualization from V3d );
351 ---Purpose: Defines the visualisation mode in the view.
353 SetAntialiasingOn ( me : mutable );
355 ---Purpose: Activates antialiasing in the view.
357 SetAntialiasingOff ( me : mutable );
359 ---Purpose: Desactivates antialiasing in the view.
361 SetZClippingDepth ( me : mutable; Depth : Length );
363 ---Purpose: Defines the depth of the medium clipping plane.
365 SetZClippingWidth ( me : mutable; Width : Length )
367 ---Purpose: Defines the thicknes around the medium clippling plane. .
368 raises BadValue from Viewer;
369 -- If the thickness is <= 0
371 SetZClippingType ( me : mutable; Type : TypeOfZclipping );
373 ---Purpose: Defines the type of ZClipping.
375 SetZCueingDepth ( me : mutable; Depth : Length );
377 ---Purpose: Defines the depth of the medium plane.
379 SetZCueingWidth ( me : mutable; Width : Length )
381 ---Purpose: Defines the thickness around the medium plane.
382 raises BadValue from Viewer;
383 -- If thickness is <= 0
385 SetZCueingOn ( me : mutable );
387 ---Purpose: Activates ZCueing in the view.
389 SetZCueingOff ( me : mutable );
391 ---Purpose: Desactivates ZCueing in the view.
393 SetLightOn( me : mutable ; MyLight : Light from V3d )
395 ---Purpose: Activates MyLight in the view.
396 raises BadValue from Viewer;
397 -- If No More Light can be activated in MyView .
399 SetLightOn( me : mutable )
401 ---Purpose: Activates all the lights defined in this view.
402 raises BadValue from Viewer;
403 -- If No More Light can be activated in MyView .
405 SetLightOff( me : mutable ; MyLight : Light from V3d );
407 ---Purpose: Desactivate MyLight in this view.
409 SetLightOff( me : mutable );
411 ---Purpose: Deactivate all the Lights defined in this view.
413 IsActiveLight( me ; aLight: Light from V3d )
414 returns Boolean from Standard;
416 ---Purpose: Returns TRUE when the light is active in this view.
418 SetTransparency( me : mutable ; AnActivity : Boolean = Standard_False);
420 ---Purpose: Activate/Deactivate the transparency in this view.
422 SetPlaneOn( me : mutable ; MyPlane : Plane from V3d )
424 ---Purpose: Activates the clipping plane in this view.
425 raises BadValue from Viewer ;
426 ---Purpose: If No More Plane can be activated in MyView .
428 SetPlaneOn( me : mutable )
430 ---Purpose: Activate all the clipping planes defined in
432 raises BadValue from Viewer;
433 ---Purpose: If No More Plane can be activated in MyView .
435 SetPlaneOff( me : mutable ; MyPlane : Plane from V3d );
437 ---Purpose: Desactivates the clipping plane defined
440 SetPlaneOff( me : mutable );
442 ---Purpose: Deactivate all clipping planes defined
445 IsActivePlane( me ; aPlane: Plane from V3d )
446 returns Boolean from Standard;
448 ---Purpose: Returns TRUE when the plane is active in this view.
450 ---------------------------------------------------
452 ---------------------------------------------------
454 ZBufferTriedronSetup ( me : mutable;
455 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
456 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
457 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
458 SizeRatio : Real from Standard = 0.8;
459 AxisDiametr : Real from Standard = 0.05;
460 NbFacettes : Integer from Standard = 12)
463 ---Purpose: Customization of the ZBUFFER Triedron.
464 --- XColor,YColor,ZColor - colors of axis
465 --- SizeRatio - ratio of decreasing of the trihedron size when its phisical
466 --- position comes out of the view
467 --- AxisDiametr - diameter relatively to axis length
468 --- NbFacettes - number of facettes of cylinders and cones
470 TriedronDisplay ( me : mutable;
471 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
472 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
473 AScale : Real from Standard = 0.02;
474 AMode : TypeOfVisualization from V3d = V3d_WIREFRAME )
477 ---Purpose: Display of the Triedron.
478 --- Initialize position, color and length of Triedron axes.
479 --- The scale is a percent of the window width.
482 TriedronErase ( me : mutable )
485 ---Purpose: Erases the Triedron.
488 TriedronEcho ( me : mutable;
489 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
492 ---Purpose: Highlights the echo zone of the Triedron.
495 ---------------------------------
496 ---Category: Graduated trihedron
497 ---------------------------------
499 GetGraduatedTrihedron(me;
501 xname, yname, zname : out ExtendedString from TCollection;
503 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
505 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
507 drawgrid : out Boolean from Standard;
509 drawaxes : out Boolean from Standard;
510 -- Number of splits along axes --
511 nbx, nby, nbz : out Integer from Standard;
512 -- Offset for drawing values --
513 xoffset, yoffset, zoffset : out Integer from Standard;
514 -- Offset for drawing names of axes --
515 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
517 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
518 -- Length of tickmarks --
519 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
521 gridcolor : out Color from Quantity;
522 -- Colors of axis names --
523 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
524 -- Colors of axis and values --
525 xcolor, ycolor, zcolor : out Color from Quantity;
526 -- Name of font for names of axes --
527 fontOfNames : out AsciiString from TCollection;
528 -- Style of names of axes --
529 styleOfNames : out FontAspect from OSD;
530 -- Size of names of axes --
531 sizeOfNames : out Integer from Standard;
532 -- Name of font for values --
533 fontOfValues : out AsciiString from TCollection;
534 -- Style of values --
535 styleOfValues : out FontAspect from OSD;
537 sizeOfValues : out Integer from Standard)
538 ---Purpose: Returns data of a graduated trihedron.
541 GraduatedTrihedronDisplay(me : mutable;
543 xname : ExtendedString from TCollection = "X";
544 yname : ExtendedString from TCollection = "Y";
545 zname : ExtendedString from TCollection = "Z";
547 xdrawname : Boolean from Standard = Standard_True;
548 ydrawname : Boolean from Standard = Standard_True;
549 zdrawname : Boolean from Standard = Standard_True;
551 xdrawvalues : Boolean from Standard = Standard_True;
552 ydrawvalues : Boolean from Standard = Standard_True;
553 zdrawvalues : Boolean from Standard = Standard_True;
555 drawgrid : Boolean from Standard = Standard_True;
557 drawaxes : Boolean from Standard = Standard_True;
558 -- Number of splits along axes --
559 nbx : Integer from Standard = 3;
560 nby : Integer from Standard = 3;
561 nbz : Integer from Standard = 3;
562 -- Offset for drawing values --
563 xoffset : Integer from Standard = 10;
564 yoffset : Integer from Standard = 10;
565 zoffset : Integer from Standard = 10;
566 -- Offset for drawing names of axes --
567 xaxisoffset : Integer from Standard = 30;
568 yaxisoffset : Integer from Standard = 30;
569 zaxisoffset : Integer from Standard = 30;
571 xdrawtickmarks : Boolean from Standard = Standard_True;
572 ydrawtickmarks : Boolean from Standard = Standard_True;
573 zdrawtickmarks : Boolean from Standard = Standard_True;
574 -- Length of tickmarks --
575 xtickmarklength : Integer from Standard = 10;
576 ytickmarklength : Integer from Standard = 10;
577 ztickmarklength : Integer from Standard = 10;
579 gridcolor : Color from Quantity = Quantity_NOC_WHITE;
581 xnamecolor : Color from Quantity = Quantity_NOC_RED;
583 ynamecolor : Color from Quantity = Quantity_NOC_GREEN;
585 znamecolor : Color from Quantity = Quantity_NOC_BLUE1;
586 -- X color of axis and values --
587 xcolor : Color from Quantity = Quantity_NOC_RED;
588 -- Y color of axis and values --
589 ycolor : Color from Quantity = Quantity_NOC_GREEN;
590 -- Z color of axis and values --
591 zcolor : Color from Quantity = Quantity_NOC_BLUE1;
592 -- Name of font for names of axes --
593 fontOfNames : AsciiString from TCollection = "Arial";
594 -- Style of names of axes --
595 styleOfNames : FontAspect from OSD = OSD_FA_Bold;
596 -- Size of names of axes --
597 sizeOfNames : Integer from Standard = 12;
598 -- Name of font for values --
599 fontOfValues : AsciiString from TCollection = "Arial";
600 -- Style of values --
601 styleOfValues : FontAspect from OSD = OSD_FA_Regular;
603 sizeOfValues : Integer from Standard = 12)
604 ---Purpose: Displays a graduated trihedron.
607 GraduatedTrihedronErase(me : mutable)
608 ---Purpose: Erases a graduated trihedron from the view.
611 ---------------------------------------------------
612 -- Color Scale methods
613 ---------------------------------------------------
615 SetLayerMgr(me : mutable; aMgr : LayerMgr from V3d);
617 ColorScaleDisplay(me : mutable);
619 ColorScaleErase(me : mutable);
621 ColorScaleIsDisplayed(me)
622 returns Boolean from Standard;
625 returns ColorScale from Aspect;
627 --------------------------------------------------------
628 ---Category: Methods to modify the Projection of the view
629 --------------------------------------------------------
631 SetFront(me: mutable);
633 ---Purpose: modify the Projection of the view perpendicularly to
634 -- the privileged plane of the viewer.
636 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
637 Start : Boolean = Standard_True )
639 ---Purpose: Rotates the eye about the coordinate system of
640 -- reference of the screen
641 -- for which the origin is the view point of the projection,
642 -- with a relative angular value in RADIANS with respect to
643 -- the initial position expressed by Start = Standard_True
644 raises BadValue from Viewer;
645 ---Purpose: Warning! raises BadValue from Viewer
646 -- If the eye, the view point, or the high point are
647 -- aligned or confused.
649 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
651 Start : Boolean = Standard_True )
653 ---Purpose: Rotates the eye about the coordinate system of
654 -- reference of the screen
655 -- for which the origin is Gravity point {X,Y,Z},
656 -- with a relative angular value in RADIANS with respect to
657 -- the initial position expressed by Start = Standard_True
658 raises BadValue from Viewer;
659 ---Purpose: If the eye, the view point, or the high point are
660 -- aligned or confused.
662 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
664 Start : Boolean = Standard_True );
666 ---Purpose: Rotates the eye about one of the coordinate axes of
667 -- of the view for which the origin is the Gravity point{X,Y,Z}
668 -- with an relative angular value in RADIANS with
669 -- respect to the initial position expressed by
670 -- Start = Standard_True
672 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
673 Start : Boolean = Standard_True ) ;
675 ---Purpose: Rotates the eye about one of the coordinate axes of
676 -- of the view for which the origin is the view point of the
677 -- projection with an relative angular value in RADIANS with
678 -- respect to the initial position expressed by
679 -- Start = Standard_True
681 Rotate ( me : mutable ; Angle : PlaneAngle ;
682 Start : Boolean = Standard_True );
684 ---Purpose: Rotates the eye around the current axis a relative
685 -- angular value in RADIANS with respect to the initial
686 -- position expressed by Start = Standard_True
688 Move ( me : mutable ; Dx,Dy,Dz : Length ;
689 Start : Boolean = Standard_True )
691 ---Purpose: Movement of the eye parallel to the coordinate system
692 -- of reference of the screen a distance relative to the
693 -- initial position expressed by Start = Standard_True.
694 raises BadValue from Viewer;
695 -- If the eye, the view point, or the high point are
696 -- aligned or confused.
698 Move ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
699 Start : Boolean = Standard_True )
701 ---Purpose: Movement of the eye parallel to one of the axes of the
702 -- coordinate system of reference of the view a distance
703 -- relative to the initial position expressed by
704 -- Start = Standard_True.
705 raises BadValue from Viewer;
706 -- If the eye, view point, or high point are aligned or confused.
708 Move ( me : mutable ; Length : Length ;
709 Start : Boolean = Standard_True )
711 ---Purpose: Movement of the eye parllel to the current axis
712 -- a distance relative to the initial position
713 -- expressed by Start = Standard_True
714 raises BadValue from Viewer;
715 -- If the eye, view point, or high point are aligned or confused.
717 Translate ( me : mutable ; Dx,Dy,Dz : Length ;
718 Start : Boolean = Standard_True )
720 ---Purpose: Movement of the ye and the view point parallel to the
721 -- frame of reference of the screen a distance relative
722 -- to the initial position expressed by
723 -- Start = Standard_True
724 raises BadValue from Viewer;
725 -- If the eye, view point, or high point are aligned or confused.
727 Translate ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
728 Start : Boolean = Standard_True );
730 ---Purpose: Movement of the eye and the view point parallel to one
731 -- of the axes of the fame of reference of the view a
732 -- distance relative to the initial position
733 -- expressed by Start = Standard_True
735 Translate ( me : mutable ; Length : Length ;
736 Start : Boolean = Standard_True );
738 ---Purpose: Movement of the eye and view point parallel to
739 -- the current axis a distance relative to the initial
740 -- position expressed by Start = Standard_True
742 Place (me: mutable; x,y: Integer from Standard;
743 aZoomFactor: Factor from Quantity = 1)
745 ---Purpose: places the point of the view corresponding
746 -- at the pixel position x,y at the center of the window
747 -- and updates the view.
750 Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
751 Start : Boolean = Standard_True )
753 ---Purpose: Rotation of the view point around the frame of reference
754 -- of the screen for which the origin is the eye of the
755 -- projection with a relative angular value in RADIANS
756 -- with respect to the initial position expressed by
757 -- Start = Standard_True
758 raises BadValue from Viewer;
759 -- If the eye, view point, or high point are aligned or confused.
761 Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
762 Start : Boolean = Standard_True )
765 ---Purpose: Rotation of the view point around one of the axes of the
766 -- frame of reference of the view for which the origin is
767 -- the eye of the projection with an angular value in
768 -- RADIANS relative to the initial position expressed by
769 -- Start = Standard_True
771 Turn ( me : mutable ; Angle : PlaneAngle ;
772 Start : Boolean = Standard_True );
774 ---Purpose: Rotation of the view point around the current axis an
775 -- angular value in RADIANS relative to the initial
776 -- position expressed by Start = Standard_True
778 SetTwist ( me : mutable ; Angle : PlaneAngle )
780 ---Purpose: Defines the angular position of the high point of
781 -- the reference frame of the view with respect to the
782 -- Y screen axis with an absolute angular value in
784 raises BadValue from Viewer;
785 -- If the eye, view point, or high point are aligned or confused.
787 SetEye( me : mutable ; X,Y,Z : Coordinate )
789 ---Purpose: Defines the position of the eye..
790 raises BadValue from Viewer ;
791 -- If the eye, view point, or high point are aligned or confused.
793 SetDepth( me : mutable ; Depth : Length )
795 ---Purpose: Defines the Depth of the eye from the view point
796 -- without update the projection .
797 raises BadValue from Viewer ;
798 -- If the Depth is <= 0.
800 SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
802 ---Purpose: Defines the orientation of the projection.
803 raises BadValue from Viewer ;
804 -- If the eye, view point, or high point are aligned or confused.
806 SetProj( me : mutable ; Orientation : TypeOfOrientation )
808 ---Purpose: Defines the orientation of the projection .
809 raises BadValue from Viewer ;
810 -- If the eye, view point, or high point are aligned or confused.
813 SetAt( me : mutable ; X,Y,Z : Coordinate )
815 ---Purpose: Defines the position of the view point.
816 raises BadValue from Viewer ;
817 -- If the eye, view point, or high point are aligned or confused.
819 SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
821 ---Purpose: Defines the orientation of the high point.
822 raises BadValue from Viewer ;
823 -- If the eye, view point, or high point are aligned or confused.
825 SetUp( me : mutable ; Orientation : TypeOfOrientation )
827 ---Purpose: Defines the orientation(SO) of the high point.
828 raises BadValue from Viewer ;
829 -- If the eye, view point, or high point are aligned or confused.
831 SetViewOrientation ( me : mutable; VO : ViewOrientation from Visual3d );
833 ---Purpose: Modifies the orientation of the view.
835 SetViewOrientationDefault( me : mutable );
837 ---Purpose: Saves the current state of the orientation of the view
838 -- which will be the return state at ResetViewOrientation.
840 ResetViewOrientation ( me : mutable );
842 ---Purpose: Resets the orientation of the view.
845 --------------------------------------------------------
846 ---Category: Methods to modify the Mapping of the view
847 --------------------------------------------------------
849 Panning ( me : mutable ; Dx , Dy : Length ;
850 aZoomFactor : Factor from Quantity = 1;
851 Start : Boolean = Standard_True )
853 ---Purpose: translates the center of the view and zooms the view.
855 raises BadValue from Viewer ;
857 SetCenter ( me : mutable ; Xc , Yc : Coordinate )
859 ---Purpose: Defines the centre of the view.
861 raises BadValue from Viewer ;
862 -- If one of the dimensions of the projection is NULL.
864 SetCenter ( me : mutable ; X,Y: Integer from Standard)
866 ---Purpose: Defines the centre of the view from a pixel position.
868 raises BadValue from Viewer ;
869 -- If one of the dimensions of the projection is NULL.
871 SetSize ( me : mutable ; Size : Length )
873 ---Purpose: Defines the size of the view while preserving the
874 -- center and height/width ratio of the window supporting
876 -- NOTE than the Depth of the View is NOT modified .
877 raises BadValue from Viewer ;
878 -- If the size of the view is <= 0
880 SetZSize ( me : mutable ; Size : Length )
882 ---Purpose: Defines the Depth size of the view
883 -- Front Plane will be set to Size/2.
884 -- Back Plane will be set to -Size/2.
885 -- Any Object located Above the Front Plane or
886 -- behind the Back Plane will be Clipped .
887 -- NOTE than the XY Size of the View is NOT modified .
888 raises BadValue from Viewer ;
889 -- If the size of the view is <= 0
891 SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
893 ---Purpose: Zooms the view by a factor relative to the initial
894 -- value expressed by Start = Standard_True
896 raises BadValue from Viewer ;
897 -- If the zoom coefficient is <= 0
899 SetScale ( me : mutable ; Coef : Factor )
901 ---Purpose: Zooms the view by a factor relative to the value
902 -- initialised by SetViewMappingDefault().
904 raises BadValue from Viewer ;
905 -- If the zoom coefficient is <= 0
907 SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
909 ---Purpose: Sets anisotropic (axial) scale factors <Sx>, <Sy>, <Sz> for view <me>.
910 -- Anisotropic scaling operation is performed through multiplying
911 -- the current view orientation matrix by a scaling matrix:
917 raises BadValue from Viewer ;
918 -- If the one of factors <= 0
920 FitAll ( me : mutable ; Coef : Coefficient = 0.01;
921 FitZ: Boolean from Standard = Standard_False; update : Boolean from Standard = Standard_True )
923 ---Purpose: Automatic zoom/panning. Objects in the view are visualised
924 -- so as to occupy the maximum space while respecting the
925 -- margin coefficient and the initial height /width ratio.
926 -- NOTE than the original Z size of the view is NOT modified .
927 raises BadValue from Viewer ;
928 -- If the margin coefficient is <0 ou >= 1 or
931 ZFitAll ( me : mutable ; Coef : Coefficient = 1.0 )
933 ---Purpose: Automatic Depth Panning. Objects visible in the view are
934 -- visualised so as to occupy the maximum Z amount of space
935 -- while respecting the margin coefficient .
936 -- NOTE than the original XY size of the view is NOT modified .
937 raises BadValue from Viewer ;
938 -- If the margin coefficient is <0 ou or
939 -- If No Objects are displayed in the view
941 DepthFitAll( me : mutable ; Aspect : Coefficient = 0.01;
942 Margin : Coefficient = 0.01 );
944 ---Purpose: Adjusts the viewing volume so as not to clip the displayed objects by front and back
945 -- and back clipping planes. Also sets depth value automatically depending on the
946 -- calculated Z size and Aspect parameter.
947 -- NOTE than the original XY size of the view is NOT modified .
949 FitAll ( me : mutable ; Umin, Vmin, Umax, Vmax : Coordinate )
951 ---Purpose: Centres the defined projection window so that it occupies
952 -- the maximum space while respecting the initial
953 -- height/width ratio.
954 -- NOTE than the original Z size of the view is NOT modified .
955 raises BadValue from Viewer;
956 -- If the defined projection window has zero size.
959 WindowFit ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer)
961 ---Purpose: Centres the defined PIXEL window so that it occupies
962 -- the maximum space while respecting the initial
963 -- height/width ratio.
964 -- NOTE than the original Z size of the view is NOT modified .
965 raises BadValue from Viewer
966 -- If the defined projection window has zero size.
969 SetViewingVolume ( me : mutable ; Left, Right, Bottom, Top, ZNear, ZFar : Real from Standard)
971 ---Purpose: Sets Z and XY size of the view according to given values
972 -- with respecting the initial view depth (eye position)
973 raises BadValue from Viewer;
974 -- If the ZNear<0, ZFar<0 or ZNear>=Zfar.
976 SetViewMapping ( me : mutable; VM : ViewMapping from Visual3d );
978 ---Purpose: Modifies the mapping of the view.
980 SetViewMappingDefault( me : mutable );
982 ---Purpose: Saves the current view mapping. This will be the
983 -- state returned from ResetViewmapping.
985 ResetViewMapping ( me : mutable );
987 ---Purpose: Resets the centring of the view.
990 Reset ( me : mutable; update : Boolean from Standard = Standard_True );
992 ---Purpose: Resets the centring and the orientation of the view
994 ---------------------------------------------------
995 ---Category: Inquire methods
996 ---------------------------------------------------
998 Convert( me ; Vp : Integer ) returns Length
1000 ---Purpose : Converts the PIXEL value
1001 -- to a value in the projection plane.
1002 raises UnMapped from V3d;
1003 -- If the view is not mapped on the window.
1005 Convert( me ; Xp,Yp : Integer ; Xv,Yv : out Coordinate )
1007 ---Purpose : Converts the point PIXEL into a point projected
1008 -- in the reference frame of the projection plane.
1009 raises UnMapped from V3d;
1010 -- If the view is not mapped on the window.
1012 Convert( me ; Vv : Length ) returns Integer
1014 ---Purpose : Converts tha value of the projection plane into
1016 raises UnMapped from V3d;
1017 -- If the view is not mapped on the window.
1019 Convert( me ; Xv,Yv : Coordinate ; Xp,Yp : out Integer )
1021 ---Purpose : Converts the point defined in the reference frame
1022 -- of the projection plane into a point PIXEL.
1023 raises UnMapped from V3d;
1024 -- If the view is not mapped on the window.
1026 Convert( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate)
1028 ---Purpose : Converts the projected point into a point
1029 -- in the reference frame of the view corresponding
1030 -- to the intersection with the projection plane
1031 -- of the eye/view point vector.
1032 raises UnMapped from V3d;
1033 -- If the view is not mapped on the window.
1035 ConvertWithProj( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate ; Vx,Vy,Vz : out Parameter)
1037 ---Purpose : Converts the projected point into a point
1038 -- in the reference frame of the view corresponding
1039 -- to the intersection with the projection plane
1040 -- of the eye/view point vector and returns the
1041 -- projection ray for further computations.
1042 raises UnMapped from V3d;
1043 -- If the view is not mapped on the window.
1045 ConvertToGrid( me ; Xp,Yp : Integer ; Xg,Yg,Zg : out Coordinate)
1047 ---Purpose : Converts the projected point into the nearest grid point
1048 -- in the reference frame of the view corresponding
1049 -- to the intersection with the projection plane
1050 -- of the eye/view point vector and display the grid marker.
1051 -- Warning: When the grid is not active the result is identical
1052 -- to the above Convert() method.
1054 -- 1) Enable the grid echo display
1055 -- myViewer->SetGridEcho(Standard_True);
1056 -- 2) When application receive a move event :
1057 -- 2.1) Check if any object is detected
1058 -- if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
1059 -- 2.2) Check if the grid is active
1060 -- if( myViewer->Grid()->IsActive() ) {
1061 -- 2.3) Display the grid echo and gets the grid point
1062 -- myView->ConvertToGrid(x,y,X,Y,Z);
1063 -- 2.4) Else this is the standard case
1064 -- } else myView->Convert(x,y,X,Y,Z);
1065 raises UnMapped from V3d;
1066 -- If the view is not mapped on the window.
1068 ConvertToGrid( me ; X,Y,Z : Coordinate ; Xg,Yg,Zg : out Coordinate)
1070 ---Purpose : Converts the point into the nearest grid point
1071 -- and display the grid marker.
1072 ---Warning: When the grid is not active the result is identical
1073 -- to the previous point.
1074 raises UnMapped from V3d;
1075 -- If the view is not mapped on the window.
1077 Convert( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1079 ---Purpose : Projects the point defined in the reference frame of
1080 -- the view into the projected point in the associated window.
1082 -- RefToPix( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1083 -- ---Purpose : Projects the point defined in the reference frame of
1084 -- -- the view into the projected point in the associated window.
1085 -- Obsolete : Use Convert(X,Y,Z,Xp,Yp);
1087 -- PixToRef( me ; Xp,Yp : Integer; X,Y,Z : out Coordinate) ;
1088 -- ---Purpose : Converts the projected point in the associated window of
1089 -- -- the view into the point defined in the reference frame.
1090 -- Obsolete : Use Convert(Xp,Yp,X,Y,Z);
1092 Project( me ; X,Y,Z : Coordinate; Xp,Yp : out Coordinate) ;
1094 ---Purpose : Converts the point defined in the user space of
1095 -- the view to the projected view plane point at z 0.
1097 BackgroundColor( me; Type : TypeOfColor ; V1, V2, V3 : out Parameter) ;
1099 ---Purpose: Returns the Background color values of the view
1100 -- depending of the color Type.
1102 BackgroundColor( me ) returns Color from Quantity;
1104 ---Purpose: Returns the Background color object of the view.
1106 GradientBackgroundColors( me;
1107 Color1 : out Color from Quantity;
1108 Color2 : out Color from Quantity) ;
1110 ---Purpose: Returns the gradient background colour objects of the view.
1112 GradientBackground ( me ) returns GradientBackground from Aspect;
1114 ---Purpose: Returns the gradient background of the view.
1116 Scale ( me ) returns Factor ;
1118 ---Purpose: Returns the current value of the zoom expressed with
1119 -- respect to SetViewMappingDefault().
1121 AxialScale ( me ; Sx, Sy, Sz : out Real from Standard ) ;
1123 ---Purpose: Returns the current values of the anisotropic (axial) scale factors.
1125 Center ( me; Xc,Yc : out Coordinate );
1127 ---Purpose: Returns the centre of the view.
1129 Size ( me; Width, Height : out Length );
1131 ---Purpose: Returns the height and width of the view.
1133 ZSize ( me ) returns Real ;
1135 ---Purpose: Returns the Depth of the view .
1137 Eye( me ; X,Y,Z : out Coordinate );
1139 ---Purpose: Returns the position of the eye.
1141 FocalReferencePoint (me ; X,Y,Z : out Coordinate );
1143 ---Purpose: Returns the position of point which emanating the
1146 ProjReferenceAxe( me ; Xpix,Ypix : Integer ;
1147 XP,YP,ZP,VX,VY,VZ : out Coordinate );
1149 ---Purpose: Returns the coordinate of the point (Xpix,Ypix)
1150 -- in the view (XP,YP,ZP), and the projection vector of the
1151 -- view passing by the point (for PerspectiveView).
1153 Depth( me ) returns Length ;
1155 ---Purpose: Returns the Distance between the Eye and View Point.
1157 Proj( me ; Vx,Vy,Vz : out Parameter );
1159 ---Purpose: Returns the projection vector.
1161 At( me ; X,Y,Z : out Coordinate );
1163 ---Purpose: Returns the position of the view point.
1165 Up( me ; Vx,Vy,Vz : out Parameter );
1167 ---Purpose: Returns the vector giving the position of the high point.
1169 Twist( me ) returns PlaneAngle ;
1171 ---Purpose: Returns in RADIANS the orientation of the view around
1172 -- the visual axis measured from the Y axis of the screen.
1174 ShadingModel ( me ) returns TypeOfShadingModel ;
1176 ---Purpose: Returns the current shading model.
1178 SurfaceDetail(me) returns TypeOfSurfaceDetail;
1180 -- purpose: returns the current SurfaceDetail mode
1182 TextureEnv(me) returns TextureEnv from Graphic3d;
1184 -- purpose: return the current environment texture used
1186 Transparency(me) returns Boolean from Standard;
1188 ---Purpose: Returns the transparency activity.
1190 Visualization ( me ) returns TypeOfVisualization from V3d;
1192 ---Purpose: Returns the current visualisation mode.
1194 Antialiasing ( me ) returns Boolean;
1196 ---Purpose: Indicates if the antialiasing is active (True) or
1197 -- inactive (False).
1199 ZCueing ( me; Depth, Width : out Length ) returns Boolean ;
1201 ---Purpose: Returns activity and information on the Zcueing.
1202 -- <Depth> : Depth of plane.
1203 -- <Width> : Thickness around the plane.
1205 ZClipping ( me; Depth, Width : out Length ) returns TypeOfZclipping;
1207 ---Purpose: Returns current information on the ZClipping.
1208 -- <Depth> : Depth of plane.
1209 -- <Width> : Thickness around the plane.
1210 -- <TypeOfZclipping> : "BACK"
1215 IfMoreLights( me ) returns Boolean;
1217 ---Purpose: Returns True if One light more can be
1218 -- activated in this View.
1220 InitActiveLights(me: mutable);
1222 ---Purpose: initializes an iteration on the active Lights.
1224 MoreActiveLights (me) returns Boolean from Standard;
1226 ---Purpose: returns true if there are more active Light(s) to return.
1228 NextActiveLights (me: mutable);
1230 ---Purpose : Go to the next active Light
1231 -- (if there is not, ActiveLight will raise an exception)
1233 ActiveLight(me) returns mutable Light from V3d;
1236 IfMorePlanes( me ) returns Boolean;
1238 ---Purpose: Returns True if One clipping plane more can be
1239 -- activated in this View.
1241 InitActivePlanes(me: mutable);
1243 ---Purpose: initializes an iteration on the active Planes.
1245 MoreActivePlanes (me) returns Boolean from Standard;
1247 ---Purpose: returns true if there are more active Plane(s) to return.
1249 NextActivePlanes (me: mutable);
1251 ---Purpose : Go to the next active Plane
1252 -- (if there is not, ActivePlane will raise an exception)
1254 ActivePlane(me) returns mutable Plane from V3d;
1257 Viewer ( me ) returns mutable Viewer from V3d;
1259 ---Purpose: Returns the viewer in which the view has been created.
1261 IfWindow ( me ) returns Boolean;
1263 ---Purpose: Returns True if MyView is associated with a window .
1265 Window ( me ) returns mutable Window from Aspect
1267 ---Purpose: Returns the Aspect Window associated with the view.
1268 raises BadValue from Viewer;
1269 -- If MyView is not associated with a window
1271 Type( me ) returns TypeOfView from V3d;
1273 ---Purpose: Returns the Type of the View
1275 Pan ( me : mutable; Dx, Dy: Integer from Standard;
1276 aZoomFactor: Factor from Quantity = 1);
1278 ---Purpose: translates the center of the view and zooms the view.
1279 -- and updates the view.
1281 Zoom ( me : mutable; X1 , Y1 , X2 , Y2 : Integer from Standard)
1284 ---Purpose: Zoom the view according to a zoom factor computed
1285 -- from the distance between the 2 mouse position <X1,Y1>,<X2,Y2>
1287 Zoom ( me: mutable; X,Y: Integer from Standard)
1290 ---Purpose: Zoom the view according to a zoom factor computed
1291 -- from the distance between the last and new mouse position <X,Y>
1293 StartZoomAtPoint(me : mutable;
1294 xpix, ypix : Integer from Standard);
1296 ---Purpose: Defines the point (pixel) of zooming (for the method ZoomAtPoint()).
1298 ZoomAtPoint(me : mutable;
1299 mouseStartX, mouseStartY, mouseEndX, mouseEndY : Integer from Standard);
1301 ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
1303 AxialScale ( me: mutable; Dx, Dy: Integer from Standard; Axis: TypeOfAxe from V3d );
1305 ---Purpose: Performs anisotropic scaling of <me> view along the given <Axis>.
1306 -- The scale factor is calculated on a basis of
1307 -- the mouse pointer displacement <Dx,Dy>.
1308 -- The calculated scale factor is then passed to SetAxialScale(Sx, Sy, Sz) method.
1310 StartRotation(me : mutable ; X,Y :Integer from Standard;
1311 zRotationThreshold: Ratio from Quantity = 0.0);
1313 ---Purpose: Begin the rotation of the view arround the screen axis
1314 -- according to the mouse position <X,Y>.
1315 -- Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
1316 -- factor is > 0 soon the distance from the start point and the center
1317 -- of the view is > (medium viewSize * <zRotationThreshold> ).
1318 -- Generally a value of 0.4 is usable to rotate around XY screen axis
1319 -- inside the circular treshold area and to rotate around Z screen axis
1320 -- outside this area.
1322 Rotation(me:mutable; X,Y :Integer from Standard);
1324 ---Purpose: Continues the rotation of the view
1325 -- with an angle computed from the last and new mouse position <X,Y>.
1327 FitAll ( me : mutable ; aWindow: Window from Aspect;
1328 Umin, Vmin, Umax, Vmax : Coordinate )
1331 ---Purpose: Change the scale factor and position of the view
1332 -- such as the bounding box <Umin, Vmin, Umax, Vmax> is contains
1336 -----------------------------------------
1337 ---Category: Private or Protected methods
1338 -----------------------------------------
1340 SetFocale( me : mutable ; Focale : Length )
1341 ---Purpose: Change View Plane Distance for Perspective Views
1342 raises TypeMismatch from Standard
1343 ---Purpose: Warning! raises TypeMismatch from Standard if the view
1344 -- is not a perspective view.
1347 Focale( me ) returns Length;
1348 ---Purpose: Returns the View Plane Distance for Perspective Views
1350 View ( me) returns mutable View from Visual3d is static ;
1352 ---Purpose: Returns the associated Visual3d view.
1354 ViewMapping ( me ) returns ViewMapping from Visual3d is static;
1356 ---Purpose: Returns the current mapping of the view.
1358 ViewOrientation ( me ) returns ViewOrientation from Visual3d is static;
1360 ---Purpose: Returns the current orientation of the view.
1362 ScreenAxis( myclass ; Vpn,Vup : Vector from Graphic3d ;
1363 Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
1364 returns Boolean is private ;
1365 ---Purpose: Determines the screen axes in the reference
1366 -- framework of the view.
1368 InitMatrix ( myclass ; Matrix : out Array2OfReal from TColStd ) is private ;
1371 Left, Right : Array2OfReal from TColStd ;
1372 Matrix : out Array2OfReal from TColStd )
1373 returns Boolean from Standard is private ;
1375 RotAxis( myclass ; Vrp : Vertex from Graphic3d ;
1376 Axe : Vector from Graphic3d ; Angle : PlaneAngle ;
1377 Matrix : out Array2OfReal from TColStd ) is private ;
1378 ---Purpose: Determines the rotation matrice around an axis
1379 -- for a given angle.
1381 TrsPoint( myclass ; P : Vertex from Graphic3d ;
1382 Matrix : Array2OfReal from TColStd )
1383 returns Vertex from Graphic3d is private ;
1384 ---Purpose: Transforms the point P according to the matrice Matrix .
1386 TrsPoint( myclass ; V : Vector from Graphic3d ;
1387 Matrix : Array2OfReal from TColStd )
1388 returns Vector from Graphic3d is private ;
1389 ---Purpose: Transforms the vector V according to the matrice Matrix .
1391 -----------------------------------------
1392 ---Category: TransientManager methods
1393 -----------------------------------------
1395 TransientManagerBeginDraw(me; DoubleBuffer: Boolean = Standard_False;
1396 RetainMode : Boolean = Standard_False)
1398 ---Purpose: Begins any graphics in the view <aView>
1399 -- Redraw any structured graphics in the back buffer before
1400 -- if <DoubleBuffer> is TRUE.
1401 -- Restore the front buffer from the back before
1402 -- if <DoubleBuffer> is FALSE.
1403 -- if <RetainMode> is TRUE.
1404 -- the graphic managed itself exposure,resizing ...
1405 -- if <RetainMode> is FALSE.
1406 -- the application must managed itself exposure,resizing ...
1408 returns Boolean from Standard;
1410 TransientManagerClearDraw(me);
1412 ---Purpose: Clear all transient graphics in the view <aView>
1415 TransientManagerBeginAddDraw(me)
1417 ---Purpose: Begins any add graphics in the view <aView>
1418 -- Redraw any structured graphics in the back buffer before
1419 -- the application must managed itself exposure,resizing ...
1420 -- Warning: Returns TRUE if transient drawing is enabled in
1421 -- the associated view.
1422 -- Returns FALSE ,if nothing works because something
1423 -- is wrong for the transient principle :
1425 returns Boolean from Standard;
1427 ---------------------------------------------------
1428 -- Category: Methods to modify the class definition
1430 ---------------------------------------------------
1432 SetAnimationModeOn ( me : mutable )
1435 ---Purpose: Activates animation mode.
1436 -- When the animation mode is activated in the view,
1437 -- all Graphic3d_Structure are stored in a graphic object.
1438 ---Category: Methods to modify the class definition
1440 SetAnimationModeOff ( me : mutable )
1443 ---Purpose: Deactivates the animation mode.
1444 ---Category: Methods to modify the class definition
1446 AnimationModeIsOn ( me )
1447 returns Boolean from Standard
1450 ---Purpose: Returns the activity of the animation mode.
1451 ---Category: Inquire methods
1453 SetAnimationMode ( me : mutable;
1454 anAnimationFlag : Boolean from Standard = Standard_True;
1455 aDegenerationFlag : Boolean from Standard = Standard_False
1458 ---Purpose : Enable/Disable animation/degeneration mode
1459 ---Category : Methods to modify the class definition
1461 AnimationMode ( me; isDegenerate: out Boolean from Standard )
1462 returns Boolean from Standard
1465 ---Purpose : Returns the animation and degenerate status.
1466 ---Category: Inquire methods
1468 ---------------------------------------------------
1469 -- Category: Methods to modify the class definition
1471 ---------------------------------------------------
1473 SetDegenerateModeOn ( me : mutable )
1476 ---Purpose: Activates degenerate mode.
1477 -- When the degenerate mode is activated in the view,
1478 -- all Graphic3d_Structure with the type TOS_COMPUTED
1479 -- displayed in this view are not computed.
1480 -- Warning: Obsolete method , use SetComputedMode()
1481 ---Category: Methods to modify the class definition
1483 SetDegenerateModeOff ( me : mutable )
1486 ---Purpose: Deactivates the degenerate mode.
1487 -- Category: Methods to modify the class definition
1488 -- Warning: if the computed mode has been disabled in the
1489 -- viewer the mode will remain degenerated.
1490 -- Warning: Obsolete method , use SetComputedMode()
1492 DegenerateModeIsOn ( me )
1493 returns Boolean from Standard
1496 ---Purpose: Returns the activity of the degenerate mode.
1497 ---Category: Inquire methods
1499 SetComputedMode ( me : mutable; aMode : Boolean from Standard )
1502 ---Purpose: Switches computed HLR mode in the view
1503 ---Category: Methods to modify the class definition
1506 returns Boolean from Standard
1509 ---Purpose: Returns the computed HLR mode state
1510 ---Category: Inquire methods
1512 MinMax ( me; Umin,Vmin, Umax,Vmax : out Coordinate ) returns Integer
1513 ---Purpose: Returns the objects number and the projection window
1514 -- of the objects contained in the view.
1517 MinMax ( me; Xmin,Ymin,Zmin, Xmax,Ymax,Zmax : out Coordinate )
1519 ---Purpose: Returns the objects number and the box encompassing
1520 -- the objects contained in the view
1523 Gravity ( me; X,Y,Z : out Coordinate ) returns Integer
1524 ---Purpose: Returns the Objects number and the gravity center
1525 -- of ALL viewable points in the view
1528 Init(me: mutable) is private;
1530 ---Category: for compatibility.
1532 WindowFitAll ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer);
1533 ---Purpose: idem than WindowFit
1535 SetPlotter ( me : mutable; aPlotter : Plotter from Graphic3d )
1536 ---Purpose: Set a plotter for plotting the contents of the view
1540 Plot ( me : mutable )
1541 ---Purpose: Create a 2D View for plotting the contents of the view
1542 raises BadValue from Viewer;
1543 -- if the plotter is undefined.
1545 Compute ( me; AVertex : Vertex from Graphic3d )
1546 returns Vertex from Graphic3d
1549 ---Purpose: Returns a new vertex when the grid is activated.
1551 SetGrid ( me : mutable;
1552 aPlane: Ax3 from gp;
1553 aGrid : Grid from Aspect )
1556 ---Purpose: Defines or Updates the definition of the
1558 ---Category: Methods to modify the class definition
1560 SetGridGraphicValues ( me : mutable;
1561 aGrid : Grid from Aspect )
1564 ---Purpose: Defines or Updates the graphic definition of the
1566 ---Category: Methods to modify the class definition
1568 SetGridActivity ( me : mutable;
1569 aFlag : Boolean from Standard )
1572 ---Purpose: Defines or Updates the activity of the
1574 ---Category: Methods to modify the class definition
1576 Tumble ( me : mutable;
1577 NbImages : Integer from Standard = 314;
1578 AnimationMode : Boolean from Standard = Standard_False )
1579 returns Real from Standard
1582 ---Purpose: Animates the view <me>
1583 -- Returns the number of images per second
1584 -- if <AnimationMode> is Standard_True, the animation mode
1587 ScreenCopy (me : mutable;
1588 aPlotterDriver : PlotterDriver from PlotMgt;
1589 fWhiteBackground : Boolean from Standard = Standard_True;
1590 aScale : Factor from Quantity = 1.0
1592 ---Purpose: dump the view
1595 theFile: CString from Standard;
1596 theBufferType : TypeOfImage from Image = Image_TOI_RGB )
1597 returns Boolean from Standard;
1599 ---Purpose: dump the full contents of the view at the same
1600 -- scale in the file <theFile>. The file name
1601 -- extension must be one of ".png",".bmp",".jpg",".gif".
1602 -- Returns FALSE when the dump has failed
1605 theFile : CString from Standard;
1606 theFormat : FormatOfSheetPaper from Aspect;
1607 theBufferType : TypeOfImage from Image = Image_TOI_RGB )
1608 returns Boolean from Standard;
1610 ---Purpose: dump the full contents of the view with a
1611 -- different scale according to the required sheet
1612 -- paper size (format) and the ratio
1613 -- width/height of the view.
1614 -- and returns FALSE when the dump has failed
1615 -- Warning : the file name extension must be one of
1616 -- ".png",".bmp",".jpg",".gif"
1617 -- but make becarefull about the time to dump and
1618 -- resulting file size especially for the A0 format.
1619 -- NOTE that you can use after any standard system utility
1620 -- for editing or sending the image file to a laser printer.
1621 -- (i.e: Microsoft Photo Editor on Windows system
1622 -- or Image Viewer on SUN system)
1624 Print (me; hPrnDC: Handle from Aspect = NULL;
1625 showDialog: Boolean = Standard_True;
1626 showBackground : Boolean = Standard_True;
1627 filename: CString = NULL;
1628 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH)
1629 returns Boolean from Standard is static;
1632 ---Purpose: print the contents of the view to printer with preview.
1633 -- <hPrnDC> : If you have already an PrinterDeviceContext (HDC),
1634 -- then you can pass it to the print routines.
1635 -- If you don't have an PrinterDeviceContext, then this parameter should
1637 -- <showDialog> : If hPrnDC == NULL, then you can force the print routines to
1638 -- open a Print Dialog box.
1639 -- If you want to do this, then set showDialog to TRUE
1640 -- If you don't want to see a dialog (only possible, if you have a hPrnDC
1641 -- or the dialog box was opened once before) then set <showDialog> to FALSE.
1642 -- <showBackground> : When set to FALSE then print the view without background color
1643 -- (background is white)
1644 -- else set to TRUE for printing with current background color.
1645 -- <filename>: If != NULL, then the view will be printed to a file.
1646 -- <printAlgorithm>: If you want to select the print algorithm, then you can
1647 -- specify one of existing algorithms: Aspect_PA_STRETCH, Aspect_PA_TILE.
1648 -- Returns Standard_True if the data is passed to the printer, otherwise
1649 -- Standard_False if the print operation failed. This might be related to
1650 -- insufficient memory or some internal errors. All this errors are
1651 -- indicated by the message boxes (on level of OpenGl_GraphicDriver).
1652 -- Warning: This function can reuse FBO assigned to the
1653 -- view on level of OpenGl_GraphicDriver; Please take it into account if
1654 -- you use it for your purposes;
1655 -- Warning: Works only under Windows.
1657 ToPixMap ( me : mutable;
1658 theWidth : Integer from Standard;
1659 theHeight : Integer from Standard;
1660 theBufferType : TypeOfImage from Image = Image_TOI_RGB;
1661 theForceCentered : Boolean from Standard = Standard_True )
1662 returns PixMap from Image;
1664 ---Purpose : dump the full contents of the view
1665 -- to a pixmap of pixel size <theWidth>*<theHeight> and
1666 -- buffer type <theBufferType>. If <theForceCentered> is true
1667 -- view scene will be centered.
1669 SetProjModel( me : mutable;
1670 amOdel: TypeOfProjectionModel from V3d = V3d_TPM_SCREEN )
1673 ---Purpose : Manages projection model
1676 returns TypeOfProjectionModel from V3d
1679 ---Purpose : Returns the current projection model
1681 SetBackFacingModel ( me : mutable;
1682 aModel : TypeOfBackfacingModel from V3d = V3d_TOBM_AUTOMATIC)
1685 ---Purpose : Manages display of the back faces
1686 -- When <aModel> is TOBM_AUTOMATIC the object backfaces
1687 -- are displayed only for surface objects and
1688 -- never displayed for solid objects.
1689 -- this was the previous mode.
1690 -- <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces
1691 -- are always displayed both for surfaces or solids.
1692 -- <aModel> is TOBM_NEVER_DISPLAYED the object backfaces
1693 -- are never displayed.
1695 BackFacingModel ( me )
1696 returns TypeOfBackfacingModel from V3d
1699 ---Purpose : Returns current state of the back faces display
1701 EnableDepthTest( me; enable : Boolean from Standard = Standard_True )
1704 ---Purpose: turns on/off opengl depth testing
1706 IsDepthTestEnabled( me ) returns Boolean from Standard
1709 ---Purpose: returns the current state of the depth testing
1711 EnableGLLight( me; enable : Boolean from Standard = Standard_True )
1714 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1716 IsGLLightEnabled( me ) returns Boolean from Standard
1719 ---Purpose: returns the current state of the gl lighting
1720 -- currently used in triedron displaying
1725 MyType : TypeOfView from V3d is protected ;
1726 MyViewer : ViewerPointer from V3d ;
1727 MyActiveLights: ListOfTransient from V3d;
1728 MyActivePlanes: ListOfTransient from V3d;
1730 MyView : View from Visual3d is protected ;
1731 MyViewMapping : ViewMapping from Visual3d is protected ;
1732 MyViewOrientation : ViewOrientation from Visual3d ;
1733 MyViewContext : ContextView from Visual3d ;
1734 MyBackground: Background from Aspect ;
1735 MyGradientBackground: GradientBackground from Aspect ;
1736 MyDefaultViewAxis: Vector from Graphic3d ;
1737 MyDefaultViewPoint: Vertex from Graphic3d ;
1739 MyWindow: Window from Aspect;
1741 MyPlotter: Plotter from Graphic3d;
1743 myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
1744 myActivePlanesIterator: ListIteratorOfListOfTransient from TColStd;
1746 sx,sy: Integer from Standard;
1747 rx,ry: Real from Standard;
1748 gx,gy,gz: Real from Standard;
1749 myComputedMode: Boolean from Standard;
1750 SwitchSetFront: Boolean from Standard;
1751 MyZoomAtPointX, MyZoomAtPointY : Integer from Standard;
1754 MyGrid : Grid from Aspect;
1755 MyPlane : Ax3 from gp;
1757 --MyColorScale : ColorScale from V3d;
1758 MyLayerMgr : LayerMgr from V3d;
1760 -- the transformation between XoY and the grid plane
1761 MyTrsf : Array2OfReal from TColStd;
1764 MyGridEchoStructure : Structure from Graphic3d;
1765 MyGridEchoGroup : Group from Graphic3d;
1767 MyProjModel : TypeOfProjectionModel from V3d is protected;
1768 MyAnimationFlags : Integer from Standard;
1770 MyTransparencyFlag : Boolean from Standard;
1773 SetViewOn from class Viewer from V3d ( me : mutable ),
1774 SetViewOn from class Viewer from V3d ( me : mutable ; View : View from V3d ),
1775 SetViewOff from class Viewer from V3d ( me : mutable ),
1776 SetViewOff from class Viewer from V3d ( me : mutable ; View : View from V3d )