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