0023649: Visualization, AIS_LocalContext - make highlighting of already selected...
[occt.git] / src / SelectMgr / SelectMgr_EntityOwner.cdl
CommitLineData
b311480e 1-- Created on: 1995-05-23
2-- Created by: Robert COUBLANC
3-- Copyright (c) 1995-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
d5f74e42 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
973c2be1 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.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
b311480e 16
7fd59977 17--Modified by rob October 25 97 store locations...
7fd59977 18-- jun 17 98 : Add virtual methods HasShape, GetShape.
19-- by default return False and Null Shape...
7fd59977 20
21
22
23
24class 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
33uses
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
41raises
42 NoSuchObject from Standard
43is
44
6e33d3ce 45 Create (aPriority: Integer = 0) returns EntityOwner from SelectMgr;
7fd59977 46 --- Purpose: Initializes the selection priority aPriority.
47 Create (aSO : SelectableObject;
48 aPriority : Integer=0)
6e33d3ce 49 returns EntityOwner from SelectMgr;
7fd59977 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
c398b00e 133 SetSelected(me:mutable;theIsSelected : Boolean from Standard);
134 ---C++: inline
135 ---Purpose:Set the state of the owner.
136 -- @param theIsSelected [in] shows if owner is selected.
137 IsSelected(me) returns Boolean from Standard;
138 ---C++: inline
139 ---Purpose: @return Standard_True if the owner is selected.
140
7fd59977 141 State(me:mutable;aStatus:Integer from Standard);
c398b00e 142 ---C++: inline
143 ---Purpose:Set the state of the owner.
144 -- The method is deprecated. Use SetSelected() instead.
145
7fd59977 146 State(me) returns Integer from Standard;
c398b00e 147 ---C++: inline
148 -- @return 1 if the owner is selected and 0 otherwise.
149 -- The method is deprecated. Use IsSelected() instead.
7fd59977 150
151 IsAutoHilight ( me ) returns Boolean from Standard is virtual;
152 ---Purpose: if owner is not auto hilighted, for group contains many such owners
153 -- will be called one method HilightSelected of SelectableObject
c398b00e 154
7fd59977 155 IsForcedHilight ( me ) returns Boolean from Standard is virtual;
156 ---Purpose: if this method returns TRUE the owner will allways call method
157 -- Hilight for SelectableObject when the owner is detected. By default
158 -- it always return FALSE.
c398b00e 159
59f45b7c 160 SetZLayer ( me : mutable;
161 thePrsMgr : PresentationManager from PrsMgr;
162 theLayerId : Integer from Standard )
163 is virtual;
164 ---Purpose: Set Z layer ID and update all presentations.
165
7fd59977 166fields
167
168 mySelectable : SOPtr;
c398b00e 169
170 myIsSelected : Boolean from Standard;
171 ---Purpose: Describes selection state of this owner:
172 -- Standard_False: the owner not selected
173 -- Standard_True: the owner is selected.
174
7fd59977 175
176end EntityOwner;