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