0023634: Eliminate Polyline and Polygon usage in drawers
[occt.git] / src / MeshVS / MeshVS_MeshEntityOwner.cxx
CommitLineData
b311480e 1// Created on: 2003-09-09
2// Created by: Alexander SOLOVYOV
3// Copyright (c) 2003-2012 OPEN CASCADE SAS
4//
5// The content of this file is subject to the Open CASCADE Technology Public
6// License Version 6.5 (the "License"). You may not use the content of this file
7// except in compliance with the License. Please obtain a copy of the License
8// at http://www.opencascade.org and read it completely before using this file.
9//
10// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12//
13// The Original Code and all software distributed under the License is
14// distributed on an "AS IS" basis, without warranty of any kind, and the
15// Initial Developer hereby disclaims all such warranties, including without
16// limitation, any warranties of merchantability, fitness for a particular
17// purpose or non-infringement. Please see the License for the specific terms
18// and conditions governing the rights and limitations under the License.
19
7fd59977 20
21#include <MeshVS_MeshEntityOwner.ixx>
22
23#include <SelectBasics_EntityOwner.hxx>
24#include <Graphic3d_Group.hxx>
25#include <TColStd_ListIteratorOfListOfReal.hxx>
26#include <Prs3d_Root.hxx>
7fd59977 27#include <SelectMgr_SelectableObject.hxx>
28#include <PrsMgr_PresentationManager.hxx>
29#include <PrsMgr_PresentationManager3d.hxx>
30#include <MeshVS_Mesh.hxx>
31
32
33#ifndef MeshVS_PRSBUILDERHXX
34#include <MeshVS_PrsBuilder.hxx>
35#endif
36
37
38//================================================================
39// Function : Constructor MeshVS_MeshEntityOwner
40// Purpose :
41//================================================================
42MeshVS_MeshEntityOwner::MeshVS_MeshEntityOwner
43 ( const SelectMgr_SOPtr& SelObj,
44 const Standard_Integer ID,
45 const Standard_Address MeshEntity,
46 const MeshVS_EntityType& Type,
47 const Standard_Integer Priority,
48 const Standard_Boolean IsGroup )
49: SelectMgr_EntityOwner ( SelObj, Priority ),
50 myAddr ( MeshEntity ),
51 myType ( Type ),
52 myID ( ID ),
53 myIsGroup ( IsGroup )
54{
55 SelectBasics_EntityOwner::Set ( Priority );
56}
57
58//================================================================
59// Function : Owner
60// Purpose :
61//================================================================
62Standard_Address MeshVS_MeshEntityOwner::Owner() const
63{
64 return myAddr;
65}
66
67//================================================================
68// Function : Type
69// Purpose :
70//================================================================
71MeshVS_EntityType MeshVS_MeshEntityOwner::Type() const
72{
73 return myType;
74}
75
76//================================================================
77// Function : IsGroup
78// Purpose :
79//================================================================
80Standard_Boolean MeshVS_MeshEntityOwner::IsGroup() const
81{
82 return myIsGroup;
83}
84
85//================================================================
86// Function : IsHilighted
87// Purpose :
88//================================================================
89Standard_Boolean MeshVS_MeshEntityOwner::IsHilighted ( const Handle(PrsMgr_PresentationManager)&,
90 const Standard_Integer ) const
91{
92 return Standard_False;
93}
94
95//================================================================
96// Function : Hilight
97// Purpose :
98//================================================================
99void MeshVS_MeshEntityOwner::Hilight ()
100{
101}
102
103//================================================================
104// Function : Hilight
105// Purpose :
106//================================================================
107void MeshVS_MeshEntityOwner::Hilight ( const Handle(PrsMgr_PresentationManager)&,
108 const Standard_Integer )
109{
110}
111
112//================================================================
113// Function : HilightWithColor
114// Purpose :
115//================================================================
116void MeshVS_MeshEntityOwner::HilightWithColor ( const Handle(PrsMgr_PresentationManager3d)& thePM,
117 const Quantity_NameOfColor theColor,
118 const Standard_Integer /*theMode*/ )
119{
120 Handle( SelectMgr_SelectableObject ) aSelObj;
121 if ( HasSelectable() )
122 aSelObj = Selectable();
123
124 if ( thePM->IsImmediateModeOn() && aSelObj->IsKind( STANDARD_TYPE( MeshVS_Mesh ) ) )
125 {
126 Handle( MeshVS_Mesh ) aMesh = Handle( MeshVS_Mesh )::DownCast ( aSelObj );
127 aMesh->HilightOwnerWithColor ( thePM, theColor, this );
128 }
129}
130
131//================================================================
132// Function : Unhilight
133// Purpose :
134//================================================================
135void MeshVS_MeshEntityOwner::Unhilight ( const Handle(PrsMgr_PresentationManager)&,
136 const Standard_Integer )
137{
138}
139
140//================================================================
141// Function : Clear
142// Purpose :
143//================================================================
144void MeshVS_MeshEntityOwner::Clear ( const Handle(PrsMgr_PresentationManager)&,
145 const Standard_Integer )
146{
147}
148
149//================================================================
150// Function : ID
151// Purpose :
152//================================================================
153Standard_Integer MeshVS_MeshEntityOwner::ID () const
154{
155 return myID;
156}