7fd59977 |
1 | -- File : AIS2D_InteractiveContext.cdl |
2 | -- Created : February 2000 |
3 | -- Author : Tanya COOL |
4 | ---Copyright: Matra Datavision 2000 |
5 | |
6 | -- Modified: EAV: 07-09-01 : NbSelected(), InitSelected(), |
7 | -- MoreSelected(), NextSelected() |
8 | |
9 | -- SAV: 15/11/01 MoveCircleTo(). detection by circle. SetDetectionMode(). |
10 | -- Detect() - internal |
11 | |
12 | class InteractiveContext from AIS2D inherits TShared from MMgt |
13 | |
14 | ---Purpose: The InteractiveContext class allows you to manage |
15 | -- graphic behavior and selection of Interactive Objects |
16 | -- in one or more viewers. |
17 | |
18 | uses |
19 | |
20 | TypeOfLine from Aspect, |
21 | WidthOfLine from Aspect, |
22 | MarkerStyle from Aspect, |
23 | TypeOfMarker from Aspect, |
24 | FontStyle from Aspect, |
25 | GenericColorMap from Aspect, |
26 | TypeMap from Aspect, |
27 | WidthMap from Aspect, |
28 | MarkMap from Aspect, |
29 | FontMap from Aspect, |
30 | GridType from Aspect, |
31 | GridDrawMode from Aspect, |
32 | CardinalPoints from Aspect, |
33 | Color from Quantity, |
34 | PlaneAngle from Quantity, |
35 | Length from Quantity, |
36 | NameOfColor from Quantity, |
37 | ExtendedString from TCollection, |
38 | Primitive from Graphic2d, |
39 | PickMode from Graphic2d, |
40 | TransientManager from Graphic2d, |
41 | DisplayList from Graphic2d, |
42 | Viewer from V2d, |
43 | View from V2d, |
44 | Drawer from Prs2d, |
45 | InteractiveObject from AIS2D, |
46 | KindOfIO from AIS2D, |
47 | DataMapOfIOStatus from AIS2D, |
48 | DataMapOfLC from AIS2D, |
49 | StatusOfDetection from AIS2D, |
50 | DisplayStatus from AIS2D, |
51 | StatusOfPick from AIS2D, |
52 | TypeOfDetection from AIS2D, |
53 | PToListOfInt from AIS2D, |
54 | ListOfIO from AIS2D, |
55 | HSequenceOfIO from AIS2D |
56 | |
57 | is |
58 | |
59 | Create( MainViewer: Viewer from V2d ) |
60 | returns mutable InteractiveContext from AIS2D; |
61 | ---Purpose: Initiates <MainViewer> |
62 | |
63 | Create( MainViewer, aCollector: Viewer from V2d) |
64 | returns mutable InteractiveContext from AIS2D; |
65 | ---Purpose: Initiates the principal viewer and Collector(trash) viewer together |
66 | |
67 | -- ************************************************************* |
68 | ---Category: Editing general Display Services |
69 | -- ************************************************************* |
70 | |
71 | Display( me : mutable; |
72 | anIObj : InteractiveObject from AIS2D; |
73 | UpdateVwr : Boolean from Standard = Standard_True); |
74 | ---Level: Public |
75 | ---Purpose: Display when no local context is opened. |
76 | -- if <anIObj> has no proper display mode, the defaut |
77 | -- display mode of the session is used |
78 | -- Same for the selection Mode (by default =0) |
79 | |
80 | Display( me : mutable; |
81 | anIObj : InteractiveObject from AIS2D; |
82 | aDispMode : Integer from Standard ; |
83 | aSelectMode : Integer from Standard; |
84 | UpdateVwr : Boolean from Standard = Standard_True; |
85 | AllowDecomp : Boolean from Standard = Standard_True); |
86 | ---Level: Public |
87 | ---Purpose: Use only if a local context is opened. Displays the |
88 | -- <aDispMode> the presentation of interactive object, |
89 | -- activates the selection mode <aSelectMode> if |
90 | -- <UpdateVwr> = Standard_False, the object is |
91 | -- displayed but no viewer will be updated; CONVENTION : |
92 | -- <aSelectMode> = -1 means no activation for <anIObj> |
93 | -- : it will be displayed but not selectable. (Option |
94 | -- only available for local context...) |
95 | -- <AllowDecomp> = true means that <anIObj> is |
96 | -- able to have subshapes detected by selection mechanisms. |
97 | -- 2 conditions: <anIObj> must be able to give a shape |
98 | -- selection modes fit the AIS2D_Shape |
99 | -- selection modes ( 1->vertex, 2->edges, 3->wires...) |
100 | |
101 | Load( me: mutable; |
102 | anIObj: InteractiveObject from AIS2D; |
103 | SelMode : Integer from Standard = -1; |
104 | AllowDecomp : Boolean from Standard = Standard_False ); |
105 | ---Purpose: Available when opened local contexts only; |
106 | -- option to load in the selector objects which will |
107 | -- be selectable but not displayed. Nevertheless, they |
108 | -- will be hilighted when detected by the selector. |
109 | -- ex : be able to select center of a line without |
110 | -- displaying all centers before selection process |
111 | |
112 | Erase( me : mutable; |
113 | anIObj : InteractiveObject from AIS2D; |
114 | UpdateVwr : Boolean from Standard = Standard_True; |
115 | PutInCollector : Boolean from Standard = Standard_True ); |
116 | ---Level: Public |
117 | ---Purpose: Erases presentations in current local context, |
118 | -- or failing that, in other local contexts which allow erasing. |
119 | -- If <PutInCollector> is false, the object is erased but |
120 | -- not put in the Collector. |
121 | |
122 | EraseMode( me : mutable; |
123 | anIObj : InteractiveObject from AIS2D; |
124 | aMode : Integer from Standard; |
125 | UpdateVwr : Boolean from Standard = Standard_True); |
126 | ---Purpose: Selects an erase mode. Used only if more than one |
127 | -- mode is displayed in the main viewer. If aMode is |
128 | -- the Prs used by default, no erase mode is selected. |
129 | |
130 | EraseAll( me : mutable; |
131 | PutInCollector : Boolean from Standard = Standard_True; |
132 | updateVwr : Boolean from Standard = Standard_True ); |
133 | ---Purpose: Every erased object goes into the Collector viewer |
134 | |
135 | DisplayAll( me : mutable; |
136 | OnlyFromCollector : Boolean from Standard = Standard_True; |
137 | updateVwr : Boolean from Standard = Standard_True); |
138 | ---Purpose: Displays all erased objects, in other words, |
139 | -- all objects in the Collector viewer. |
140 | |
141 | EraseSelected( me : mutable; |
142 | PutInCollector : Boolean from Standard = Standard_True; |
143 | updateVwr : Boolean from Standard = Standard_True ); |
144 | ---Purpose: Erases selected objects if a local context is open. |
145 | -- Erases current objects if there is no active local context. |
146 | -- If a local context is open and if <updateVwr> equals |
147 | -- Standard_False, the presentation of the Interactive Object |
148 | -- activates the selection mode; the object is displayed but |
149 | -- no viewer will be updated. |
150 | |
151 | DisplaySelected( me : mutable; |
152 | updateVwr : Boolean from Standard = Standard_True ); |
153 | ---Purpose: Displays or erases selected objects if a local |
154 | -- context is open. If no active local context is found, |
155 | -- only current objects can be displayed or erased. |
156 | |
157 | KeepTemporary( me : mutable; |
158 | anIObj : InteractiveObject from AIS2D; |
159 | InWhichLocal: Integer from Standard = -1) |
160 | returns Boolean from Standard; |
161 | ---Purpose: Changes the status of a temporary object it will be -- |
162 | -- kept at the neutral point, i.e. put in the list of |
163 | -- displayed objects, with its temporary attributes |
164 | -- (displaymode,selection mode) returns true if done -- |
165 | -- inWhichLocal means that gives the local context in |
166 | -- which <anIObj> is displayed. By default, -1 means the |
167 | -- last opened one |
168 | |
169 | Redisplay( me : mutable; |
170 | anIObj : InteractiveObject from AIS2D; |
171 | updateVwr : Boolean from Standard = Standard_True; |
172 | allModes : Boolean from Standard = Standard_False); |
173 | ---Purpose: Forces Recompute of the seen presentations of the object; |
174 | -- if <allModes>= True -> recomputes all the |
175 | -- presentations . |
176 | |
177 | --*********************************************************************** |
178 | ---Category: Querying and Editing Selection Process |
179 | --*********************************************************************** |
180 | |
181 | IsCurrent( me; anIObj: InteractiveObject from AIS2D ) |
182 | returns Boolean from Standard; |
183 | ---Purpose: Finds the current selected entity <anIObj> in Neutral Point. |
184 | |
185 | IsSelected( me; anIObj: InteractiveObject from AIS2D ) |
186 | returns Boolean from Standard; |
187 | ---Purpose: Confirms selection. Returns true if <anIObj> is selected in the interactive context |
188 | |
189 | Highlight( me : mutable; |
190 | anIObj : InteractiveObject from AIS2D; |
191 | updateVwr: Boolean from Standard = Standard_True); |
192 | ---Purpose: Updates the display in the viewer to take dynamic detection |
193 | -- into account. |
194 | -- If a local context is open and if <updateVwr> equals Standard_False, |
195 | -- the presentation of the Interactive Object activates the selection |
196 | -- mode; the object is displayed but no viewer will be updated. |
197 | |
198 | HighlightWithColor( me: mutable; |
199 | anIObj:InteractiveObject from AIS2D; |
200 | aCol: NameOfColor from Quantity; |
201 | updateVwr: Boolean from Standard = Standard_True ); |
202 | ---Purpose: Changes the color of the object in view <anIObj>. |
203 | -- It paints this object the color passed as the argument <aCol> |
204 | -- If a local context is open and if <updateVwr> equals Standard_False, |
205 | -- the presentation of the Interactive Object activates the selection |
206 | -- mode; the object is displayed but no viewer will be updated. |
207 | |
208 | Unhighlight( me : mutable; |
209 | anIObj : InteractiveObject from AIS2D; |
210 | updateVwr : Boolean from Standard = Standard_True ); |
211 | ---Purpose: Removes hilighting from the entity <anIObj>. Updates the viewer. |
212 | -- If a local context is open and if <updateVwr> equals Standard_False, |
213 | -- the presentation of the Interactive Object activates the selection |
214 | -- mode; the object is displayed but no viewer will be updated. |
215 | |
216 | |
217 | --**************************************************************** |
218 | ---Category: Graphic Detection and Selection |
219 | --**************************************************************** |
220 | |
221 | SetPrecision( me: mutable; aPrec: Integer from Standard ); |
222 | ---C++: inline |
223 | ---Level: Public |
224 | ---Purpose: Sets the precision of detection |
225 | |
226 | DetectPrecision( me ) returns Integer from Standard; |
227 | ---C++: inline |
228 | ---Level: Public |
229 | ---Purpose: Returns the precision of detection |
230 | |
231 | Place( me : mutable; |
232 | XPix, YPix : Integer from Standard; |
233 | aView : View from V2d; |
234 | anIO : InteractiveObject from AIS2D; |
235 | isTemporary : Boolean from Standard = Standard_False ); |
236 | ---Level: Public |
237 | ---Purpose: Places object <anIO> to the pixel position (XPix, YPix) |
238 | -- in the view <aView> is using TransientManager. |
239 | -- It's possible to use without preliminary application of Display method. |
240 | |
241 | Drag( me : mutable; |
242 | XPix, YPix : Integer from Standard; |
243 | aView : View from V2d; |
244 | isTemporary: Boolean from Standard = Standard_True ); |
245 | ---Level: Public |
246 | ---Purpose: Places selected objects to the pixel position (XPix, YPix) |
247 | -- in the view <aView>. If <isTemporary> is True, is used TransientManager. |
248 | |
249 | MoveTo( me: mutable; |
250 | XPix, YPix: Integer from Standard; |
251 | aView: View from V2d ) returns StatusOfDetection from AIS2D; |
252 | ---Level: Public |
253 | ---Purpose: Relays mouse position in pixels XPix and YPix to the |
254 | -- interactive context selectors. This is done by the view <aView> |
255 | -- passing this position to the main viewer and updating it. |
256 | -- Functions in both Neutral Point and local contexts. |
257 | |
258 | ---SAV |
259 | MoveCircleTo( me: mutable; XPix, YPix, Radius : Integer from Standard; |
260 | aView: View from V2d ) returns StatusOfDetection from AIS2D; |
261 | ---Level: Public |
262 | ---Purpose: Relays mouse position in circle <XPix, YPix> and <Radius> to the |
263 | -- interactive context selectors. This is done by the view <aView> |
264 | -- passing this position to the main viewer and updating it. |
265 | -- Functions in both Neutral Point and local contexts. |
266 | |
267 | MoveTo( me: mutable; |
268 | Xmin, Ymin, Xmax, Ymax: Integer from Standard; |
269 | aView: View from V2d ) returns StatusOfDetection from AIS2D; |
270 | ---Level: Public |
271 | ---Purpose: Relays mouse position in rectangle Xmin, Ymin, Xmax, Ymax to the |
272 | -- interactive context selectors. This is done by the view <aView> |
273 | -- passing this position to the main viewer and updating it. |
274 | -- Functions in both Neutral Point and local contexts. |
275 | |
276 | |
277 | ---SAV |
278 | Detect( me: mutable; dList : DisplayList from Graphic2d; aView : View from V2d ) |
279 | returns StatusOfDetection from AIS2D is private; |
280 | |
281 | Select( me : mutable; |
282 | UpdateVwr : Boolean from Standard = Standard_True) |
283 | returns StatusOfPick from AIS2D; |
284 | ---Level: Public |
285 | ---Purpose: Stores and hilights the previous detected; Unhilights |
286 | -- the previous picked. |
287 | |
288 | ShiftSelect( me: mutable; UpdateVwr: Boolean from Standard = Standard_True ) |
289 | returns StatusOfPick from AIS2D; |
290 | ---Level: Public |
291 | ---Purpose: adds the last detected to the list of previous picked. |
292 | -- if the last detected was already declared as picked, |
293 | -- removes it from the Picked List. |
294 | |
295 | ShiftSelect( me: mutable; XPMin, YPMin, XPMax, YPMax: Integer from Standard; |
296 | aView: View from V2d; UpdateVwr : Boolean from Standard = Standard_True) |
297 | returns StatusOfPick from AIS2D; |
298 | ---Level: Public |
299 | ---Purpose: rectangle of selection ; adds new detected entities into the |
300 | -- picked list, removes the detected entities that were already stored... |
301 | |
302 | |
303 | SetHighlightColor( me: mutable; aCol: NameOfColor from Quantity ); |
304 | ---Purpose: Allows to set the color used to show highlighted entities, |
305 | -- that is, entities picked out by the mouse. |
306 | |
307 | SetSelectionColor( me: mutable; aCol: NameOfColor from Quantity ); |
308 | ---Purpose: Sets the color used to show selected entities |
309 | |
310 | SetSubIntensityColor( me: mutable; aCol: NameOfColor from Quantity ); |
311 | ---Purpose: Allows you to set the color used to show that an object |
312 | -- is not currently selected |
313 | |
314 | DisplayMode( me ) returns Integer from Standard; |
315 | ---C++: inline |
316 | ---Purpose: Returns the display mode setting |
317 | |
318 | HighlightColor( me ) returns NameOfColor from Quantity; |
319 | ---C++: inline |
320 | ---Level: Public |
321 | ---Purpose: Returns the name of the color used to show highlighted entities, |
322 | -- that is, entities picked out by the mouse |
323 | |
324 | SelectionColor( me ) returns NameOfColor from Quantity; |
325 | ---C++: inline |
326 | ---Level: Public |
327 | ---Purpose: Returns the name of the color used to show selected entities. |
328 | |
329 | SubIntensityColor( me ) returns NameOfColor from Quantity; |
330 | ---C++: inline |
331 | ---Level: Public |
332 | ---Purpose: Returns the name of the color used to show |
333 | -- that an object is not currently selected. |
334 | |
335 | SubIntensityOn( me : mutable; |
336 | anIObj : InteractiveObject from AIS2D; |
337 | UpdateVwr : Boolean from Standard = Standard_True); |
338 | ---Level: Public |
339 | ---Purpose: Highlights, and removes highlights from, the displayed object |
340 | -- <anIObj> which is displayed at Neutral Point with subintensity |
341 | -- color; available only for active local context. |
342 | -- There is no effect if there is no local context. |
343 | |
344 | SubIntensityOff( me : mutable; |
345 | anIObj : InteractiveObject from AIS2D; |
346 | UpdateVwr : Boolean from Standard = Standard_True); |
347 | ---Level: Public |
348 | ---Purpose: Removes the subintensity option for the entity <anIObj>. |
349 | |
350 | |
351 | -- ************************************************************* |
352 | -- Management of the Trash Bin Viewer |
353 | -- ************************************************************* |
354 | |
355 | IsCollectorClosed( me ) returns Boolean from Standard; |
356 | ---C++: inline |
357 | ---Level: Internal |
358 | ---Purpose: |
359 | |
360 | CloseCollector( me: mutable ); |
361 | ---C++: inline |
362 | ---Level: Internal |
363 | ---Purpose: Allows to close Collector |
364 | |
365 | OpenCollector( me: mutable ); |
366 | ---Level: Internal |
367 | ---Purpose: Allows to open Collector |
368 | |
369 | --************************************************************************ |
370 | ---Category: Specific Local Context Action |
371 | --************************************************************************ |
372 | |
373 | OpenLocalContext( me : mutable; |
374 | UseDispObj : Boolean from Standard = Standard_True; |
375 | AllowDecomposit : Boolean from Standard = Standard_True; |
376 | AcceptEraseOfObj: Boolean from Standard = Standard_False ) |
377 | returns Integer from Standard; |
378 | ---Level: Public |
379 | ---Purpose: Opens a local context of display and selection |
380 | -- returns the index of new opened local context. |
381 | -- Must be stored and used to close the local context. |
382 | |
383 | CloseLocalContext( me : mutable; |
384 | ind : Integer from Standard = -1; |
385 | updateVwr : Boolean from Standard = Standard_True ); |
386 | ---Level: Public |
387 | ---Purpose: close the current opened local context. |
388 | -- Use <ind> to be sure to close the local context you Opened ! |
389 | -- if <ind> == -1 the current local context is closed |
390 | -- WITHOUT VERIFICATION. |
391 | -- if <ind> is greater than the current opened local context, |
392 | -- nothing is done. |
393 | |
394 | IndexOfCurrentLocal( me ) returns Integer from Standard; |
395 | ---Level: Public |
396 | ---Purpose: returns -1 if no opened local context. |
397 | |
398 | CloseAllContext( me: mutable; updateVwr: Boolean from Standard = Standard_True); |
399 | ---Level: Public |
400 | ---Purpose: Allows to close all local contexts at one go and return to |
401 | -- Neutral Point. |
402 | |
403 | --**************************************************************** |
404 | ---Category: non interactive actions about Selection |
405 | -- 2 categories are distinct: |
406 | -- - Current Objects |
407 | -- - Selected Objects |
408 | -- a Current object is the object picked |
409 | -- at neutral Point. |
410 | -- The Selected objects are objects picked |
411 | -- when a local context is opened |
412 | |
413 | |
414 | SetCurrentObject( me : mutable; |
415 | anIObj : InteractiveObject from AIS2D; |
416 | UpdateVwr: Boolean from Standard = Standard_True ); |
417 | ---Level: Public |
418 | ---Purpose: Updates the view of the current object in open context. |
419 | -- Objects selected when there is no open local context |
420 | -- are called current objects; those selected in open local context, |
421 | -- selected objects. |
422 | |
423 | AddOrRemoveCurObject( me : mutable; |
424 | anIObj : InteractiveObject from AIS2D; |
425 | UpdateVwr : Boolean from Standard = Standard_True); |
426 | ---Level: Public |
427 | ---Purpose: Allows to add a current object to the list of current objects |
428 | -- or remove it from that list. |
429 | -- Objects selected when there is no open local context are called |
430 | -- current objects; those selected in open local context, |
431 | -- selected objects. |
432 | |
433 | |
434 | UpdateCurrent( me: mutable ); |
435 | ---Level: Public |
436 | ---Purpose: updates the list of current objects |
437 | -- i.e. hilights new current objects, |
438 | -- unhighlights old current objects |
439 | -- |
440 | |
441 | SetOkCurrent( me: mutable ); |
442 | ---Level: Internal |
443 | ---Purpose: |
444 | |
445 | --FirstCurrentObject( me: mutable ) returns InteractiveObject from AIS2D; |
446 | ---Level: Public |
447 | ---Purpose: Returns the first current object in the list of current objects. |
448 | |
449 | HighlightCurrent( me: mutable; |
450 | UpdateVwr: Boolean from Standard = Standard_True); |
451 | ---Level: Public |
452 | ---Purpose: Highlights current objects. |
453 | |
454 | UnhighlightCurrent( me: mutable; |
455 | UpdateVwr: Boolean from Standard = Standard_True); |
456 | ---Level: Public |
457 | ---Purpose: Unhighlights current objects. |
458 | |
459 | ClearCurrent(me: mutable; UpdateVwr: Boolean from Standard = Standard_True); |
460 | ---Level: Public |
461 | ---Purpose: Empties previous current objects in order to get the current |
462 | -- objects detected by the selector using UpdateCurrent. |
463 | |
464 | SetSelected( me: mutable; anIObj: InteractiveObject from AIS2D; |
465 | UpdateVwr: Boolean from Standard = Standard_True ); |
466 | ---Level: Public |
467 | ---Purpose: Puts the selected <anIObj> in the current objects list. |
468 | |
469 | SetSelectedCurrent( me: mutable ); |
470 | ---Level: Public |
471 | ---Purpose: Puts the selected list in the current objects list. |
472 | |
473 | UpdateSelected( me: mutable; |
474 | UpdateVwr: Boolean from Standard=Standard_True ); |
475 | ---Level: Public |
476 | ---Purpose: Updates the list of selected objects, i.e. hilights |
477 | -- new selected objects, removes hilighting from former |
478 | -- selected objects. |
479 | |
480 | AddOrRemoveSelected( me: mutable; |
481 | anIObj : InteractiveObject from AIS2D; |
482 | UpdateVwr: Boolean from Standard = Standard_True); |
483 | ---Level: Public |
484 | ---Purpose: Allows you to add a selected object <anIObj> to the list of selected |
485 | -- objects or remove it from that list. |
486 | |
487 | HighlightSelected( me: mutable; |
488 | UpdateVwr: Boolean from Standard = Standard_True); |
489 | ---Level: Public |
490 | ---Purpose: Highlights selected objects. |
491 | |
492 | UnhighlightSelected( me: mutable; |
493 | UpdateVwr: Boolean from Standard = Standard_True ); |
494 | ---Level: Public |
495 | ---Purpose: UnHighlights selected objects. |
496 | |
497 | ClearSelected( me: mutable; |
498 | UpdateVwr: Boolean from Standard = Standard_True); |
499 | ---Level: Public |
500 | ---Purpose: Empties previous selected objects in order to get |
501 | -- the selected objects detected by the selector using UpdateSelected. |
502 | |
503 | NbSelected( me ) returns Integer from Standard; |
504 | ---Level: Public |
505 | ---Purpose: Returns number of objects selected in |
506 | --- local context ( if opened ) or in neutral context |
507 | |
508 | InitSelected( me: mutable ); |
509 | ---Level: Public |
510 | ---Purpose: Iteration |
511 | |
512 | MoreSelected( me ) returns Boolean from Standard; |
513 | ---Level: Public |
514 | ---Purpose: Iteration |
515 | |
516 | NextSelected( me: mutable ); |
517 | ---Level: Public |
518 | ---Purpose: Iteration |
519 | |
520 | SelectedObject( me ) returns TShared from MMgt; |
521 | ---Level: Public |
522 | ---Purpose: Returns current selected object ( see InitSelected() .. ) |
523 | -- The object type depends on highlight mode |
524 | -- ( OBJECT, PRIMITIVE etc ) |
525 | |
526 | |
527 | --***************************************************************** |
528 | -- Querying Graphic Attributes |
529 | --***************************************************************** |
530 | |
531 | DisplayStatus( me; anIObj: InteractiveObject from AIS2D ) |
532 | returns DisplayStatus from AIS2D; |
533 | ---Level: Public |
534 | ---Purpose: Returns the display status of the entity <anIObj>. |
535 | |
536 | DisplayedModes( me; anIObj: InteractiveObject from AIS2D ) |
537 | returns PToListOfInt from AIS2D; |
538 | ---Level: Public |
539 | ---Purpose: Returns the list of active display modes for the entity <anIObj> |
540 | |
541 | IsDisplayed( me; anIObj:InteractiveObject from AIS2D ) |
542 | returns Boolean from Standard; |
543 | ---Level: Public |
544 | ---Purpose: Returns true if <anIObj> is displayed in the interactive context |
545 | |
546 | IsDisplayed( me; |
547 | anIObj: InteractiveObject from AIS2D; |
548 | aMode : Integer from Standard ) |
549 | returns Boolean from Standard; |
550 | |
551 | ---Level: Public |
552 | ---Purpose: Returns true if <anIObj> is displayed in the interactive context with <aMode> display mode |
553 | |
554 | IsHighlighted( me; anIObj: InteractiveObject from AIS2D ) |
555 | returns Boolean from Standard; |
556 | ---Level: Public |
557 | ---Purpose: Returns true if the Interactive Object <anIObj> |
558 | -- is highlighted in the interactive context. |
559 | |
560 | IsHighlighted( me; |
561 | anIObj : InteractiveObject from AIS2D; |
562 | WithColor : out Boolean from Standard; |
563 | theHiCol : out NameOfColor from Quantity ) |
564 | returns Boolean from Standard; |
565 | ---Level: Public |
566 | ---Purpose: if <anIObj> is highlighted with a specific color |
567 | -- <WithColor> will be returned TRUE |
568 | -- <theHiCol> gives the name of the hilightcolor |
569 | |
570 | IsInCollector( me; anIObj: InteractiveObject from AIS2D ) |
571 | returns Boolean from Standard; |
572 | ---Level: Public |
573 | ---Purpose: Returns true if the entity <anIObj> is in the Collector viewer. |
574 | |
575 | Status( me; |
576 | anIObj : InteractiveObject from AIS2D; |
577 | aStatus: in out ExtendedString from TCollection); |
578 | ---Level: Public |
579 | ---Purpose: Modified the status of the entity <anIObj> |
580 | |
581 | UpdateCurrentViewer( me: mutable ); |
582 | ---Level: Public |
583 | ---Purpose: Updates the current viewer, the viewer in Neutral Point. |
584 | |
585 | UpdateCollector( me: mutable ); |
586 | ---Level: Public |
587 | ---Purpose: Updates the Collector viewer |
588 | |
589 | --******************************************************************************** |
590 | ---Category: Information methods - Get Fields |
591 | --******************************************************************************** |
592 | |
593 | CurrentViewer( me ) returns any Viewer from V2d; |
594 | ---C++: inline |
595 | ---Level: Public |
596 | ---Purpose: Returns the current viewer. |
597 | |
598 | HasOpenedContext( me ) returns Boolean from Standard; |
599 | ---C++: inline |
600 | ---Level: Public |
601 | ---Purpose: Returns true if there is an open context. |
602 | |
603 | DisplayedObjects( me; |
604 | aListOfIO : in out ListOfIO from AIS2D; |
605 | OnlyFromNeutral : Boolean from Standard = Standard_False ); |
606 | ---Level: Public |
607 | ---Purpose: gives the list of displayed objects in the main viewer. |
608 | |
609 | --******************************************************************************** |
610 | |
611 | GetDefModes( me; |
612 | anIObj : InteractiveObject from AIS2D; |
613 | Dmode : out Integer from Standard; |
614 | HiMod : out TypeOfDetection from AIS2D; |
615 | SelMode : out Integer from Standard ) is private; |
616 | ---Level: Public |
617 | ---Purpose: Returns display, highlight and selection modes of the <anIObj> |
618 | |
619 | EraseGlobal( me : mutable; |
620 | anIObj : InteractiveObject from AIS2D; |
621 | UpdateVwr : Boolean from Standard = Standard_True; |
622 | PutInCollector : Boolean from Standard = Standard_True) is private; |
623 | ---Level: Internal |
624 | ---Purpose: |
625 | |
626 | SetPickMode( me: mutable; aMode: PickMode from Graphic2d ); |
627 | ---C++: inline |
628 | ---Level: Public |
629 | ---Purpose: Allows to provide settings for pick mode. |
630 | |
631 | GetPickMode( me) returns PickMode from Graphic2d; |
632 | ---C++: inline |
633 | ---Level: Public |
634 | ---Purpose: Returns the pick mode |
635 | |
636 | |
637 | --********************************************************************************** |
638 | |
639 | HighestIndex( me ) returns Integer from Standard; |
640 | ---Level: Internal |
641 | ---Purpose: |
642 | |
643 | --********************************************************************************** |
644 | -- Category: initialization of the attributes |
645 | --********************************************************************************** |
646 | |
647 | InitializeColor( me: mutable; aColor: Color from Quantity ) returns Integer from Standard; |
648 | ---Purpose: Initialize <aColor> in the color map |
649 | |
650 | InitializeStyle( me: mutable; aType: TypeOfLine from Aspect ) returns Integer from Standard; |
651 | ---Purpose: Initialize <aType> in the type map |
652 | |
653 | InitializeWidth( me: mutable; aWidth: WidthOfLine from Aspect ) returns Integer from Standard; |
654 | ---Purpose: Initialize <aWidth> in the width map |
655 | |
656 | InitializeMarker( me: mutable; aMark: TypeOfMarker from Aspect ) returns Integer from Standard; |
657 | ---Purpose: Initialize <aMark> in the mark map |
658 | |
659 | InitializeFont( me: mutable; aFont: FontStyle from Aspect ) returns Integer from Standard; |
660 | ---Purpose: Initialize <aFont> in the font map |
661 | |
662 | --********************************************************************************** |
663 | ResetOriginalState( me : mutable; |
664 | updateVwr : Boolean from Standard = Standard_True ); |
665 | ---Level: Public |
666 | ---Purpose: to be used only with no opened |
667 | -- local context.. displays and activates objects in their |
668 | -- original state before local contexts were opened... |
669 | |
670 | |
671 | DrawObject( me: mutable; anObj: InteractiveObject from AIS2D; aDispMode: Integer from Standard ) |
672 | is private; |
673 | |
674 | AvailableToDetect( me; anObj: InteractiveObject from AIS2D ) returns Boolean from Standard |
675 | is private; |
676 | DoDetectObject( me: mutable; anObj: InteractiveObject from AIS2D; aDrawer: TransientManager from Graphic2d ) |
677 | is private; |
678 | IsIOPicked( me; anObj: InteractiveObject from AIS2D ) |
679 | returns Boolean from Standard is private; |
680 | IsPrimPicked( me; anObj: InteractiveObject from AIS2D; aPrim: Primitive from Graphic2d ) |
681 | returns Boolean from Standard is private; |
682 | IsElemPicked( me; anObj: InteractiveObject from AIS2D; |
683 | aPrim: Primitive from Graphic2d; ind: Integer from Standard ) |
684 | returns Boolean from Standard is private; |
685 | IsElemSelected( me; anObj: InteractiveObject from AIS2D; |
686 | aPrim: Primitive from Graphic2d; ind: Integer from Standard ) |
687 | returns Boolean from Standard is private; |
688 | |
689 | IsIOSelected( me; anObj: InteractiveObject from AIS2D ) |
690 | returns Boolean from Standard is private; |
691 | IsPrimSelected( me; anObj: InteractiveObject from AIS2D; |
692 | aPrim: Primitive from Graphic2d ) |
693 | returns Boolean from Standard is private; |
694 | |
695 | --********************************************************************************** |
696 | -- Category: immediate mode management |
697 | --********************************************************************************** |
698 | |
699 | BeginImmediateDraw( me: mutable; aView: View from V2d ); |
700 | ---Level: Public |
701 | ---Purpose: switches on immediate mode |
702 | |
703 | ImmediateDraw(me: mutable; anIObj: InteractiveObject from AIS2D; aView: View from V2d ); |
704 | ---Level: Public |
705 | ---Purpose: draws object <anIObj> into immediate mode |
706 | |
707 | EndImmediateDraw( me: mutable; aView: View from V2d ); |
708 | ---Level: Public |
709 | ---Purpose: switches of immediate mode |
710 | |
711 | IsImmediateModeOn( me; aView: View from V2d ) returns Boolean from Standard; |
712 | ---Level: Public |
713 | ---Purpose: returns true if immediate mode is on |
714 | |
715 | ---SAV |
716 | SetDetectionMode(me:mutable; mode : TypeOfDetection from AIS2D); |
717 | |
718 | fields |
719 | |
720 | myMainVwr : Viewer from V2d; |
721 | myCollectorVwr : Viewer from V2d; |
722 | myIsCollClosed : Boolean from Standard; |
723 | myObjects : DataMapOfIOStatus from AIS2D; |
724 | |
725 | -- the selection and current objects. |
726 | |
727 | myDetectPrecision: Integer from Standard; |
728 | myResetDetect : Boolean from Standard; |
729 | |
730 | myLastPicked : InteractiveObject from AIS2D; |
731 | myLastinMain : InteractiveObject from AIS2D; |
732 | myLastinColl : InteractiveObject from AIS2D; |
733 | |
734 | mySeqOfDetIO : HSequenceOfIO from AIS2D; |
735 | mySeqOfSelIO : HSequenceOfIO from AIS2D; |
736 | |
737 | myCurDetectMode : TypeOfDetection from AIS2D; |
738 | |
739 | myWasLastMain : Boolean from Standard; |
740 | myPickMode : PickMode from Graphic2d; |
741 | |
742 | -- the attributes of session... |
743 | |
744 | myHighlightColor : NameOfColor from Quantity; |
745 | mySelectionColor : NameOfColor from Quantity; |
746 | mySubIntensity : NameOfColor from Quantity; |
747 | myDisplayMode : Integer from Standard; |
748 | |
749 | -- The Local Context... |
750 | |
751 | myLocalContexts : DataMapOfLC from AIS2D; |
752 | myCurLocalIndex : Integer from Standard; |
753 | myLastMoveView : View from V2d; |
754 | |
755 | myColorMap : GenericColorMap from Aspect is protected; |
756 | myTypeMap : TypeMap from Aspect is protected; |
757 | myWidthMap : WidthMap from Aspect is protected; |
758 | myMarkMap : MarkMap from Aspect is protected; |
759 | myFontMap : FontMap from Aspect is protected; |
760 | |
761 | -- Iteration |
762 | |
763 | myCurSelected : Integer from Standard; |
764 | myMaxSelected : Integer from Standard; |
765 | |
766 | friends |
767 | |
768 | class LocalContext from AIS2D |
769 | |
770 | end InteractiveContext; |