0024830: Remove redundant keyword 'mutable' in CDL declarations
[occt.git] / src / SelectMgr / SelectMgr_EntityOwner.cdl
1 -- Created on: 1995-05-23
2 -- Created by: Robert COUBLANC
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 --Modified by rob October 25 97 store locations...
18 --                jun 17 98 : Add virtual methods HasShape, GetShape.
19 --                            by default return False and Null Shape...         
20
21
22
23
24 class EntityOwner from SelectMgr inherits EntityOwner from SelectBasics
25
26         ---Purpose: A framework to define classes of owners of sensitive primitives.
27         -- The owner is the link between application and
28         -- selection data structures.
29         -- For the application to make its own objects selectable,
30         -- it must define owner classes inheriting this framework.
31         --           
32
33 uses
34     SelectableObject       from SelectMgr,
35     SOPtr                  from SelectMgr,
36     NameOfColor            from Quantity,
37     Location               from TopLoc,
38     PresentationManager    from PrsMgr,
39     PresentationManager3d  from PrsMgr
40
41 raises
42     NoSuchObject from Standard
43 is
44
45     Create (aPriority: Integer = 0) returns EntityOwner from SelectMgr;
46         --- Purpose: Initializes the selection priority aPriority.  
47     Create (aSO      : SelectableObject;
48             aPriority : Integer=0)
49     returns EntityOwner from SelectMgr;
50         ---Purpose: Constructs a framework with the selectable object
51         -- anSO being attributed the selection priority aPriority.
52         
53     HasSelectable(me) returns Boolean from Standard;
54         ---Purpose: Returns true if there is a selectable object to serve as an owner.
55
56     Selectable(me) returns any SelectableObject from SelectMgr
57         ---Purpose: Returns a selectable object detected in the working context.
58     raises NoSuchObject from Standard
59     is static;
60     
61     Set(me:mutable; aSO : SelectableObject) is static;    
62         ---Purpose: Sets the selectable object anSO to be used by the
63         -- second constructor above.
64
65             ---Category: hilight of the owner when detected...
66             --           the following virtual methods have a default
67             --           implementation which acts on stored selectable
68             --           if it exists. else does nothing.
69             --           WARNING: if methods are redefined in inheriting
70             --           classes :
71             --            if the hilight methods don't use presentable objects
72             --            YOU MUST :
73             --            1) ask The presentationManager if it is in
74             --               immediate mode
75             --            2) if it is, add your presentation to 
76             --               the immediate list of presentation manager.
77             --           
78
79     Hilight(me:mutable) is virtual;    
80         ---Purpose: Provides a framework to highlight any selectable
81         -- object found subsequently which can serve as an
82         -- owner of a sensitive primitive.
83     IsHilighted (me  ;
84                  aPM   : PresentationManager from PrsMgr;
85                  aMode : Integer  from  Standard  =0)
86     returns Boolean from Standard is virtual;    
87         ---Purpose: Returns true if the presentation manager aPM
88         -- highlights selections corresponding to the selection mode aMode.
89
90     Hilight(me    : mutable;
91             aPM   : PresentationManager from PrsMgr;
92             aMode : Integer  from  Standard  =0) is virtual;    
93       ---Purpose: Highlights the owner of a detected selectable object in
94       -- the presentation manager aPM. This object could be
95       -- the owner of a sensitive primitive.
96       -- The display mode for the highlight is aMode; this has
97       -- the default value of 0, that is, wireframe mode.  
98     
99     HilightWithColor  (me    : mutable;
100                        aPM   : PresentationManager3d from PrsMgr;
101                        aColor: NameOfColor from Quantity;
102                        aMode : Integer  from  Standard  =0) is virtual;    
103
104     Unhilight(me    : mutable;
105               aPM   : PresentationManager from PrsMgr;
106               aMode : Integer  from  Standard  =0) is virtual;    
107         ---Purpose: Removes highlighting from the owner of a detected
108         -- selectable object in the presentation manager aPM.
109         -- This object could be the owner of a sensitive primitive.
110         -- The display mode for the highlight is aMode; this has
111         -- the default value of 0, that is, wireframe mode. 
112         
113     Clear(me: mutable;  
114           aPM   : PresentationManager from PrsMgr;
115           aMode : Integer  from  Standard  =0) is virtual;    
116         ---Purpose: Clears the owners matching the value of the selection
117         -- mode aMode from the presentation manager object aPM.
118
119     ---Category: internal methods for location on  objects...
120     --           Default implementations of HasLocation() and Location() rely on 
121     --           location obtained from <mySelectable> field, to minimize memory usage.
122     --           SetLocation() and ResetLocation() do nothing by default.
123     HasLocation(me) returns Boolean from Standard is redefined;
124     SetLocation(me:mutable; aLoc : Location from TopLoc) is redefined;
125     ResetLocation(me:mutable) is redefined;
126     Location(me) returns Location from TopLoc is redefined;
127     ---C++: return const&
128     
129     
130
131     --very Internal method (to be used in selection process only...)
132
133     State(me:mutable;aStatus:Integer from Standard);
134         ---C++: inline
135     State(me)  returns Integer from Standard;
136         ---C++: inline
137
138     IsAutoHilight ( me ) returns Boolean from Standard is virtual; 
139     ---Purpose: if owner is not auto hilighted, for group contains many such owners 
140     --          will be called one method HilightSelected of SelectableObject 
141      
142     IsForcedHilight ( me ) returns Boolean from Standard is virtual; 
143     ---Purpose: if this method returns TRUE the owner will allways call method
144     --          Hilight for SelectableObject when the owner is detected. By default 
145     --          it always return FALSE.  
146     
147     SetZLayer ( me         : mutable;
148                 thePrsMgr  : PresentationManager from PrsMgr;
149                 theLayerId : Integer from Standard )
150       is virtual;
151     ---Purpose: Set Z layer ID and update all presentations.
152
153 fields
154
155     mySelectable        : SOPtr;
156     mystate             : Integer from Standard;
157
158 end EntityOwner;