0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / SelectMgr / SelectMgr_EntityOwner.cxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <SelectMgr_EntityOwner.hxx>
18
19 IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_EntityOwner, Standard_Transient)
20
21 //==================================================
22 // Function: SelectMgr_EntityOwner
23 // Purpose :
24 //==================================================
25 SelectMgr_EntityOwner::SelectMgr_EntityOwner (const Standard_Integer thePriority)
26 : mySelectable (NULL),
27   mypriority (thePriority),
28   myIsSelected (Standard_False),
29   myFromDecomposition (Standard_False)
30 {
31   //
32 }
33
34 //==================================================
35 // Function: SelectMgr_EntityOwner
36 // Purpose :
37 //==================================================
38 SelectMgr_EntityOwner::SelectMgr_EntityOwner (const Handle(SelectMgr_SelectableObject)& theSelObj,
39                                               const Standard_Integer thePriority)
40 : mySelectable (theSelObj.get()),
41   mypriority (thePriority),
42   myIsSelected (Standard_False),
43   myFromDecomposition (Standard_False)
44 {
45   //
46 }
47
48 //==================================================
49 // Function: SelectMgr_EntityOwner
50 // Purpose :
51 //==================================================
52 SelectMgr_EntityOwner::SelectMgr_EntityOwner (const Handle(SelectMgr_EntityOwner)& theOwner,
53                                               const Standard_Integer thePriority)
54 : mySelectable (theOwner->mySelectable),
55   mypriority (thePriority),
56   myIsSelected (Standard_False),
57   myFromDecomposition (Standard_False)
58 {
59   //
60 }
61
62 //=======================================================================
63 //function : HilightWithColor
64 //purpose  :
65 //=======================================================================
66 void SelectMgr_EntityOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePM,
67                                               const Handle(Prs3d_Drawer)& theStyle,
68                                               const Standard_Integer theMode)
69 {
70   if (mySelectable == NULL)
71   {
72     return;
73   }
74
75   if (IsAutoHilight())
76   {
77     const Graphic3d_ZLayerId aHiLayer = theStyle->ZLayer() != Graphic3d_ZLayerId_UNKNOWN ? theStyle->ZLayer() : mySelectable->ZLayer();
78     thePM->Color (mySelectable, theStyle, theMode, NULL, aHiLayer);
79   }
80   else
81   {
82     mySelectable->HilightOwnerWithColor (thePM, theStyle, this);
83   }
84 }
85
86 // =======================================================================
87 // function : DumpJson
88 // purpose  :
89 // =======================================================================
90 void SelectMgr_EntityOwner::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
91 {
92   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
93
94   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this)
95
96   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, mySelectable)
97   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mypriority)
98   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsSelected)
99   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFromDecomposition)
100 }