1 // Created on: 2003-09-09
2 // Created by: Alexander SOLOVYOV
3 // Copyright (c) 2003-2012 OPEN CASCADE SAS
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.
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.
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.
21 #include <MeshVS_MeshEntityOwner.ixx>
23 #include <SelectBasics_EntityOwner.hxx>
24 #include <Graphic3d_Group.hxx>
25 #include <TColStd_ListIteratorOfListOfReal.hxx>
26 #include <Prs3d_Root.hxx>
27 #include <Graphic3d_Vertex.hxx>
28 #include <Graphic3d_Array1OfVertex.hxx>
29 #include <SelectMgr_SelectableObject.hxx>
30 #include <PrsMgr_PresentationManager.hxx>
31 #include <PrsMgr_PresentationManager3d.hxx>
32 #include <MeshVS_Mesh.hxx>
35 #ifndef MeshVS_PRSBUILDERHXX
36 #include <MeshVS_PrsBuilder.hxx>
40 //================================================================
41 // Function : Constructor MeshVS_MeshEntityOwner
43 //================================================================
44 MeshVS_MeshEntityOwner::MeshVS_MeshEntityOwner
45 ( const SelectMgr_SOPtr& SelObj,
46 const Standard_Integer ID,
47 const Standard_Address MeshEntity,
48 const MeshVS_EntityType& Type,
49 const Standard_Integer Priority,
50 const Standard_Boolean IsGroup )
51 : SelectMgr_EntityOwner ( SelObj, Priority ),
52 myAddr ( MeshEntity ),
57 SelectBasics_EntityOwner::Set ( Priority );
60 //================================================================
63 //================================================================
64 Standard_Address MeshVS_MeshEntityOwner::Owner() const
69 //================================================================
72 //================================================================
73 MeshVS_EntityType MeshVS_MeshEntityOwner::Type() const
78 //================================================================
81 //================================================================
82 Standard_Boolean MeshVS_MeshEntityOwner::IsGroup() const
87 //================================================================
88 // Function : IsHilighted
90 //================================================================
91 Standard_Boolean MeshVS_MeshEntityOwner::IsHilighted ( const Handle(PrsMgr_PresentationManager)&,
92 const Standard_Integer ) const
94 return Standard_False;
97 //================================================================
100 //================================================================
101 void MeshVS_MeshEntityOwner::Hilight ()
105 //================================================================
106 // Function : Hilight
108 //================================================================
109 void MeshVS_MeshEntityOwner::Hilight ( const Handle(PrsMgr_PresentationManager)&,
110 const Standard_Integer )
114 //================================================================
115 // Function : HilightWithColor
117 //================================================================
118 void MeshVS_MeshEntityOwner::HilightWithColor ( const Handle(PrsMgr_PresentationManager3d)& thePM,
119 const Quantity_NameOfColor theColor,
120 const Standard_Integer /*theMode*/ )
122 Handle( SelectMgr_SelectableObject ) aSelObj;
123 if ( HasSelectable() )
124 aSelObj = Selectable();
126 if ( thePM->IsImmediateModeOn() && aSelObj->IsKind( STANDARD_TYPE( MeshVS_Mesh ) ) )
128 Handle( MeshVS_Mesh ) aMesh = Handle( MeshVS_Mesh )::DownCast ( aSelObj );
129 aMesh->HilightOwnerWithColor ( thePM, theColor, this );
133 //================================================================
134 // Function : Unhilight
136 //================================================================
137 void MeshVS_MeshEntityOwner::Unhilight ( const Handle(PrsMgr_PresentationManager)&,
138 const Standard_Integer )
142 //================================================================
145 //================================================================
146 void MeshVS_MeshEntityOwner::Clear ( const Handle(PrsMgr_PresentationManager)&,
147 const Standard_Integer )
151 //================================================================
154 //================================================================
155 Standard_Integer MeshVS_MeshEntityOwner::ID () const