Back to home page

EIC code displayed by LXR

 
 

    


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

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 
0029   //! Creates new inactive for selection object with base entity theEntity
0030   Standard_EXPORT SelectMgr_SensitiveEntity (const Handle(Select3D_SensitiveEntity)& theEntity);
0031 
0032   ~SelectMgr_SensitiveEntity() {}
0033 
0034   //! Clears up all resources and memory
0035   Standard_EXPORT void Clear();
0036 
0037   //! Returns related instance of SelectBasics class
0038   const Handle(Select3D_SensitiveEntity)& BaseSensitive() const { return mySensitive; }
0039 
0040   //! Returns true if this entity belongs to the active selection
0041   //! mode of parent object
0042   Standard_Boolean IsActiveForSelection() const { return myIsActiveForSelection; }
0043 
0044   //! Marks entity as inactive for selection
0045   void ResetSelectionActiveStatus() const { myIsActiveForSelection = Standard_False; }
0046 
0047   //! Marks entity as active for selection
0048   void SetActiveForSelection() const { myIsActiveForSelection = Standard_True; }
0049 
0050   //! Dumps the content of me into the stream
0051   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0052 
0053   DEFINE_STANDARD_RTTIEXT(SelectMgr_SensitiveEntity,Standard_Transient) // Type definition
0054 
0055 private:
0056 
0057   Handle(Select3D_SensitiveEntity) mySensitive;      //!< Related SelectBasics entity
0058   mutable Standard_Boolean         myIsActiveForSelection;       //!< Selection activity status
0059 };
0060 
0061 DEFINE_STANDARD_HANDLE(SelectMgr_SensitiveEntity, Standard_Transient)
0062 
0063 #endif // _SelectMgr_SensitiveEntity_HeaderFile