b311480e |
1 | // Created on: 2003-09-09 |
2 | // Created by: Alexander SOLOVYOV |
973c2be1 |
3 | // Copyright (c) 2003-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | #include <MeshVS_MeshEntityOwner.ixx> |
17 | |
18 | #include <SelectBasics_EntityOwner.hxx> |
19 | #include <Graphic3d_Group.hxx> |
20 | #include <TColStd_ListIteratorOfListOfReal.hxx> |
21 | #include <Prs3d_Root.hxx> |
7fd59977 |
22 | #include <SelectMgr_SelectableObject.hxx> |
23 | #include <PrsMgr_PresentationManager.hxx> |
24 | #include <PrsMgr_PresentationManager3d.hxx> |
25 | #include <MeshVS_Mesh.hxx> |
26 | |
27 | |
28 | #ifndef MeshVS_PRSBUILDERHXX |
29 | #include <MeshVS_PrsBuilder.hxx> |
30 | #endif |
31 | |
32 | |
33 | //================================================================ |
34 | // Function : Constructor MeshVS_MeshEntityOwner |
35 | // Purpose : |
36 | //================================================================ |
37 | MeshVS_MeshEntityOwner::MeshVS_MeshEntityOwner |
38 | ( const SelectMgr_SOPtr& SelObj, |
39 | const Standard_Integer ID, |
40 | const Standard_Address MeshEntity, |
41 | const MeshVS_EntityType& Type, |
42 | const Standard_Integer Priority, |
43 | const Standard_Boolean IsGroup ) |
44 | : SelectMgr_EntityOwner ( SelObj, Priority ), |
45 | myAddr ( MeshEntity ), |
46 | myType ( Type ), |
47 | myID ( ID ), |
48 | myIsGroup ( IsGroup ) |
49 | { |
50 | SelectBasics_EntityOwner::Set ( Priority ); |
51 | } |
52 | |
53 | //================================================================ |
54 | // Function : Owner |
55 | // Purpose : |
56 | //================================================================ |
57 | Standard_Address MeshVS_MeshEntityOwner::Owner() const |
58 | { |
59 | return myAddr; |
60 | } |
61 | |
62 | //================================================================ |
63 | // Function : Type |
64 | // Purpose : |
65 | //================================================================ |
66 | MeshVS_EntityType MeshVS_MeshEntityOwner::Type() const |
67 | { |
68 | return myType; |
69 | } |
70 | |
71 | //================================================================ |
72 | // Function : IsGroup |
73 | // Purpose : |
74 | //================================================================ |
75 | Standard_Boolean MeshVS_MeshEntityOwner::IsGroup() const |
76 | { |
77 | return myIsGroup; |
78 | } |
79 | |
80 | //================================================================ |
81 | // Function : IsHilighted |
82 | // Purpose : |
83 | //================================================================ |
84 | Standard_Boolean MeshVS_MeshEntityOwner::IsHilighted ( const Handle(PrsMgr_PresentationManager)&, |
85 | const Standard_Integer ) const |
86 | { |
87 | return Standard_False; |
88 | } |
89 | |
90 | //================================================================ |
91 | // Function : Hilight |
92 | // Purpose : |
93 | //================================================================ |
94 | void MeshVS_MeshEntityOwner::Hilight () |
95 | { |
96 | } |
97 | |
98 | //================================================================ |
99 | // Function : Hilight |
100 | // Purpose : |
101 | //================================================================ |
102 | void MeshVS_MeshEntityOwner::Hilight ( const Handle(PrsMgr_PresentationManager)&, |
103 | const Standard_Integer ) |
104 | { |
105 | } |
106 | |
107 | //================================================================ |
108 | // Function : HilightWithColor |
109 | // Purpose : |
110 | //================================================================ |
111 | void MeshVS_MeshEntityOwner::HilightWithColor ( const Handle(PrsMgr_PresentationManager3d)& thePM, |
112 | const Quantity_NameOfColor theColor, |
113 | const Standard_Integer /*theMode*/ ) |
114 | { |
115 | Handle( SelectMgr_SelectableObject ) aSelObj; |
116 | if ( HasSelectable() ) |
117 | aSelObj = Selectable(); |
118 | |
119 | if ( thePM->IsImmediateModeOn() && aSelObj->IsKind( STANDARD_TYPE( MeshVS_Mesh ) ) ) |
120 | { |
121 | Handle( MeshVS_Mesh ) aMesh = Handle( MeshVS_Mesh )::DownCast ( aSelObj ); |
122 | aMesh->HilightOwnerWithColor ( thePM, theColor, this ); |
123 | } |
124 | } |
125 | |
126 | //================================================================ |
127 | // Function : Unhilight |
128 | // Purpose : |
129 | //================================================================ |
130 | void MeshVS_MeshEntityOwner::Unhilight ( const Handle(PrsMgr_PresentationManager)&, |
131 | const Standard_Integer ) |
132 | { |
133 | } |
134 | |
135 | //================================================================ |
136 | // Function : Clear |
137 | // Purpose : |
138 | //================================================================ |
139 | void MeshVS_MeshEntityOwner::Clear ( const Handle(PrsMgr_PresentationManager)&, |
140 | const Standard_Integer ) |
141 | { |
142 | } |
143 | |
144 | //================================================================ |
145 | // Function : ID |
146 | // Purpose : |
147 | //================================================================ |
148 | Standard_Integer MeshVS_MeshEntityOwner::ID () const |
149 | { |
150 | return myID; |
151 | } |