0024023: Revamp the OCCT Handle -- ambiguity
[occt.git] / src / AIS / AIS_LocalContext.cdl
old mode 100755 (executable)
new mode 100644 (file)
index 02a3946..6462590
@@ -1,22 +1,18 @@
 -- Created on: 1996-09-04
 -- Created by: Robert COUBLANC
 -- Copyright (c) 1996-1999 Matra Datavision
--- Copyright (c) 1999-2012 OPEN CASCADE SAS
+-- Copyright (c) 1999-2014 OPEN CASCADE SAS
 --
--- The content of this file is subject to the Open CASCADE Technology Public
--- License Version 6.5 (the "License"). You may not use the content of this file
--- except in compliance with the License. Please obtain a copy of the License
--- at http://www.opencascade.org and read it completely before using this file.
+-- This file is part of Open CASCADE Technology software library.
 --
--- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
--- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License 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.
 --
--- The Original Code and all software distributed under the License is
--- distributed on an "AS IS" basis, without warranty of any kind, and the
--- Initial Developer hereby disclaims all such warranties, including without
--- limitation, any warranties of merchantability, fitness for a particular
--- purpose or non-infringement. Please see the License for the specific terms
--- and conditions governing the rights and limitations under the License.
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
 
 -- Modified     May  20th 98  :  
 --              Modification in Management of selected entities 
 --              Modifications in Management of hilight of detected entities
 --              VTN 23/11/99 BUC60614 Avoid to crash because
 --              myStdFilters array is too short.
---   GG  : BUC60688 25/05/00 Add SetSensitivity() methods
---   GG  : IMP150501 Remove oboslete method DragTo
---              (See AIS_InteractiveContext)
---   ZSV : IMP160701 Add InitDetected(),MoreDetected(),NextDetected(),
---                       DetectedCurrentShape(),DetectedCurrentObject()
---                       methods
-
 
 class LocalContext from AIS inherits TShared from MMgt
 
@@ -62,7 +51,6 @@ uses
     Shape                     from TopoDS,
     View                      from V3d,
     PresentationManager3d     from PrsMgr,
-    Projector                 from Select3D,
     IndexedMapOfOwner         from SelectMgr,
     EntityOwner               from SelectMgr,
     OrFilter                  from SelectMgr,
@@ -72,6 +60,7 @@ uses
     ListOfFilter              from SelectMgr,
     BRepOwner                 from StdSelect,
     ViewerSelector3d          from StdSelect,
+    SensitivityMode           from StdSelect,
     InteractiveContext        from AIS,
     ClearMode                 from AIS,
     InteractiveObject         from AIS,
@@ -84,7 +73,7 @@ uses
 
 is
 
-    Create returns mutable LocalContext from AIS;
+    Create returns LocalContext from AIS;
     
 
     Create (aCtx                : InteractiveContext from AIS;
@@ -93,7 +82,7 @@ is
             AcceptStandardModes : Boolean from Standard=Standard_True;
             AcceptErase         : Boolean from Standard= Standard_False;
             UseBothViewers      : Boolean from Standard= Standard_False)
-            returns mutable LocalContext from AIS;
+            returns LocalContext from AIS;
     ---Purpose: Constructor By Default, the  displayed objects are 
     --          automatically loaded.
 
@@ -115,14 +104,6 @@ is
 
     Terminate(me: mutable; updateviewer : Boolean from Standard = Standard_True);
 
-    HasSameProjector(me;aPrj:Projector from Select3D)
-    returns Boolean from Standard;
-    ---Purpose: compares the current projector of the localContext
-    --          with <aPrj>
-    --          returns True if the projectors are identical.
-    --          (no need to update projection of selection primitives
-    --          when closing the local context)....
-
     Reactivate(me:mutable);
     ---Purpose: to be called when a upper local context was closed...
     --          useful to put pack the right projector...
@@ -233,13 +214,12 @@ is
     AutomaticHilight(me) returns Boolean;
     ---C++: inline
 
-
-
                     ---Category: THE SELECTION PROCESS
 
-
-    MoveTo(me:mutable;Xpix,Ypix : Integer from Standard;
-                         aview : View from V3d)
+    MoveTo (me                   : mutable;
+            theXpix, theYpix     : Integer from Standard;
+            theView              : View from V3d;
+            theToRedrawImmediate : Boolean from Standard)
     returns StatusOfDetection from AIS;
 
 
@@ -248,15 +228,18 @@ is
     ---Purpose: returns True if more than one entity
     --          was detected at the last Mouse position.
     
-    HilightNextDetected(me:mutable;aView:View from V3d)
+    HilightNextDetected (me      : mutable;
+                         theView : View from V3d;
+                         theToRedrawImmediate : Boolean from Standard)
     returns Integer from Standard;
     ---Purpose: returns True if  last detected. the next detected will
     --          be first one (endless loop)
 
-    HilightPreviousDetected(me:mutable;aView:View from V3d)
+    HilightPreviousDetected (me                   : mutable;
+                             theView              : View from V3d;
+                             theToRedrawImmediate : Boolean from Standard)
     returns Integer from Standard;
 
-    
     UnhilightLastDetected(me:mutable;aView:View from V3d) returns Boolean from Standard;
     ---Purpose: returns True if something was done...
 
@@ -324,28 +307,55 @@ is
                         aShape       : Shape from TopoDS;
                         updateviewer : Boolean from Standard=Standard_True);
 
-    AddOrRemoveSelected(me           : mutable;
-                        Ownr         : EntityOwner from SelectMgr;
-                        updateviewer : Boolean from Standard=Standard_True);
-
-
+    AddOrRemoveSelected(me             : mutable;
+                        theOwner       : EntityOwner from SelectMgr;
+                        toUpdateViewer : Boolean from Standard = Standard_True);
+
+    ClearSelected (me             : mutable;
+                   toUpdateViewer : Boolean from Standard = Standard_True);
+    ---Purpose: Clears local context selection.
+    --          @param toUpdateViewer [in] if TRUE the viewer will be updated.
+
+    ClearOutdatedSelection (me                 : mutable;
+                            theIO              : InteractiveObject from AIS;
+                            toClearDeactivated : Boolean from Standard);
+    ---Purpose: Clears outdated selection and detection of owners for the
+    --          interactive object. Use this method if selection structures
+    --          of the interactive object have changed. The method unhilights
+    --          and removes outdated entity owners from lists of selected
+    --          and detected owners.
+    --          @param theIO [in] the interactive object.
+    --          @param toClearDeactivated [in] pass TRUE to treat deactivated
+    --                 entity owners as 'outdated' when clearing the selection.
 
-    ClearSelected(me:mutable;updateviewer : Boolean from Standard=Standard_True);
-    ---Purpose: 
-
-                    
                     ---Category: GET THE DETECTED
 
-
     HasDetected     (me) returns Boolean from Standard;
     ---C++: inline
 
     InitDetected(me: mutable);
+    ---Purpose:
+    -- Initialization for iteration through mouse-detected objects in local context.
+
     MoreDetected(me) returns Boolean from Standard;
+    ---Purpose:
+    -- @return true if there is more mouse-detected objects after the current one
+    -- during iteration through mouse-detected interactive objects.
+
     NextDetected(me: mutable);
+    ---Purpose:
+    -- Gets next current object during iteration through mouse-detected
+    -- interactive objects.
+
     DetectedCurrentShape(me) returns Shape from TopoDS;
     ---C++: return const &
+    ---Purpose:
+    -- @return current mouse-detected shape or empty (null) shape, if current interactive object
+    -- is not a shape (AIS_Shape) or there is no current mouse-detected interactive object at all.
+
     DetectedCurrentObject(me) returns InteractiveObject from AIS;
+    ---Purpose:
+    -- @return current mouse-detected interactive object or null object if there is no current detected.
 
     HasDetectedShape(me) returns Boolean from Standard;
     DetectedShape   (me) returns Shape from TopoDS;
@@ -362,8 +372,12 @@ is
     HasShape(me) returns Boolean from Standard;
     ---Purpose: returns TRUE if the detected entity is a shape
     --          coming from a Decomposition of an element.
+    HasSelectedShape(me) returns Boolean from Standard;
+    ---Purpose: returns true if current selection is not empty
+    --          and the owner of selected object contains a shape.
+    --          This method does not take into account decomposition
+    --          status of detected shape.
     SelectedShape(me) returns Shape from TopoDS;
-    ---C++: return const &
 
     SelectedOwner(me) returns EntityOwner from SelectMgr;
     IsSelected(me;aniobj: InteractiveObject from AIS) returns Boolean  from  Standard;
@@ -386,26 +400,6 @@ is
                        anObject: InteractiveObject from AIS;
                        Prior   : Integer from Standard);
 
-    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.
-
     DisplayedObjects(me;theMapToFill : in out MapOfTransient from TColStd)
     returns Integer from Standard;
 
@@ -442,52 +436,50 @@ is
                 WithColor : out Boolean from Standard;
                 HiCol     : out NameOfColor from Quantity)
     returns Boolean from Standard;
-    
-    SetSensitivity(me:mutable;
-                        aPrecision: Real from Standard);
-    ---Level: Public
-    ---Purpose: Define the current selection sensitivity for
-    --          this local context according to the view size.
-    
-    SetSensitivity(me:mutable;
-                        aPrecision: Integer from Standard = 2);
+
+    SetPixelTolerance(me:mutable;
+                        aPrecision: Real from Standard = 2);
     ---Level: Public
     ---Purpose: Define the current selection sensitivity for
     --          this local context according to the view size.
 
-                        ---Category: IMMEDIATE MODE
+    PixelTolerance(me) returns Real from Standard;
+    ---Level: Public 
+    ---Purpose: Returns the pixel tolerance.
 
+                        ---Category: IMMEDIATE MODE
 
-    BeginImmediateDraw (me:mutable)  returns Boolean from Standard;
-    ---Purpose: initializes the list of presentations to be displayed
-    --          returns False if No Local COnte
 
-    ImmediateAdd (me:mutable;anIObj:InteractiveObject from AIS;aMode:Integer from Standard=0)
+    BeginImmediateDraw (me : mutable)
     returns Boolean from Standard;
-    ---Purpose: returns True if <anIObj> has been stored in the list.
+    ---Purpose: Resets the transient list of presentations previously displayed in immediate mode
+    -- and begins accumulation of new list by following AddToImmediateList()/Color()/Highlight() calls.
 
-    ImmediateRemove (me:mutable;anIObj:InteractiveObject from AIS;aMode:Integer from Standard=0)
-    returns Boolean from Standard;
-    ---Purpose: returns True if <anIObj> has been removed from the list.
+    ClearImmediateDraw (me : mutable) is virtual;
+    ---Purpose: Resets the transient list of presentations previously displayed in immediate mode.
 
-    EndImmediateDraw(me:mutable;aView : View from V3d;DoubleBuf:Boolean from Standard=Standard_False)
+    ImmediateAdd (me : mutable;
+                  theObj  : InteractiveObject from AIS;
+                  theMode : Integer from Standard = 0)
     returns Boolean from Standard;
-    ---Purpose: returns True if the immediate display has been done.
+    ---Purpose: Stores presentation theMode of object theObj in the transient list of presentations to be displayed in immediate mode.
+    -- Will be taken in account in EndImmediateDraw method.
 
-    IsImmediateModeOn(me) returns Boolean from Standard;
-            
-                            ---Category: INTERNAL METHODS;
-
-    UpdateConversion(me:mutable);
+    EndImmediateDraw (me      : mutable;
+                      theView : View from V3d)
+    returns Boolean from Standard;
+    ---Purpose: Allows rapid drawing of the view theView by avoiding an update of the whole background.
 
-    UpdateSort(me:mutable);
+    IsImmediateModeOn (me) returns Boolean from Standard;
+    ---Purpose: Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
 
+                            ---Category: INTERNAL METHODS;
 
 
-    Status(me) returns AsciiString from TCollection is private;
+    Status(me) returns AsciiString from TCollection;
     
     Status(me;anObject : InteractiveObject from AIS)
-    returns any LocalStatus from AIS is private;
+    returns any LocalStatus from AIS;
     ---C++: return const&
 
 
@@ -497,19 +489,17 @@ is
     UnloadContextObjects(me:mutable);
 
     Process(me       : mutable;
-            anObject : SelectableObject from SelectMgr;
-            WithProj: Boolean from Standard = Standard_True) is static private;
+            anObject : SelectableObject from SelectMgr) is static private;
 
-    Process(me:mutable;
-            WithProj: Boolean from Standard = Standard_True) is static private;
+    Process(me:mutable) is static private;
     
 
-    ActivateStandardModes(me:mutable;anObject: SelectableObject from SelectMgr;
-            WithProj: Boolean from Standard = Standard_True)  is  static  private;
+    ActivateStandardModes(me:mutable;anObject: SelectableObject from SelectMgr)  is  static  private;
 
-    ManageDetected(me:mutable;
-                   aPickOwner : EntityOwner from SelectMgr;
-                   aview      : View  from  V3d) is static  private;
+    manageDetected (me                   : mutable;
+                    thePickOwner         : EntityOwner from SelectMgr;
+                    theView              : View from V3d;
+                    theToRedrawImmediate : Boolean from Standard) is static private;
 
     DetectedIndex(me:mutable) returns Integer from Standard is static private;
     ---C++: inline
@@ -538,13 +528,6 @@ is
     ComesFromDecomposition(me; aPickedIndex : Integer from Standard)
     returns Boolean from Standard is static private;
 
-
-    DisplayAreas(me:mutable;aviou:View from V3d);
-    
-    ClearAreas (me:mutable;
-                aView: View from V3d) is static;
-    ---Level: Internal 
-
     HasFilters(me;aType:ShapeEnum from TopAbs) 
     returns Boolean from Standard is private;
     
@@ -552,17 +535,10 @@ is
     
     ClearSensitive(me:mutable;aView:View from V3d) is static;
 
-
-        
-    MainSelector(me) returns any ViewerSelector3d from StdSelect;
+    MainSelector(me) returns ViewerSelector3d from StdSelect;
     ---C++: inline
     ---C++: return const&
 
-
-    HilightTriangle(me:mutable;Rank:Integer from Standard;aViou:View from V3d) is static private;
-    ---Level: Internal 
-
-
     FindSelectedOwnerFromIO(me;anIObj:InteractiveObject from AIS)
     returns EntityOwner from SelectMgr;
 
@@ -608,16 +584,15 @@ fields
     myDetectedSeq  : SequenceOfInteger from TColStd;
     myCurDetected  : Integer from Standard;
 
-   -- the detected objects.
+   -- The detected objects.
+
     myAISDetectedSeq : SequenceOfInteractive from AIS;
+    -- the sequence of detected interative objects.
     myAISCurDetected : Integer from Standard;
-    -- This variables is used by following functions:
+    -- current detected interactive object.
+    -- This variable is used by following functions:
     -- InitDetected(), MoreDetected(), NextDetected(), DetectedCurrentShape(), DetectedCurrentObject().
     
-friends 
-
-    KeepTemporary from  InteractiveContext from AIS(me:mutable;anIObj:InteractiveObject from AIS;WhichMode  :  Integer  from  Standard  =  -1) 
-
 end LocalContext;