Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 09:21:52

0001 // Created on: 2014-08-15
0002 // Created by: Varvara POSKONINA
0003 // Copyright (c) 2005-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 _SelectMgr_SensitiveEntity_HeaderFile
0017 #define _SelectMgr_SensitiveEntity_HeaderFile
0018 
0019 #include <Select3D_SensitiveEntity.hxx>
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 //! The purpose of this class is to mark sensitive entities selectable or not
0024 //! depending on current active selection of parent object for proper BVH traverse
0025 class SelectMgr_SensitiveEntity : public Standard_Transient
0026 {
0027 public:
0028   //! Creates new inactive for selection object with base entity theEntity
0029   Standard_EXPORT SelectMgr_SensitiveEntity(const occ::handle<Select3D_SensitiveEntity>& theEntity);
0030 
0031   ~SelectMgr_SensitiveEntity() override = default;
0032 
0033   //! Clears up all resources and memory
0034   Standard_EXPORT void Clear();
0035 
0036   //! Returns related instance of SelectBasics class
0037   const occ::handle<Select3D_SensitiveEntity>& BaseSensitive() const { return mySensitive; }
0038 
0039   //! Returns true if this entity belongs to the active selection
0040   //! mode of parent object
0041   bool IsActiveForSelection() const { return myIsActiveForSelection; }
0042 
0043   //! Marks entity as inactive for selection
0044   void ResetSelectionActiveStatus() const { myIsActiveForSelection = false; }
0045 
0046   //! Marks entity as active for selection
0047   void SetActiveForSelection() const { myIsActiveForSelection = true; }
0048 
0049   //! Dumps the content of me into the stream
0050   Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const;
0051 
0052   DEFINE_STANDARD_RTTIEXT(SelectMgr_SensitiveEntity, Standard_Transient) // Type definition
0053 
0054 private:
0055   occ::handle<Select3D_SensitiveEntity> mySensitive;            //!< Related SelectBasics entity
0056   mutable bool                          myIsActiveForSelection; //!< Selection activity status
0057 };
0058 
0059 #endif // _SelectMgr_SensitiveEntity_HeaderFile