1 -- Created on: 1992-01-15
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
21 -- Modified: FMN - 24/12/97 -> Suppression GEOMLITE
22 -- CQO - 24/12/97 -> BUC50037
23 -- stt:25-02-98; S3558: ajout IfManageStandardEvent
24 -- stt:08-04-98; suppr IfManageStandardEvent
25 -- CAL - 18/08/98 -> S3892. Ajout grilles 3d.
26 -- BGN - 16-09-98; Points d'entree du Triedre (S3819, Phase 1)
27 -- 22-09-98 ; BGN : S3989 (anciennement S3819)
28 -- TypeOfTriedron* from Aspect(et pas V3d)
29 -- CAL - 21/10/98 -> Speciale. Ajout methode Tumble.
30 -- 29-OCT-98 : DCB : Adding ScreenCopy () method.
31 -- GG - 10/11/99 : PRO19603 Adding Redraw( area ) method
32 -- GG - 15/12/99 : GER61351 Adding SetBackgroundColor()
33 -- and BackgroundColor() methods
34 -- GG - 24/01/00 : -> Remove internal PixToRef() method, use Convert()
36 -- -> Rename internal RefToPix() to Convert() method.
37 -- -> Add ConvertToGrid() methods,
38 -- the Compute() internal method become private.
39 -- -> Add SetProjModel() method.
40 -- VKH - 15/11/99 : G004
41 -- -> Add method Dump()
43 -- -> Add Transparency() method
44 -- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
45 -- -> Add Print method (works only under Windows).
47 -- -> Add IsActiveLight() & IsActivePlane() methods
49 -- -> Add ToPixMap() method
50 -- GG - RIC120302 Add NEW SetWindow method.
52 -- -> Add EnableDepthTest() & IsDepthTestEnabled().
53 -- VSV - 28/05/02: ZBUFFER mode of Trihedron
54 -- SAV - 23/12/02 -> Added methods to set background image
55 -- NKV - 23/07/07 -> Define custom projection and model view matrixes
56 -- NKV - 08/02/07 -> Add ConvertWithProj() method
58 class View from V3d inherits TShared from MMgt
60 ---Purpose: Defines the application object VIEW for the
61 -- VIEWER application.
62 -- The methods of this class allow the editing
63 -- and inquiring the parameters linked to the view.
64 -- (Projection,Mapping,Zclipping,DepthCueing,AntiAliasing
66 -- Warning: The default parameters are defined by the class
67 -- Viewer (Example : SetDefaultViewSize()).
68 -- Certain methods are mouse oriented, and it is
69 -- necessary to know the difference between the start and
70 -- the continuation of this gesture in putting the method
72 -- Example : Shifting the eye-view along the screen axes.
74 -- View->Move(10.,20.,0.,True) (Starting motion)
75 -- View->Move(15.,-5.,0.,False) (Next motion)
83 ColorScale from Aspect,
84 Array2OfReal from TColStd,
87 Structure from Graphic3d,
90 ListOfTransient from V3d,
91 ListIteratorOfListOfTransient from TColStd,
94 TypeOfOrientation from V3d,
95 TypeOfShadingModel from V3d,
96 TypeOfSurfaceDetail from V3d,
97 TextureEnv from Graphic3d,
98 TypeOfVisualization from V3d,
99 TypeOfZclipping from V3d,
100 TypeOfProjectionModel from V3d,
101 TypeOfBackfacingModel from V3d,
106 ViewMapping from Visual3d,
107 ViewOrientation from Visual3d,
108 ContextView from Visual3d,
109 Vector from Graphic3d,
110 Vertex from Graphic3d,
111 Plotter from Graphic3d,
114 BufferType from Graphic3d,
115 Background from Aspect,
116 GradientBackground from Aspect,
117 TypeOfColor from Quantity,
118 NameOfColor from Quantity,
120 Length from Quantity,
121 PlaneAngle from Quantity,
122 Parameter from Quantity,
123 Factor from Quantity,
125 Coefficient from Quantity,
127 Array2OfReal from TColStd,
128 ViewerPointer from V3d,
129 TransientManager from Visual3d,
130 TypeOfTriedronEcho from Aspect,
131 TypeOfTriedronPosition from Aspect,
132 RenderingContext from Aspect,
133 GraphicCallbackProc from Aspect,
134 FillMethod from Aspect,
135 GradientFillMethod from Aspect,
136 FontAspect from Font,
137 AsciiString from TCollection,
138 ExtendedString from TCollection,
139 PrintAlgo from Aspect
143 BadValue from V3d, TypeMismatch from Standard,
144 MultiplyDefined from Standard,UnMapped from V3d
148 Create ( VM : mutable Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
149 ---Purpose: Initialises the view.
151 Create ( VM : mutable Viewer ; V : View from V3d; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
152 ---Purpose: Initialises the view by copying.
154 --------------------------------------------------------
155 ---Category: Methods to modify the Status of the view
156 --------------------------------------------------------
158 SetWindow ( me : mutable ; IdWin : Window )
159 ---Purpose: Activates the view in the window specified and Map the
160 -- Window to the screen.
161 raises MultiplyDefined from Standard;
163 ---Purpose: Warning! raises MultiplyDefined from Standard
164 -- if the view is already activated in a window.
165 -- Warning: The view is centered and resized to preserve
166 -- the height/width ratio of the window.
168 SetWindow ( me : mutable ;
169 aWindow : Window from Aspect;
170 aContext : RenderingContext from Aspect;
171 aDisplayCB : GraphicCallbackProc from Aspect;
172 aClientData : Address from Standard
174 ---Purpose: Activates the view in the specified Window
175 -- If <aContext> is not NULL the graphic context is used
176 -- to draw something in this view.
177 -- Otherwise an internal graphic context is created.
178 -- If <aDisplayCB> is not NULL then a user display CB is
179 -- call at the end of the OCC graphic traversal and just
180 -- before the swap of buffers. The <aClientData> is pass
181 -- to this call back.
182 raises MultiplyDefined from Standard;
184 ---Purpose: Warning! raises MultiplyDefined from Standard
185 -- if the view is already activated in a window.
186 -- Warning: The view is centered and resized to preserve
187 -- the height/width ratio of the window.
189 SetMagnify (me: mutable; IdWin : Window;
190 aPreviousView : View from V3d;
191 x1 , y1 , x2 , y2: Integer from Standard)
196 ---Purpose: Destroys the view.
198 Update ( me ) is static;
200 ---Purpose: Deprecated, Redraw() should be used instead.
204 ---Purpose: Redisplays the view even if there has not
205 -- been any modification.
206 -- Must be called if the view is shown.
207 -- (Ex: DeIconification ) .
209 Redraw ( me ;x,y,width,height: Integer from Standard);
211 ---Purpose: Redisplays the view area after esxposure.
212 -- [x,y] define the min xy area position
213 -- [width,height] the size of the area in pixel unit.
215 MustBeResized ( me : mutable )
217 ---Purpose: Must be called when the window supporting the
218 -- view changes size.
219 raises UnMapped from V3d;
220 ---Purpose: if the view is not mapped on a window.
221 -- Warning: The view is centered and resized to preserve
222 -- the height/width ratio of the window.
224 DoMapping ( me : mutable );
226 ---Purpose: Must be called when the window supporting the
227 -- view is mapped or unmapped.
229 IsEmpty ( me ) returns Boolean;
231 ---Purpose: Returns the status of the view regarding
232 -- the displayed structures inside
233 -- Returns True is The View is empty
237 ---Purpose: Updates the lights of the view. The view is redrawn.
239 --------------------------------------------------------
240 ---Category: Methods to modify the Attributes of the view
241 --------------------------------------------------------
243 SetBackgroundColor ( me : mutable ;
244 Type : TypeOfColor; V1, V2, V3 : Parameter );
246 ---Purpose: Defines the background colour of the view
248 -- the colour definition type,
249 -- and the three corresponding values.
251 SetBackgroundColor ( me : mutable ; Color : Color from Quantity );
253 ---Purpose: Defines the background colour of the view
255 -- the colour object.
257 SetBackgroundColor ( me : mutable ; Name : NameOfColor );
259 ---Purpose: Defines the background colour of the view
261 -- the colour name in the form Quantity_NOC_xxxx .
263 SetBgGradientColors ( me : mutable ;
264 Color1 : Color from Quantity;
265 Color2 : Color from Quantity;
266 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
267 update : Boolean from Standard = Standard_False );
269 ---Purpose: Defines the gradient background colours of the view
271 -- two colour objects,
272 -- and fill method (horizontal by default)
274 SetBgGradientColors ( me : mutable ;
275 Color1 : NameOfColor;
276 Color2 : NameOfColor;
277 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
278 update : Boolean from Standard = Standard_False );
280 ---Purpose: Defines the gradient background colours of the view
282 -- two colour names in the form Quantity_NOC_xxxx,
283 -- and fill method (horizontal by default)
285 SetBgGradientStyle( me : mutable ;
286 AMethod : GradientFillMethod from Aspect = Aspect_GFM_HOR;
287 update : Boolean from Standard = Standard_False);
289 ---Purpose: Defines the gradient background fill method of the view
291 SetBackgroundImage( me : mutable; FileName : CString from Standard;
292 FillStyle : FillMethod from Aspect = Aspect_FM_CENTERED;
293 update : Boolean from Standard = Standard_False );
295 ---Purpose: Defines the background texture of the view
297 --- texture image file name,
298 --- and fill method (centered by default)
300 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
301 update : Boolean from Standard = Standard_False );
303 ---Purpose: Defines the textured background fill method of the view
305 SetAxis ( me : mutable; X,Y,Z : Coordinate ;
306 Vx,Vy,Vz : Parameter )
308 ---Purpose: Definition of an axis from its origin and
310 -- This will be the current axis for rotations and movements.
311 raises BadValue from V3d;
312 ---Purpose: Warning! raises BadValue from V3d if the vector normal is NULL. .
314 SetShadingModel ( me : mutable; Model : TypeOfShadingModel );
316 ---Purpose: Defines the shading model for the
317 -- visualisation ZBUFFER mode.
318 -- Various models are available.
320 SetSurfaceDetail(me : mutable; SurfaceDetail : TypeOfSurfaceDetail);
322 ---Purpose: select the kind of rendering for texture mapping
323 -- no texture mapping by default
325 SetTextureEnv(me : mutable; ATexture : TextureEnv from Graphic3d);
327 ---Purpose: set the environment texture to use
328 -- no environment texture by default
330 SetVisualization ( me : mutable;
331 Mode : TypeOfVisualization from V3d );
333 ---Purpose: Defines the visualisation mode in the view.
335 SetAntialiasingOn ( me : mutable );
337 ---Purpose: Activates antialiasing in the view.
339 SetAntialiasingOff ( me : mutable );
341 ---Purpose: Desactivates antialiasing in the view.
343 SetZClippingDepth ( me : mutable; Depth : Length );
345 ---Purpose: Defines the depth of the medium clipping plane.
347 SetZClippingWidth ( me : mutable; Width : Length )
349 ---Purpose: Defines the thicknes around the medium clippling plane. .
350 raises BadValue from V3d;
351 -- If the thickness is <= 0
353 SetZClippingType ( me : mutable; Type : TypeOfZclipping );
355 ---Purpose: Defines the type of ZClipping.
357 SetZCueingDepth ( me : mutable; Depth : Length );
359 ---Purpose: Defines the depth of the medium plane.
361 SetZCueingWidth ( me : mutable; Width : Length )
363 ---Purpose: Defines the thickness around the medium plane.
364 raises BadValue from V3d;
365 -- If thickness is <= 0
367 SetZCueingOn ( me : mutable );
369 ---Purpose: Activates ZCueing in the view.
371 SetZCueingOff ( me : mutable );
373 ---Purpose: Desactivates ZCueing in the view.
375 SetLightOn( me : mutable ; MyLight : Light from V3d )
377 ---Purpose: Activates MyLight in the view.
378 raises BadValue from V3d;
379 -- If No More Light can be activated in MyView .
381 SetLightOn( me : mutable )
383 ---Purpose: Activates all the lights defined in this view.
384 raises BadValue from V3d;
385 -- If No More Light can be activated in MyView .
387 SetLightOff( me : mutable ; MyLight : Light from V3d );
389 ---Purpose: Desactivate MyLight in this view.
391 SetLightOff( me : mutable );
393 ---Purpose: Deactivate all the Lights defined in this view.
395 IsActiveLight( me ; aLight: Light from V3d )
396 returns Boolean from Standard;
398 ---Purpose: Returns TRUE when the light is active in this view.
400 SetTransparency( me : mutable ; AnActivity : Boolean = Standard_False);
402 ---Purpose: Activate/Deactivate the transparency in this view.
404 SetPlaneOn( me : mutable ; MyPlane : Plane from V3d )
406 ---Purpose: Activates the clipping plane in this view.
407 raises BadValue from V3d ;
408 ---Purpose: If No More Plane can be activated in MyView .
410 SetPlaneOn( me : mutable )
412 ---Purpose: Activate all the clipping planes defined in
414 raises BadValue from V3d;
415 ---Purpose: If No More Plane can be activated in MyView .
417 SetPlaneOff( me : mutable ; MyPlane : Plane from V3d );
419 ---Purpose: Desactivates the clipping plane defined
422 SetPlaneOff( me : mutable );
424 ---Purpose: Deactivate all clipping planes defined
427 IsActivePlane( me ; aPlane: Plane from V3d )
428 returns Boolean from Standard;
430 ---Purpose: Returns TRUE when the plane is active in this view.
432 SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
433 returns Boolean from Standard;
434 ---Purpose: sets the immediate update mode and returns the previous one.
437 ---------------------------------------------------
439 ---------------------------------------------------
441 ZBufferTriedronSetup ( me : mutable;
442 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
443 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
444 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
445 SizeRatio : Real from Standard = 0.8;
446 AxisDiametr : Real from Standard = 0.05;
447 NbFacettes : Integer from Standard = 12)
450 ---Purpose: Customization of the ZBUFFER Triedron.
451 --- XColor,YColor,ZColor - colors of axis
452 --- SizeRatio - ratio of decreasing of the trihedron size when its phisical
453 --- position comes out of the view
454 --- AxisDiametr - diameter relatively to axis length
455 --- NbFacettes - number of facettes of cylinders and cones
457 TriedronDisplay ( me : mutable;
458 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
459 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
460 AScale : Real from Standard = 0.02;
461 AMode : TypeOfVisualization from V3d = V3d_WIREFRAME )
464 ---Purpose: Display of the Triedron.
465 --- Initialize position, color and length of Triedron axes.
466 --- The scale is a percent of the window width.
469 TriedronErase ( me : mutable )
472 ---Purpose: Erases the Triedron.
475 TriedronEcho ( me : mutable;
476 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
479 ---Purpose: Highlights the echo zone of the Triedron.
482 ---------------------------------
483 ---Category: Graduated trihedron
484 ---------------------------------
486 GetGraduatedTrihedron(me;
488 xname, yname, zname : out ExtendedString from TCollection;
490 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
492 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
494 drawgrid : out Boolean from Standard;
496 drawaxes : out Boolean from Standard;
497 -- Number of splits along axes --
498 nbx, nby, nbz : out Integer from Standard;
499 -- Offset for drawing values --
500 xoffset, yoffset, zoffset : out Integer from Standard;
501 -- Offset for drawing names of axes --
502 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
504 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
505 -- Length of tickmarks --
506 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
508 gridcolor : out Color from Quantity;
509 -- Colors of axis names --
510 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
511 -- Colors of axis and values --
512 xcolor, ycolor, zcolor : out Color from Quantity;
513 -- Name of font for names of axes --
514 fontOfNames : out AsciiString from TCollection;
515 -- Style of names of axes --
516 styleOfNames : out FontAspect from Font;
517 -- Size of names of axes --
518 sizeOfNames : out Integer from Standard;
519 -- Name of font for values --
520 fontOfValues : out AsciiString from TCollection;
521 -- Style of values --
522 styleOfValues : out FontAspect from Font;
524 sizeOfValues : out Integer from Standard)
525 ---Purpose: Returns data of a graduated trihedron.
528 GraduatedTrihedronDisplay(me : mutable;
530 xname : ExtendedString from TCollection = "X";
531 yname : ExtendedString from TCollection = "Y";
532 zname : ExtendedString from TCollection = "Z";
534 xdrawname : Boolean from Standard = Standard_True;
535 ydrawname : Boolean from Standard = Standard_True;
536 zdrawname : Boolean from Standard = Standard_True;
538 xdrawvalues : Boolean from Standard = Standard_True;
539 ydrawvalues : Boolean from Standard = Standard_True;
540 zdrawvalues : Boolean from Standard = Standard_True;
542 drawgrid : Boolean from Standard = Standard_True;
544 drawaxes : Boolean from Standard = Standard_True;
545 -- Number of splits along axes --
546 nbx : Integer from Standard = 3;
547 nby : Integer from Standard = 3;
548 nbz : Integer from Standard = 3;
549 -- Offset for drawing values --
550 xoffset : Integer from Standard = 10;
551 yoffset : Integer from Standard = 10;
552 zoffset : Integer from Standard = 10;
553 -- Offset for drawing names of axes --
554 xaxisoffset : Integer from Standard = 30;
555 yaxisoffset : Integer from Standard = 30;
556 zaxisoffset : Integer from Standard = 30;
558 xdrawtickmarks : Boolean from Standard = Standard_True;
559 ydrawtickmarks : Boolean from Standard = Standard_True;
560 zdrawtickmarks : Boolean from Standard = Standard_True;
561 -- Length of tickmarks --
562 xtickmarklength : Integer from Standard = 10;
563 ytickmarklength : Integer from Standard = 10;
564 ztickmarklength : Integer from Standard = 10;
566 gridcolor : Color from Quantity = Quantity_NOC_WHITE;
568 xnamecolor : Color from Quantity = Quantity_NOC_RED;
570 ynamecolor : Color from Quantity = Quantity_NOC_GREEN;
572 znamecolor : Color from Quantity = Quantity_NOC_BLUE1;
573 -- X color of axis and values --
574 xcolor : Color from Quantity = Quantity_NOC_RED;
575 -- Y color of axis and values --
576 ycolor : Color from Quantity = Quantity_NOC_GREEN;
577 -- Z color of axis and values --
578 zcolor : Color from Quantity = Quantity_NOC_BLUE1;
579 -- Name of font for names of axes --
580 fontOfNames : AsciiString from TCollection = "Arial";
581 -- Style of names of axes --
582 styleOfNames : FontAspect from Font = Font_FA_Bold;
583 -- Size of names of axes --
584 sizeOfNames : Integer from Standard = 12;
585 -- Name of font for values --
586 fontOfValues : AsciiString from TCollection = "Arial";
587 -- Style of values --
588 styleOfValues : FontAspect from Font = Font_FA_Regular;
590 sizeOfValues : Integer from Standard = 12)
591 ---Purpose: Displays a graduated trihedron.
594 GraduatedTrihedronErase(me : mutable)
595 ---Purpose: Erases a graduated trihedron from the view.
598 ---------------------------------------------------
599 -- Color Scale methods
600 ---------------------------------------------------
602 SetLayerMgr(me : mutable; aMgr : LayerMgr from V3d);
604 ColorScaleDisplay(me : mutable);
606 ColorScaleErase(me : mutable);
608 ColorScaleIsDisplayed(me)
609 returns Boolean from Standard;
612 returns ColorScale from Aspect;
614 --------------------------------------------------------
615 ---Category: Methods to modify the Projection of the view
616 --------------------------------------------------------
618 SetFront(me: mutable);
620 ---Purpose: modify the Projection of the view perpendicularly to
621 -- the privileged plane of the viewer.
623 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
624 Start : Boolean = Standard_True )
626 ---Purpose: Rotates the eye about the coordinate system of
627 -- reference of the screen
628 -- for which the origin is the view point of the projection,
629 -- with a relative angular value in RADIANS with respect to
630 -- the initial position expressed by Start = Standard_True
631 raises BadValue from V3d;
632 ---Purpose: Warning! raises BadValue from V3d
633 -- If the eye, the view point, or the high point are
634 -- aligned or confused.
636 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
638 Start : Boolean = Standard_True )
640 ---Purpose: Rotates the eye about the coordinate system of
641 -- reference of the screen
642 -- for which the origin is Gravity point {X,Y,Z},
643 -- with a relative angular value in RADIANS with respect to
644 -- the initial position expressed by Start = Standard_True
645 raises BadValue from V3d;
646 ---Purpose: If the eye, the view point, or the high point are
647 -- aligned or confused.
649 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
651 Start : Boolean = Standard_True );
653 ---Purpose: Rotates the eye about one of the coordinate axes of
654 -- of the view for which the origin is the Gravity point{X,Y,Z}
655 -- with an relative angular value in RADIANS with
656 -- respect to the initial position expressed by
657 -- Start = Standard_True
659 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
660 Start : Boolean = Standard_True ) ;
662 ---Purpose: Rotates the eye about one of the coordinate axes of
663 -- of the view for which the origin is the view point of the
664 -- projection with an relative angular value in RADIANS with
665 -- respect to the initial position expressed by
666 -- Start = Standard_True
668 Rotate ( me : mutable ; Angle : PlaneAngle ;
669 Start : Boolean = Standard_True );
671 ---Purpose: Rotates the eye around the current axis a relative
672 -- angular value in RADIANS with respect to the initial
673 -- position expressed by Start = Standard_True
675 Move ( me : mutable ; Dx,Dy,Dz : Length ;
676 Start : Boolean = Standard_True )
678 ---Purpose: Movement of the eye parallel to the coordinate system
679 -- of reference of the screen a distance relative to the
680 -- initial position expressed by Start = Standard_True.
681 raises BadValue from V3d;
682 -- If the eye, the view point, or the high point are
683 -- aligned or confused.
685 Move ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
686 Start : Boolean = Standard_True )
688 ---Purpose: Movement of the eye parallel to one of the axes of the
689 -- coordinate system of reference of the view a distance
690 -- relative to the initial position expressed by
691 -- Start = Standard_True.
692 raises BadValue from V3d;
693 -- If the eye, view point, or high point are aligned or confused.
695 Move ( me : mutable ; Length : Length ;
696 Start : Boolean = Standard_True )
698 ---Purpose: Movement of the eye parllel to the current axis
699 -- a distance relative to the initial position
700 -- expressed by Start = Standard_True
701 raises BadValue from V3d;
702 -- If the eye, view point, or high point are aligned or confused.
704 Translate ( me : mutable ; Dx,Dy,Dz : Length ;
705 Start : Boolean = Standard_True )
707 ---Purpose: Movement of the ye and the view point parallel to the
708 -- frame of reference of the screen a distance relative
709 -- to the initial position expressed by
710 -- Start = Standard_True
711 raises BadValue from V3d;
712 -- If the eye, view point, or high point are aligned or confused.
714 Translate ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
715 Start : Boolean = Standard_True );
717 ---Purpose: Movement of the eye and the view point parallel to one
718 -- of the axes of the fame of reference of the view a
719 -- distance relative to the initial position
720 -- expressed by Start = Standard_True
722 Translate ( me : mutable ; Length : Length ;
723 Start : Boolean = Standard_True );
725 ---Purpose: Movement of the eye and view point parallel to
726 -- the current axis a distance relative to the initial
727 -- position expressed by Start = Standard_True
729 Place (me: mutable; x,y: Integer from Standard;
730 aZoomFactor: Factor from Quantity = 1)
732 ---Purpose: places the point of the view corresponding
733 -- at the pixel position x,y at the center of the window
734 -- and updates the view.
737 Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
738 Start : Boolean = Standard_True )
740 ---Purpose: Rotation of the view point around the frame of reference
741 -- of the screen for which the origin is the eye of the
742 -- projection with a relative angular value in RADIANS
743 -- with respect to the initial position expressed by
744 -- Start = Standard_True
745 raises BadValue from V3d;
746 -- If the eye, view point, or high point are aligned or confused.
748 Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
749 Start : Boolean = Standard_True )
752 ---Purpose: Rotation of the view point around one of the axes of the
753 -- frame of reference of the view for which the origin is
754 -- the eye of the projection with an angular value in
755 -- RADIANS relative to the initial position expressed by
756 -- Start = Standard_True
758 Turn ( me : mutable ; Angle : PlaneAngle ;
759 Start : Boolean = Standard_True );
761 ---Purpose: Rotation of the view point around the current axis an
762 -- angular value in RADIANS relative to the initial
763 -- position expressed by Start = Standard_True
765 SetTwist ( me : mutable ; Angle : PlaneAngle )
767 ---Purpose: Defines the angular position of the high point of
768 -- the reference frame of the view with respect to the
769 -- Y screen axis with an absolute angular value in
771 raises BadValue from V3d;
772 -- If the eye, view point, or high point are aligned or confused.
774 SetEye( me : mutable ; X,Y,Z : Coordinate )
776 ---Purpose: Defines the position of the eye..
777 raises BadValue from V3d ;
778 -- If the eye, view point, or high point are aligned or confused.
780 SetDepth( me : mutable ; Depth : Length )
782 ---Purpose: Defines the Depth of the eye from the view point
783 -- without update the projection .
784 raises BadValue from V3d ;
785 -- If the Depth is <= 0.
787 SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
789 ---Purpose: Defines the orientation of the projection.
790 raises BadValue from V3d ;
791 -- If the eye, view point, or high point are aligned or confused.
793 SetProj( me : mutable ; Orientation : TypeOfOrientation )
795 ---Purpose: Defines the orientation of the projection .
796 raises BadValue from V3d ;
797 -- If the eye, view point, or high point are aligned or confused.
800 SetAt( me : mutable ; X,Y,Z : Coordinate )
802 ---Purpose: Defines the position of the view point.
803 raises BadValue from V3d ;
804 -- If the eye, view point, or high point are aligned or confused.
806 SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
808 ---Purpose: Defines the orientation of the high point.
809 raises BadValue from V3d ;
810 -- If the eye, view point, or high point are aligned or confused.
812 SetUp( me : mutable ; Orientation : TypeOfOrientation )
814 ---Purpose: Defines the orientation(SO) of the high point.
815 raises BadValue from V3d ;
816 -- If the eye, view point, or high point are aligned or confused.
818 SetViewOrientation ( me : mutable; VO : ViewOrientation from Visual3d );
820 ---Purpose: Modifies the orientation of the view.
822 SetViewOrientationDefault( me : mutable );
824 ---Purpose: Saves the current state of the orientation of the view
825 -- which will be the return state at ResetViewOrientation.
827 ResetViewOrientation ( me : mutable );
829 ---Purpose: Resets the orientation of the view.
832 --------------------------------------------------------
833 ---Category: Methods to modify the Mapping of the view
834 --------------------------------------------------------
836 Panning ( me : mutable ; Dx , Dy : Length ;
837 aZoomFactor : Factor from Quantity = 1;
838 Start : Boolean = Standard_True )
840 ---Purpose: translates the center of the view and zooms the view.
842 raises BadValue from V3d ;
844 SetCenter ( me : mutable ; Xc , Yc : Coordinate )
846 ---Purpose: Defines the centre of the view.
848 raises BadValue from V3d ;
849 -- If one of the dimensions of the projection is NULL.
851 SetCenter ( me : mutable ; X,Y: Integer from Standard)
853 ---Purpose: Defines the centre of the view from a pixel position.
855 raises BadValue from V3d ;
856 -- If one of the dimensions of the projection is NULL.
858 SetSize ( me : mutable ; Size : Length )
860 ---Purpose: Defines the size of the view while preserving the
861 -- center and height/width ratio of the window supporting
863 -- NOTE than the Depth of the View is NOT modified .
864 raises BadValue from V3d ;
865 -- If the size of the view is <= 0
867 SetZSize ( me : mutable ; Size : Length )
869 ---Purpose: Defines the Depth size of the view
870 -- Front Plane will be set to Size/2.
871 -- Back Plane will be set to -Size/2.
872 -- Any Object located Above the Front Plane or
873 -- behind the Back Plane will be Clipped .
874 -- NOTE than the XY Size of the View is NOT modified .
875 raises BadValue from V3d ;
876 -- If the size of the view is <= 0
878 SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
880 ---Purpose: Zooms the view by a factor relative to the initial
881 -- value expressed by Start = Standard_True
883 raises BadValue from V3d ;
884 -- If the zoom coefficient is <= 0
886 SetScale ( me : mutable ; Coef : Factor )
888 ---Purpose: Zooms the view by a factor relative to the value
889 -- initialised by SetViewMappingDefault().
891 raises BadValue from V3d ;
892 -- If the zoom coefficient is <= 0
894 SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
896 ---Purpose: Sets anisotropic (axial) scale factors <Sx>, <Sy>, <Sz> for view <me>.
897 -- Anisotropic scaling operation is performed through multiplying
898 -- the current view orientation matrix by a scaling matrix:
904 raises BadValue from V3d ;
905 -- If the one of factors <= 0
907 FitAll ( me : mutable ; Coef : Coefficient = 0.01;
908 FitZ: Boolean from Standard = Standard_False; update : Boolean from Standard = Standard_True )
910 ---Purpose: Automatic zoom/panning. Objects in the view are visualised
911 -- so as to occupy the maximum space while respecting the
912 -- margin coefficient and the initial height /width ratio.
913 -- NOTE than the original Z size of the view is NOT modified .
914 raises BadValue from V3d ;
915 -- If the margin coefficient is <0 ou >= 1 or
918 ZFitAll ( me : mutable ; Coef : Coefficient = 1.0 )
920 ---Purpose: Automatic Depth Panning. Objects visible in the view are
921 -- visualised so as to occupy the maximum Z amount of space
922 -- while respecting the margin coefficient .
923 -- NOTE than the original XY size of the view is NOT modified .
924 raises BadValue from V3d ;
925 -- If the margin coefficient is <0 ou or
926 -- If No Objects are displayed in the view
928 DepthFitAll( me : mutable ; Aspect : Coefficient = 0.01;
929 Margin : Coefficient = 0.01 );
931 ---Purpose: Adjusts the viewing volume so as not to clip the displayed objects by front and back
932 -- and back clipping planes. Also sets depth value automatically depending on the
933 -- calculated Z size and Aspect parameter.
934 -- NOTE than the original XY size of the view is NOT modified .
936 FitAll ( me : mutable ; Umin, Vmin, Umax, Vmax : Coordinate )
938 ---Purpose: Centres the defined projection window so that it occupies
939 -- the maximum space while respecting the initial
940 -- height/width ratio.
941 -- NOTE than the original Z size of the view is NOT modified .
942 raises BadValue from V3d;
943 -- If the defined projection window has zero size.
946 WindowFit ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer)
948 ---Purpose: Centres the defined PIXEL window so that it occupies
949 -- the maximum space while respecting the initial
950 -- height/width ratio.
951 -- NOTE than the original Z size of the view is NOT modified .
952 raises BadValue from V3d
953 -- If the defined projection window has zero size.
956 SetViewingVolume ( me : mutable ; Left, Right, Bottom, Top, ZNear, ZFar : Real from Standard)
958 ---Purpose: Sets Z and XY size of the view according to given values
959 -- with respecting the initial view depth (eye position).
960 -- Width/heigth aspect ratio should be preserved by the caller
961 -- of this method similarly to SetSize() to avoid unexpected
962 -- visual results like non-uniform scaling of objects in the view.
963 raises BadValue from V3d;
964 -- If the ZNear<0, ZFar<0 or ZNear>=Zfar.
966 SetViewMapping ( me : mutable; VM : ViewMapping from Visual3d );
968 ---Purpose: Modifies the mapping of the view.
970 SetViewMappingDefault( me : mutable );
972 ---Purpose: Saves the current view mapping. This will be the
973 -- state returned from ResetViewmapping.
975 ResetViewMapping ( me : mutable );
977 ---Purpose: Resets the centring of the view.
980 Reset ( me : mutable; update : Boolean from Standard = Standard_True );
982 ---Purpose: Resets the centring and the orientation of the view
984 ---------------------------------------------------
985 ---Category: Inquire methods
986 ---------------------------------------------------
988 Convert( me ; Vp : Integer ) returns Length
990 ---Purpose : Converts the PIXEL value
991 -- to a value in the projection plane.
992 raises UnMapped from V3d;
993 -- If the view is not mapped on the window.
995 Convert( me ; Xp,Yp : Integer ; Xv,Yv : out Coordinate )
997 ---Purpose : Converts the point PIXEL into a point projected
998 -- in the reference frame of the projection plane.
999 raises UnMapped from V3d;
1000 -- If the view is not mapped on the window.
1002 Convert( me ; Vv : Length ) returns Integer
1004 ---Purpose : Converts tha value of the projection plane into
1006 raises UnMapped from V3d;
1007 -- If the view is not mapped on the window.
1009 Convert( me ; Xv,Yv : Coordinate ; Xp,Yp : out Integer )
1011 ---Purpose : Converts the point defined in the reference frame
1012 -- of the projection plane into a point PIXEL.
1013 raises UnMapped from V3d;
1014 -- If the view is not mapped on the window.
1016 Convert( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate)
1018 ---Purpose : Converts the projected point into a point
1019 -- in the reference frame of the view corresponding
1020 -- to the intersection with the projection plane
1021 -- of the eye/view point vector.
1022 raises UnMapped from V3d;
1023 -- If the view is not mapped on the window.
1025 ConvertWithProj( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate ; Vx,Vy,Vz : out Parameter)
1027 ---Purpose : Converts the projected point into a point
1028 -- in the reference frame of the view corresponding
1029 -- to the intersection with the projection plane
1030 -- of the eye/view point vector and returns the
1031 -- projection ray for further computations.
1032 raises UnMapped from V3d;
1033 -- If the view is not mapped on the window.
1035 ConvertToGrid( me ; Xp,Yp : Integer ; Xg,Yg,Zg : out Coordinate)
1037 ---Purpose : Converts the projected point into the nearest grid 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 display the grid marker.
1041 -- Warning: When the grid is not active the result is identical
1042 -- to the above Convert() method.
1044 -- 1) Enable the grid echo display
1045 -- myViewer->SetGridEcho(Standard_True);
1046 -- 2) When application receive a move event :
1047 -- 2.1) Check if any object is detected
1048 -- if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
1049 -- 2.2) Check if the grid is active
1050 -- if( myViewer->Grid()->IsActive() ) {
1051 -- 2.3) Display the grid echo and gets the grid point
1052 -- myView->ConvertToGrid(x,y,X,Y,Z);
1053 -- 2.4) Else this is the standard case
1054 -- } else myView->Convert(x,y,X,Y,Z);
1055 raises UnMapped from V3d;
1056 -- If the view is not mapped on the window.
1058 ConvertToGrid( me ; X,Y,Z : Coordinate ; Xg,Yg,Zg : out Coordinate)
1060 ---Purpose : Converts the point into the nearest grid point
1061 -- and display the grid marker.
1062 ---Warning: When the grid is not active the result is identical
1063 -- to the previous point.
1064 raises UnMapped from V3d;
1065 -- If the view is not mapped on the window.
1067 Convert( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1069 ---Purpose : Projects the point defined in the reference frame of
1070 -- the view into the projected point in the associated window.
1072 -- RefToPix( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1073 -- ---Purpose : Projects the point defined in the reference frame of
1074 -- -- the view into the projected point in the associated window.
1075 -- Obsolete : Use Convert(X,Y,Z,Xp,Yp);
1077 -- PixToRef( me ; Xp,Yp : Integer; X,Y,Z : out Coordinate) ;
1078 -- ---Purpose : Converts the projected point in the associated window of
1079 -- -- the view into the point defined in the reference frame.
1080 -- Obsolete : Use Convert(Xp,Yp,X,Y,Z);
1082 Project( me ; X,Y,Z : Coordinate; Xp,Yp : out Coordinate) ;
1084 ---Purpose : Converts the point defined in the user space of
1085 -- the view to the projected view plane point at z 0.
1087 BackgroundColor( me; Type : TypeOfColor ; V1, V2, V3 : out Parameter) ;
1089 ---Purpose: Returns the Background color values of the view
1090 -- depending of the color Type.
1092 BackgroundColor( me ) returns Color from Quantity;
1094 ---Purpose: Returns the Background color object of the view.
1096 GradientBackgroundColors( me;
1097 Color1 : out Color from Quantity;
1098 Color2 : out Color from Quantity) ;
1100 ---Purpose: Returns the gradient background colour objects of the view.
1102 GradientBackground ( me ) returns GradientBackground from Aspect;
1104 ---Purpose: Returns the gradient background of the view.
1106 Scale ( me ) returns Factor ;
1108 ---Purpose: Returns the current value of the zoom expressed with
1109 -- respect to SetViewMappingDefault().
1111 AxialScale ( me ; Sx, Sy, Sz : out Real from Standard ) ;
1113 ---Purpose: Returns the current values of the anisotropic (axial) scale factors.
1115 Center ( me; Xc,Yc : out Coordinate );
1117 ---Purpose: Returns the centre of the view.
1119 Size ( me; Width, Height : out Length );
1121 ---Purpose: Returns the height and width of the view.
1123 ZSize ( me ) returns Real ;
1125 ---Purpose: Returns the Depth of the view .
1127 Eye( me ; X,Y,Z : out Coordinate );
1129 ---Purpose: Returns the position of the eye.
1131 FocalReferencePoint (me ; X,Y,Z : out Coordinate );
1133 ---Purpose: Returns the position of point which emanating the
1136 ProjReferenceAxe( me ; Xpix,Ypix : Integer ;
1137 XP,YP,ZP,VX,VY,VZ : out Coordinate );
1139 ---Purpose: Returns the coordinate of the point (Xpix,Ypix)
1140 -- in the view (XP,YP,ZP), and the projection vector of the
1141 -- view passing by the point (for PerspectiveView).
1143 Depth( me ) returns Length ;
1145 ---Purpose: Returns the Distance between the Eye and View Point.
1147 Proj( me ; Vx,Vy,Vz : out Parameter );
1149 ---Purpose: Returns the projection vector.
1151 At( me ; X,Y,Z : out Coordinate );
1153 ---Purpose: Returns the position of the view point.
1155 Up( me ; Vx,Vy,Vz : out Parameter );
1157 ---Purpose: Returns the vector giving the position of the high point.
1159 Twist( me ) returns PlaneAngle ;
1161 ---Purpose: Returns in RADIANS the orientation of the view around
1162 -- the visual axis measured from the Y axis of the screen.
1164 ShadingModel ( me ) returns TypeOfShadingModel ;
1166 ---Purpose: Returns the current shading model.
1168 SurfaceDetail(me) returns TypeOfSurfaceDetail;
1170 -- purpose: returns the current SurfaceDetail mode
1172 TextureEnv(me) returns TextureEnv from Graphic3d;
1174 -- purpose: return the current environment texture used
1176 Transparency(me) returns Boolean from Standard;
1178 ---Purpose: Returns the transparency activity.
1180 Visualization ( me ) returns TypeOfVisualization from V3d;
1182 ---Purpose: Returns the current visualisation mode.
1184 Antialiasing ( me ) returns Boolean;
1186 ---Purpose: Indicates if the antialiasing is active (True) or
1187 -- inactive (False).
1189 ZCueing ( me; Depth, Width : out Length ) returns Boolean ;
1191 ---Purpose: Returns activity and information on the Zcueing.
1192 -- <Depth> : Depth of plane.
1193 -- <Width> : Thickness around the plane.
1195 ZClipping ( me; Depth, Width : out Length ) returns TypeOfZclipping;
1197 ---Purpose: Returns current information on the ZClipping.
1198 -- <Depth> : Depth of plane.
1199 -- <Width> : Thickness around the plane.
1200 -- <TypeOfZclipping> : "BACK"
1205 IfMoreLights( me ) returns Boolean;
1207 ---Purpose: Returns True if One light more can be
1208 -- activated in this View.
1210 InitActiveLights(me: mutable);
1212 ---Purpose: initializes an iteration on the active Lights.
1214 MoreActiveLights (me) returns Boolean from Standard;
1216 ---Purpose: returns true if there are more active Light(s) to return.
1218 NextActiveLights (me: mutable);
1220 ---Purpose : Go to the next active Light
1221 -- (if there is not, ActiveLight will raise an exception)
1223 ActiveLight(me) returns mutable Light from V3d;
1226 IfMorePlanes( me ) returns Boolean;
1228 ---Purpose: Returns True if One clipping plane more can be
1229 -- activated in this View.
1231 InitActivePlanes(me: mutable);
1233 ---Purpose: initializes an iteration on the active Planes.
1235 MoreActivePlanes (me) returns Boolean from Standard;
1237 ---Purpose: returns true if there are more active Plane(s) to return.
1239 NextActivePlanes (me: mutable);
1241 ---Purpose : Go to the next active Plane
1242 -- (if there is not, ActivePlane will raise an exception)
1244 ActivePlane(me) returns mutable Plane from V3d;
1247 Viewer ( me ) returns mutable Viewer from V3d;
1249 ---Purpose: Returns the viewer in which the view has been created.
1251 IfWindow ( me ) returns Boolean;
1253 ---Purpose: Returns True if MyView is associated with a window .
1255 Window ( me ) returns mutable Window from Aspect
1257 ---Purpose: Returns the Aspect Window associated with the view.
1258 raises BadValue from V3d;
1259 -- If MyView is not associated with a window
1261 Type( me ) returns TypeOfView from V3d;
1263 ---Purpose: Returns the Type of the View
1265 Pan ( me : mutable; Dx, Dy: Integer from Standard;
1266 aZoomFactor: Factor from Quantity = 1);
1268 ---Purpose: translates the center of the view and zooms the view.
1269 -- and updates the view.
1271 Zoom ( me : mutable; X1 , Y1 , X2 , Y2 : Integer from Standard)
1274 ---Purpose: Zoom the view according to a zoom factor computed
1275 -- from the distance between the 2 mouse position <X1,Y1>,<X2,Y2>
1277 Zoom ( me: mutable; X,Y: Integer from Standard)
1280 ---Purpose: Zoom the view according to a zoom factor computed
1281 -- from the distance between the last and new mouse position <X,Y>
1283 StartZoomAtPoint(me : mutable;
1284 xpix, ypix : Integer from Standard);
1286 ---Purpose: Defines the point (pixel) of zooming (for the method ZoomAtPoint()).
1288 ZoomAtPoint(me : mutable;
1289 mouseStartX, mouseStartY, mouseEndX, mouseEndY : Integer from Standard);
1291 ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
1293 AxialScale ( me: mutable; Dx, Dy: Integer from Standard; Axis: TypeOfAxe from V3d );
1295 ---Purpose: Performs anisotropic scaling of <me> view along the given <Axis>.
1296 -- The scale factor is calculated on a basis of
1297 -- the mouse pointer displacement <Dx,Dy>.
1298 -- The calculated scale factor is then passed to SetAxialScale(Sx, Sy, Sz) method.
1300 StartRotation(me : mutable ; X,Y :Integer from Standard;
1301 zRotationThreshold: Ratio from Quantity = 0.0);
1303 ---Purpose: Begin the rotation of the view arround the screen axis
1304 -- according to the mouse position <X,Y>.
1305 -- Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
1306 -- factor is > 0 soon the distance from the start point and the center
1307 -- of the view is > (medium viewSize * <zRotationThreshold> ).
1308 -- Generally a value of 0.4 is usable to rotate around XY screen axis
1309 -- inside the circular treshold area and to rotate around Z screen axis
1310 -- outside this area.
1312 Rotation(me:mutable; X,Y :Integer from Standard);
1314 ---Purpose: Continues the rotation of the view
1315 -- with an angle computed from the last and new mouse position <X,Y>.
1317 FitAll ( me : mutable ; aWindow: Window from Aspect;
1318 Umin, Vmin, Umax, Vmax : Coordinate )
1321 ---Purpose: Change the scale factor and position of the view
1322 -- such as the bounding box <Umin, Vmin, Umax, Vmax> is contains
1326 -----------------------------------------
1327 ---Category: Private or Protected methods
1328 -----------------------------------------
1330 SetFocale( me : mutable ; Focale : Length )
1331 ---Purpose: Change View Plane Distance for Perspective Views
1332 raises TypeMismatch from Standard
1333 ---Purpose: Warning! raises TypeMismatch from Standard if the view
1334 -- is not a perspective view.
1337 Focale( me ) returns Length;
1338 ---Purpose: Returns the View Plane Distance for Perspective Views
1340 View ( me) returns mutable View from Visual3d is static ;
1342 ---Purpose: Returns the associated Visual3d view.
1344 ViewMapping ( me ) returns ViewMapping from Visual3d is static;
1346 ---Purpose: Returns the current mapping of the view.
1348 ViewOrientation ( me ) returns ViewOrientation from Visual3d is static;
1350 ---Purpose: Returns the current orientation of the view.
1352 ScreenAxis( myclass ; Vpn,Vup : Vector from Graphic3d ;
1353 Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
1354 returns Boolean is private ;
1355 ---Purpose: Determines the screen axes in the reference
1356 -- framework of the view.
1358 InitMatrix ( myclass ; Matrix : out Array2OfReal from TColStd ) is private ;
1361 Left, Right : Array2OfReal from TColStd ;
1362 Matrix : out Array2OfReal from TColStd )
1363 returns Boolean from Standard is private ;
1365 RotAxis( myclass ; Vrp : Vertex from Graphic3d ;
1366 Axe : Vector from Graphic3d ; Angle : PlaneAngle ;
1367 Matrix : out Array2OfReal from TColStd ) is private ;
1368 ---Purpose: Determines the rotation matrice around an axis
1369 -- for a given angle.
1371 TrsPoint( myclass ; P : Vertex from Graphic3d ;
1372 Matrix : Array2OfReal from TColStd )
1373 returns Vertex from Graphic3d is private ;
1374 ---Purpose: Transforms the point P according to the matrice Matrix .
1376 TrsPoint( myclass ; V : Vector from Graphic3d ;
1377 Matrix : Array2OfReal from TColStd )
1378 returns Vector from Graphic3d is private ;
1379 ---Purpose: Transforms the vector V according to the matrice Matrix .
1381 ImmediateUpdate (me) is static protected;
1384 -----------------------------------------
1385 ---Category: TransientManager methods
1386 -----------------------------------------
1388 TransientManagerBeginDraw(me; DoubleBuffer: Boolean = Standard_False;
1389 RetainMode : Boolean = Standard_False)
1391 ---Purpose: Begins any graphics in the view <aView>
1392 -- Redraw any structured graphics in the back buffer before
1393 -- if <DoubleBuffer> is TRUE.
1394 -- Restore the front buffer from the back before
1395 -- if <DoubleBuffer> is FALSE.
1396 -- if <RetainMode> is TRUE.
1397 -- the graphic managed itself exposure,resizing ...
1398 -- if <RetainMode> is FALSE.
1399 -- the application must managed itself exposure,resizing ...
1401 returns Boolean from Standard;
1403 TransientManagerClearDraw(me);
1405 ---Purpose: Clear all transient graphics in the view <aView>
1408 TransientManagerBeginAddDraw(me)
1410 ---Purpose: Begins any add graphics in the view <aView>
1411 -- Redraw any structured graphics in the back buffer before
1412 -- the application must managed itself exposure,resizing ...
1413 -- Warning: Returns TRUE if transient drawing is enabled in
1414 -- the associated view.
1415 -- Returns FALSE ,if nothing works because something
1416 -- is wrong for the transient principle :
1418 returns Boolean from Standard;
1420 SetComputedMode ( me : mutable; aMode : Boolean from Standard )
1423 ---Purpose: Switches computed HLR mode in the view
1424 ---Category: Methods to modify the class definition
1427 returns Boolean from Standard
1430 ---Purpose: Returns the computed HLR mode state
1431 ---Category: Inquire methods
1433 MinMax ( me; Umin,Vmin, Umax,Vmax : out Coordinate ) returns Integer
1434 ---Purpose: Returns the objects number and the projection window
1435 -- of the objects contained in the view.
1438 MinMax ( me; Xmin,Ymin,Zmin, Xmax,Ymax,Zmax : out Coordinate )
1440 ---Purpose: Returns the objects number and the box encompassing
1441 -- the objects contained in the view
1444 Gravity ( me; X,Y,Z : out Coordinate ) returns Integer
1445 ---Purpose: Returns the Objects number and the gravity center
1446 -- of ALL viewable points in the view
1449 Init(me: mutable) is private;
1451 ---Category: for compatibility.
1453 WindowFitAll ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer);
1454 ---Purpose: idem than WindowFit
1456 SetPlotter ( me : mutable; aPlotter : Plotter from Graphic3d )
1457 ---Purpose: Set a plotter for plotting the contents of the view
1461 Plot ( me : mutable )
1462 ---Purpose: Create a 2D View for plotting the contents of the view
1463 raises BadValue from V3d;
1464 -- if the plotter is undefined.
1466 Compute ( me; AVertex : Vertex from Graphic3d )
1467 returns Vertex from Graphic3d
1470 ---Purpose: Returns a new vertex when the grid is activated.
1472 SetGrid ( me : mutable;
1473 aPlane: Ax3 from gp;
1474 aGrid : Grid from Aspect )
1477 ---Purpose: Defines or Updates the definition of the
1479 ---Category: Methods to modify the class definition
1481 SetGridGraphicValues ( me : mutable;
1482 aGrid : Grid from Aspect )
1485 ---Purpose: Defines or Updates the graphic definition of the
1487 ---Category: Methods to modify the class definition
1489 SetGridActivity ( me : mutable;
1490 aFlag : Boolean from Standard )
1493 ---Purpose: Defines or Updates the activity of the
1495 ---Category: Methods to modify the class definition
1498 theFile : CString from Standard;
1499 theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB )
1500 returns Boolean from Standard;
1502 ---Purpose: dump the full contents of the view at the same
1503 -- scale in the file <theFile>. The file name
1504 -- extension must be one of ".png",".bmp",".jpg",".gif".
1505 -- Returns FALSE when the dump has failed
1507 Print (me; hPrnDC: Handle from Aspect = NULL;
1508 showDialog: Boolean = Standard_True;
1509 showBackground : Boolean = Standard_True;
1510 filename: CString = NULL;
1511 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH)
1512 returns Boolean from Standard is static;
1515 ---Purpose: print the contents of the view to printer with preview.
1516 -- <hPrnDC> : If you have already an PrinterDeviceContext (HDC),
1517 -- then you can pass it to the print routines.
1518 -- If you don't have an PrinterDeviceContext, then this parameter should
1520 -- <showDialog> : If hPrnDC == NULL, then you can force the print routines to
1521 -- open a Print Dialog box.
1522 -- If you want to do this, then set showDialog to TRUE
1523 -- If you don't want to see a dialog (only possible, if you have a hPrnDC
1524 -- or the dialog box was opened once before) then set <showDialog> to FALSE.
1525 -- <showBackground> : When set to FALSE then print the view without background color
1526 -- (background is white)
1527 -- else set to TRUE for printing with current background color.
1528 -- <filename>: If != NULL, then the view will be printed to a file.
1529 -- <printAlgorithm>: If you want to select the print algorithm, then you can
1530 -- specify one of existing algorithms: Aspect_PA_STRETCH, Aspect_PA_TILE.
1531 -- Returns Standard_True if the data is passed to the printer, otherwise
1532 -- Standard_False if the print operation failed. This might be related to
1533 -- insufficient memory or some internal errors. All this errors are
1534 -- indicated by the message boxes (on level of OpenGl_GraphicDriver).
1535 -- Warning: This function can reuse FBO assigned to the
1536 -- view on level of OpenGl_GraphicDriver; Please take it into account if
1537 -- you use it for your purposes;
1538 -- Warning: Works only under Windows.
1540 ToPixMap ( me : mutable;
1541 theImage : in out PixMap from Image;
1542 theWidth : Integer from Standard;
1543 theHeight : Integer from Standard;
1544 theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB;
1545 theForceCentered : Boolean from Standard = Standard_True )
1546 returns Boolean from Standard;
1548 ---Purpose : dump the full contents of the view
1549 -- to a pixmap of pixel size <theWidth>*<theHeight> and
1550 -- buffer type <theBufferType>. If <theForceCentered> is true
1551 -- view scene will be centered.
1552 -- Pixmap will be automatically (re)allocated when needed.
1554 SetProjModel( me : mutable;
1555 amOdel: TypeOfProjectionModel from V3d = V3d_TPM_SCREEN )
1558 ---Purpose : Manages projection model
1561 returns TypeOfProjectionModel from V3d
1564 ---Purpose : Returns the current projection model
1566 SetBackFacingModel ( me : mutable;
1567 aModel : TypeOfBackfacingModel from V3d = V3d_TOBM_AUTOMATIC)
1570 ---Purpose : Manages display of the back faces
1571 -- When <aModel> is TOBM_AUTOMATIC the object backfaces
1572 -- are displayed only for surface objects and
1573 -- never displayed for solid objects.
1574 -- this was the previous mode.
1575 -- <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces
1576 -- are always displayed both for surfaces or solids.
1577 -- <aModel> is TOBM_NEVER_DISPLAYED the object backfaces
1578 -- are never displayed.
1580 BackFacingModel ( me )
1581 returns TypeOfBackfacingModel from V3d
1584 ---Purpose : Returns current state of the back faces display
1586 EnableDepthTest( me; enable : Boolean from Standard = Standard_True )
1589 ---Purpose: turns on/off opengl depth testing
1591 IsDepthTestEnabled( me ) returns Boolean from Standard
1594 ---Purpose: returns the current state of the depth testing
1596 EnableGLLight( me; enable : Boolean from Standard = Standard_True )
1599 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1601 IsGLLightEnabled( me ) returns Boolean from Standard
1604 ---Purpose: returns the current state of the gl lighting
1605 -- currently used in triedron displaying
1610 MyType : TypeOfView from V3d is protected ;
1611 MyViewer : ViewerPointer from V3d ;
1612 MyActiveLights: ListOfTransient from V3d;
1613 MyActivePlanes: ListOfTransient from V3d;
1615 MyView : View from Visual3d is protected ;
1616 MyViewMapping : ViewMapping from Visual3d is protected ;
1617 MyViewOrientation : ViewOrientation from Visual3d ;
1618 MyViewContext : ContextView from Visual3d ;
1619 MyBackground: Background from Aspect ;
1620 MyGradientBackground: GradientBackground from Aspect ;
1621 MyDefaultViewAxis: Vector from Graphic3d ;
1622 MyDefaultViewPoint: Vertex from Graphic3d ;
1624 MyWindow: Window from Aspect;
1626 MyPlotter: Plotter from Graphic3d;
1628 myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
1629 myActivePlanesIterator: ListIteratorOfListOfTransient from TColStd;
1631 sx,sy: Integer from Standard;
1632 rx,ry: Real from Standard;
1633 gx,gy,gz: Real from Standard;
1634 myComputedMode: Boolean from Standard;
1635 SwitchSetFront: Boolean from Standard;
1636 MyZoomAtPointX, MyZoomAtPointY : Integer from Standard;
1639 MyGrid : Grid from Aspect;
1640 MyPlane : Ax3 from gp;
1642 --MyColorScale : ColorScale from V3d;
1643 MyLayerMgr : LayerMgr from V3d;
1645 MyProjModel : TypeOfProjectionModel from V3d is protected;
1647 -- the transformation between XoY and the grid plane
1648 MyTrsf : Array2OfReal from TColStd;
1651 MyGridEchoStructure : Structure from Graphic3d;
1652 MyGridEchoGroup : Group from Graphic3d;
1654 MyTransparencyFlag : Boolean from Standard;
1655 myImmediateUpdate: Boolean from Standard is protected;
1658 SetViewOn from class Viewer from V3d ( me : mutable ),
1659 SetViewOn from class Viewer from V3d ( me : mutable ; View : View from V3d ),
1660 SetViewOff from class Viewer from V3d ( me : mutable ),
1661 SetViewOff from class Viewer from V3d ( me : mutable ; View : View from V3d )