0024428: Implementation of LGPL license
[occt.git] / src / AIS / AIS_InteractiveContext.cdl
old mode 100755 (executable)
new mode 100644 (file)
index 57090f2..3eb225e
@@ -1,19 +1,26 @@
--- File:       AIS_InteractiveContext.cdl
--- Created:    Wed Dec 18 10:11:30 1996
--- Author:     Robert COUBLANC
---             <rob@robox.paris1.matra-dtv.fr>
---             
+-- Created on: 1996-12-18
+-- Created by: Robert COUBLANC
+-- Copyright (c) 1996-1999 Matra Datavision
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
+--
+-- This file is part of Open CASCADE Technology software library.
+--
+-- This library is free software; you can redistribute it and / or modify it
+-- under the terms of the GNU Lesser General Public version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
+--
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
+
 --Modified by   
 --   rob : Dec 17 1997 -> Update Method Added + Use in Deviation Angle...
---   
 --   rob : Feb 05 1998 -> UpdateOnlySelection, UpdateOnlyPrs
---   
 --         Apr 02 1998 -> Select Methods has been added a boolean updateviewer.
 --   GG  :  GER61351 17/11/1999 Change SetColor() with a compatible i
 --         Quantity_Color instead the restricted NameOfColor.
 --          Add SetCurrentFacingModel() methods
---   EUG :  G003 05/11/1999 Degeneration mode support
---              Add SetDegenerateModel() methods
 --   GG  : IMP140200 Add SetSelectedAspect() method
 --   GG  : 25/05/00 BUC60688 Add SetSensitivity() methods 
 --   VSV : 22/05/01 Add Selection by polygon
 --   SAV : OCC172 : Delete() redefined to remove selection objects from
 --                  the static map.
 --   SAN : OCC4895 22/03/04 High-level interface for controlling polygon offsets
---
 --   SLN : SetToHilightSelected method added
 
----Copyright:   Matra Datavision 1996
 
 
 class InteractiveContext from AIS inherits TShared from MMgt
@@ -103,6 +108,7 @@ uses
     SelectionManager      from SelectMgr,
     PresentationManager3d from PrsMgr,
     ViewerSelector3d      from StdSelect,
+    SensitivityMode       from StdSelect,
     MapOfInteractive      from AIS,
     InteractiveObject     from AIS,
     DisplayMode           from AIS,
@@ -131,7 +137,6 @@ uses
     Location              from TopLoc,
     EntityOwner           from SelectMgr,
     TypeOfFacingModel    from Aspect,
-    TypeOfDegenerateModel from Aspect,
     Array1OfPnt2d         from TColgp,
     Transformation       from Geom
 
@@ -142,25 +147,9 @@ is
        ---Purpose:
        -- Constructs the interactive context object defined by
        -- the principal viewer MainViewer.    
-    
-    Create(MainViewer,Collector: Viewer from V3d)
-    returns mutable InteractiveContext from  AIS;
-       ---Purpose:
-       -- Constructs the interactive context object defined by
-       -- the principal viewer MainViewer and the collector
-       -- (or trash) viewer.
-          
 
     Delete(me) is redefined;
 
-    IsCollectorClosed(me) returns Boolean from Standard;
-    ---C++: inline
-    CloseCollector(me:mutable);
-    ---C++: inline
-    OpenCollector(me:mutable);
-
-
-
                    ---Category: General DISPLAY SERVICES
     SetAutoActivateSelection( me: mutable; Auto : Boolean from Standard ); 
     GetAutoActivateSelection( me ) returns Boolean from Standard;
@@ -233,70 +222,27 @@ is
 
     Erase(me             : mutable; 
          aniobj         : InteractiveObject from AIS;
-         updateviewer   : Boolean from Standard = Standard_True;
-         PutInCollector : Boolean from Standard = Standard_False);
----Purpose: To erase presentations in current local context, or
--- failing that, in other local contexts which allow erasing.
---
--- If putinCollector is True, the object is erased with graphical status Erased,
--- and put into the Collector. These objects can be retrieved
--- from Interactive Context by ObjectsInCollector method.
--- If putinCollector is False, the objects erased with graphical status FullErased,
--- and not put into the Collector. These objects can be retrieved
--- from Interactive Context by ErasedObjects method.
---
--- Note: objects that are put into the Collector recomute their presentation
--- for Collector Presentation Manager.
---
--- If a local context is open and if updateviewer is
--- False, the presentation of the Interactive
--- Object activates the selection mode; the object is
--- displayed but no viewer will be updated.
-
-    EraseMode(me             : mutable;
-             aniobj         : InteractiveObject from AIS;
-             aMode          : Integer from Standard;
-             updateviewer   : Boolean from Standard = Standard_True); 
-    ---Purpose: Updates viewer contents and returns the display
--- mode of each aniobj object. Use only if more than
--- one display mode is active in the main viewer.
--- This method works only on presentation modes other
--- than the default mode. Nothing is done if aMode is
--- the default presentation mode.
--- If a local context is open and if updateviewer equals
--- Standard_False, the presentation of the Interactive
--- Object activates the selection mode; the object is
--- displayed but no viewer will be updated.
-
-
-
-    EraseAll(me:mutable;
-            PutInCollector : Boolean from Standard = Standard_False;
-            updateviewer   : Boolean from Standard = Standard_True);
-    ---Purpose: Every erased object goes into the Collector viewer,
-    --          depending on PutInCollector value.
-
-    DisplayAll(me                : mutable;
-              OnlyFromCollector : Boolean from Standard = Standard_False;
-              updateviewer      : Boolean from Standard = Standard_True);
-    ---Purpose: Displays all erased objects or display all objects from collector
-
-    DisplayFromCollector(me     : mutable;
-                         anIObj          :  InteractiveObject from AIS;
-                         updateviewer    : Boolean from Standard = Standard_True);
-    ---Purpose: display anIObj from the collector.
-
-    EraseSelected(me:mutable;
-                 PutInCollector:Boolean from Standard=Standard_False; 
-                 updateviewer:Boolean from Standard = Standard_True);
+         updateviewer   : Boolean from Standard = Standard_True);
+---Purpose: Hides the object. The object's presentations are simply
+-- flagged as invisible and therefore excluded from redrawing.
+-- To show hidden objects, use Display().
+
+    EraseAll (me          : mutable;
+              updateviewer: Boolean from Standard = Standard_True);
+    ---Purpose: Hides all objects. The object's presentations are simply
+-- flagged as invisible and therefore excluded from redrawing.
+-- To show all hidden objects, use DisplayAll().
+
+    DisplayAll(me          : mutable;
+               updateviewer: Boolean from Standard = Standard_True);
+    ---Purpose: Displays all hidden objects.
+
+    EraseSelected(me: mutable;
+                  updateviewer: Boolean from Standard = Standard_True);
        ---Purpose:
--- Erases selected objects if there is no open active local context.
--- If there is no local context activated and if
--- updateviewer equals Standard_False, the
--- presentation of the Interactive Object activates the
--- selection mode; the object is displayed but no viewer
--- will be updated.
--- If a local context is open, this method is neutral.
+-- Hides selected objects. The object's presentations are simply
+-- flagged as invisible and therefore excluded from redrawing.
+-- To show hidden objects, use Display().
     
     DisplaySelected(me:mutable;updateviewer:Boolean from Standard = Standard_True);
     ---Purpose: Displays selected objects if a local context is open.
@@ -406,6 +352,26 @@ is
     ---Purpose: Sets the display priority aPriority of the seen parts
 -- presentation of the entity anIobj.
 
+    SetZLayer( me         : mutable;
+               theIObj    : InteractiveObject from AIS;
+               theLayerId : Integer from Standard );
+    ---Purpose: Set Z layer id for interactive object. The layer can be
+    -- specified for displayed object only. The Z layers can be used to display
+    -- temporarily presentations of some object in front of the other objects
+    -- in the scene. The ids for Z layers are generated by V3d_Viewer.
+    -- Note that Z layers differ from under-/overlayer in V3d_View:
+    -- under-/overlayer are intended for specific 2D drawings that appear
+    -- behind/in front of all 3D presentations, while SetZLayer() method
+    -- applies to regular 3D presentations and does not imply any specific
+    -- drawing methods.
+
+    GetZLayer( me;
+               theIObj : InteractiveObject from AIS )
+      returns Integer from Standard;
+    ---Purpose: Get Z layer id set for displayed interactive object.
+    -- If the object doesn't exists in context or has no computed presentations,
+    -- the method returns -1.
+
     Redisplay(me     : mutable;
              aniobj : InteractiveObject from AIS;
              updateviewer : Boolean from Standard = Standard_True;
@@ -494,6 +460,17 @@ is
 -- Removes selection mode from Interactive Objects.
 -- aMode provides the selection mode index of the entity aniobj.
     
+    SetSensitivityMode(me    : mutable;
+                       aMode : SensitivityMode from StdSelect) is static;
+    ---Level: Public
+    ---Purpose: Sets the selection sensitivity mode. SM_WINDOW mode
+    -- uses the specified pixel tolerance to compute the sensitivity
+    -- value, SM_VIEW mode allows to define the sensitivity manually.
+
+    SensitivityMode(me) returns SensitivityMode from StdSelect;
+    ---Level: Public
+    ---Purpose: Returns the selection sensitivity mode.
+
     SetSensitivity(me:mutable;
                        aPrecision: Real from Standard);
     ---Level: Public
@@ -506,7 +483,11 @@ is
 --   When a local context is open, the defined sensitivity applies to
 -- this local context instead of the main context.
 
-    SetSensitivity(me:mutable;
+    Sensitivity (me) returns Real from Standard;
+    ---Level: Public 
+    ---Purpose: Returns the selection sensitivity value.
+
+    SetPixelTolerance(me:mutable;
                        aPrecision: Integer from Standard = 4);
     ---Level: Public
     ---Purpose: Define the current selection pixel sensitivity
@@ -514,6 +495,10 @@ is
     --  Warning: When a local context is open the sensitivity is apply on it 
     --          instead on the main context.
 
+    PixelTolerance(me) returns Integer from Standard;
+    ---Level: Public 
+    ---Purpose: Returns the pixel tolerance.
+
                   ---Category: put locations on objects....
                   --           
 
@@ -651,33 +636,6 @@ is
 -- Standard_False, the presentation of the Interactive
 -- Object activates the selection mode; the object is
 -- displayed but no viewer will be updated.
-        
-    SetDegenerateModel ( me : mutable;
-               aniobj  : InteractiveObject from AIS;
-                aModel  : TypeOfDegenerateModel from Aspect =
-                                                Aspect_TDM_WIREFRAME;
-                aRatio : Ratio from Quantity = 0.0);
-    ---Level: Public
-    ---Purpose: Sets the model of degeneration for the shaded representation
-    --   of the object <aniobj>
-    --   according to the degenerate ratio >= 0. & <= 1. where :
-    --   <aRatio> = 0. indicate that all polygons of the object
-    --      will be displayed.
-    --   <aRatio> = 1. indicate that no polygons will be displayed !!
-    --   When <ARatio> is > 0 & < 1. the corresponding amount
-    --   of object polygons will be displayed with a random method.
-    --  Warning: the degenerate structure is shown only when
-    -- the animation and degenerate flags are set to TRUE
-    -- in V3d_View::SetAnimationMode(..)
-    ---Category: Methods to manage the object degeneration
-
-    SetDegenerateModel (
-     me         : mutable;
-     aModel     : TypeOfDegenerateModel from Aspect;
-     aSkipRatio : Ratio                 from Quantity = 0.0
-    ) is static;
-    ---Purpose: Defines the degenerate method to apply on the shaded 
-    --  representation of all objects.
 
     SetLocalAttributes(me      : mutable; 
                       aniobj  : InteractiveObject from AIS;
@@ -710,8 +668,8 @@ is
     SetPolygonOffsets ( me : mutable;
                anObj        : InteractiveObject from AIS;
                aMode        : Integer from Standard;
-               aFactor      : Real from Standard = 1.0;
-               aUnits       : Real from Standard = 0.0;
+               aFactor      : ShortReal from Standard = 1.0;
+               aUnits       : ShortReal from Standard = 0.0;
        updateviewer : Boolean from Standard = Standard_True ) is static;
     ---Purpose: Sets up polygon offsets for the given AIS_InteractiveObject.
     --          It simply calls anObj->SetPolygonOffsets() 
@@ -728,8 +686,8 @@ is
     PolygonOffsets ( me;
                anObj   : InteractiveObject from AIS;
                aMode   : out Integer from Standard;
-               aFactor : out Real from Standard;
-               aUnits  : out Real from Standard ) is static;
+               aFactor : out ShortReal from Standard;
+               aUnits  : out ShortReal from Standard ) is static;
     ---Level: Public
     ---Purpose: Retrieves current polygon offsets settings for <anObj>.
     ---Category: Inquire methods
@@ -779,8 +737,7 @@ is
     ---Purpose: Returns the display status of the entity anIobj.
 -- This will be one of the following:
 -- -   DS_Displayed   displayed in main viewer
--- -   DS_Erased   erased in the Collector
--- -   DS_FullErased   erased everywhere but in the Collector
+-- -   DS_Erased   hidden in main viewer
 -- -   DS_Temporary   temporarily displayed
 -- -   DS_None   nowhere displayed.
 
@@ -810,17 +767,12 @@ is
     --          <WithColor> will be returned TRUE
     --          <theHiCol> gives the name of the hilightcolor
 
-    IsInCollector(me;anIObj:InteractiveObject from AIS)
-    returns Boolean from Standard;
----Purpose:
--- Returns true if the entity anIobj is in the Collector viewer.
-    
     DisplayPriority(me;anIobj: InteractiveObject from AIS)
     returns Integer from Standard;
 ---Purpose:
 -- Returns the display priority of the entity anIobj. This
 -- will be display   mode of anIobj if it is in the main
--- viewer, and the highlight mode if it is in the Collector viewer.
+-- viewer.
 
     HasColor(me; aniobj: InteractiveObject from AIS)
     returns Boolean from Standard;
@@ -854,11 +806,6 @@ is
 -- are called current objects; those selected in open
 -- local context, selected objects.   
 
-    UpdateCollector(me:mutable);
----Purpose: Updates the Collector viewer.
-
-
-
                    ---Category: General Attributes for the session
 
     DisplayMode(me)        returns Integer     from Standard;
@@ -1140,7 +1087,7 @@ is
     --          is changed.
     --          When <globalChange> is FALSE , only the current group
     --          of the object presentation is changed.
-    --         Updates the viewer or collector when <updateViewer> is TRUE
+    --         Updates the viewer when <updateViewer> is TRUE
     ---Category: Graphic attributes management
 
            ---Category: GRAPHIC DETECTION  / SELECTION
@@ -1942,30 +1889,9 @@ is
     --          by Default, <WhichSignature> = -1 means 
     --          control only on <WhichKind>.
 
-    Collector(me) returns any Viewer from V3d;
-    ---C++: return const &
-    ---C++: inline
-    
-    ObjectsInCollector (me;aListOfIO : in out ListOfInteractive from AIS);
-    ---Purpose:
-    -- Returns the list aListOfIO of erased objects of a
-    -- particular Type WhichKind and Signature WhichSignature.
-    -- By Default, WhichSignature equals 1. This means
-    -- that there is a check on type only.
-
-    ObjectsInCollector (me;
-                       WhichKind :KindOfInteractive from AIS; 
-                       WhichSignature :Integer from Standard;
-                        aListOfIO : in out ListOfInteractive from AIS);
-    ---Purpose: gives the list of erased objects of a particular
-    --          Type and signature
-    --          by Default, <WhichSignature> = -1 means 
-    --          control only on <WhichKind>.
-
-    
     ErasedObjects (me;theListOfIO : in out ListOfInteractive from AIS);
     ---Purpose:
-    -- Returns the list theListOfIO of erased objects (but not placed into collecter)
+    -- Returns the list theListOfIO of erased objects (hidden objects)
     -- particular Type WhichKind and Signature WhichSignature.
     -- By Default, WhichSignature equals 1. This means
     -- that there is a check on type only.
@@ -1974,7 +1900,7 @@ is
                        WhichKind :KindOfInteractive from AIS; 
                        WhichSignature :Integer from Standard;
                         theListOfIO : in out ListOfInteractive from AIS);
-    ---Purpose: gives the list of erased objects (but not placed into collecter)
+    ---Purpose: gives the list of erased objects (hidden objects)
     --          Type and signature
     --          by Default, <WhichSignature> = -1 means 
     --          control only on <WhichKind>.
@@ -2033,11 +1959,21 @@ is
 
     DomainOfMainViewer(me) returns CString from Standard;
     ---Purpose: Returns the domain name of the main viewer.
-    DomainOfCollector(me) returns CString from Standard;
-    ---Purpose: Returns the domain name of the Collector viewer.
-    
+
            ---Category: Internal
 
+        ---Category: Internal
+
+    LocalContext(me) returns LocalContext from AIS;
+    ---Level: Internal 
+    ---Purpose:
+    -- This method is only intended for advanced operation, particularly with
+    -- the aim to improve performance when many objects have to be selected
+    -- together. Otherwise, you should use other (non-internal) methods of
+    -- class AIS_InteractiveContext without trying to obtain an instance of
+    -- AIS_LocalContext.
+    ---C++: inline
+
     SelectionManager(me) returns any SelectionManager from SelectMgr;
     ---C++: inline
     ---C++: return const &
@@ -2045,24 +1981,13 @@ is
     MainPrsMgr     (me) returns any PresentationManager3d from PrsMgr;
     ---C++: inline
     ---C++: return const &
-    CollectorPrsMgr(me) returns any PresentationManager3d from PrsMgr;
-    ---C++: inline
-    ---C++: return const &
-
 
     MainSelector(me) returns any ViewerSelector3d from StdSelect;
     ---C++: inline
     ---C++: return const &
     LocalSelector(me) returns any ViewerSelector3d from StdSelect;
 
-
-    CollectorSelector(me)  returns any ViewerSelector3d from StdSelect;
-    ---C++: inline
-    ---C++: return const &   
-
-
-
-    PurgeDisplay(me:mutable;CollectorToo:Boolean from Standard = Standard_False) 
+    PurgeDisplay(me:mutable) 
     returns Integer from Standard;
     ---Level: Internal 
     ---Purpose: Clears all the structures which don't
@@ -2098,9 +2023,8 @@ is
 
 
     EraseGlobal(me             : mutable;
-               anObj          : InteractiveObject from AIS;
-               updateviewer   : Boolean from Standard = Standard_True;
-               PutInCollector : Boolean from Standard = Standard_False) is static private;
+                anObj          : InteractiveObject from AIS;
+                updateviewer   : Boolean from Standard = Standard_True) is static private;
                
     ClearGlobal(me             : mutable;
                anObj          : InteractiveObject from AIS;
@@ -2139,12 +2063,6 @@ fields
     myMainVwr    : Viewer from V3d;
     myMainSel    : ViewerSelector3d from StdSelect;
 
-    myCollectorPM  : PresentationManager3d from PrsMgr;  
-    myCollectorVwr : Viewer from V3d;
-    myCollectorSel : ViewerSelector3d from StdSelect;
-
-    myIsCollClosed : Boolean from Standard;
-
     -- the selection and current objects.
 
     mySelectionName : AsciiString from TCollection;
@@ -2152,7 +2070,6 @@ fields
 
     myLastPicked    : InteractiveObject from AIS;    
     myLastinMain    : InteractiveObject from AIS;
-    myLastinColl    : InteractiveObject from AIS;
     
     
     myWasLastMain       : Boolean from Standard;