Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:16

0001 // Created on: 2007-01-24
0002 // Created by: Sergey  Kochetkov
0003 // Copyright (c) 2007-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _MeshVS_MeshOwner_HeaderFile
0017 #define _MeshVS_MeshOwner_HeaderFile
0018 
0019 #include <SelectMgr_EntityOwner.hxx>
0020 #include <PrsMgr_PresentationManager.hxx>
0021 
0022 class MeshVS_DataSource;
0023 class TColStd_HPackedMapOfInteger;
0024 class PrsMgr_PresentationManager;
0025 
0026 
0027 class MeshVS_MeshOwner;
0028 DEFINE_STANDARD_HANDLE(MeshVS_MeshOwner, SelectMgr_EntityOwner)
0029 
0030 //! The custom mesh owner used for advanced mesh selection. This class provides methods to store information:
0031 //! 1) IDs of hilighted mesh nodes and elements
0032 //! 2) IDs of mesh nodes and elements selected on the mesh
0033 class MeshVS_MeshOwner : public SelectMgr_EntityOwner
0034 {
0035 
0036 public:
0037 
0038   
0039   Standard_EXPORT MeshVS_MeshOwner(const SelectMgr_SelectableObject* theSelObj, const Handle(MeshVS_DataSource)& theDS, const Standard_Integer thePriority = 0);
0040   
0041   Standard_EXPORT const Handle(MeshVS_DataSource)& GetDataSource() const;
0042   
0043   //! Returns ids of selected mesh nodes
0044   Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetSelectedNodes() const;
0045   
0046   //! Returns ids of selected mesh elements
0047   Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetSelectedElements() const;
0048   
0049   //! Saves ids of selected mesh entities
0050   Standard_EXPORT virtual void AddSelectedEntities (const Handle(TColStd_HPackedMapOfInteger)& Nodes, const Handle(TColStd_HPackedMapOfInteger)& Elems);
0051   
0052   //! Clears ids of selected mesh entities
0053   Standard_EXPORT virtual void ClearSelectedEntities();
0054   
0055   //! Returns ids of hilighted mesh nodes
0056   Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetDetectedNodes() const;
0057   
0058   //! Returns ids of hilighted mesh elements
0059   Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetDetectedElements() const;
0060   
0061   //! Saves ids of hilighted mesh entities
0062   Standard_EXPORT void SetDetectedEntities (const Handle(TColStd_HPackedMapOfInteger)& Nodes, const Handle(TColStd_HPackedMapOfInteger)& Elems);
0063 
0064   Standard_EXPORT virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePM,
0065                                                  const Handle(Prs3d_Drawer)& theColor,
0066                                                  const Standard_Integer theMode) Standard_OVERRIDE;
0067 
0068   Standard_EXPORT virtual void Unhilight (const Handle(PrsMgr_PresentationManager)& PM, const Standard_Integer Mode = 0) Standard_OVERRIDE;
0069 
0070   Standard_EXPORT virtual Standard_Boolean IsForcedHilight() const Standard_OVERRIDE;
0071 
0072   DEFINE_STANDARD_RTTIEXT(MeshVS_MeshOwner,SelectMgr_EntityOwner)
0073 
0074 protected:
0075 
0076   Handle(TColStd_HPackedMapOfInteger) mySelectedNodes;
0077   Handle(TColStd_HPackedMapOfInteger) mySelectedElems;
0078 
0079 private:
0080 
0081   Handle(MeshVS_DataSource) myDataSource;
0082   Handle(TColStd_HPackedMapOfInteger) myDetectedNodes;
0083   Handle(TColStd_HPackedMapOfInteger) myDetectedElems;
0084   Standard_Integer myLastID;
0085 
0086 };
0087 
0088 #endif // _MeshVS_MeshOwner_HeaderFile