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 return mySelectable != NULL;
62 Handle(SelectMgr_SelectableObject) SelectMgr_EntityOwner::Selectable() const
67 //=======================================================================
68 //function : about Hilight
70 //=======================================================================
71 Standard_Boolean SelectMgr_EntityOwner::IsHilighted(const Handle(PrsMgr_PresentationManager)& PM,
72 const Standard_Integer aMode) const
74 return PM->IsHighlighted(mySelectable,aMode);
75 return Standard_False;
77 void SelectMgr_EntityOwner::Hilight(const Handle(PrsMgr_PresentationManager)& PM,
78 const Standard_Integer aMode)
80 PM->Highlight(mySelectable,aMode);
83 void SelectMgr_EntityOwner::HilightWithColor(const Handle(PrsMgr_PresentationManager3d)& PM,
84 const Quantity_NameOfColor aColor,
85 const Standard_Integer aMode)
87 if( HasSelectable() ) {
89 PM->Color(mySelectable,aColor,aMode);
91 mySelectable->HilightOwnerWithColor( PM, aColor, this );
95 void SelectMgr_EntityOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& PM,
96 const Standard_Integer aMode)
99 PM->Unhighlight(mySelectable,aMode);
102 void SelectMgr_EntityOwner::Clear(const Handle(PrsMgr_PresentationManager)&,
103 const Standard_Integer)
105 // nothing done on the selectable here...
109 void SelectMgr_EntityOwner::
113 //=======================================================================
114 //function : about Transformation
116 //=======================================================================
118 Standard_Boolean SelectMgr_EntityOwner::HasLocation() const
120 return (HasSelectable() && mySelectable->HasTransformation());
123 void SelectMgr_EntityOwner::SetLocation(const TopLoc_Location&)
127 TopLoc_Location SelectMgr_EntityOwner::Location() const
129 return !HasLocation() ? TopLoc_Location() : TopLoc_Location(mySelectable->Transformation());
132 void SelectMgr_EntityOwner::ResetLocation()
136 Standard_Boolean SelectMgr_EntityOwner::IsAutoHilight () const
138 if ( mySelectable==0 )
139 return Standard_True;
141 return mySelectable->IsAutoHilight();
144 Standard_Boolean SelectMgr_EntityOwner::IsForcedHilight () const
146 return Standard_False;
149 //=======================================================================
150 //function : SetZLayer
152 //=======================================================================
153 void SelectMgr_EntityOwner::SetZLayer (const Standard_Integer )