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)
90 if( HasSelectable() ) {
92 PM->Color(mySelectable,aColor,aMode);
94 mySelectable->HilightOwnerWithColor( PM, aColor, this );
98 void SelectMgr_EntityOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& PM,
99 const Standard_Integer aMode)
102 PM->Unhighlight(mySelectable,aMode);
105 void SelectMgr_EntityOwner::Clear(const Handle(PrsMgr_PresentationManager)&,
106 const Standard_Integer)
108 // nothing done on the selectable here...
112 void SelectMgr_EntityOwner::
117 //=======================================================================
118 //function : about Location
120 //=======================================================================
122 Standard_Boolean SelectMgr_EntityOwner::HasLocation() const
124 return (HasSelectable() && mySelectable->HasLocation());
127 void SelectMgr_EntityOwner::SetLocation(const TopLoc_Location&)
131 const TopLoc_Location& SelectMgr_EntityOwner::Location() const
133 static TopLoc_Location anIdentity;
134 return HasSelectable() ? mySelectable->Location() : anIdentity;
137 void SelectMgr_EntityOwner::ResetLocation()
141 Standard_Boolean SelectMgr_EntityOwner::IsAutoHilight () const
143 if ( mySelectable==0 )
144 return Standard_True;
146 return mySelectable->IsAutoHilight();
149 Standard_Boolean SelectMgr_EntityOwner::IsForcedHilight () const
151 return Standard_False;
154 //=======================================================================
155 //function : SetZLayer
157 //=======================================================================
158 void SelectMgr_EntityOwner::SetZLayer
159 (const Handle(PrsMgr_PresentationManager)&,
160 const Standard_Integer)