b311480e |
1 | // Created on: 1995-05-23 |
2 | // Created by: Robert COUBLANC |
3 | // Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
f838dac4 |
17 | #include <SelectMgr_EntityOwner.hxx> |
7fd59977 |
18 | |
0ef04197 |
19 | IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_EntityOwner, Standard_Transient) |
92efcf78 |
20 | |
7fd59977 |
21 | //================================================== |
f838dac4 |
22 | // Function: SelectMgr_EntityOwner |
7fd59977 |
23 | // Purpose : |
24 | //================================================== |
f838dac4 |
25 | SelectMgr_EntityOwner::SelectMgr_EntityOwner (const Standard_Integer thePriority) |
0ef04197 |
26 | : mySelectable (NULL), |
27 | mypriority (thePriority), |
f838dac4 |
28 | myIsSelected (Standard_False), |
29 | myFromDecomposition (Standard_False) |
7fd59977 |
30 | { |
f838dac4 |
31 | // |
7fd59977 |
32 | } |
33 | |
f838dac4 |
34 | //================================================== |
35 | // Function: SelectMgr_EntityOwner |
36 | // Purpose : |
37 | //================================================== |
38 | SelectMgr_EntityOwner::SelectMgr_EntityOwner (const Handle(SelectMgr_SelectableObject)& theSelObj, |
39 | const Standard_Integer thePriority) |
0ef04197 |
40 | : mySelectable (theSelObj.get()), |
41 | mypriority (thePriority), |
f838dac4 |
42 | myIsSelected (Standard_False), |
43 | myFromDecomposition (Standard_False) |
7fd59977 |
44 | { |
f838dac4 |
45 | // |
7fd59977 |
46 | } |
47 | |
f838dac4 |
48 | //================================================== |
49 | // Function: SelectMgr_EntityOwner |
50 | // Purpose : |
51 | //================================================== |
52 | SelectMgr_EntityOwner::SelectMgr_EntityOwner (const Handle(SelectMgr_EntityOwner)& theOwner, |
53 | const Standard_Integer thePriority) |
0ef04197 |
54 | : mySelectable (theOwner->mySelectable), |
55 | mypriority (thePriority), |
f838dac4 |
56 | myIsSelected (Standard_False), |
57 | myFromDecomposition (Standard_False) |
0717ddc1 |
58 | { |
f838dac4 |
59 | // |
0717ddc1 |
60 | } |
61 | |
7fd59977 |
62 | //======================================================================= |
0ef04197 |
63 | //function : HilightWithColor |
f838dac4 |
64 | //purpose : |
7fd59977 |
65 | //======================================================================= |
0ef04197 |
66 | void SelectMgr_EntityOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePM, |
f838dac4 |
67 | const Handle(Prs3d_Drawer)& theStyle, |
8e5fb5ea |
68 | const Standard_Integer theMode) |
7fd59977 |
69 | { |
0ef04197 |
70 | if (mySelectable == NULL) |
8e5fb5ea |
71 | { |
f838dac4 |
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); |
eafb234b |
83 | } |
7fd59977 |
84 | } |
0904aa63 |
85 | |
86 | // ======================================================================= |
87 | // function : DumpJson |
88 | // purpose : |
89 | // ======================================================================= |
90 | void SelectMgr_EntityOwner::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const |
91 | { |
3de0f784 |
92 | OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_EntityOwner); |
0904aa63 |
93 | |
3de0f784 |
94 | OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, mySelectable); |
95 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mypriority); |
96 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsSelected); |
97 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFromDecomposition); |
0904aa63 |
98 | } |