f751596e |
1 | // Created on: 2014-08-15 |
2 | // Created by: Varvara POSKONINA |
3 | // Copyright (c) 2005-2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
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. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _SelectMgr_SensitiveEntity_HeaderFile |
17 | #define _SelectMgr_SensitiveEntity_HeaderFile |
18 | |
19 | #include <SelectBasics_SensitiveEntity.hxx> |
7ab15952 |
20 | #include <Standard.hxx> |
ec357c5c |
21 | #include <Standard_Type.hxx> |
f751596e |
22 | |
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 |
7ab15952 |
25 | class SelectMgr_SensitiveEntity : public Standard_Transient |
f751596e |
26 | { |
27 | public: |
28 | |
29 | //! Creates new inactive for selection object with base entity theEntity |
0ef04197 |
30 | Standard_EXPORT SelectMgr_SensitiveEntity (const Handle(Select3D_SensitiveEntity)& theEntity); |
f751596e |
31 | |
32 | ~SelectMgr_SensitiveEntity() {} |
33 | |
34 | //! Clears up all resources and memory |
1f3913c6 |
35 | Standard_EXPORT void Clear(); |
f751596e |
36 | |
37 | //! Returns related instance of SelectBasics class |
0ef04197 |
38 | const Handle(Select3D_SensitiveEntity)& BaseSensitive() const { return mySensitive; } |
f751596e |
39 | |
40 | //! Returns true if this entity belongs to the active selection |
41 | //! mode of parent object |
f5b72419 |
42 | Standard_Boolean IsActiveForSelection() const { return myIsActiveForSelection; } |
f751596e |
43 | |
44 | //! Marks entity as inactive for selection |
f5b72419 |
45 | void ResetSelectionActiveStatus() const { myIsActiveForSelection = Standard_False; } |
f751596e |
46 | |
47 | //! Marks entity as active for selection |
f5b72419 |
48 | void SetActiveForSelection() const { myIsActiveForSelection = Standard_True; } |
f751596e |
49 | |
92efcf78 |
50 | DEFINE_STANDARD_RTTIEXT(SelectMgr_SensitiveEntity,Standard_Transient) // Type definition |
7ab15952 |
51 | |
f751596e |
52 | private: |
53 | |
0ef04197 |
54 | Handle(Select3D_SensitiveEntity) mySensitive; //!< Related SelectBasics entity |
55 | mutable Standard_Boolean myIsActiveForSelection; //!< Selection activity status |
f751596e |
56 | }; |
57 | |
7ab15952 |
58 | DEFINE_STANDARD_HANDLE(SelectMgr_SensitiveEntity, Standard_Transient) |
59 | |
f751596e |
60 | #endif // _SelectMgr_SensitiveEntity_HeaderFile |