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 #include <SelectMgr_EntityOwner.ixx>
21 //==================================================
24 //==================================================
25 SelectMgr_EntityOwner::SelectMgr_EntityOwner(const Standard_Integer aPriority):
26 SelectBasics_EntityOwner(aPriority),
28 myIsSelected (Standard_False)
32 SelectMgr_EntityOwner::SelectMgr_EntityOwner(const Handle(SelectMgr_SelectableObject)& aSO,
33 const Standard_Integer aPriority):
34 SelectBasics_EntityOwner(aPriority),
35 myIsSelected (Standard_False)
37 mySelectable = aSO.operator->();
40 SelectMgr_EntityOwner::SelectMgr_EntityOwner (const Handle(SelectMgr_EntityOwner)& theOwner, const Standard_Integer aPriority)
42 SelectBasics_EntityOwner(aPriority),
43 mySelectable (theOwner->mySelectable)
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::
116 //=======================================================================
117 //function : about Transformation
119 //=======================================================================
121 Standard_Boolean SelectMgr_EntityOwner::HasLocation() const
123 return (HasSelectable() && mySelectable->HasTransformation());
126 void SelectMgr_EntityOwner::SetLocation(const TopLoc_Location&)
130 TopLoc_Location SelectMgr_EntityOwner::Location() const
132 return !HasLocation() ? TopLoc_Location() : TopLoc_Location(mySelectable->Transformation());
135 void SelectMgr_EntityOwner::ResetLocation()
139 Standard_Boolean SelectMgr_EntityOwner::IsAutoHilight () const
141 if ( mySelectable==0 )
142 return Standard_True;
144 return mySelectable->IsAutoHilight();
147 Standard_Boolean SelectMgr_EntityOwner::IsForcedHilight () const
149 return Standard_False;
152 //=======================================================================
153 //function : SetZLayer
155 //=======================================================================
156 void SelectMgr_EntityOwner::SetZLayer (const Standard_Integer )