0024171: Eliminate CLang compiler warning -Wreorder
[occt.git] / src / SelectMgr / SelectMgr_EntityOwner.cxx
CommitLineData
b311480e 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
5//
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.
10//
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.
13//
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.
20
7fd59977 21
22
23
24#include <SelectMgr_EntityOwner.ixx>
25
26
27
28//==================================================
29// Function:
30// Purpose :
31//==================================================
32SelectMgr_EntityOwner::SelectMgr_EntityOwner(const Standard_Integer aPriority):
33SelectBasics_EntityOwner(aPriority),
34mySelectable(NULL),
35mystate(0)
36{
37}
38
39SelectMgr_EntityOwner::SelectMgr_EntityOwner(const Handle(SelectMgr_SelectableObject)& aSO,
40 const Standard_Integer aPriority):
41SelectBasics_EntityOwner(aPriority),
42mystate(0)
43{
44 mySelectable = aSO.operator->();
45}
46
47
48//=======================================================================
49//function : About Selectable...
50//purpose :
51//=======================================================================
52void SelectMgr_EntityOwner::Set(const Handle(SelectMgr_SelectableObject)& aSO)
53{
54 mySelectable = aSO.operator->();
55}
56
57Standard_Boolean SelectMgr_EntityOwner::HasSelectable() const
58{
59 Handle(Standard_Transient) aNull;
60 if(mySelectable != aNull.operator->()){
61 if(!Selectable().IsNull()) return Standard_True;}
62 return Standard_False;
63}
64
65Handle(SelectMgr_SelectableObject) SelectMgr_EntityOwner::Selectable() const
66{
67 return mySelectable;
68}
69
70//=======================================================================
71//function : about Hilight
72//purpose :
73//=======================================================================
74Standard_Boolean SelectMgr_EntityOwner::IsHilighted(const Handle(PrsMgr_PresentationManager)& PM,
75 const Standard_Integer aMode) const
76{if(HasSelectable())
77 return PM->IsHighlighted(mySelectable,aMode);
78 return Standard_False;
79}
80void SelectMgr_EntityOwner::Hilight(const Handle(PrsMgr_PresentationManager)& PM,
81 const Standard_Integer aMode)
82{if(HasSelectable())
83 PM->Highlight(mySelectable,aMode);
84}
85
86void SelectMgr_EntityOwner::HilightWithColor(const Handle(PrsMgr_PresentationManager3d)& PM,
87 const Quantity_NameOfColor aColor,
88 const Standard_Integer aMode)
89{
eafb234b 90 if( HasSelectable() ) {
7fd59977 91 if( IsAutoHilight() )
92 PM->Color(mySelectable,aColor,aMode);
93 else
94 mySelectable->HilightOwnerWithColor( PM, aColor, this );
eafb234b 95 }
7fd59977 96}
97
98void SelectMgr_EntityOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& PM,
99 const Standard_Integer aMode)
100{
101 if(HasSelectable())
102 PM->Unhighlight(mySelectable,aMode);
103}
104
35e08fe8 105void SelectMgr_EntityOwner::Clear(const Handle(PrsMgr_PresentationManager)&,
106 const Standard_Integer)
7fd59977 107{
108// nothing done on the selectable here...
109}
110
111
112void SelectMgr_EntityOwner::
113Hilight(){}
114
115
116
117//=======================================================================
118//function : about Location
119//purpose :
120//=======================================================================
121
122Standard_Boolean SelectMgr_EntityOwner::HasLocation() const
123{
124 return (HasSelectable() && mySelectable->HasLocation());
125}
126
127void SelectMgr_EntityOwner::SetLocation(const TopLoc_Location&)
128{
129}
130
131const TopLoc_Location& SelectMgr_EntityOwner::Location() const
132{
133 static TopLoc_Location anIdentity;
134 return HasSelectable() ? mySelectable->Location() : anIdentity;
135}
136
137void SelectMgr_EntityOwner::ResetLocation()
138{
139}
140
141Standard_Boolean SelectMgr_EntityOwner::IsAutoHilight () const
142{
143 if ( mySelectable==0 )
144 return Standard_True;
145 else
146 return mySelectable->IsAutoHilight();
147}
148
149Standard_Boolean SelectMgr_EntityOwner::IsForcedHilight () const
150{
151 return Standard_False;
152}
59f45b7c 153
154//=======================================================================
155//function : SetZLayer
156//purpose :
157//=======================================================================
158void SelectMgr_EntityOwner::SetZLayer
35e08fe8 159 (const Handle(PrsMgr_PresentationManager)&,
160 const Standard_Integer)
59f45b7c 161{
162}