0022337: V3d_View::Print crashes in OCCT 6.5.0
[occt.git] / src / V3d / V3d_View.cdl
CommitLineData
7fd59977 1--
2-- File: V3d_View.cdl
3-- Created: Wed Jan 15 14:47:42 1992
4-- Author: GG
5-- Modified: FMN - 24/12/97 -> Suppression GEOMLITE
6-- CQO - 24/12/97 -> BUC50037
7-- stt:25-02-98; S3558: ajout IfManageStandardEvent
8-- stt:08-04-98; suppr IfManageStandardEvent
9-- CAL - 18/08/98 -> S3892. Ajout grilles 3d.
10-- BGN - 16-09-98; Points d'entree du Triedre (S3819, Phase 1)
11-- 22-09-98 ; BGN : S3989 (anciennement S3819)
12-- TypeOfTriedron* from Aspect(et pas V3d)
13-- CAL - 21/10/98 -> Speciale. Ajout methode Tumble.
14-- 29-OCT-98 : DCB : Adding ScreenCopy () method.
15-- GG - 10/11/99 : PRO19603 Adding Redraw( area ) method
16-- GG - 15/12/99 : GER61351 Adding SetBackgroundColor()
17-- and BackgroundColor() methods
18-- GG - 24/01/00 : -> Remove internal PixToRef() method, use Convert()
19-- method instead.
20-- -> Rename internal RefToPix() to Convert() method.
21-- -> Add ConvertToGrid() methods,
22-- the Compute() internal method become private.
23-- -> Add SetProjModel() method.
24-- EUG - 25/01/00 : G003
25-- -> Add methods SetAnimationMode() and
26-- AnimationMode()
27-- -> Add methods SetComputedMode() and
28-- ComputedMode()
29-- Warning : SetDegenerateModeOn() and Off()
30-- become obsolete.
31-- -> Add methods SetBackFacingModel() and
32-- BackFacingModel()
33-- VKH - 15/11/99 : G004
34-- -> Add method Dump()
35-- GG - IMP210200
36-- -> Add Transparency() method
37--
38-- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
39-- -> Add Print method (works only under Windows).
40--
41-- GG - IMP231100
42-- -> Add IsActiveLight() & IsActivePlane() methods
43-- SZV - IMP100701
44-- -> Add ToPixMap() method
45-- GG - RIC120302 Add NEW SetWindow method.
46--
47-- SAV - 22/10/01
48-- -> Add EnableDepthTest() & IsDepthTestEnabled().
49-- VSV - 28/05/02: ZBUFFER mode of Trihedron
50--
51-- SAV - 23/12/02 -> Added methods to set background image
52--
53-- NKV - 23/07/07 -> Define custom projection and model view matrixes
54--
55-- NKV - 08/02/07 -> Add ConvertWithProj() method
56--
57---Copyright: Matra Datavision 1992
58--
59
60deferred class View from V3d
61
62 ---Purpose: Defines the application object VIEW for the
63 -- VIEWER application.
64 -- The methods of this class allow the editing
65 -- and inquiring the parameters linked to the view.
66 -- (Projection,Mapping,Zclipping,DepthCueing,AntiAliasing
67 -- et Conversions) .
68 -- Warning: The default parameters are defined by the class
69 -- Viewer (Example : SetDefaultViewSize()).
70 -- Certain methods are mouse oriented, and it is
71 -- necessary to know the difference between the start and
72 -- the continuation of this gesture in putting the method
73 -- into operation.
74 -- Example : Shifting the eye-view along the screen axes.
75 --
76 -- View->Move(10.,20.,0.,True) (Starting motion)
77 -- View->Move(15.,-5.,0.,False) (Next motion)
78
79
80inherits
81
82 View from Viewer
83
84uses
85
86 -- S3892
87 Ax3 from gp,
88 LayerMgr from V3d,
89 ColorScale from V3d,
90 ColorScale from Aspect,
91 Array2OfReal from TColStd,
92 Grid from Aspect,
93 Handle from Aspect,
94 Structure from Graphic3d,
95 Group from Graphic3d,
96
97 ListOfTransient from V3d,
98 ListIteratorOfListOfTransient from TColStd,
99 TypeOfView from V3d,
100 TypeOfAxe from V3d,
101 TypeOfOrientation from V3d,
102 TypeOfShadingModel from V3d,
103 TypeOfSurfaceDetail from V3d,
104 TextureEnv from Graphic3d,
105 TypeOfVisualization from V3d,
106 TypeOfZclipping from V3d,
107 TypeOfProjectionModel from V3d,
108 TypeOfBackfacingModel from V3d,
109 Viewer from V3d,
110 Light from V3d,
111 Plane from V3d,
112 View from Visual3d,
113 ViewMapping from Visual3d,
114 ViewOrientation from Visual3d,
115 ContextView from Visual3d,
116 Vector from Graphic3d,
117 Vertex from Graphic3d,
118 Plotter from Graphic3d,
119 Window from Aspect,
120 PixMap from Image,
121 TypeOfImage from Image,
122 Background from Aspect,
123 GradientBackground from Aspect,
124 PlotterDriver from PlotMgt,
125 TypeOfColor from Quantity,
126 NameOfColor from Quantity,
127 Color from Quantity,
128 Length from Quantity,
129 PlaneAngle from Quantity,
130 Parameter from Quantity,
131 Factor from Quantity,
132 Ratio from Quantity,
133 Coefficient from Quantity,
134 Coordinate from V3d,
135 Array2OfReal from TColStd,
136 ViewerPointer from V3d,
137 TransientManager from Visual3d,
138 TypeOfTriedronEcho from Aspect,
139 TypeOfTriedronPosition from Aspect,
140 FormatOfSheetPaper from Aspect,
141 RenderingContext from Aspect,
142 GraphicCallbackProc from Aspect,
143 FillMethod from Aspect,
144 GradientFillMethod from Aspect,
13a22457
S
145 FontAspect from OSD,
146 AsciiString from TCollection,
7edf74fd
A
147 ExtendedString from TCollection,
148 PrintAlgo from Aspect
7fd59977 149
150raises
151
152 BadValue from Viewer, TypeMismatch from Standard,
153 MultiplyDefined from Standard,UnMapped from V3d
154
155is
156
157 Initialize ( VM : mutable Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
158 ---Purpose: Initialises the view.
159
160 Initialize ( VM : mutable Viewer ; V : View from V3d; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
161 ---Purpose: Initialises the view by copying.
162
163 --------------------------------------------------------
164 ---Category: Methods to modify the Status of the view
165 --------------------------------------------------------
166
167 SetWindow ( me : mutable ; IdWin : Window )
168 ---Purpose: Activates the view in the window specified and Map the
169 -- Window to the screen.
170 raises MultiplyDefined from Standard;
171 ---Level: Public
172 ---Purpose: Warning! raises MultiplyDefined from Standard
173 -- if the view is already activated in a window.
174 -- Warning: The view is centered and resized to preserve
175 -- the height/width ratio of the window.
176
177 SetWindow ( me : mutable ;
178 aWindow : Window from Aspect;
179 aContext : RenderingContext from Aspect;
180 aDisplayCB : GraphicCallbackProc from Aspect;
181 aClientData : Address from Standard
182 )
183 ---Purpose: Activates the view in the specified Window
184 -- If <aContext> is not NULL the graphic context is used
185 -- to draw something in this view.
186 -- Otherwise an internal graphic context is created.
187 -- If <aDisplayCB> is not NULL then a user display CB is
188 -- call at the end of the OCC graphic traversal and just
189 -- before the swap of buffers. The <aClientData> is pass
190 -- to this call back.
191 raises MultiplyDefined from Standard;
192 ---Level: Public
193 ---Purpose: Warning! raises MultiplyDefined from Standard
194 -- if the view is already activated in a window.
195 -- Warning: The view is centered and resized to preserve
196 -- the height/width ratio of the window.
197
198 SetMagnify (me: mutable; IdWin : Window;
199 aPreviousView : View from V3d;
200 x1 , y1 , x2 , y2: Integer from Standard)
201 is static;
202
203 Remove ( me );
204 ---Level: Public
205 ---Purpose: Destroys the view.
206
207 Update ( me ) is redefined static;
208 ---Level: Public
209 ---Purpose: Updates the display of the view.
210 -- Must be called to update the view
211 -- when the update mode is deferred (WAIT) .
212
213 Redraw ( me );
214 ---Level: Public
215 ---Purpose: Redisplays the view even if there has not
216 -- been any modification.
217 -- Must be called if the view is shown.
218 -- (Ex: DeIconification ) .
219
220 Redraw ( me ;x,y,width,height: Integer from Standard);
221 ---Level: Public
222 ---Purpose: Redisplays the view area after esxposure.
223 -- [x,y] define the min xy area position
224 -- [width,height] the size of the area in pixel unit.
225
226 MustBeResized ( me : mutable )
227 ---Level: Public
228 ---Purpose: Must be called when the window supporting the
229 -- view changes size.
230 raises UnMapped from V3d;
231 ---Purpose: if the view is not mapped on a window.
232 -- Warning: The view is centered and resized to preserve
233 -- the height/width ratio of the window.
234
235 DoMapping ( me : mutable );
236 ---Level: Advanced
237 ---Purpose: Must be called when the window supporting the
238 -- view is mapped or unmapped.
239
240 IsEmpty ( me ) returns Boolean;
241 ---Level: Public
242 ---Purpose: Returns the status of the view regarding
243 -- the displayed structures inside
244 -- Returns True is The View is empty
245
246 UpdateLights (me);
247 ---Level: Public
248 ---Purpose: Updates the lights of the view. The view is redrawn.
249
250 --------------------------------------------------------
251 ---Category: Methods to modify the Attributes of the view
252 --------------------------------------------------------
253
254 SetBackgroundColor ( me : mutable ;
255 Type : TypeOfColor; V1, V2, V3 : Parameter );
256 ---Level: Public
257 ---Purpose: Defines the background colour of the view
258 -- by supplying :
259 -- the colour definition type,
260 -- and the three corresponding values.
261
262 SetBackgroundColor ( me : mutable ; Color : Color from Quantity );
263 ---Level: Public
264 ---Purpose: Defines the background colour of the view
265 -- by supplying :
266 -- the colour object.
267
268 SetBackgroundColor ( me : mutable ; Name : NameOfColor );
269 ---Level: Public
270 ---Purpose: Defines the background colour of the view
271 -- by supplying :
272 -- the colour name in the form Quantity_NOC_xxxx .
273
274 SetBgGradientColors ( me : mutable ;
275 Color1 : Color from Quantity;
276 Color2 : Color from Quantity;
277 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
278 update : Boolean from Standard = Standard_False );
279 ---Level: Public
280 ---Purpose: Defines the gradient background colours of the view
281 -- by supplying :
282 -- the colour objects.
283
284 SetBgGradientColors ( me : mutable ;
285 Color1 : NameOfColor;
286 Color2 : NameOfColor;
287 FillStyle : GradientFillMethod from Aspect = Aspect_GFM_HOR;
288 update : Boolean from Standard = Standard_False );
289 ---Level: Public
290 ---Purpose: Defines the gradient background colours of the view
291 -- by supplying :
292 -- the colour names in the form Quantity_NOC_xxxx .
293
294 SetBgGradientStyle( me ;
295 AMethod : GradientFillMethod from Aspect = Aspect_GFM_HOR;
296 update : Boolean from Standard = Standard_False);
297 ---Level: Public
298 ---Purpose: Defines the gradient background fill method of the view
299
300 SetBackgroundImage( me : mutable; FileName : CString from Standard;
301 FillStyle : FillMethod from Aspect = Aspect_FM_CENTERED;
302 update : Boolean from Standard = Standard_False );
303
304 SetBgImageStyle( me : mutable; FillStyle : FillMethod from Aspect;
305 update : Boolean from Standard = Standard_False );
306
307 SetAxis ( me : mutable; X,Y,Z : Coordinate ;
308 Vx,Vy,Vz : Parameter )
309 ---Level: Public
310 ---Purpose: Definition of an axis from its origin and
311 -- its orientation .
312 -- This will be the current axis for rotations and movements.
313 raises BadValue from Viewer;
314 ---Purpose: Warning! raises BadValue from Viewer if the vector normal is NULL. .
315
316 SetShadingModel ( me : mutable; Model : TypeOfShadingModel );
317 ---Level: Public
318 ---Purpose: Defines the shading model for the
319 -- visualisation ZBUFFER mode.
320 -- Various models are available.
321
322 SetSurfaceDetail(me : mutable; SurfaceDetail : TypeOfSurfaceDetail);
323 ---Level: Public
324 ---Purpose: select the kind of rendering for texture mapping
325 -- no texture mapping by default
326
327 SetTextureEnv(me : mutable; ATexture : TextureEnv from Graphic3d);
328 ---Level: Public
329 ---Purpose: set the environment texture to use
330 -- no environment texture by default
331
332 SetVisualization ( me : mutable;
333 Mode : TypeOfVisualization from V3d );
334 ---Level: Public
335 ---Purpose: Defines the visualisation mode in the view.
336
337 SetAntialiasingOn ( me : mutable );
338 ---Level: Public
339 ---Purpose: Activates antialiasing in the view.
340
341 SetAntialiasingOff ( me : mutable );
342 ---Level: Public
343 ---Purpose: Desactivates antialiasing in the view.
344
345 SetZClippingDepth ( me : mutable; Depth : Length );
346 ---Level: Public
347 ---Purpose: Defines the depth of the medium clipping plane.
348
349 SetZClippingWidth ( me : mutable; Width : Length )
350 ---Level: Public
351 ---Purpose: Defines the thicknes around the medium clippling plane. .
352 raises BadValue from Viewer;
353 -- If the thickness is <= 0
354
355 SetZClippingType ( me : mutable; Type : TypeOfZclipping );
356 ---Level: Public
357 ---Purpose: Defines the type of ZClipping.
358
359 SetZCueingDepth ( me : mutable; Depth : Length );
360 ---Level: Public
361 ---Purpose: Defines the depth of the medium plane.
362
363 SetZCueingWidth ( me : mutable; Width : Length )
364 ---Level: Public
365 ---Purpose: Defines the thickness around the medium plane.
366 raises BadValue from Viewer;
367 -- If thickness is <= 0
368
369 SetZCueingOn ( me : mutable );
370 ---Level: Public
371 ---Purpose: Activates ZCueing in the view.
372
373 SetZCueingOff ( me : mutable );
374 ---Level: Public
375 ---Purpose: Desactivates ZCueing in the view.
376
377 SetLightOn( me : mutable ; MyLight : Light from V3d )
378 ---Level: Public
379 ---Purpose: Activates MyLight in the view.
380 raises BadValue from Viewer;
381 -- If No More Light can be activated in MyView .
382
383 SetLightOn( me : mutable )
384 ---Level: Public
385 ---Purpose: Activates all the lights defined in this view.
386 raises BadValue from Viewer;
387 -- If No More Light can be activated in MyView .
388
389 SetLightOff( me : mutable ; MyLight : Light from V3d );
390 ---Level: Public
391 ---Purpose: Desactivate MyLight in this view.
392
393 SetLightOff( me : mutable );
394 ---Level: Public
395 ---Purpose: Deactivate all the Lights defined in this view.
396
397 IsActiveLight( me ; aLight: Light from V3d )
398 returns Boolean from Standard;
399 ---Level: Public
400 ---Purpose: Returns TRUE when the light is active in this view.
401
402 SetTransparency( me : mutable ; AnActivity : Boolean = Standard_False);
403 ---Level: Public
404 ---Purpose: Activate/Deactivate the transparency in this view.
405
406 SetPlaneOn( me : mutable ; MyPlane : Plane from V3d )
407 ---Level: Public
408 ---Purpose: Activates the clipping plane in this view.
409 raises BadValue from Viewer ;
410 ---Purpose: If No More Plane can be activated in MyView .
411
412 SetPlaneOn( me : mutable )
413 ---Level: Public
414 ---Purpose: Activate all the clipping planes defined in
415 -- this view.
416 raises BadValue from Viewer;
417 ---Purpose: If No More Plane can be activated in MyView .
418
419 SetPlaneOff( me : mutable ; MyPlane : Plane from V3d );
420 ---Level: Public
421 ---Purpose: Desactivates the clipping plane defined
422 -- in this view.
423
424 SetPlaneOff( me : mutable );
425 ---Level: Public
426 ---Purpose: Deactivate all clipping planes defined
427 -- in this view.
428
429 IsActivePlane( me ; aPlane: Plane from V3d )
430 returns Boolean from Standard;
431 ---Level: Public
432 ---Purpose: Returns TRUE when the plane is active in this view.
433
434 ---------------------------------------------------
435 -- Triedron methods
436 ---------------------------------------------------
437
438 ZBufferTriedronSetup ( me : mutable;
439 XColor : NameOfColor from Quantity = Quantity_NOC_RED;
440 YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
441 ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
442 SizeRatio : Real from Standard = 0.8;
443 AxisDiametr : Real from Standard = 0.05;
444 NbFacettes : Integer from Standard = 12)
445 is static;
446 ---Level: Advanced
447 ---Purpose: Customization of the ZBUFFER Triedron.
448 --- XColor,YColor,ZColor - colors of axis
449 --- SizeRatio - ratio of decreasing of the trihedron size when its phisical
450 --- position comes out of the view
451 --- AxisDiametr - diameter relatively to axis length
452 --- NbFacettes - number of facettes of cylinders and cones
453
454 TriedronDisplay ( me : mutable;
455 APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
456 AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
457 AScale : Real from Standard = 0.02;
458 AMode : TypeOfVisualization from V3d = V3d_WIREFRAME )
459 is static;
460 ---Level: Advanced
461 ---Purpose: Display of the Triedron.
462 --- Initialize position, color and length of Triedron axes.
463 --- The scale is a percent of the window width.
464 ---Category:
465
466 TriedronErase ( me : mutable )
467 is static;
468 ---Level: Advanced
469 ---Purpose: Erases the Triedron.
470 ---Category:
471
472 TriedronEcho ( me : mutable;
473 AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
474 is static;
475 ---Level: Advanced
476 ---Purpose: Highlights the echo zone of the Triedron.
477 ---Category:
478
479 ---------------------------------
480 ---Category: Graduated trihedron
481 ---------------------------------
482
483 GetGraduatedTrihedron(me;
484 -- Names of axes --
13a22457 485 xname, yname, zname : out ExtendedString from TCollection;
7fd59977 486 -- Draw names --
13a22457 487 xdrawname, ydrawname, zdrawname : out Boolean from Standard;
7fd59977 488 -- Draw values --
13a22457 489 xdrawvalues, ydrawvalues, zdrawvalues : out Boolean from Standard;
7fd59977 490 -- Draw grid --
491 drawgrid : out Boolean from Standard;
492 -- Draw axes --
493 drawaxes : out Boolean from Standard;
494 -- Number of splits along axes --
13a22457 495 nbx, nby, nbz : out Integer from Standard;
7fd59977 496 -- Offset for drawing values --
13a22457 497 xoffset, yoffset, zoffset : out Integer from Standard;
7fd59977 498 -- Offset for drawing names of axes --
13a22457 499 xaxisoffset, yaxisoffset, zaxisoffset : out Integer from Standard;
7fd59977 500 -- Draw tickmarks --
13a22457 501 xdrawtickmarks, ydrawtickmarks, zdrawtickmarks : out Boolean from Standard;
7fd59977 502 -- Length of tickmarks --
13a22457 503 xtickmarklength, ytickmarklength, ztickmarklength : out Integer from Standard;
7fd59977 504 -- Grid color --
505 gridcolor : out Color from Quantity;
13a22457
S
506 -- Colors of axis names --
507 xnamecolor, ynamecolor, znamecolor : out Color from Quantity;
508 -- Colors of axis and values --
509 xcolor, ycolor, zcolor : out Color from Quantity;
7fd59977 510 -- Name of font for names of axes --
13a22457 511 fontOfNames : out AsciiString from TCollection;
7fd59977 512 -- Style of names of axes --
513 styleOfNames : out FontAspect from OSD;
514 -- Size of names of axes --
515 sizeOfNames : out Integer from Standard;
516 -- Name of font for values --
13a22457 517 fontOfValues : out AsciiString from TCollection;
7fd59977 518 -- Style of values --
519 styleOfValues : out FontAspect from OSD;
520 -- Size of values --
521 sizeOfValues : out Integer from Standard)
522 ---Purpose: Returns data of a graduated trihedron.
523 is static;
524
525 GraduatedTrihedronDisplay(me : mutable;
526 -- Names of axes --
13a22457
S
527 xname : ExtendedString from TCollection = "X";
528 yname : ExtendedString from TCollection = "Y";
529 zname : ExtendedString from TCollection = "Z";
7fd59977 530 -- Draw names --
531 xdrawname : Boolean from Standard = Standard_True;
532 ydrawname : Boolean from Standard = Standard_True;
533 zdrawname : Boolean from Standard = Standard_True;
534 -- Draw values --
535 xdrawvalues : Boolean from Standard = Standard_True;
536 ydrawvalues : Boolean from Standard = Standard_True;
537 zdrawvalues : Boolean from Standard = Standard_True;
538 -- Draw grid --
539 drawgrid : Boolean from Standard = Standard_True;
540 -- Draw axes --
541 drawaxes : Boolean from Standard = Standard_True;
542 -- Number of splits along axes --
543 nbx : Integer from Standard = 3;
544 nby : Integer from Standard = 3;
545 nbz : Integer from Standard = 3;
546 -- Offset for drawing values --
547 xoffset : Integer from Standard = 10;
548 yoffset : Integer from Standard = 10;
549 zoffset : Integer from Standard = 10;
550 -- Offset for drawing names of axes --
551 xaxisoffset : Integer from Standard = 30;
552 yaxisoffset : Integer from Standard = 30;
553 zaxisoffset : Integer from Standard = 30;
554 -- Draw tickmarks --
555 xdrawtickmarks : Boolean from Standard = Standard_True;
556 ydrawtickmarks : Boolean from Standard = Standard_True;
557 zdrawtickmarks : Boolean from Standard = Standard_True;
558 -- Length of tickmarks --
559 xtickmarklength : Integer from Standard = 10;
560 ytickmarklength : Integer from Standard = 10;
561 ztickmarklength : Integer from Standard = 10;
562 -- Grid color --
563 gridcolor : Color from Quantity = Quantity_NOC_WHITE;
564 -- X name color --
565 xnamecolor : Color from Quantity = Quantity_NOC_RED;
566 -- Y name color --
567 ynamecolor : Color from Quantity = Quantity_NOC_GREEN;
568 -- Z name color --
569 znamecolor : Color from Quantity = Quantity_NOC_BLUE1;
570 -- X color of axis and values --
571 xcolor : Color from Quantity = Quantity_NOC_RED;
572 -- Y color of axis and values --
573 ycolor : Color from Quantity = Quantity_NOC_GREEN;
574 -- Z color of axis and values --
575 zcolor : Color from Quantity = Quantity_NOC_BLUE1;
576 -- Name of font for names of axes --
13a22457 577 fontOfNames : AsciiString from TCollection = "Arial";
7fd59977 578 -- Style of names of axes --
579 styleOfNames : FontAspect from OSD = OSD_FA_Bold;
580 -- Size of names of axes --
581 sizeOfNames : Integer from Standard = 12;
582 -- Name of font for values --
13a22457 583 fontOfValues : AsciiString from TCollection = "Arial";
7fd59977 584 -- Style of values --
585 styleOfValues : FontAspect from OSD = OSD_FA_Regular;
586 -- Size of values --
587 sizeOfValues : Integer from Standard = 12)
588 ---Purpose: Displays a graduated trihedron.
589 is static;
590
591 GraduatedTrihedronErase(me : mutable)
592 ---Purpose: Erases a graduated trihedron from the view.
593 is static;
594
595 ---------------------------------------------------
596 -- Color Scale methods
597 ---------------------------------------------------
598
599 SetLayerMgr(me : mutable; aMgr : LayerMgr from V3d);
600
601 ColorScaleDisplay(me : mutable);
602
603 ColorScaleErase(me : mutable);
604
605 ColorScaleIsDisplayed(me)
606 returns Boolean from Standard;
607
608 ColorScale(me)
609 returns ColorScale from Aspect;
610
611 --------------------------------------------------------
612 ---Category: Methods to modify the Projection of the view
613 --------------------------------------------------------
614
615 SetFront(me: mutable);
616 ---Level: Public
617 ---Purpose: modify the Projection of the view perpendicularly to
618 -- the privileged plane of the viewer.
619
620 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
621 Start : Boolean = Standard_True )
622 ---Level: Public
623 ---Purpose: Rotates the eye about the coordinate system of
624 -- reference of the screen
625 -- for which the origin is the view point of the projection,
626 -- with a relative angular value in RADIANS with respect to
627 -- the initial position expressed by Start = Standard_True
628 raises BadValue from Viewer;
629 ---Purpose: Warning! raises BadValue from Viewer
630 -- If the eye, the view point, or the high point are
631 -- aligned or confused.
632
633 Rotate ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
634 X,Y,Z : Coordinate ;
635 Start : Boolean = Standard_True )
636 ---Level: Public
637 ---Purpose: Rotates the eye about the coordinate system of
638 -- reference of the screen
639 -- for which the origin is Gravity point {X,Y,Z},
640 -- with a relative angular value in RADIANS with respect to
641 -- the initial position expressed by Start = Standard_True
642 raises BadValue from Viewer;
643 ---Purpose: If the eye, the view point, or the high point are
644 -- aligned or confused.
645
646 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
647 X,Y,Z : Coordinate ;
648 Start : Boolean = Standard_True );
649 ---Level: Public
650 ---Purpose: Rotates the eye about one of the coordinate axes of
651 -- of the view for which the origin is the Gravity point{X,Y,Z}
652 -- with an relative angular value in RADIANS with
653 -- respect to the initial position expressed by
654 -- Start = Standard_True
655
656 Rotate ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
657 Start : Boolean = Standard_True ) ;
658 ---Level: Public
659 ---Purpose: Rotates the eye about one of the coordinate axes of
660 -- of the view for which the origin is the view point of the
661 -- projection with an relative angular value in RADIANS with
662 -- respect to the initial position expressed by
663 -- Start = Standard_True
664
665 Rotate ( me : mutable ; Angle : PlaneAngle ;
666 Start : Boolean = Standard_True );
667 ---Level: Public
668 ---Purpose: Rotates the eye around the current axis a relative
669 -- angular value in RADIANS with respect to the initial
670 -- position expressed by Start = Standard_True
671
672 Move ( me : mutable ; Dx,Dy,Dz : Length ;
673 Start : Boolean = Standard_True )
674 ---Level: Public
675 ---Purpose: Movement of the eye parallel to the coordinate system
676 -- of reference of the screen a distance relative to the
677 -- initial position expressed by Start = Standard_True.
678 raises BadValue from Viewer;
679 -- If the eye, the view point, or the high point are
680 -- aligned or confused.
681
682 Move ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
683 Start : Boolean = Standard_True )
684 ---Level: Public
685 ---Purpose: Movement of the eye parallel to one of the axes of the
686 -- coordinate system of reference of the view a distance
687 -- relative to the initial position expressed by
688 -- Start = Standard_True.
689 raises BadValue from Viewer;
690 -- If the eye, view point, or high point are aligned or confused.
691
692 Move ( me : mutable ; Length : Length ;
693 Start : Boolean = Standard_True )
694 ---Level: Public
695 ---Purpose: Movement of the eye parllel to the current axis
696 -- a distance relative to the initial position
697 -- expressed by Start = Standard_True
698 raises BadValue from Viewer;
699 -- If the eye, view point, or high point are aligned or confused.
700
701 Translate ( me : mutable ; Dx,Dy,Dz : Length ;
702 Start : Boolean = Standard_True )
703 ---Level: Public
704 ---Purpose: Movement of the ye and the view point parallel to the
705 -- frame of reference of the screen a distance relative
706 -- to the initial position expressed by
707 -- Start = Standard_True
708 raises BadValue from Viewer;
709 -- If the eye, view point, or high point are aligned or confused.
710
711 Translate ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
712 Start : Boolean = Standard_True );
713 ---Level: Public
714 ---Purpose: Movement of the eye and the view point parallel to one
715 -- of the axes of the fame of reference of the view a
716 -- distance relative to the initial position
717 -- expressed by Start = Standard_True
718
719 Translate ( me : mutable ; Length : Length ;
720 Start : Boolean = Standard_True );
721 ---Level: Public
722 ---Purpose: Movement of the eye and view point parallel to
723 -- the current axis a distance relative to the initial
724 -- position expressed by Start = Standard_True
725
726 Place (me: mutable; x,y: Integer from Standard;
727 aZoomFactor: Factor from Quantity = 1)
728 ---Level: Public
729 ---Purpose: places the point of the view corresponding
730 -- at the pixel position x,y at the center of the window
731 -- and updates the view.
732 is redefined static;
733
734 Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
735 Start : Boolean = Standard_True )
736 ---Level: Public
737 ---Purpose: Rotation of the view point around the frame of reference
738 -- of the screen for which the origin is the eye of the
739 -- projection with a relative angular value in RADIANS
740 -- with respect to the initial position expressed by
741 -- Start = Standard_True
742 raises BadValue from Viewer;
743 -- If the eye, view point, or high point are aligned or confused.
744
745 Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
746 Start : Boolean = Standard_True )
747 ;
748 ---Level: Public
749 ---Purpose: Rotation of the view point around one of the axes of the
750 -- frame of reference of the view for which the origin is
751 -- the eye of the projection with an angular value in
752 -- RADIANS relative to the initial position expressed by
753 -- Start = Standard_True
754
755 Turn ( me : mutable ; Angle : PlaneAngle ;
756 Start : Boolean = Standard_True );
757 ---Level: Public
758 ---Purpose: Rotation of the view point around the current axis an
759 -- angular value in RADIANS relative to the initial
760 -- position expressed by Start = Standard_True
761
762 SetTwist ( me : mutable ; Angle : PlaneAngle )
763 ---Level: Public
764 ---Purpose: Defines the angular position of the high point of
765 -- the reference frame of the view with respect to the
766 -- Y screen axis with an absolute angular value in
767 -- RADIANS.
768 raises BadValue from Viewer;
769 -- If the eye, view point, or high point are aligned or confused.
770
771 SetEye( me : mutable ; X,Y,Z : Coordinate )
772 ---Level: Public
773 ---Purpose: Defines the position of the eye..
774 raises BadValue from Viewer ;
775 -- If the eye, view point, or high point are aligned or confused.
776
777 SetDepth( me : mutable ; Depth : Length )
778 ---Level: Public
779 ---Purpose: Defines the Depth of the eye from the view point
780 -- without update the projection .
781 raises BadValue from Viewer ;
782 -- If the Depth is <= 0.
783
784 SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
785 ---Level: Public
786 ---Purpose: Defines the orientation of the projection.
787 raises BadValue from Viewer ;
788 -- If the eye, view point, or high point are aligned or confused.
789
790 SetProj( me : mutable ; Orientation : TypeOfOrientation )
791 ---Level: Public
792 ---Purpose: Defines the orientation of the projection .
793 raises BadValue from Viewer ;
794 -- If the eye, view point, or high point are aligned or confused.
795 -- Updates the view
796
797 SetAt( me : mutable ; X,Y,Z : Coordinate )
798 ---Level: Public
799 ---Purpose: Defines the position of the view point.
800 raises BadValue from Viewer ;
801 -- If the eye, view point, or high point are aligned or confused.
802
803 SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
804 ---Level: Public
805 ---Purpose: Defines the orientation of the high point.
806 raises BadValue from Viewer ;
807 -- If the eye, view point, or high point are aligned or confused.
808
809 SetUp( me : mutable ; Orientation : TypeOfOrientation )
810 ---Level: Public
811 ---Purpose: Defines the orientation(SO) of the high point.
812 raises BadValue from Viewer ;
813 -- If the eye, view point, or high point are aligned or confused.
814
815 SetViewOrientation ( me : mutable; VO : ViewOrientation from Visual3d );
816 ---Level: Public
817 ---Purpose: Modifies the orientation of the view.
818
819 SetViewOrientationDefault( me : mutable );
820 ---Level: Public
821 ---Purpose: Saves the current state of the orientation of the view
822 -- which will be the return state at ResetViewOrientation.
823
824 ResetViewOrientation ( me : mutable );
825 ---Level: Public
826 ---Purpose: Resets the orientation of the view.
827 -- Updates the view
828
829 --------------------------------------------------------
830 ---Category: Methods to modify the Mapping of the view
831 --------------------------------------------------------
832
833 Panning ( me : mutable ; Dx , Dy : Length ;
834 aZoomFactor : Factor from Quantity = 1;
835 Start : Boolean = Standard_True )
836 ---Level: Public
837 ---Purpose: translates the center of the view and zooms the view.
838 -- Updates the view.
839 raises BadValue from Viewer ;
840
841 SetCenter ( me : mutable ; Xc , Yc : Coordinate )
842 ---Level: Public
843 ---Purpose: Defines the centre of the view.
844 -- Updates the view.
845 raises BadValue from Viewer ;
846 -- If one of the dimensions of the projection is NULL.
847
848 SetCenter ( me : mutable ; X,Y: Integer from Standard)
849 ---Level: Public
850 ---Purpose: Defines the centre of the view from a pixel position.
851 -- Updates the view.
852 raises BadValue from Viewer ;
853 -- If one of the dimensions of the projection is NULL.
854
855 SetSize ( me : mutable ; Size : Length )
856 ---Level: Public
857 ---Purpose: Defines the size of the view while preserving the
858 -- center and height/width ratio of the window supporting
859 -- the view.
860 -- NOTE than the Depth of the View is NOT modified .
861 raises BadValue from Viewer ;
862 -- If the size of the view is <= 0
863
864 SetZSize ( me : mutable ; Size : Length )
865 ---Level: Public
866 ---Purpose: Defines the Depth size of the view
867 -- Front Plane will be set to Size/2.
868 -- Back Plane will be set to -Size/2.
869 -- Any Object located Above the Front Plane or
870 -- behind the Back Plane will be Clipped .
871 -- NOTE than the XY Size of the View is NOT modified .
872 raises BadValue from Viewer ;
873 -- If the size of the view is <= 0
874
875 SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
876 ---Level: Public
877 ---Purpose: Zooms the view by a factor relative to the initial
878 -- value expressed by Start = Standard_True
879 -- Updates the view.
880 raises BadValue from Viewer ;
881 -- If the zoom coefficient is <= 0
882
883 SetScale ( me : mutable ; Coef : Factor )
884 ---Level: Public
885 ---Purpose: Zooms the view by a factor relative to the value
886 -- initialised by SetViewMappingDefault().
887 -- Updates the view.
888 raises BadValue from Viewer ;
889 -- If the zoom coefficient is <= 0
890
891 SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
892 ---Level: Public
893 ---Purpose: Sets anisotropic (axial) scale factors <Sx>, <Sy>, <Sz> for view <me>.
894 -- Anisotropic scaling operation is performed through multiplying
895 -- the current view orientation matrix by a scaling matrix:
896 -- || Sx 0 0 0 ||
897 -- || 0 Sy 0 0 ||
898 -- || 0 0 Sz 0 ||
899 -- || 0 0 0 1 ||
900 -- Updates the view.
901 raises BadValue from Viewer ;
902 -- If the one of factors <= 0
903
904 FitAll ( me : mutable ; Coef : Coefficient = 0.01;
905 FitZ: Boolean from Standard = Standard_False; update : Boolean from Standard = Standard_True )
906 ---Level: Public
907 ---Purpose: Automatic zoom/panning. Objects in the view are visualised
908 -- so as to occupy the maximum space while respecting the
909 -- margin coefficient and the initial height /width ratio.
910 -- NOTE than the original Z size of the view is NOT modified .
911 raises BadValue from Viewer ;
912 -- If the margin coefficient is <0 ou >= 1 or
913 -- Updates the view
914
915 ZFitAll ( me : mutable ; Coef : Coefficient = 1.0 )
916 ---Level: Public
917 ---Purpose: Automatic Depth Panning. Objects visible in the view are
918 -- visualised so as to occupy the maximum Z amount of space
919 -- while respecting the margin coefficient .
920 -- NOTE than the original XY size of the view is NOT modified .
921 raises BadValue from Viewer ;
922 -- If the margin coefficient is <0 ou or
923 -- If No Objects are displayed in the view
924
925 DepthFitAll( me : mutable ; Aspect : Coefficient = 0.01;
926 Margin : Coefficient = 0.01 );
927 ---Level: Public
928 ---Purpose: Adjusts the viewing volume so as not to clip the displayed objects by front and back
929 -- and back clipping planes. Also sets depth value automatically depending on the
930 -- calculated Z size and Aspect parameter.
931 -- NOTE than the original XY size of the view is NOT modified .
932
933 FitAll ( me : mutable ; Umin, Vmin, Umax, Vmax : Coordinate )
934 ---Level: Public
935 ---Purpose: Centres the defined projection window so that it occupies
936 -- the maximum space while respecting the initial
937 -- height/width ratio.
938 -- NOTE than the original Z size of the view is NOT modified .
939 raises BadValue from Viewer;
940 -- If the defined projection window has zero size.
941
942
943 WindowFit ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer)
944 ---Level: Public
945 ---Purpose: Centres the defined PIXEL window so that it occupies
946 -- the maximum space while respecting the initial
947 -- height/width ratio.
948 -- NOTE than the original Z size of the view is NOT modified .
949 raises BadValue from Viewer
950 -- If the defined projection window has zero size.
951 is redefined static;
952
953 SetViewingVolume ( me : mutable ; Left, Right, Bottom, Top, ZNear, ZFar : Real from Standard)
954 ---Level: Public
955 ---Purpose: Sets Z and XY size of the view according to given values
956 -- with respecting the initial view depth (eye position)
957 raises BadValue from Viewer;
958 -- If the ZNear<0, ZFar<0 or ZNear>=Zfar.
959
960 SetViewMapping ( me : mutable; VM : ViewMapping from Visual3d );
961 ---Level: Public
962 ---Purpose: Modifies the mapping of the view.
963
964 SetViewMappingDefault( me : mutable );
965 ---Level: Public
966 ---Purpose: Saves the current view mapping. This will be the
967 -- state returned from ResetViewmapping.
968
969 ResetViewMapping ( me : mutable );
970 ---Level: Public
971 ---Purpose: Resets the centring of the view.
972 -- Updates the view
973
974 Reset ( me : mutable; update : Boolean from Standard = Standard_True );
975 ---Level: Public
976 ---Purpose: Resets the centring and the orientation of the view
977 -- Updates the view
978 ---------------------------------------------------
979 ---Category: Inquire methods
980 ---------------------------------------------------
981
982 Convert( me ; Vp : Integer ) returns Length
983 ---Level: Public
984 ---Purpose : Converts the PIXEL value
985 -- to a value in the projection plane.
986 raises UnMapped from V3d;
987 -- If the view is not mapped on the window.
988
989 Convert( me ; Xp,Yp : Integer ; Xv,Yv : out Coordinate )
990 ---Level: Public
991 ---Purpose : Converts the point PIXEL into a point projected
992 -- in the reference frame of the projection plane.
993 raises UnMapped from V3d;
994 -- If the view is not mapped on the window.
995
996 Convert( me ; Vv : Length ) returns Integer
997 ---Level: Public
998 ---Purpose : Converts tha value of the projection plane into
999 -- a PIXEL value.
1000 raises UnMapped from V3d;
1001 -- If the view is not mapped on the window.
1002
1003 Convert( me ; Xv,Yv : Coordinate ; Xp,Yp : out Integer )
1004 ---Level: Public
1005 ---Purpose : Converts the point defined in the reference frame
1006 -- of the projection plane into a point PIXEL.
1007 raises UnMapped from V3d;
1008 -- If the view is not mapped on the window.
1009
1010 Convert( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate)
1011 ---Level: Public
1012 ---Purpose : Converts the projected point into a point
1013 -- in the reference frame of the view corresponding
1014 -- to the intersection with the projection plane
1015 -- of the eye/view point vector.
1016 raises UnMapped from V3d;
1017 -- If the view is not mapped on the window.
1018
1019 ConvertWithProj( me ; Xp,Yp : Integer ; X,Y,Z : out Coordinate ; Vx,Vy,Vz : out Parameter)
1020 ---Level: Public
1021 ---Purpose : Converts the projected point into a point
1022 -- in the reference frame of the view corresponding
1023 -- to the intersection with the projection plane
1024 -- of the eye/view point vector and returns the
1025 -- projection ray for further computations.
1026 raises UnMapped from V3d;
1027 -- If the view is not mapped on the window.
1028
1029 ConvertToGrid( me ; Xp,Yp : Integer ; Xg,Yg,Zg : out Coordinate)
1030 ---Level: Public
1031 ---Purpose : Converts the projected point into the nearest grid point
1032 -- in the reference frame of the view corresponding
1033 -- to the intersection with the projection plane
1034 -- of the eye/view point vector and display the grid marker.
1035 -- Warning: When the grid is not active the result is identical
1036 -- to the above Convert() method.
1037 -- How to use :
1038 -- 1) Enable the grid echo display
1039 -- myViewer->SetGridEcho(Standard_True);
1040 -- 2) When application receive a move event :
1041 -- 2.1) Check if any object is detected
1042 -- if( myInteractiveContext->MoveTo(x,y) == AIS_SOD_Nothing ) {
1043 -- 2.2) Check if the grid is active
1044 -- if( myViewer->Grid()->IsActive() ) {
1045 -- 2.3) Display the grid echo and gets the grid point
1046 -- myView->ConvertToGrid(x,y,X,Y,Z);
1047 -- 2.4) Else this is the standard case
1048 -- } else myView->Convert(x,y,X,Y,Z);
1049 raises UnMapped from V3d;
1050 -- If the view is not mapped on the window.
1051
1052 ConvertToGrid( me ; X,Y,Z : Coordinate ; Xg,Yg,Zg : out Coordinate)
1053 ---Level: Public
1054 ---Purpose : Converts the point into the nearest grid point
1055 -- and display the grid marker.
1056 ---Warning: When the grid is not active the result is identical
1057 -- to the previous point.
1058 raises UnMapped from V3d;
1059 -- If the view is not mapped on the window.
1060
1061 Convert( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1062 ---Level: Public
1063 ---Purpose : Projects the point defined in the reference frame of
1064 -- the view into the projected point in the associated window.
1065
1066-- RefToPix( me ; X,Y,Z : Coordinate; Xp,Yp : out Integer) ;
1067-- ---Purpose : Projects the point defined in the reference frame of
1068-- -- the view into the projected point in the associated window.
1069-- Obsolete : Use Convert(X,Y,Z,Xp,Yp);
1070
1071-- PixToRef( me ; Xp,Yp : Integer; X,Y,Z : out Coordinate) ;
1072-- ---Purpose : Converts the projected point in the associated window of
1073-- -- the view into the point defined in the reference frame.
1074-- Obsolete : Use Convert(Xp,Yp,X,Y,Z);
1075
1076 Project( me ; X,Y,Z : Coordinate; Xp,Yp : out Coordinate) ;
1077 ---Level: Public
1078 ---Purpose : Converts the point defined in the user space of
1079 -- the view to the projected view plane point at z 0.
1080
1081 BackgroundColor( me; Type : TypeOfColor ; V1, V2, V3 : out Parameter) ;
1082 ---Level: Public
1083 ---Purpose: Returns the Background color values of the view
1084 -- depending of the color Type.
1085
1086 BackgroundColor( me ) returns Color from Quantity;
1087 ---Level: Public
1088 ---Purpose: Returns the Background color object of the view.
1089
1090 GradientBackgroundColors( me;
1091 Color1 : out Color from Quantity;
1092 Color2 : out Color from Quantity) ;
1093 ---Level: Public
1094 ---Purpose: Returns the gradient background colour objects of the view.
1095
1096 GradientBackground ( me ) returns GradientBackground from Aspect;
1097 ---Level: Public
1098 ---Purpose: Returns the gradient background of the view.
1099
1100 Scale ( me ) returns Factor ;
1101 ---Level: Public
1102 ---Purpose: Returns the current value of the zoom expressed with
1103 -- respect to SetViewMappingDefault().
1104
1105 AxialScale ( me ; Sx, Sy, Sz : out Real from Standard ) ;
1106 ---Level: Public
1107 ---Purpose: Returns the current values of the anisotropic (axial) scale factors.
1108
1109 Center ( me; Xc,Yc : out Coordinate );
1110 ---Level: Public
1111 ---Purpose: Returns the centre of the view.
1112
1113 Size ( me; Width, Height : out Length );
1114 ---Level: Public
1115 ---Purpose: Returns the height and width of the view.
1116
1117 ZSize ( me ) returns Real ;
1118 ---Level: Public
1119 ---Purpose: Returns the Depth of the view .
1120
1121 Eye( me ; X,Y,Z : out Coordinate );
1122 ---Level: Public
1123 ---Purpose: Returns the position of the eye.
1124
1125 FocalReferencePoint (me ; X,Y,Z : out Coordinate );
1126 ---Level: Public
1127 ---Purpose: Returns the position of point which emanating the
1128 -- projections.
1129
1130 ProjReferenceAxe( me ; Xpix,Ypix : Integer ;
1131 XP,YP,ZP,VX,VY,VZ : out Coordinate );
1132 ---Level: Public
1133 ---Purpose: Returns the coordinate of the point (Xpix,Ypix)
1134 -- in the view (XP,YP,ZP), and the projection vector of the
1135 -- view passing by the point (for PerspectiveView).
1136
1137 Depth( me ) returns Length ;
1138 ---Level: Public
1139 ---Purpose: Returns the Distance between the Eye and View Point.
1140
1141 Proj( me ; Vx,Vy,Vz : out Parameter );
1142 ---Level: Public
1143 ---Purpose: Returns the projection vector.
1144
1145 At( me ; X,Y,Z : out Coordinate );
1146 ---Level: Public
1147 ---Purpose: Returns the position of the view point.
1148
1149 Up( me ; Vx,Vy,Vz : out Parameter );
1150 ---Level: Public
1151 ---Purpose: Returns the vector giving the position of the high point.
1152
1153 Twist( me ) returns PlaneAngle ;
1154 ---Level: Public
1155 ---Purpose: Returns in RADIANS the orientation of the view around
1156 -- the visual axis measured from the Y axis of the screen.
1157
1158 ShadingModel ( me ) returns TypeOfShadingModel ;
1159 ---Level: Public
1160 ---Purpose: Returns the current shading model.
1161
1162 SurfaceDetail(me) returns TypeOfSurfaceDetail;
1163 ---Level: Public
1164 -- purpose: returns the current SurfaceDetail mode
1165
1166 TextureEnv(me) returns TextureEnv from Graphic3d;
1167 ---Level: Public
1168 -- purpose: return the current environment texture used
1169
1170 Transparency(me) returns Boolean from Standard;
1171 ---Level: Public
1172 ---Purpose: Returns the transparency activity.
1173
1174 Visualization ( me ) returns TypeOfVisualization from V3d;
1175 ---Level: Public
1176 ---Purpose: Returns the current visualisation mode.
1177
1178 Antialiasing ( me ) returns Boolean;
1179 ---Level: Public
1180 ---Purpose: Indicates if the antialiasing is active (True) or
1181 -- inactive (False).
1182
1183 ZCueing ( me; Depth, Width : out Length ) returns Boolean ;
1184 ---Level: Public
1185 ---Purpose: Returns activity and information on the Zcueing.
1186 -- <Depth> : Depth of plane.
1187 -- <Width> : Thickness around the plane.
1188
1189 ZClipping ( me; Depth, Width : out Length ) returns TypeOfZclipping;
1190 ---Level: Public
1191 ---Purpose: Returns current information on the ZClipping.
1192 -- <Depth> : Depth of plane.
1193 -- <Width> : Thickness around the plane.
1194 -- <TypeOfZclipping> : "BACK"
1195 -- "FRONT"
1196 -- "SLICE"
1197 -- "OFF"
1198
1199 IfMoreLights( me ) returns Boolean;
1200 ---Level: Advanced
1201 ---Purpose: Returns True if One light more can be
1202 -- activated in this View.
1203
1204 InitActiveLights(me: mutable);
1205 ---Level: Advanced
1206 ---Purpose: initializes an iteration on the active Lights.
1207
1208 MoreActiveLights (me) returns Boolean from Standard;
1209 ---Level: Advanced
1210 ---Purpose: returns true if there are more active Light(s) to return.
1211
1212 NextActiveLights (me: mutable);
1213 ---Level: Advanced
1214 ---Purpose : Go to the next active Light
1215 -- (if there is not, ActiveLight will raise an exception)
1216
1217 ActiveLight(me) returns mutable Light from V3d;
1218 ---Level: Advanced
1219
1220 IfMorePlanes( me ) returns Boolean;
1221 ---Level: Advanced
1222 ---Purpose: Returns True if One clipping plane more can be
1223 -- activated in this View.
1224
1225 InitActivePlanes(me: mutable);
1226 ---Level: Advanced
1227 ---Purpose: initializes an iteration on the active Planes.
1228
1229 MoreActivePlanes (me) returns Boolean from Standard;
1230 ---Level: Advanced
1231 ---Purpose: returns true if there are more active Plane(s) to return.
1232
1233 NextActivePlanes (me: mutable);
1234 ---Level: Advanced
1235 ---Purpose : Go to the next active Plane
1236 -- (if there is not, ActivePlane will raise an exception)
1237
1238 ActivePlane(me) returns mutable Plane from V3d;
1239 ---Level: Advanced
1240
1241 Viewer ( me ) returns mutable Viewer from V3d;
1242 ---Level: Advanced
1243 ---Purpose: Returns the viewer in which the view has been created.
1244
1245 IfWindow ( me ) returns Boolean;
1246 ---Level: Public
1247 ---Purpose: Returns True if MyView is associated with a window .
1248
1249 Window ( me ) returns mutable Window from Aspect
1250 ---Level: Public
1251 ---Purpose: Returns the Aspect Window associated with the view.
1252 raises BadValue from Viewer;
1253 -- If MyView is not associated with a window
1254
1255 Type( me ) returns TypeOfView from V3d;
1256 ---Level: Public
1257 ---Purpose: Returns the Type of the View
1258
1259 Pan ( me : mutable; Dx, Dy: Integer from Standard;
1260 aZoomFactor: Factor from Quantity = 1);
1261 ---Level: Public
1262 ---Purpose: translates the center of the view and zooms the view.
1263 -- and updates the view.
1264
1265 Zoom ( me : mutable; X1 , Y1 , X2 , Y2 : Integer from Standard)
1266 is static;
1267 ---Level: Public
1268 ---Purpose: Zoom the view according to a zoom factor computed
1269 -- from the distance between the 2 mouse position <X1,Y1>,<X2,Y2>
1270
1271 Zoom ( me: mutable; X,Y: Integer from Standard)
1272 is static;
1273 ---Level: Public
1274 ---Purpose: Zoom the view according to a zoom factor computed
1275 -- from the distance between the last and new mouse position <X,Y>
1276
1277 StartZoomAtPoint(me : mutable;
1278 xpix, ypix : Integer from Standard);
1279 ---Level: Public
1280 ---Purpose: Defines the point (pixel) of zooming (for the method ZoomAtPoint()).
1281
1282 ZoomAtPoint(me : mutable;
1283 mouseStartX, mouseStartY, mouseEndX, mouseEndY : Integer from Standard);
1284 ---Level: Public
1285 ---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
1286
1287 AxialScale ( me: mutable; Dx, Dy: Integer from Standard; Axis: TypeOfAxe from V3d );
1288 ---Level: Public
1289 ---Purpose: Performs anisotropic scaling of <me> view along the given <Axis>.
1290 -- The scale factor is calculated on a basis of
1291 -- the mouse pointer displacement <Dx,Dy>.
1292 -- The calculated scale factor is then passed to SetAxialScale(Sx, Sy, Sz) method.
1293
1294 StartRotation(me : mutable ; X,Y :Integer from Standard;
1295 zRotationThreshold: Ratio from Quantity = 0.0);
1296 ---Level: Public
1297 ---Purpose: Begin the rotation of the view arround the screen axis
1298 -- according to the mouse position <X,Y>.
1299 -- Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
1300 -- factor is > 0 soon the distance from the start point and the center
1301 -- of the view is > (medium viewSize * <zRotationThreshold> ).
1302 -- Generally a value of 0.4 is usable to rotate around XY screen axis
1303 -- inside the circular treshold area and to rotate around Z screen axis
1304 -- outside this area.
1305
1306 Rotation(me:mutable; X,Y :Integer from Standard);
1307 ---Level: Public
1308 ---Purpose: Continues the rotation of the view
1309 -- with an angle computed from the last and new mouse position <X,Y>.
1310
1311 FitAll ( me : mutable ; aWindow: Window from Aspect;
1312 Umin, Vmin, Umax, Vmax : Coordinate )
1313 is static private;
1314 ---Level: Public
1315 ---Purpose: Change the scale factor and position of the view
1316 -- such as the bounding box <Umin, Vmin, Umax, Vmax> is contains
1317 -- in the view.
1318
1319
1320 -----------------------------------------
1321 ---Category: Private or Protected methods
1322 -----------------------------------------
1323
1324 SetFocale( me : mutable ; Focale : Length )
1325 ---Purpose: Change View Plane Distance for Perspective Views
1326 raises TypeMismatch from Standard
1327 ---Purpose: Warning! raises TypeMismatch from Standard if the view
1328 -- is not a perspective view.
1329 is static ;
1330
1331 Focale( me ) returns Length;
1332 ---Purpose: Returns the View Plane Distance for Perspective Views
1333
1334 View ( me) returns mutable View from Visual3d is static ;
1335 ---Level: Advanced
1336 ---Purpose: Returns the associated Visual3d view.
1337
1338 ViewMapping ( me ) returns ViewMapping from Visual3d is static;
1339 ---Level: Advanced
1340 ---Purpose: Returns the current mapping of the view.
1341
1342 ViewOrientation ( me ) returns ViewOrientation from Visual3d is static;
1343 ---Level: Advanced
1344 ---Purpose: Returns the current orientation of the view.
1345
1346 ScreenAxis( myclass ; Vpn,Vup : Vector from Graphic3d ;
1347 Xaxe,Yaxe,Zaxe : out Vector from Graphic3d )
1348 returns Boolean is private ;
1349 ---Purpose: Determines the screen axes in the reference
1350 -- framework of the view.
1351
1352 InitMatrix ( myclass ; Matrix : out Array2OfReal from TColStd ) is private ;
1353
1354 Multiply( myclass ;
1355 Left, Right : Array2OfReal from TColStd ;
1356 Matrix : out Array2OfReal from TColStd )
1357 returns Boolean from Standard is private ;
1358
1359 RotAxis( myclass ; Vrp : Vertex from Graphic3d ;
1360 Axe : Vector from Graphic3d ; Angle : PlaneAngle ;
1361 Matrix : out Array2OfReal from TColStd ) is private ;
1362 ---Purpose: Determines the rotation matrice around an axis
1363 -- for a given angle.
1364
1365 TrsPoint( myclass ; P : Vertex from Graphic3d ;
1366 Matrix : Array2OfReal from TColStd )
1367 returns Vertex from Graphic3d is private ;
1368 ---Purpose: Transforms the point P according to the matrice Matrix .
1369
1370 TrsPoint( myclass ; V : Vector from Graphic3d ;
1371 Matrix : Array2OfReal from TColStd )
1372 returns Vector from Graphic3d is private ;
1373 ---Purpose: Transforms the vector V according to the matrice Matrix .
1374
1375 -----------------------------------------
1376 ---Category: TransientManager methods
1377 -----------------------------------------
1378
1379 TransientManagerBeginDraw(me; DoubleBuffer: Boolean = Standard_False;
1380 RetainMode : Boolean = Standard_False)
1381 ---Level: Public
1382 ---Purpose: Begins any graphics in the view <aView>
1383 -- Redraw any structured graphics in the back buffer before
1384 -- if <DoubleBuffer> is TRUE.
1385 -- Restore the front buffer from the back before
1386 -- if <DoubleBuffer> is FALSE.
1387 -- if <RetainMode> is TRUE.
1388 -- the graphic managed itself exposure,resizing ...
1389 -- if <RetainMode> is FALSE.
1390 -- the application must managed itself exposure,resizing ...
1391 --
1392 returns Boolean from Standard;
1393
1394 TransientManagerClearDraw(me);
1395 ---Level: Public
1396 ---Purpose: Clear all transient graphics in the view <aView>
1397
1398
1399 TransientManagerBeginAddDraw(me)
1400 ---Level: Public
1401 ---Purpose: Begins any add graphics in the view <aView>
1402 -- Redraw any structured graphics in the back buffer before
1403 -- the application must managed itself exposure,resizing ...
1404 -- Warning: Returns TRUE if transient drawing is enabled in
1405 -- the associated view.
1406 -- Returns FALSE ,if nothing works because something
1407 -- is wrong for the transient principle :
1408 --
1409 returns Boolean from Standard;
1410
1411 ---------------------------------------------------
1412 -- Category: Methods to modify the class definition
1413 -- Animation Mode
1414 ---------------------------------------------------
1415
1416 SetAnimationModeOn ( me : mutable )
1417 is static;
1418 ---Level: Advanced
1419 ---Purpose: Activates animation mode.
1420 -- When the animation mode is activated in the view,
1421 -- all Graphic3d_Structure are stored in a graphic object.
1422 ---Category: Methods to modify the class definition
1423
1424 SetAnimationModeOff ( me : mutable )
1425 is static;
1426 ---Level: Advanced
1427 ---Purpose: Deactivates the animation mode.
1428 ---Category: Methods to modify the class definition
1429
1430 AnimationModeIsOn ( me )
1431 returns Boolean from Standard
1432 is static;
1433 ---Level: Advanced
1434 ---Purpose: Returns the activity of the animation mode.
1435 ---Category: Inquire methods
1436
1437 SetAnimationMode ( me : mutable;
1438 anAnimationFlag : Boolean from Standard = Standard_True;
1439 aDegenerationFlag : Boolean from Standard = Standard_False
1440 ) is static;
1441 ---Level : Advanced
1442 ---Purpose : Enable/Disable animation/degeneration mode
1443 ---Category : Methods to modify the class definition
1444
1445 AnimationMode ( me; isDegenerate: out Boolean from Standard )
1446 returns Boolean from Standard
1447 is static;
1448 ---Level : Advanced
1449 ---Purpose : Returns the animation and degenerate status.
1450 ---Category: Inquire methods
1451
1452 ---------------------------------------------------
1453 -- Category: Methods to modify the class definition
1454 -- Degenerate Mode
1455 ---------------------------------------------------
1456
1457 SetDegenerateModeOn ( me : mutable )
1458 is static;
1459 ---Level : Obsolete
1460 ---Purpose: Activates degenerate mode.
1461 -- When the degenerate mode is activated in the view,
1462 -- all Graphic3d_Structure with the type TOS_COMPUTED
1463 -- displayed in this view are not computed.
1464 -- Warning: Obsolete method , use SetComputedMode()
1465 ---Category: Methods to modify the class definition
1466
1467 SetDegenerateModeOff ( me : mutable )
1468 is static;
1469 ---Level : Obsolete
1470 ---Purpose: Deactivates the degenerate mode.
1471 -- Category: Methods to modify the class definition
1472 -- Warning: if the computed mode has been disabled in the
1473 -- viewer the mode will remain degenerated.
1474 -- Warning: Obsolete method , use SetComputedMode()
1475
1476 DegenerateModeIsOn ( me )
1477 returns Boolean from Standard
1478 is static;
1479 ---Level : Obsolete
1480 ---Purpose: Returns the activity of the degenerate mode.
1481 ---Category: Inquire methods
1482
1483 SetComputedMode ( me : mutable; aMode : Boolean from Standard )
1484 is static;
1485 ---Level: Advanced
1486 ---Purpose: Switches computed HLR mode in the view
1487 ---Category: Methods to modify the class definition
1488
1489 ComputedMode ( me )
1490 returns Boolean from Standard
1491 is static;
1492 ---Level: Advanced
1493 ---Purpose: Returns the computed HLR mode state
1494 ---Category: Inquire methods
1495
1496 MinMax ( me; Umin,Vmin, Umax,Vmax : out Coordinate ) returns Integer
1497 ---Purpose: Returns the objects number and the projection window
1498 -- of the objects contained in the view.
1499 is static private;
1500
1501 MinMax ( me; Xmin,Ymin,Zmin, Xmax,Ymax,Zmax : out Coordinate )
1502 returns Integer
1503 ---Purpose: Returns the objects number and the box encompassing
1504 -- the objects contained in the view
1505 is static private;
1506
1507 Gravity ( me; X,Y,Z : out Coordinate ) returns Integer
1508 ---Purpose: Returns the Objects number and the gravity center
1509 -- of ALL viewable points in the view
1510 is static private;
1511
1512 Init(me: mutable) is private;
1513
1514 ---Category: for compatibility.
1515
1516 WindowFitAll ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer);
1517 ---Purpose: idem than WindowFit
1518
1519 SetPlotter ( me : mutable; aPlotter : Plotter from Graphic3d )
1520 ---Purpose: Set a plotter for plotting the contents of the view
1521 -- field MyPlotter
1522 is virtual;
1523
1524 Plot ( me : mutable )
1525 ---Purpose: Create a 2D View for plotting the contents of the view
1526 raises BadValue from Viewer;
1527 -- if the plotter is undefined.
1528
1529 Compute ( me; AVertex : Vertex from Graphic3d )
1530 returns Vertex from Graphic3d
1531 is static private;
1532 ---Level: Internal
1533 ---Purpose: Returns a new vertex when the grid is activated.
1534
1535 SetGrid ( me : mutable;
1536 aPlane: Ax3 from gp;
1537 aGrid : Grid from Aspect )
1538 is static;
1539 ---Level: Internal
1540 ---Purpose: Defines or Updates the definition of the
1541 -- grid in <me>
1542 ---Category: Methods to modify the class definition
1543
1544 SetGridGraphicValues ( me : mutable;
1545 aGrid : Grid from Aspect )
1546 is static;
1547 ---Level: Internal
1548 ---Purpose: Defines or Updates the graphic definition of the
1549 -- grid in <me>
1550 ---Category: Methods to modify the class definition
1551
1552 SetGridActivity ( me : mutable;
1553 aFlag : Boolean from Standard )
1554 is static;
1555 ---Level: Internal
1556 ---Purpose: Defines or Updates the activity of the
1557 -- grid in <me>
1558 ---Category: Methods to modify the class definition
1559
1560 Tumble ( me : mutable;
1561 NbImages : Integer from Standard = 314;
1562 AnimationMode : Boolean from Standard = Standard_False )
1563 returns Real from Standard
1564 is static;
1565 ---Level : Advanced
1566 ---Purpose: Animates the view <me>
1567 -- Returns the number of images per second
1568 -- if <AnimationMode> is Standard_True, the animation mode
1569 -- is activated.
1570
1571 ScreenCopy (me : mutable;
1572 aPlotterDriver : PlotterDriver from PlotMgt;
1573 fWhiteBackground : Boolean from Standard = Standard_True;
1574 aScale : Factor from Quantity = 1.0
1575 ) is static;
1576 ---Purpose: dump the view
1577
1578 Dump ( me: mutable;
1579 theFile: CString from Standard;
1580 theBufferType : TypeOfImage from Image = Image_TOI_RGB )
1581 returns Boolean from Standard;
1582 ---Level: Public
1583 ---Purpose: dump the full contents of the view at the same
1584 -- scale in the file <theFile>. The file name
1585 -- extension must be one of ".png",".bmp",".jpg",".gif".
1586 -- Returns FALSE when the dump has failed
1587
1588 Dump ( me: mutable;
1589 theFile : CString from Standard;
1590 theFormat : FormatOfSheetPaper from Aspect;
1591 theBufferType : TypeOfImage from Image = Image_TOI_RGB )
1592 returns Boolean from Standard;
1593 ---Level: Public
1594 ---Purpose: dump the full contents of the view with a
1595 -- different scale according to the required sheet
1596 -- paper size (format) and the ratio
1597 -- width/height of the view.
1598 -- and returns FALSE when the dump has failed
1599 -- Warning : the file name extension must be one of
1600 -- ".png",".bmp",".jpg",".gif"
1601 -- but make becarefull about the time to dump and
1602 -- resulting file size especially for the A0 format.
1603 -- NOTE that you can use after any standard system utility
1604 -- for editing or sending the image file to a laser printer.
1605 -- (i.e: Microsoft Photo Editor on Windows system
1606 -- or Image Viewer on SUN system)
1607
1608 Print (me; hPrnDC: Handle from Aspect = NULL;
1609 showDialog: Boolean = Standard_True;
7edf74fd
A
1610 showBackground : Boolean = Standard_True;
1611 filename: CString = NULL;
1612 printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH)
1613 returns Boolean from Standard is static;
7fd59977 1614
1615 ---Level: Public
1616 ---Purpose: print the contents of the view to printer with preview.
1617 -- <hPrnDC> : If you have already an PrinterDeviceContext (HDC),
1618 -- then you can pass it to the print routines.
1619 -- If you don't have an PrinterDeviceContext, then this parameter should
1620 -- be NULL.
1621 -- <showDialog> : If hPrnDC == NULL, then you can force the print routines to
1622 -- open a Print Dialog box.
1623 -- If you want to do this, then set showDialog to TRUE
1624 -- If you don't want to see a dialog (only possible, if you have a hPrnDC
1625 -- or the dialog box was opened once before) then set <showDialog> to FALSE.
1626 -- <showBackground> : When set to FALSE then print the view without background color
1627 -- (background is white)
1628 -- else set to TRUE for printing with current background color.
1629 -- <filename>: If != NULL, then the view will be printed to a file.
7edf74fd
A
1630 -- <printAlgorithm>: If you want to select the print algorithm, then you can
1631 -- specify one of existing algorithms: Aspect_PA_STRETCH, Aspect_PA_TILE.
1632 -- Returns Standard_True if the data is passed to the printer, otherwise
1633 -- Standard_False if the print operation failed. This might be related to
1634 -- insufficient memory or some internal errors. All this errors are
1635 -- indicated by the message boxes (on level of OpenGl_GraphicDriver).
1636 -- Warning: This function can reuse FBO assigned to the
1637 -- view on level of OpenGl_GraphicDriver; Please take it into account if
1638 -- you use it for your purposes;
7fd59977 1639 -- Warning: Works only under Windows.
1640
1641 ToPixMap ( me : mutable;
1642 theWidth : Integer from Standard;
1643 theHeight : Integer from Standard;
1644 theBufferType : TypeOfImage from Image = Image_TOI_RGB;
1645 theForceCentered : Boolean from Standard = Standard_True )
1646 returns PixMap from Image;
1647 ---Level : Public
1648 ---Purpose : dump the full contents of the view
1649 -- to a pixmap of pixel size <theWidth>*<theHeight> and
1650 -- buffer type <theBufferType>. If <theForceCentered> is true
1651 -- view scene will be centered.
1652
1653 SetProjModel( me : mutable;
1654 amOdel: TypeOfProjectionModel from V3d = V3d_TPM_SCREEN )
1655 is static;
1656 ---Level : Advanced
1657 ---Purpose : Manages projection model
1658
1659 ProjModel( me )
1660 returns TypeOfProjectionModel from V3d
1661 is static;
1662 ---Level : Advanced
1663 ---Purpose : Returns the current projection model
1664
1665 SetBackFacingModel ( me : mutable;
1666 aModel : TypeOfBackfacingModel from V3d = V3d_TOBM_AUTOMATIC)
1667 is static;
1668 ---Level : Public
1669 ---Purpose : Manages display of the back faces
1670 -- When <aModel> is TOBM_AUTOMATIC the object backfaces
1671 -- are displayed only for surface objects and
1672 -- never displayed for solid objects.
1673 -- this was the previous mode.
1674 -- <aModel> is TOBM_ALWAYS_DISPLAYED the object backfaces
1675 -- are always displayed both for surfaces or solids.
1676 -- <aModel> is TOBM_NEVER_DISPLAYED the object backfaces
1677 -- are never displayed.
1678
1679 BackFacingModel ( me )
1680 returns TypeOfBackfacingModel from V3d
1681 is static;
1682 ---Level : Public
1683 ---Purpose : Returns current state of the back faces display
1684
1685 EnableDepthTest( me; enable : Boolean from Standard = Standard_True )
1686 is static;
1687 ---Level: Public
1688 ---Purpose: turns on/off opengl depth testing
1689
1690 IsDepthTestEnabled( me ) returns Boolean from Standard
1691 is static;
1692 ---Level: Public
1693 ---Purpose: returns the current state of the depth testing
1694
1695 EnableGLLight( me; enable : Boolean from Standard = Standard_True )
1696 is static;
1697 ---Level: Public
1698 ---Purpose: turns on/off opengl lighting, currently used in triedron displaying
1699
1700 IsGLLightEnabled( me ) returns Boolean from Standard
1701 is static;
1702 ---Level: Public
1703 ---Purpose: returns the current state of the gl lighting
1704 -- currently used in triedron displaying
1705
1706
1707fields
1708
1709 MyType : TypeOfView from V3d is protected ;
1710 MyViewer : ViewerPointer from V3d ;
1711 MyActiveLights: ListOfTransient from V3d;
1712 MyActivePlanes: ListOfTransient from V3d;
1713
1714 MyView : View from Visual3d is protected ;
1715 MyViewMapping : ViewMapping from Visual3d is protected ;
1716 MyViewOrientation : ViewOrientation from Visual3d ;
1717 MyViewContext : ContextView from Visual3d ;
1718 MyBackground: Background from Aspect ;
1719 MyGradientBackground: GradientBackground from Aspect ;
1720 MyDefaultViewAxis: Vector from Graphic3d ;
1721 MyDefaultViewPoint: Vertex from Graphic3d ;
1722
1723 MyWindow: Window from Aspect;
1724
1725 MyPlotter: Plotter from Graphic3d;
1726
1727 myActiveLightsIterator: ListIteratorOfListOfTransient from TColStd;
1728 myActivePlanesIterator: ListIteratorOfListOfTransient from TColStd;
1729
1730 sx,sy: Integer from Standard;
1731 rx,ry: Real from Standard;
1732 gx,gy,gz: Real from Standard;
1733 myComputedMode: Boolean from Standard;
1734 SwitchSetFront: Boolean from Standard;
1735 MyZoomAtPointX, MyZoomAtPointY : Integer from Standard;
1736
1737 -- the 3d grid
1738 MyGrid : Grid from Aspect;
1739 MyPlane : Ax3 from gp;
1740
1741 --MyColorScale : ColorScale from V3d;
1742 MyLayerMgr : LayerMgr from V3d;
1743
1744 -- the transformation between XoY and the grid plane
1745 MyTrsf : Array2OfReal from TColStd;
1746
1747 -- echo
1748 MyGridEchoStructure : Structure from Graphic3d;
1749 MyGridEchoGroup : Group from Graphic3d;
1750
1751 MyProjModel : TypeOfProjectionModel from V3d is protected;
1752 MyAnimationFlags : Integer from Standard;
1753
1754 MyTransparencyFlag : Boolean from Standard;
1755friends
1756
1757 SetViewOn from class Viewer from V3d ( me : mutable ),
1758 SetViewOn from class Viewer from V3d ( me : mutable ; View : View from V3d ),
1759 SetViewOff from class Viewer from V3d ( me : mutable ),
1760 SetViewOff from class Viewer from V3d ( me : mutable ; View : View from V3d )
1761
1762end View;