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