1 // Copyright: Matra-Datavision 1995
2 // File: SelectMgr_EntityOwner.cxx
3 // Created: Tue May 23 10:18:48 1995
4 // Author: Robert COUBLANC
9 #include <SelectMgr_EntityOwner.ixx>
13 //==================================================
16 //==================================================
17 SelectMgr_EntityOwner::SelectMgr_EntityOwner(const Standard_Integer aPriority):
18 SelectBasics_EntityOwner(aPriority),
24 SelectMgr_EntityOwner::SelectMgr_EntityOwner(const Handle(SelectMgr_SelectableObject)& aSO,
25 const Standard_Integer aPriority):
26 SelectBasics_EntityOwner(aPriority),
29 mySelectable = aSO.operator->();
33 //=======================================================================
34 //function : About Selectable...
36 //=======================================================================
37 void SelectMgr_EntityOwner::Set(const Handle(SelectMgr_SelectableObject)& aSO)
39 mySelectable = aSO.operator->();
42 Standard_Boolean SelectMgr_EntityOwner::HasSelectable() const
44 Handle(Standard_Transient) aNull;
45 if(mySelectable != aNull.operator->()){
46 if(!Selectable().IsNull()) return Standard_True;}
47 return Standard_False;
50 Handle(SelectMgr_SelectableObject) SelectMgr_EntityOwner::Selectable() const
55 //=======================================================================
56 //function : about Hilight
58 //=======================================================================
59 Standard_Boolean SelectMgr_EntityOwner::IsHilighted(const Handle(PrsMgr_PresentationManager)& PM,
60 const Standard_Integer aMode) const
62 return PM->IsHighlighted(mySelectable,aMode);
63 return Standard_False;
65 void SelectMgr_EntityOwner::Hilight(const Handle(PrsMgr_PresentationManager)& PM,
66 const Standard_Integer aMode)
68 PM->Highlight(mySelectable,aMode);
71 void SelectMgr_EntityOwner::HilightWithColor(const Handle(PrsMgr_PresentationManager3d)& PM,
72 const Quantity_NameOfColor aColor,
73 const Standard_Integer aMode)
77 PM->Color(mySelectable,aColor,aMode);
79 mySelectable->HilightOwnerWithColor( PM, aColor, this );
82 void SelectMgr_EntityOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& PM,
83 const Standard_Integer aMode)
86 PM->Unhighlight(mySelectable,aMode);
89 void SelectMgr_EntityOwner::Clear(const Handle(PrsMgr_PresentationManager)& PM,
90 const Standard_Integer aMode)
92 // nothing done on the selectable here...
96 void SelectMgr_EntityOwner::
101 //=======================================================================
102 //function : about Location
104 //=======================================================================
106 Standard_Boolean SelectMgr_EntityOwner::HasLocation() const
108 return (HasSelectable() && mySelectable->HasLocation());
111 void SelectMgr_EntityOwner::SetLocation(const TopLoc_Location&)
115 const TopLoc_Location& SelectMgr_EntityOwner::Location() const
117 static TopLoc_Location anIdentity;
118 return HasSelectable() ? mySelectable->Location() : anIdentity;
121 void SelectMgr_EntityOwner::ResetLocation()
125 Standard_Boolean SelectMgr_EntityOwner::IsAutoHilight () const
127 if ( mySelectable==0 )
128 return Standard_True;
130 return mySelectable->IsAutoHilight();
133 Standard_Boolean SelectMgr_EntityOwner::IsForcedHilight () const
135 return Standard_False;