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