1 // Created on: 2003-09-09
2 // Created by: Alexander SOLOVYOV
3 // Copyright (c) 2003-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #include <Graphic3d_Group.hxx>
18 #include <MeshVS_Mesh.hxx>
19 #include <MeshVS_MeshEntityOwner.hxx>
20 #include <Prs3d_Root.hxx>
21 #include <PrsMgr_PresentationManager.hxx>
22 #include <PrsMgr_PresentationManager3d.hxx>
23 #include <SelectBasics_EntityOwner.hxx>
24 #include <SelectMgr_SelectableObject.hxx>
25 #include <Standard_Type.hxx>
26 #include <TColStd_ListIteratorOfListOfReal.hxx>
28 IMPLEMENT_STANDARD_RTTIEXT(MeshVS_MeshEntityOwner,SelectMgr_EntityOwner)
30 #ifndef MeshVS_PRSBUILDERHXX
31 #include <MeshVS_PrsBuilder.hxx>
35 //================================================================
36 // Function : Constructor MeshVS_MeshEntityOwner
38 //================================================================
39 MeshVS_MeshEntityOwner::MeshVS_MeshEntityOwner
40 ( const SelectMgr_SOPtr& SelObj,
41 const Standard_Integer ID,
42 const Standard_Address MeshEntity,
43 const MeshVS_EntityType& Type,
44 const Standard_Integer Priority,
45 const Standard_Boolean IsGroup )
46 : SelectMgr_EntityOwner ( SelObj, Priority ),
47 myAddr ( MeshEntity ),
52 SelectBasics_EntityOwner::Set ( Priority );
55 //================================================================
58 //================================================================
59 Standard_Address MeshVS_MeshEntityOwner::Owner() const
64 //================================================================
67 //================================================================
68 MeshVS_EntityType MeshVS_MeshEntityOwner::Type() const
73 //================================================================
76 //================================================================
77 Standard_Boolean MeshVS_MeshEntityOwner::IsGroup() const
82 //================================================================
83 // Function : IsHilighted
85 //================================================================
86 Standard_Boolean MeshVS_MeshEntityOwner::IsHilighted ( const Handle(PrsMgr_PresentationManager)&,
87 const Standard_Integer ) const
89 return Standard_False;
92 //================================================================
93 // Function : HilightWithColor
95 //================================================================
96 void MeshVS_MeshEntityOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM,
97 const Handle(Prs3d_Drawer)& theStyle,
98 const Standard_Integer /*theMode*/ )
100 Handle( SelectMgr_SelectableObject ) aSelObj;
101 if ( HasSelectable() )
102 aSelObj = Selectable();
104 if ( thePM->IsImmediateModeOn() && aSelObj->IsKind( STANDARD_TYPE( MeshVS_Mesh ) ) )
106 Handle( MeshVS_Mesh ) aMesh = Handle( MeshVS_Mesh )::DownCast ( aSelObj );
107 aMesh->HilightOwnerWithColor ( thePM, theStyle, this );
111 //================================================================
112 // Function : Unhilight
114 //================================================================
115 void MeshVS_MeshEntityOwner::Unhilight ( const Handle(PrsMgr_PresentationManager)&,
116 const Standard_Integer )
120 //================================================================
123 //================================================================
124 void MeshVS_MeshEntityOwner::Clear ( const Handle(PrsMgr_PresentationManager)&,
125 const Standard_Integer )
129 //================================================================
132 //================================================================
133 Standard_Integer MeshVS_MeshEntityOwner::ID () const