MeVisLab Toolbox Reference
CSOScopeEvents.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2012, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 
18 
19 #pragma once
20 
21 #include "MLCSOIncludes.h"
22 #include "CSOEvent.h"
23 
24 ML_START_NAMESPACE
25 
26 class CSOList;
27 
29 
32 {
33 public:
34  CSOChangeEventScope(CSOList* csoList, unsigned int id, CSOEvent::CSOEventType eventType);
36 protected:
38  unsigned int _id;
40 };
41 
43 
47 {
48 public:
50  const std::string& senderType="",
51  const std::string& senderName="",
52  const std::string& customMessage="",
53  CSOIdVector csoIds = CSOIdVector());
54 
56 
57  MLuint64 getUniqueId() { return _uniqueId; }
58 
59 private:
60  MLuint64 _uniqueId;
61 
62  std::string _senderType;
63  std::string _senderName;
64  std::string _customMessage;
65 
66  CSOList* _csoList;
67 };
68 
70 
73 {
74 public:
75  CSOAttributeChangeScope(CSOList* csoList, unsigned int csoId, CSOEvent::CSOEventType eventType);
76 };
77 
79 
82 {
83 public:
84  CSOGeometryChangeScope(CSOList* csoList, unsigned int csoId);
86 };
87 
89 
92 {
93 public:
94  CSOModificationScope(CSOList* csoList, unsigned int csoId);
96 };
97 
99 
102 {
103 public:
104  CSOGroupChangeEventScope(CSOList* csoList, unsigned int groupId, CSOEvent::CSOEventType eventType);
106 protected:
108  unsigned int _groupId;
110 };
111 
113 
116 {
117 public:
118  CSOGroupAttributeChangeScope(CSOList* csoList, unsigned int csoId, CSOEvent::CSOEventType eventType);
119 };
120 
122 
125 {
126 public:
129  void setId(unsigned int groupId) { _groupId = groupId; }
130 private:
131  CSOList* _csoList;
132  unsigned int _groupId;
133 };
134 
136 
139 {
140 public:
141  CSOAddScope(CSOList* csoList);
143  void setId(unsigned int csoId) { _csoId = csoId; }
144 private:
145  CSOList* _csoList;
146  unsigned int _csoId;
147 };
148 
150 
153 {
154 public:
157  void setId(unsigned int csoId) { _csoId = csoId; }
158 private:
159  CSOList* _csoList;
160  unsigned int _csoId;
161 };
162 
163 
165 
168 {
169 public:
170  CSOSelectionChangeScope(CSOList* csoList, unsigned int csoId);
171  CSOSelectionChangeScope(CSOList* csoList, const CSOIdVector& csoIds);
173 
174 private:
175  void _sendPreEvent();
176  CSOList* _csoList;
177  CSOIdVector _csoIds;
178 };
179 
181 
184 {
185 public:
186  CSOGroupSelectionChangeScope(CSOList* csoList, unsigned int groupId);
189 
190 private:
191  void _sendPreEvent();
192  CSOList* _csoList;
193  CSOIdVector _groupIds;
194 };
195 
197 
199 
202 {
203 public:
204  CSOAddToGroupScope(CSOList* csoList, unsigned int csoId, unsigned int groupId);
206 private:
207  CSOList* _csoList;
208  unsigned int _csoId;
209  unsigned int _groupId;
210 };
211 
213 
216 {
217 public:
218  CSORemoveFromGroupScope(CSOList* csoList, unsigned int csoId, unsigned int groupId);
219  CSORemoveFromGroupScope(CSOList* csoList, const CSOIdVector& csoIds, unsigned int groupId);
220  CSORemoveFromGroupScope(CSOList* csoList, unsigned int csoId, const CSOIdVector& groupIds);
222 
223 private:
224  bool _shouldSendEvents();
225  void _sendPreEvent();
226  CSOList* _csoList;
227  CSOIdVector _csoIds;
228  CSOIdVector _groupIds;
229 };
230 
231 ML_END_NAMESPACE
std::vector< unsigned int > CSOIdVector
Defines a vector to hold CSO and CSOGroup ids.
Definition: MLCSOIncludes.h:63
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
Definition: MLCSOSystem.h:23
Class for sending event if a CSO has been added.
void setId(unsigned int csoId)
CSOAddScope(CSOList *csoList)
Class for sending events if a CSO was added to a Group.
CSOAddToGroupScope(CSOList *csoList, unsigned int csoId, unsigned int groupId)
Class for sending events if visual attribute of a CSO have changed.
CSOAttributeChangeScope(CSOList *csoList, unsigned int csoId, CSOEvent::CSOEventType eventType)
Base class for event grouping / pre-/post-command of changes of a CSO.
CSOChangeEventScope(CSOList *csoList, unsigned int id, CSOEvent::CSOEventType eventType)
CSOEvent::CSOEventType _eventType
Class for sending event if a CSO has been created.
CSOCreationScope(CSOList *csoList)
void setId(unsigned int csoId)
CSOEventType
Enumeration for specifying the exact type of event.
Definition: CSOEvent.h:49
Class for sending events if the geometry of a CSO has changed.
CSOGeometryChangeScope(CSOList *csoList, unsigned int csoId)
Class for sending events if a CSOGroup has been added.
void setId(unsigned int groupId)
CSOGroupAddScope(CSOList *csoList)
Class for sending events if visual attributes of a CSOGroup have changed.
CSOGroupAttributeChangeScope(CSOList *csoList, unsigned int csoId, CSOEvent::CSOEventType eventType)
Base class for event grouping / pre-/post-command of changes of a CSOGroup.
CSOGroupChangeEventScope(CSOList *csoList, unsigned int groupId, CSOEvent::CSOEventType eventType)
CSOEvent::CSOEventType _eventType
Class for sending events if the selection of CSOGroups has been changed.
CSOGroupSelectionChangeScope(CSOList *csoList, unsigned int groupId)
CSOGroupSelectionChangeScope(CSOList *csoList, const CSOIdVector &groupIds)
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Definition: CSOList.h:61
Class for sending events if a CSO was changed by an algorithm.
CSOModificationScope(CSOList *csoList, unsigned int csoId)
This class is to be used in modules, not in the CSO base library.
CSOModuleEventGroupScope(CSOList *csoList, const std::string &senderType="", const std::string &senderName="", const std::string &customMessage="", CSOIdVector csoIds=CSOIdVector())
Class for sending events if a CSO was removed from a Group.
CSORemoveFromGroupScope(CSOList *csoList, const CSOIdVector &csoIds, unsigned int groupId)
CSORemoveFromGroupScope(CSOList *csoList, unsigned int csoId, const CSOIdVector &groupIds)
CSORemoveFromGroupScope(CSOList *csoList, unsigned int csoId, unsigned int groupId)
Class for sending events if the selection of CSOs has been changed.
CSOSelectionChangeScope(CSOList *csoList, const CSOIdVector &csoIds)
CSOSelectionChangeScope(CSOList *csoList, unsigned int csoId)
The CSO represents a contour segmentation object.
Definition: CSO.h:44
UINT64 MLuint64
Introduce platform independent 64 bit unsigned integer type.
Definition: mlTypeDefs.h:513