summaryrefslogtreecommitdiff
path: root/inc/SelectMgr_SelectionManager.hxx
blob: d9237e04af93c92c3086d6565c345e817d2c84b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _SelectMgr_SelectionManager_HeaderFile
#define _SelectMgr_SelectionManager_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_SelectMgr_SelectionManager_HeaderFile
#include <Handle_SelectMgr_SelectionManager.hxx>
#endif

#ifndef _TColStd_MapOfTransient_HeaderFile
#include <TColStd_MapOfTransient.hxx>
#endif
#ifndef _SelectMgr_DataMapOfObjectSelectors_HeaderFile
#include <SelectMgr_DataMapOfObjectSelectors.hxx>
#endif
#ifndef _MMgt_TShared_HeaderFile
#include <MMgt_TShared.hxx>
#endif
#ifndef _Handle_SelectMgr_ViewerSelector_HeaderFile
#include <Handle_SelectMgr_ViewerSelector.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_SelectMgr_SelectableObject_HeaderFile
#include <Handle_SelectMgr_SelectableObject.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _SelectMgr_TypeOfUpdate_HeaderFile
#include <SelectMgr_TypeOfUpdate.hxx>
#endif
class SelectMgr_ViewerSelector;
class SelectMgr_SelectableObject;
class TCollection_AsciiString;


//! A framework to manage selection from the point of <br>
//! view of viewer selectors. These can be added and <br>
//! removed, and selection modes can be activated and <br>
//! deactivated. In addition, objects may be known to all <br>
//! selectors or only to some. <br>
class SelectMgr_SelectionManager : public MMgt_TShared {

public:

  //! Constructs an empty selection manager object. <br>
  Standard_EXPORT   SelectMgr_SelectionManager();
  //! Adds the viewer selector aSelector to this framework. <br>
  Standard_EXPORT     void Add(const Handle(SelectMgr_ViewerSelector)& aSelector) ;
  
  Standard_EXPORT     void Remove(const Handle(SelectMgr_ViewerSelector)& aSelector) ;
  
//! Returns true if this framework contains the viewer selector aSelector. <br>
  Standard_EXPORT     Standard_Boolean Contains(const Handle(SelectMgr_ViewerSelector)& aSelector) const;
  //! Returns true if this framework contains the <br>
//! selectable object aSelectableObject. <br>
  Standard_EXPORT     Standard_Boolean Contains(const Handle(SelectMgr_SelectableObject)& aSelectableObject) const;
  //!  Loads and computes one  mode of <br>
//!        selection if  <aMode> notequal -1 ; <br>
//!         if  <anObject> already has a <br>
//!        selection with this mode, it's emptied and the sensitive <br>
//!        entities are computed  for this mode else one  Selection <br>
//!        is created with this mode before computing. <br>
  Standard_EXPORT     void Load(const Handle(SelectMgr_SelectableObject)& anObject,const Standard_Integer aMode = -1) ;
  //!   Local    object  available for <br>
//!        <aSelector> Only.  the sensitive entities for  selection <br>
//!        of mode <aMode> are computed if <aMode> not equal -1. <br>
//!        if <aMode> =-1 oc compute is done <br>
  Standard_EXPORT     void Load(const Handle(SelectMgr_SelectableObject)& anObject,const Handle(SelectMgr_ViewerSelector)& aSelector,const Standard_Integer aMode = -1) ;
  //! removes the object from All the ViewerSelectors where it was; <br>
  Standard_EXPORT     void Remove(const Handle(SelectMgr_SelectableObject)& anObject) ;
  //! removes the object from aSelector; <br>
  Standard_EXPORT     void Remove(const Handle(SelectMgr_SelectableObject)& anObject,const Handle(SelectMgr_ViewerSelector)& aSelector) ;
  //! Activates the selection mode aMode in a selector <br>
//! for the selectable object anObject. <br>
  Standard_EXPORT     void Activate(const Handle(SelectMgr_SelectableObject)& anObject,const Standard_Integer aMode = 0,const Standard_Boolean AutomaticProj = Standard_True) ;
  //! Activates the selection mode aMode in the selector <br>
//! aSelector for the selectable object anObject. <br>
  Standard_EXPORT     void Activate(const Handle(SelectMgr_SelectableObject)& anObject,const Standard_Integer aMode,const Handle(SelectMgr_ViewerSelector)& aSelector,const Standard_Boolean AutomaticProj = Standard_True) ;
  //! Deactivate all the activated modes in any <br>
//!          Selector for <anObject> <br>
  Standard_EXPORT     void Deactivate(const Handle(SelectMgr_SelectableObject)& anObject) ;
  //! Deactivates the Mode <aMode> in every Selector where <br>
//!          it was activated <br>
  Standard_EXPORT     void Deactivate(const Handle(SelectMgr_SelectableObject)& anObject,const Standard_Integer aMode) ;
  //! Deactivates the selection mode aMode in the <br>
//! selector aSelector for the selectable object anObject. <br>
  Standard_EXPORT     void Deactivate(const Handle(SelectMgr_SelectableObject)& anObject,const Standard_Integer aMode,const Handle(SelectMgr_ViewerSelector)& aSelector) ;
  //! Deactivates all selection modes in the selector <br>
//!  aSelector for the selectable object anObject. <br>
  Standard_EXPORT     void Deactivate(const Handle(SelectMgr_SelectableObject)& anObject,const Handle(SelectMgr_ViewerSelector)& aSelector) ;
  //! Ensures that no object in the selector aSelector will be active. <br>
  Standard_EXPORT     void Sleep(const Handle(SelectMgr_ViewerSelector)& aSelector) ;
  //! the objet is temporarily deactivated everywhere it was activated. <br>
  Standard_EXPORT     void Sleep(const Handle(SelectMgr_SelectableObject)& anObject) ;
  //! Different from Deactivate; this method <br>
//!          deactivates the activated modes of an object, <br>
//!          but just for a time; when the Awake Method is called <br>
//!          the sleeping modes are reactivated. <br>
  Standard_EXPORT     void Sleep(const Handle(SelectMgr_SelectableObject)& anObject,const Handle(SelectMgr_ViewerSelector)& aSelector) ;
  //! activates all the deactivated objects in a selector. <br>
  Standard_EXPORT     void Awake(const Handle(SelectMgr_ViewerSelector)& aSelector,const Standard_Boolean AutomaticProj = Standard_True) ;
  
  Standard_EXPORT     void Awake(const Handle(SelectMgr_SelectableObject)& anObject,const Standard_Boolean AutomaticProj = Standard_True) ;
  //! activates all the deactivated modes <br>
//!          of an object in a selector <br>
  Standard_EXPORT     void Awake(const Handle(SelectMgr_SelectableObject)& anObject,const Handle(SelectMgr_ViewerSelector)& aSelector,const Standard_Boolean AutomaticProj = Standard_True) ;
  //! Returns true if the selection is active for the selectable object anObject. <br>
  Standard_EXPORT     Standard_Boolean IsActivated(const Handle(SelectMgr_SelectableObject)& anObject) const;
  //! Returns true if the selection mode aMode is active for the selectable object anObject. <br>
  Standard_EXPORT     Standard_Boolean IsActivated(const Handle(SelectMgr_SelectableObject)& anObject,const Standard_Integer aMode) const;
  //! Returns true if the selection mode aMode is active for the selectable <br>
//!          object anObject in the viewer selector aSelector. <br>
  Standard_EXPORT     Standard_Boolean IsActivated(const Handle(SelectMgr_SelectableObject)& anObject,const Handle(SelectMgr_ViewerSelector)& aSelector,const Standard_Integer aMode) const;
  //! computes Selections in <anIObj> if they are <br>
//!          activated in at least one Selector. <br>
//!          puts a recompute flag in each selection which is not active. <br>
//!          if <aMode>=-1 all the selection modes will have to be <br>
//!          recomputed. <br>
//!          if <ForceUpdate>  = True, all selections are recomputed, <br>
//!          even if they are not active. <br>
  Standard_EXPORT     void RecomputeSelection(const Handle(SelectMgr_SelectableObject)& anIObj,const Standard_Boolean ForceUpdate = Standard_False,const Standard_Integer aMode = -1) ;
  //! updates the selectionModes of <anObject> <br>
//!          According to <br>
//!          . the stored type of update in each selection <br>
//!          mode, <br>
//!          . the activation status of each selection mode <br>
//!          if <ForceUpdate> == True Recompute <br>
  Standard_EXPORT     void Update(const Handle(SelectMgr_SelectableObject)& anObject,const Standard_Boolean ForceUpdate = Standard_True) ;
  
  Standard_EXPORT     void Update(const Handle(SelectMgr_SelectableObject)& anObject,const Handle(SelectMgr_ViewerSelector)& aSelector,const Standard_Boolean ForceUpdate = Standard_True) ;
  
  Standard_EXPORT     void SetUpdateMode(const Handle(SelectMgr_SelectableObject)& anObject,const SelectMgr_TypeOfUpdate aType) ;
  
  Standard_EXPORT     void SetUpdateMode(const Handle(SelectMgr_SelectableObject)& anObject,const Standard_Integer aSelMode,const SelectMgr_TypeOfUpdate aType) ;
  
  Standard_EXPORT     TCollection_AsciiString Status() const;
  
  Standard_EXPORT     TCollection_AsciiString Status(const Handle(SelectMgr_SelectableObject)& anObject) const;




  DEFINE_STANDARD_RTTI(SelectMgr_SelectionManager)

protected:




private: 

  
  Standard_EXPORT     void LoadMode(const Handle(SelectMgr_SelectableObject)& anObject,const Standard_Integer aMode) ;

TColStd_MapOfTransient myselectors;
TColStd_MapOfTransient myglobal;
SelectMgr_DataMapOfObjectSelectors mylocal;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif