b311480e |
1 | -- Created on: 1996-12-11 |
2 | -- Created by: Robert COUBLANC |
3 | -- Copyright (c) 1996-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
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 | -- GG : GER61351 17/11/1999 Change SetColor() with a compatible |
22 | -- Quantity_Color instead the restricted NameOfColor. |
23 | -- Add SetCurrentFacingModel() methods |
7fd59977 |
24 | -- GG : IMP140100 Add HasPresentation() and Presentation() methods |
25 | -- Add SetAspect() method |
26 | -- SAN : OCC4895 22/03/04 High-level interface for controlling polygon offsets |
7fd59977 |
27 | |
28 | |
29 | deferred class InteractiveObject from AIS inherits SelectableObject from SelectMgr |
30 | |
31 | ---Purpose: |
32 | -- Defines a class of objects with display and selection services. |
33 | -- Entities which are visualized and selected are |
34 | -- Interactive Objects. You can make use of classes of |
35 | -- standard Interactive Objects for which all necessary |
36 | -- methods have already been programmed, or you can |
37 | -- implement your own classes of Interactive Objects. |
38 | -- Specific attributes of entities such as arrow aspect for |
39 | -- dimensions must be loaded in a Drawer. This Drawer |
40 | -- is then applied to the Interactive Object in view. |
41 | -- There are four types of Interactive Object in AIS: the |
42 | -- construction element or Datum, the Relation, which |
43 | -- includes both dimensions and constraints, the Object, |
44 | -- and finally, when the object is of an unknown type, the None type. |
45 | -- Inside these categories, a signature, or index, |
46 | -- provides the possibility of additional characterization. |
47 | -- By default, the Interactive Object has a None type |
48 | -- and a signature of 0. If you want to give a particular |
49 | -- type and signature to your interactive object, you must |
50 | -- redefine the methods, Signature and Type. |
51 | -- Warning |
52 | -- In the case of attribute methods, methods for |
53 | -- standard attributes are virtual. They must be |
54 | -- redefined by the inheriting classes. Setcolor for a |
55 | -- point and Setcolor for a plane, for example, do not |
56 | -- affect the same attributes in the Drawer. |
57 | |
58 | uses |
59 | Trsf from gp, |
60 | NameOfColor from Quantity, |
61 | Color from Quantity, |
62 | Ratio from Quantity, |
63 | ListOfTransient from TColStd, |
64 | ListOfInteger from TColStd, |
65 | Box from Bnd, |
66 | NameOfMaterial from Graphic3d, |
67 | MaterialAspect from Graphic3d, |
68 | Drawer from AIS, |
69 | PToContext from AIS, |
70 | TypeOfPresentation3d from PrsMgr, |
71 | InteractiveContext from AIS, |
72 | KindOfInteractive from AIS, |
73 | TypeOfFacingModel from Aspect, |
7fd59977 |
74 | Transformation from Geom, |
75 | Presentation from Prs3d, |
76 | BasicAspect from Prs3d, |
77 | -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets |
78 | PresentationManager from PrsMgr, |
79 | Presentation from PrsMgr |
80 | -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets |
81 | |
82 | is |
83 | Initialize (aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView) ; |
84 | ---Purpose: The TypeOfPresention3d means that the interactive object |
85 | -- may have a presentation dependant of the view of Display |
86 | |
87 | |
88 | |
89 | ---Category: Virtual methods to be redefined... |
90 | |
91 | Type (me) returns KindOfInteractive from AIS is virtual; |
92 | ---Purpose: |
93 | -- Returns the kind of Interactive Object: |
94 | -- - None |
95 | -- - Datum |
96 | -- - Relation |
97 | -- - Object |
98 | -- By default, the interactive object has a None type. |
99 | -- Because specific shapes entail different behavior |
100 | -- according to their sub-shapes, you may need to |
101 | -- create a Local Context. This will allow you to |
102 | -- specify the additional characteristics which you |
103 | -- need to handle these shapes. |
104 | |
105 | Signature(me) returns Integer from Standard is virtual; |
106 | ---Purpose: Specifies additional characteristics of Interactive |
107 | -- Objects. A signature is, in fact, an index with integer |
108 | -- values assigned different properties. |
109 | -- This method is frequently used in conjuction with |
110 | -- Type to give a particular type and signature to an |
111 | -- Interactive Object. By default, the Interactive Object |
112 | -- has a None type and a signature of 0. Among the |
113 | -- datums, this signature is attributed to the shape |
114 | -- The remaining datums have the following default signatures: |
115 | -- - Point signature 1 |
116 | -- - Axis signature 2 |
117 | -- - Trihedron signature 3 |
118 | -- - PlaneTrihedron signature 4 |
119 | -- - Line signature 5 |
120 | -- - Circle signature 6 |
121 | -- - Plane signature 7. |
122 | |
123 | |
124 | AcceptShapeDecomposition(me) returns Boolean from Standard is virtual; |
125 | ---C++: inline |
126 | ---Purpose: Informs the graphic context that the interactive Object |
127 | -- may be decomposed into sub-shapes for dynamic selection. |
128 | -- The most used Interactive Object is AIS_Shape. |
129 | -- Activation methods for standard selection modes are |
130 | -- proposed in the Interactive Context. These include |
131 | -- selection by vertex or by edges. For datums with the |
132 | -- same behavior as AIS_Shape, such as vetices and |
133 | -- edges, we must redefine the virtual method so that |
134 | -- AcceptShapeDecomposition returns false. |
135 | -- Rule for selection : |
136 | -- Mode 0 : Selection of the interactive Object itself |
137 | -- Mode 1 : Selection of vertices |
138 | -- Mode 2 : Selection Of Edges |
139 | -- Mode 3 : Selection Of Wires |
140 | -- Mode 4 : Selection Of Faces ... |
141 | |
142 | |
143 | SetCurrentFacingModel(me: mutable; |
144 | aModel: TypeOfFacingModel from Aspect = Aspect_TOFM_BOTH_SIDE); |
145 | ---Purpose: change the current facing model apply on polygons for |
146 | -- SetColor(), SetTransparency(), SetMaterial() methods |
147 | -- default facing model is Aspect_TOFM_TWO_SIDE. This mean that attributes is |
148 | -- applying both on the front and back face. |
149 | |
150 | CurrentFacingModel(me) returns TypeOfFacingModel from Aspect; |
151 | ---Purpose: Returns the current facing model which is in effect. |
152 | |
153 | SetColor(me:mutable;aColor:Color from Quantity) is virtual; |
154 | |
155 | SetColor(me:mutable;aColor:NameOfColor from Quantity) is virtual; |
156 | ---Purpose: only the interactive obj knowns which Drawer attribute |
157 | -- is affected by the color (ex: for a wire, it's the |
158 | -- wireaspect field of the drawer, but for a vertex, only |
159 | -- the point aspect field is affected by the color) |
160 | -- WARNING : Do not forget to set the corresponding fields |
161 | -- here (hasOwnColor and myOwnColor) |
162 | |
163 | UnsetColor(me:mutable) is virtual; |
164 | ---Purpose: Removes color settings. Only the Interactive Object |
165 | -- knows which Drawer attribute is affected by the color |
166 | -- setting. For a wire, for example, wire aspect is the |
167 | -- attribute affected. For a vertex, however, only point |
168 | -- aspect is affected by the color setting. |
169 | |
170 | SetWidth(me:mutable; aValue:Real from Standard) is virtual; |
171 | ---Purpose: Allows you to provide the setting aValue for width. |
172 | -- Only the Interactive Object knows which Drawer |
173 | -- attribute is affected by the width setting. |
174 | |
175 | UnsetWidth(me:mutable) is virtual; |
176 | |
177 | AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is virtual; |
178 | ---Purpose: Returns true if the class of objects accepts the display mode aMode. |
179 | -- The interactive context can have a default mode of |
180 | -- representation for the set of Interactive Objects. This |
181 | -- mode may not be accepted by a given class of |
182 | -- objects. Consequently, this virtual method allowing us |
183 | -- to get information about the class in question must be implemented. |
184 | DefaultDisplayMode(me) returns Integer from Standard is virtual; |
185 | ---Purpose: Returns the default display mode. This method is to |
186 | -- be implemented when the main mode is not mode 0. |
187 | |
188 | |
189 | Redisplay (me:mutable; AllModes:Boolean from Standard =Standard_False); |
190 | ---Purpose: Updates the active presentation; if <AllModes> = Standard_True |
191 | -- all the presentations inside are recomputed. |
192 | |
193 | |
194 | SetInfiniteState(me:mutable;aFlag:Boolean from Standard = Standard_True); |
195 | ---Purpose: Sets the infinite state flag aFlage. |
196 | -- if <aFlag> = True , the interactiveObject is |
197 | -- considered as infinite, i.e. its graphic presentations |
198 | -- are not taken in account for View FitAll... |
199 | |
200 | IsInfinite(me) returns Boolean from Standard; |
201 | ---C++: inline |
202 | ---Purpose: |
203 | -- Returns true if the interactive object is infinite. In this |
204 | -- case, its graphic presentations are not taken into |
205 | -- account in the fit-all view. |
206 | |
207 | |
208 | ---Category: Link To InteractiveContext |
209 | |
210 | HasInteractiveContext(me) returns Boolean from Standard; |
211 | ---Purpose: Indicates whether the Interactive Object has a pointer |
212 | -- to an interactive context. |
213 | |
214 | GetContext(me) returns InteractiveContext from AIS; |
215 | ---Purpose: Returns the context pointer to the interactive context. |
216 | |
217 | SetContext(me:mutable; aCtx : InteractiveContext from AIS) is virtual; |
218 | ---Purpose: Sets the interactive context aCtx and provides a link |
219 | -- to the default drawing tool or "Drawer" if there is none. |
220 | |
221 | HasOwner (me) returns Boolean from Standard; |
222 | ---Purpose: Returns true if the object has an owner attributed to it. |
223 | -- The owner can be a shape for a set of sub-shapes or |
224 | -- a sub-shape for sub-shapes which it is composed of, |
225 | -- and takes the form of a transient. |
226 | |
227 | GetOwner (me) returns any Transient from Standard; |
228 | ---Purpose: Returns the owner of the Interactive Object. |
229 | -- The owner can be a shape for a set of sub-shapes or |
230 | -- a sub-shape for sub-shapes which it is composed of, |
231 | -- and takes the form of a transient. |
232 | -- There are two types of owners: |
233 | -- - Direct owners, decomposition shapes such as |
234 | -- edges, wires, and faces. |
235 | -- - Users, presentable objects connecting to sensitive |
236 | -- primitives, or a shape which has been decomposed. |
237 | ---C++: inline |
238 | ---C++: return const& |
239 | |
240 | |
241 | |
242 | SetOwner (me : mutable; |
243 | ApplicativeEntity : Transient from Standard); |
244 | ---Purpose: Allows you to attribute the owner ApplicativeEntity to |
245 | -- an Interactive Object. This can be a shape for a set of |
246 | -- sub-shapes or a sub-shape for sub-shapes which it |
247 | -- is composed of. The owner takes the form of a transient. |
248 | ---C++: inline |
249 | |
250 | ClearOwner(me:mutable); |
251 | ---Purpose: Each Interactive Object has methods which allow us |
252 | -- to attribute an Owner to it in the form of a Transient. |
253 | -- This method removes the owner from the graphic entity. |
254 | |
255 | |
256 | HasUsers(me) returns Boolean from Standard; |
257 | |
258 | Users(me) returns ListOfTransient from TColStd; |
259 | ---C++: inline |
260 | ---C++: return const& |
261 | |
262 | |
263 | AddUser(me:mutable; aUser : Transient from Standard); |
264 | |
265 | ClearUsers(me:mutable); |
266 | |
267 | |
268 | |
269 | ---Category: "STANDARD" LOCAL ATTRIBUTES : |
270 | -- |
271 | -- -Local DisplayMode |
272 | -- -Color |
273 | -- -width of lines or points |
274 | -- -typeOfLine or Marker Aspect |
275 | -- -material name (if needed) |
276 | -- -transparency (if needed) |
277 | -- |
278 | -- Specific attributes of entities (such as |
279 | -- arrow aspect for dimensions) must be |
280 | -- loaded in a Drawer; this drawer is then |
281 | -- applied to InteractiveObject WARNING : |
282 | -- Here the Methods for standard attributes |
283 | -- are virtual and do nothing they must be |
284 | -- redefined by the inheriting classes |
285 | -- (setcolor for a point and setcolor for a plane |
286 | -- don't affect the same attributes in the Drawer) |
287 | |
288 | |
289 | HasDisplayMode (me) |
290 | returns Boolean from Standard; |
291 | ---Purpose: |
292 | -- Returns true if the Interactive Object has a display |
293 | -- mode setting. Otherwise, it is displayed in Neutral Point. |
294 | ---C++: inline |
295 | |
296 | SetDisplayMode(me : mutable; aMode : Integer from Standard); |
297 | ---Purpose: Sets the display mode aMode for the interactive object. |
298 | -- An object can have its own temporary display mode, |
299 | -- which is different from that proposed by the interactive context. |
300 | -- The range of possibilities currently proposed is the following: |
301 | -- - AIS_WireFrame |
302 | -- - AIS_Shaded |
303 | -- - AIS_QuickHLR |
304 | -- - AIS_ExactHLR |
305 | -- This range can, however, be extended through the creation of new display modes. |
306 | |
307 | UnsetDisplayMode(me : mutable); |
308 | ---Purpose: Removes display mode settings from the interactive object. |
309 | ---C++: inline |
310 | |
311 | DisplayMode(me) |
312 | returns Integer; |
313 | ---C++: inline |
314 | ---Purpose: Returns the display mode setting of the Interactive Object. |
315 | -- The range of possibilities is the following: |
316 | -- - AIS_WireFrame |
317 | -- - AIS_Shaded |
318 | -- - AIS_QuickHLR |
319 | -- - AIS_ExactHLR |
320 | -- This range can, however, be extended through the |
321 | -- creation of new display modes. |
322 | |
323 | |
324 | HasSelectionMode(me) returns Boolean from Standard; |
325 | ---Purpose: Allows you to change the selection mode of an |
326 | -- Interactive Object. |
327 | -- The default selection mode setting is 0. |
328 | -- For shapes, for example, the selection modes are as follows: |
329 | -- - mode 0 - selection of the shape itself |
330 | -- - mode 1 - selection of vertices |
331 | -- - mode 2 - selection of edges |
332 | -- - mode 3 - selection of wires |
333 | -- - mode 4 - selection of faces |
334 | -- - mode 5 - selection of shells |
335 | -- - mode 6 - selection of solids |
336 | -- - mode 7 - selection of compounds |
337 | -- For trihedra, on the other hand, the selection modes are the following four: |
338 | -- - mode 0 - selection of a trihedron |
339 | -- - mode 1 - selection of its origin |
340 | -- - mode 2 - selection of its axes |
341 | -- - mode 3 - selection of its planes |
342 | |
343 | SelectionMode(me) returns Integer from Standard; |
344 | ---Purpose: Returns the selection mode of the interactive object. |
345 | |
346 | SetSelectionMode(me:mutable; aMode: Integer from Standard); |
347 | ---Purpose: You can change the default selection mode index |
348 | -- aMode of an Interactive Object. |
349 | -- This is only of interest if you decide that mode 0 |
350 | -- adopted by convention will not do. |
351 | |
352 | UnsetSelectionMode(me:mutable); |
353 | ---Purpose: You can change the default selection mode index of |
354 | -- an Interactive Object. |
355 | -- This is only of interest if you decide that the 0 mode |
356 | -- adopted by convention will not do. |
357 | ---C++: inline |
358 | |
359 | |
360 | SelectionPriority(me) returns Integer from Standard; |
361 | ---C++: inline |
362 | ---Purpose: Returns the selection priority setting. -1 indicates that there is none. |
363 | -- You can modify the selection priority of an owner to |
364 | -- make one entity more selectionable than another one. |
365 | -- The default selection priority for an owner is 5, for |
366 | -- example. To increase selection priority, choose a |
367 | -- setting between 5 and 10. An entity with priority 7 will |
368 | -- take priority over one with a setting of 6 if both |
369 | -- objects are selected at the same time. |
370 | -- You could give vertices priority 8, edges priority 7, |
371 | -- faces priority 6, and shapes priority 5. If a vertex, an |
372 | -- edge and a face are simultaneously detected during |
373 | -- selection, only the vertex will then be highlighted. |
374 | -- For trihedra, for example, the default priorities are the following four: |
375 | -- - priority 1 - a trihedron |
376 | -- - priority 5 - its origin |
377 | -- - priority 3 - its axes |
378 | -- - priority 2 - its planes |
379 | |
380 | SetSelectionPriority(me:mutable; aPriority : Integer from Standard); |
381 | ---C++: inline |
382 | ---Purpose: Allows you to provide a setting aPriority for selection priority. |
383 | -- You can modify selection priority of an owner to make |
384 | -- one entity more selectionable than another one. The |
385 | -- default selection priority for an owner is 5, for |
386 | -- example. To increase selection priority, choose a |
387 | -- setting between 5 and 10. An entity with priority 7 will |
388 | -- take priority over one with a setting of 6. |
389 | |
390 | UnsetSelectionPriority(me:mutable); |
391 | ---C++: inline |
392 | ---Purpose: Removes the setting for selection priority. SelectionPriority then returns -1. |
393 | |
394 | HasSelectionPriority(me) returns Boolean from Standard; |
395 | ---C++: inline |
396 | ---Purpose: Returns true if there is a setting for selection priority. |
397 | -- You can modify selection priority of an owner to make |
398 | -- one entity more selectionable than another one. The |
399 | -- default selection priority for an owner is 5, for |
400 | -- example. To increase selection priority, choose a |
401 | -- setting between 5 and 10. An entity with priority 7 will |
402 | -- take priority over one with a setting of 6. |
403 | |
404 | HasHilightMode(me) returns Boolean from Standard; |
405 | ---C++: inline |
406 | ---Purpose: Returns true if the Interactive Object is in highlight mode. |
407 | |
408 | HilightMode(me) returns Integer from Standard ; |
409 | ---C++: inline |
410 | ---Purpose: Returns the setting for highlight mode. |
411 | -- At dynamic detection, the presentation echoed by the |
412 | -- Interactive Context, is by default the presentation |
413 | -- already on the screen. You can specify a Highlight |
414 | -- presentation mode which is valid no matter what the |
415 | -- active representation of the object. It makes no |
416 | -- difference whether this choice is temporary or |
417 | -- definitive. To do this, we use the following functions: |
418 | -- - SetHilightMode |
419 | -- - UnSetHilightMode |
420 | -- In the case of a shape, whether it is visualized in |
421 | -- wireframe presentation or with shading, we want to |
422 | -- systematically highlight the wireframe presentation. |
423 | -- Consequently, we set the highlight mode to 0. |
424 | |
425 | SetHilightMode(me:mutable;anIndex : Integer from Standard); |
426 | ---C++: inline |
427 | ---Purpose: Sets the highlight mode anIndex for the interactive object. |
428 | -- If, for example, you want to systematically highlight |
429 | -- the wireframe presentation of a shape - whether |
430 | -- visualized in wireframe presentation or with shading - |
431 | -- you set the highlight mode to 0. |
432 | |
433 | UnsetHilightMode(me:mutable); |
434 | ---C++: inline |
435 | ---Purpose: Allows the user to take a given Prs for hilight |
436 | -- ex : for a shape which would be displayed in shading mode |
437 | -- the hilight Prs is the wireframe mode. |
438 | -- if No specific hilight mode is defined, the displayed Prs |
439 | -- will be the hilighted one. |
440 | |
441 | HasColor (me) returns Boolean from Standard; |
442 | ---C++: inline |
443 | ---Purpose: Returns true if the Interactive Object has color. |
444 | |
445 | Color(me) returns NameOfColor from Quantity is virtual; |
446 | ---C++: inline |
447 | ---Purpose: Returns the color setting of the Interactive Object. |
448 | |
449 | Color(me; aColor: out Color from Quantity) is virtual; |
450 | ---C++: inline |
451 | |
452 | HasWidth(me) returns Boolean from Standard; |
453 | ---C++: inline |
454 | ---Purpose: Returns true if the Interactive Object has width. |
455 | |
456 | Width(me) returns Real from Standard ; |
457 | --- Purpose: Returns the width setting of the Interactive Object. |
458 | |
459 | HasMaterial(me) returns Boolean from Standard ; |
460 | ---Purpose: Returns true if the Interactive Object has a setting for material. |
461 | Material(me) returns NameOfMaterial from Graphic3d is virtual; |
462 | ---Purpose: Returns the current material setting. |
463 | -- This will be on of the following materials: |
464 | -- - Brass |
465 | -- - Bronze |
466 | -- - Gold |
467 | -- - Pewter |
468 | -- - Silver |
469 | -- - Stone. |
470 | |
471 | SetMaterial(me:mutable;aName:NameOfMaterial from Graphic3d) is virtual; |
472 | ---Purpose: Sets the name aName for material defining this |
473 | -- display attribute for the interactive object. |
474 | -- Material aspect determines shading aspect, color and |
475 | -- transparency of visible entities. |
476 | |
477 | |
478 | SetMaterial(me:mutable;aName:MaterialAspect from Graphic3d) is virtual; |
479 | --- Purpose: Sets the material aMat defining this display attribute |
480 | -- for the interactive object. |
481 | -- Material aspect determines shading aspect, color and |
482 | -- transparency of visible entities. |
483 | |
484 | UnsetMaterial(me:mutable) is virtual; |
485 | ---Purpose: Removes the setting for material. |
486 | |
487 | SetTransparency(me:mutable;aValue : Real from Standard=0.6) is virtual; |
488 | ---Purpose: Attributes a setting aValue for transparency. |
489 | -- The transparency value should be between 0.0 and 1.0. |
490 | -- At 0.0 an object will be totally opaque, and at 1.0, fully transparent. |
491 | -- Warning At a value of 1.0, there may be nothing visible. |
492 | |
493 | IsTransparent(me) returns Boolean from Standard; |
494 | ---C++: inline |
495 | ---Purpose: Returns true if there is a transparency setting. |
496 | |
497 | Transparency(me) returns Real from Standard is virtual; |
498 | ---Purpose: Returns the transparency setting. |
499 | -- This will be between 0.0 and 1.0. |
500 | -- At 0.0 an object will be totally opaque, and at 1.0, fully transparent. |
501 | |
502 | UnsetTransparency(me:mutable) is virtual; |
503 | ---Purpose: Removes the transparency setting. The object is opaque by default. |
504 | |
505 | SetAttributes(me:mutable; aDrawer: Drawer from AIS) is virtual; |
506 | ---Purpose: Initializes the drawing tool aDrawer. |
507 | |
508 | Attributes(me) returns any Drawer from AIS; |
509 | ---C++: return const& |
510 | ---C++: inline |
511 | ---Purpose: Returns the attributes settings. |
512 | |
513 | UnsetAttributes(me:mutable) is virtual; |
514 | ---Purpose: Clears settings provided by the drawing tool aDrawer. |
515 | |
516 | ---Category: information about Prs to be recomputed |
517 | -- after local attributes change... to be removed... |
518 | |
519 | RecomputeEveryPrs(me) returns Boolean is virtual private; |
520 | |
521 | MustRecomputePrs(me;aMode : Integer from Standard) is private; |
522 | |
523 | ListOfRecomputeModes(me)returns ListOfInteger from TColStd is private; |
524 | ---C++: return const& |
525 | SetRecomputeOk(me:mutable) is private; |
526 | |
7fd59977 |
527 | State(me:mutable;theState: Integer from Standard) ; |
528 | ---C++: inline |
529 | State(me) returns Integer from Standard ; |
530 | ---C++: inline |
531 | |
7fd59977 |
532 | SetTransformation ( me : mutable; |
533 | aTranformation: Transformation from Geom; |
534 | postConcatenate: Boolean from Standard = Standard_False; |
535 | updateSelection: Boolean from Standard = Standard_True) |
536 | is static; |
537 | ---Level: Public |
538 | ---Purpose: Transforms all presentations of the object |
539 | -- and replace the actual transformation matrix if <postConcatenate> is FALSE. |
540 | -- Note that the selection must be updated only at the end of |
541 | -- object animation when <updateSelection> is TRUE |
542 | ---Category: Transformation method |
543 | |
544 | UnsetTransformation ( me : mutable ) |
545 | is static; |
546 | ---Level: Public |
547 | ---Purpose: Deactivate the current transformation |
548 | ---Category: Transformation method |
549 | |
550 | Transformation ( me : mutable ) returns Transformation from Geom |
551 | is static; |
552 | ---Level: Public |
553 | ---Purpose: Returns the current transformation associated |
554 | -- to the first available presentation of this object. |
555 | ---Category: Inquire transformation method |
556 | |
557 | HasTransformation ( me ) returns Boolean from Standard |
558 | is static; |
559 | ---Level: Public |
560 | ---Purpose: Returns TRUE when this object is transformed |
561 | ---Category: Inquire transformation method |
562 | |
563 | HasPresentation ( me ) returns Boolean from Standard |
564 | is static; |
565 | ---Level: Public |
566 | ---Purpose: Returns TRUE when this object has a presentation |
567 | -- in the current DisplayMode() |
568 | ---Category: Inquire transformation method |
569 | |
570 | Presentation ( me ) returns Presentation from Prs3d |
571 | is static; |
572 | ---Level: Public |
573 | ---Purpose: Returns the current presentation of this object |
574 | -- according to the current DisplayMode() |
575 | ---Category: Inquire transformation method |
576 | |
577 | SetAspect ( me : mutable; anAspect: any BasicAspect from Prs3d; |
578 | globalChange: Boolean from Standard = Standard_True) |
579 | is static; |
580 | ---Level: Public |
581 | ---Purpose: Sets the graphic basic aspect to the current presentation. |
582 | -- When <globalChange> is TRUE , the full object presentation |
583 | -- is changed. |
584 | -- When <globalChange> is FALSE , only the current group |
585 | -- of the object presentation is changed. |
586 | ---Category: Graphic attributes management |
587 | |
588 | -- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets |
589 | SetPolygonOffsets ( me : mutable; |
590 | aMode : Integer from Standard; |
60be1f9b |
591 | aFactor : ShortReal from Standard = 1.0; |
592 | aUnits : ShortReal from Standard = 0.0 ) is virtual; |
7fd59977 |
593 | ---Level: Public |
594 | ---Purpose: Sets up polygon offsets for this object. |
595 | -- It modifies all existing presentations of <anObj> (if any), |
596 | -- so it is reasonable to call this method after <anObj> has been displayed. |
597 | -- Otherwise, Compute() method should pass Graphic3d_AspectFillArea3d |
598 | -- aspect from <myDrawer> to Graphic3d_Group to make polygon offsets work. |
599 | -- |
600 | -- <aMode> parameter can contain various combinations of |
601 | -- Aspect_PolygonOffsetMode enumeration elements (Aspect_POM_None means |
602 | -- that polygon offsets are not changed). |
603 | -- If <aMode> is different from Aspect_POM_Off and Aspect_POM_None, then <aFactor> and <aUnits> |
604 | -- arguments are used by graphic renderer to calculate a depth offset value: |
605 | -- |
606 | -- offset = <aFactor> * m + <aUnits> * r, where |
607 | -- m - maximum depth slope for the polygon currently being displayed, |
608 | -- r - minimum window coordinates depth resolution (implementation-specific). |
609 | -- |
610 | -- Deafult settings for OCC 3D viewer: mode = Aspect_POM_Fill, factor = 1., units = 0. |
611 | -- |
612 | -- Negative offset values move polygons closer to the viewport, |
613 | -- while positive values shift polygons away. |
614 | -- Consult OpenGL reference for details (glPolygonOffset function description). |
615 | -- |
616 | -- NOTE: This method has a side effect - it creates own shading aspect |
617 | -- if not yet created, so it is better to set up object material, |
618 | -- color, etc. first. |
619 | ---Category: Graphic attributes management |
620 | |
621 | HasPolygonOffsets ( me ) |
622 | returns Boolean from Standard |
623 | is virtual; |
624 | ---Level: Public |
625 | ---Purpose: Returns Standard_True if <myDrawer> has non-null shading aspect |
626 | ---Category: Inquire methods |
627 | |
628 | PolygonOffsets ( me; |
629 | aMode : out Integer from Standard; |
60be1f9b |
630 | aFactor : out ShortReal from Standard; |
631 | aUnits : out ShortReal from Standard ) is virtual; |
7fd59977 |
632 | ---Level: Public |
633 | ---Purpose: Retrieves current polygon offsets settings from <myDrawer>. |
634 | ---Category: Inquire methods |
635 | |
636 | fields |
637 | |
638 | myCTXPtr : PToContext from AIS; |
639 | |
640 | -- The reference to applicative World... |
641 | |
642 | myOwner : Transient from Standard; |
643 | myUsers : ListOfTransient from TColStd; |
644 | |
645 | -- The Information Fields |
646 | |
647 | myDrawer : Drawer from AIS is protected ; |
648 | myTransparency : Real from Standard is protected; |
649 | -- GER61351 myOwnColor : NameOfColor from Quantity is protected; |
650 | myOwnColor : Color from Quantity is protected; |
651 | myOwnMaterial : NameOfMaterial from Graphic3d is protected; |
652 | ---myOwnMaterial : NameOfPhysicalMaterial from Graphic3d is protected; |
653 | mySelPriority : Integer from Standard; |
654 | myDisplayMode : Integer from Standard ; |
655 | mySelectionMode : Integer from Standard; |
656 | myHilightMode : Integer from Standard is protected; |
657 | myOwnWidth : Real from Standard is protected; |
658 | myInfiniteState : Boolean from Standard is protected; |
659 | hasOwnColor : Boolean from Standard is protected; |
660 | hasOwnMaterial : Boolean from Standard is protected ; |
661 | myCurrentFacingModel: TypeOfFacingModel from Aspect is protected; |
662 | |
663 | -- the management field (to be removed)... |
664 | myRecomputeEveryPrs : Boolean from Standard is protected; |
665 | |
666 | myToRecomputeModes : ListOfInteger from TColStd is protected; |
667 | mystate : Integer from Standard; |
668 | myHasTransformation : Boolean from Standard; |
669 | |
670 | |
671 | friends |
672 | class InteractiveContext from AIS |
673 | |
674 | end InteractiveObject; |
675 | |