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