1 // Created on: 2007-01-24
2 // Created by: Sergey Kochetkov
3 // Copyright (c) 2007-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.
16 #ifndef _MeshVS_MeshOwner_HeaderFile
17 #define _MeshVS_MeshOwner_HeaderFile
19 #include <SelectMgr_EntityOwner.hxx>
20 #include <PrsMgr_PresentationManager3d.hxx>
21 #include <Quantity_NameOfColor.hxx>
23 class MeshVS_DataSource;
24 class TColStd_HPackedMapOfInteger;
25 class PrsMgr_PresentationManager;
28 class MeshVS_MeshOwner;
29 DEFINE_STANDARD_HANDLE(MeshVS_MeshOwner, SelectMgr_EntityOwner)
31 //! The custom mesh owner used for advanced mesh selection. This class provides methods to store information:
32 //! 1) IDs of hilighted mesh nodes and elements
33 //! 2) IDs of mesh nodes and elements selected on the mesh
34 class MeshVS_MeshOwner : public SelectMgr_EntityOwner
40 Standard_EXPORT MeshVS_MeshOwner(const SelectMgr_SelectableObject* theSelObj, const Handle(MeshVS_DataSource)& theDS, const Standard_Integer thePriority = 0);
42 Standard_EXPORT const Handle(MeshVS_DataSource)& GetDataSource() const;
44 //! Returns ids of selected mesh nodes
45 Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetSelectedNodes() const;
47 //! Returns ids of selected mesh elements
48 Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetSelectedElements() const;
50 //! Saves ids of selected mesh entities
51 Standard_EXPORT virtual void AddSelectedEntities (const Handle(TColStd_HPackedMapOfInteger)& Nodes, const Handle(TColStd_HPackedMapOfInteger)& Elems);
53 //! Clears ids of selected mesh entities
54 Standard_EXPORT virtual void ClearSelectedEntities();
56 //! Returns ids of hilighted mesh nodes
57 Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetDetectedNodes() const;
59 //! Returns ids of hilighted mesh elements
60 Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetDetectedElements() const;
62 //! Saves ids of hilighted mesh entities
63 Standard_EXPORT void SetDetectedEntities (const Handle(TColStd_HPackedMapOfInteger)& Nodes, const Handle(TColStd_HPackedMapOfInteger)& Elems);
65 Standard_EXPORT virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM,
66 const Handle(Prs3d_Drawer)& theColor,
67 const Standard_Integer theMode = 0) Standard_OVERRIDE;
69 Standard_EXPORT virtual void Unhilight (const Handle(PrsMgr_PresentationManager)& PM, const Standard_Integer Mode = 0) Standard_OVERRIDE;
71 Standard_EXPORT virtual Standard_Boolean IsForcedHilight() const Standard_OVERRIDE;
76 DEFINE_STANDARD_RTTIEXT(MeshVS_MeshOwner,SelectMgr_EntityOwner)
81 Handle(TColStd_HPackedMapOfInteger) mySelectedNodes;
82 Handle(TColStd_HPackedMapOfInteger) mySelectedElems;
88 Handle(MeshVS_DataSource) myDataSource;
89 Handle(TColStd_HPackedMapOfInteger) myDetectedNodes;
90 Handle(TColStd_HPackedMapOfInteger) myDetectedElems;
91 Standard_Integer myLastID;
102 #endif // _MeshVS_MeshOwner_HeaderFile