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
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
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...
24 class EntityOwner from SelectMgr inherits EntityOwner from SelectBasics
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.
34 SelectableObject from SelectMgr,
36 NameOfColor from Quantity,
38 PresentationManager from PrsMgr,
39 PresentationManager3d from PrsMgr
42 NoSuchObject from Standard
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.
53 HasSelectable(me) returns Boolean from Standard;
54 ---Purpose: Returns true if there is a selectable object to serve as an owner.
56 Selectable(me) returns any SelectableObject from SelectMgr
57 ---Purpose: Returns a selectable object detected in the working context.
58 raises NoSuchObject from Standard
61 Set(me:mutable; aSO : SelectableObject) is static;
62 ---Purpose: Sets the selectable object anSO to be used by the
63 -- second constructor above.
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
71 -- if the hilight methods don't use presentable objects
73 -- 1) ask The presentationManager if it is in
75 -- 2) if it is, add your presentation to
76 -- the immediate list of presentation manager.
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.
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.
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.
99 HilightWithColor (me : mutable;
100 aPM : PresentationManager3d from PrsMgr;
101 aColor: NameOfColor from Quantity;
102 aMode : Integer from Standard =0) is virtual;
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.
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.
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&
131 --very Internal method (to be used in selection process only...)
133 State(me:mutable;aStatus:Integer from Standard);
135 State(me) returns Integer from Standard;
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
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.
147 SetZLayer ( me : mutable;
148 thePrsMgr : PresentationManager from PrsMgr;
149 theLayerId : Integer from Standard )
151 ---Purpose: Set Z layer ID and update all presentations.
155 mySelectable : SOPtr;
156 mystate : Integer from Standard;