1 // Created on: 2014-08-15
2 // Created by: Varvara POSKONINA
3 // Copyright (c) 2005-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 _SelectMgr_SensitiveEntity_HeaderFile
17 #define _SelectMgr_SensitiveEntity_HeaderFile
19 #include <SelectBasics_SensitiveEntity.hxx>
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 //! The purpose of this class is to mark sensitive entities selectable or not
24 //! depending on current active selection of parent object for proper BVH traverse
25 class SelectMgr_SensitiveEntity : public Standard_Transient
29 //! Creates new inactive for selection object with base entity theEntity
30 Standard_EXPORT SelectMgr_SensitiveEntity (const Handle(Select3D_SensitiveEntity)& theEntity);
32 ~SelectMgr_SensitiveEntity() {}
34 //! Clears up all resources and memory
35 Standard_EXPORT void Clear();
37 //! Returns related instance of SelectBasics class
38 const Handle(Select3D_SensitiveEntity)& BaseSensitive() const { return mySensitive; }
40 //! Returns true if this entity belongs to the active selection
41 //! mode of parent object
42 Standard_Boolean IsActiveForSelection() const { return myIsActiveForSelection; }
44 //! Marks entity as inactive for selection
45 void ResetSelectionActiveStatus() const { myIsActiveForSelection = Standard_False; }
47 //! Marks entity as active for selection
48 void SetActiveForSelection() const { myIsActiveForSelection = Standard_True; }
50 //! Dumps the content of me into the stream
51 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
53 DEFINE_STANDARD_RTTIEXT(SelectMgr_SensitiveEntity,Standard_Transient) // Type definition
57 Handle(Select3D_SensitiveEntity) mySensitive; //!< Related SelectBasics entity
58 mutable Standard_Boolean myIsActiveForSelection; //!< Selection activity status
61 DEFINE_STANDARD_HANDLE(SelectMgr_SensitiveEntity, Standard_Transient)
63 #endif // _SelectMgr_SensitiveEntity_HeaderFile