Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:58:41

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 //! The custom mesh owner used for advanced mesh selection. This class provides methods to store
0027 //! information: 1) IDs of hilighted mesh nodes and elements 2) IDs of mesh nodes and elements
0028 //! selected on the mesh
0029 class MeshVS_MeshOwner : public SelectMgr_EntityOwner
0030 {
0031 
0032 public:
0033   Standard_EXPORT MeshVS_MeshOwner(const SelectMgr_SelectableObject*     theSelObj,
0034                                    const occ::handle<MeshVS_DataSource>& theDS,
0035                                    const int                             thePriority = 0);
0036 
0037   Standard_EXPORT const occ::handle<MeshVS_DataSource>& GetDataSource() const;
0038 
0039   //! Returns ids of selected mesh nodes
0040   Standard_EXPORT const occ::handle<TColStd_HPackedMapOfInteger>& GetSelectedNodes() const;
0041 
0042   //! Returns ids of selected mesh elements
0043   Standard_EXPORT const occ::handle<TColStd_HPackedMapOfInteger>& GetSelectedElements() const;
0044 
0045   //! Saves ids of selected mesh entities
0046   Standard_EXPORT virtual void AddSelectedEntities(
0047     const occ::handle<TColStd_HPackedMapOfInteger>& Nodes,
0048     const occ::handle<TColStd_HPackedMapOfInteger>& Elems);
0049 
0050   //! Clears ids of selected mesh entities
0051   Standard_EXPORT virtual void ClearSelectedEntities();
0052 
0053   //! Returns ids of hilighted mesh nodes
0054   Standard_EXPORT const occ::handle<TColStd_HPackedMapOfInteger>& GetDetectedNodes() const;
0055 
0056   //! Returns ids of hilighted mesh elements
0057   Standard_EXPORT const occ::handle<TColStd_HPackedMapOfInteger>& GetDetectedElements() const;
0058 
0059   //! Saves ids of hilighted mesh entities
0060   Standard_EXPORT void SetDetectedEntities(const occ::handle<TColStd_HPackedMapOfInteger>& Nodes,
0061                                            const occ::handle<TColStd_HPackedMapOfInteger>& Elems);
0062 
0063   Standard_EXPORT void HilightWithColor(const occ::handle<PrsMgr_PresentationManager>& thePM,
0064                                         const occ::handle<Prs3d_Drawer>&               theColor,
0065                                         const int theMode) override;
0066 
0067   Standard_EXPORT void Unhilight(const occ::handle<PrsMgr_PresentationManager>& PM,
0068                                  const int                                      Mode = 0) override;
0069 
0070   Standard_EXPORT bool IsForcedHilight() const override;
0071 
0072   DEFINE_STANDARD_RTTIEXT(MeshVS_MeshOwner, SelectMgr_EntityOwner)
0073 
0074 protected:
0075   occ::handle<TColStd_HPackedMapOfInteger> mySelectedNodes;
0076   occ::handle<TColStd_HPackedMapOfInteger> mySelectedElems;
0077 
0078 private:
0079   occ::handle<MeshVS_DataSource>           myDataSource;
0080   occ::handle<TColStd_HPackedMapOfInteger> myDetectedNodes;
0081   occ::handle<TColStd_HPackedMapOfInteger> myDetectedElems;
0082   int                                      myLastID;
0083 };
0084 
0085 #endif // _MeshVS_MeshOwner_HeaderFile