0024075: Boolean Section between two faces fails
[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{
90 if( HasSelectable() )
91 if( IsAutoHilight() )
92 PM->Color(mySelectable,aColor,aMode);
93 else
94 mySelectable->HilightOwnerWithColor( PM, aColor, this );
95}
96
97void SelectMgr_EntityOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& PM,
98 const Standard_Integer aMode)
99{
100 if(HasSelectable())
101 PM->Unhighlight(mySelectable,aMode);
102}
103
104void SelectMgr_EntityOwner::Clear(const Handle(PrsMgr_PresentationManager)& PM,
105 const Standard_Integer aMode)
106{
107// nothing done on the selectable here...
108}
109
110
111void SelectMgr_EntityOwner::
112Hilight(){}
113
114
115
116//=======================================================================
117//function : about Location
118//purpose :
119//=======================================================================
120
121Standard_Boolean SelectMgr_EntityOwner::HasLocation() const
122{
123 return (HasSelectable() && mySelectable->HasLocation());
124}
125
126void SelectMgr_EntityOwner::SetLocation(const TopLoc_Location&)
127{
128}
129
130const TopLoc_Location& SelectMgr_EntityOwner::Location() const
131{
132 static TopLoc_Location anIdentity;
133 return HasSelectable() ? mySelectable->Location() : anIdentity;
134}
135
136void SelectMgr_EntityOwner::ResetLocation()
137{
138}
139
140Standard_Boolean SelectMgr_EntityOwner::IsAutoHilight () const
141{
142 if ( mySelectable==0 )
143 return Standard_True;
144 else
145 return mySelectable->IsAutoHilight();
146}
147
148Standard_Boolean SelectMgr_EntityOwner::IsForcedHilight () const
149{
150 return Standard_False;
151}
59f45b7c 152
153//=======================================================================
154//function : SetZLayer
155//purpose :
156//=======================================================================
157void SelectMgr_EntityOwner::SetZLayer
158 (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
159 const Standard_Integer theLayerId)
160{
161}