1 // Created on: 1995-05-23
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
24 #include <SelectMgr_EntityOwner.ixx>
28 //==================================================
31 //==================================================
32 SelectMgr_EntityOwner::SelectMgr_EntityOwner(const Standard_Integer aPriority):
33 SelectBasics_EntityOwner(aPriority),
39 SelectMgr_EntityOwner::SelectMgr_EntityOwner(const Handle(SelectMgr_SelectableObject)& aSO,
40 const Standard_Integer aPriority):
41 SelectBasics_EntityOwner(aPriority),
44 mySelectable = aSO.operator->();
48 //=======================================================================
49 //function : About Selectable...
51 //=======================================================================
52 void SelectMgr_EntityOwner::Set(const Handle(SelectMgr_SelectableObject)& aSO)
54 mySelectable = aSO.operator->();
57 Standard_Boolean SelectMgr_EntityOwner::HasSelectable() const
59 Handle(Standard_Transient) aNull;
60 if(mySelectable != aNull.operator->()){
61 if(!Selectable().IsNull()) return Standard_True;}
62 return Standard_False;
65 Handle(SelectMgr_SelectableObject) SelectMgr_EntityOwner::Selectable() const
70 //=======================================================================
71 //function : about Hilight
73 //=======================================================================
74 Standard_Boolean SelectMgr_EntityOwner::IsHilighted(const Handle(PrsMgr_PresentationManager)& PM,
75 const Standard_Integer aMode) const
77 return PM->IsHighlighted(mySelectable,aMode);
78 return Standard_False;
80 void SelectMgr_EntityOwner::Hilight(const Handle(PrsMgr_PresentationManager)& PM,
81 const Standard_Integer aMode)
83 PM->Highlight(mySelectable,aMode);
86 void SelectMgr_EntityOwner::HilightWithColor(const Handle(PrsMgr_PresentationManager3d)& PM,
87 const Quantity_NameOfColor aColor,
88 const Standard_Integer aMode)
92 PM->Color(mySelectable,aColor,aMode);
94 mySelectable->HilightOwnerWithColor( PM, aColor, this );
97 void SelectMgr_EntityOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& PM,
98 const Standard_Integer aMode)
101 PM->Unhighlight(mySelectable,aMode);
104 void SelectMgr_EntityOwner::Clear(const Handle(PrsMgr_PresentationManager)&,
105 const Standard_Integer)
107 // nothing done on the selectable here...
111 void SelectMgr_EntityOwner::
116 //=======================================================================
117 //function : about Location
119 //=======================================================================
121 Standard_Boolean SelectMgr_EntityOwner::HasLocation() const
123 return (HasSelectable() && mySelectable->HasLocation());
126 void SelectMgr_EntityOwner::SetLocation(const TopLoc_Location&)
130 const TopLoc_Location& SelectMgr_EntityOwner::Location() const
132 static TopLoc_Location anIdentity;
133 return HasSelectable() ? mySelectable->Location() : anIdentity;
136 void SelectMgr_EntityOwner::ResetLocation()
140 Standard_Boolean SelectMgr_EntityOwner::IsAutoHilight () const
142 if ( mySelectable==0 )
143 return Standard_True;
145 return mySelectable->IsAutoHilight();
148 Standard_Boolean SelectMgr_EntityOwner::IsForcedHilight () const
150 return Standard_False;
153 //=======================================================================
154 //function : SetZLayer
156 //=======================================================================
157 void SelectMgr_EntityOwner::SetZLayer
158 (const Handle(PrsMgr_PresentationManager)&,
159 const Standard_Integer)