MeVisLab Toolbox Reference
mlFieldSensor.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, 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#ifndef ML_FIELD_SENSOR_H
14#define ML_FIELD_SENSOR_H
15
21
22//ML-includes
23#include "mlInitSystemML.h"
24
26
28class Field;
30
31//------------------------------------------------------------------------------------
37//------------------------------------------------------------------------------------
39{
40
41public:
42
44 enum Strength { NO_NOTIFICATION = 0,
45 NO_CHANGE = 1,
46 CHANGED = 2
47 };
48
55
57 virtual ~FieldSensor();
58
64
69
74
76 Field* getField() const;
77
84
85private:
86 friend class Field;
87
89 void attachFieldInternal(Field* field);
90
92 Field* _attachedField;
93
95 MLSensorCB* _callbackFunc;
96
98 void* _userData;
99
101 Strength _notificationStrength;
102};
103
104
106
107#endif // __mlFieldSensor_H
108
109
110
111
112
113
Class to define and to manage field sensors.
virtual ~FieldSensor()
Destructor: Disconnects field sensor from the connected field and clear.
FieldSensor(MLSensorCB *callbackFunction, void *userData)
Creates a field sensor with callback function callback and a parameter userData.
void attachField(Field *field)
Attaches a field sensor to a the field field.
void callback(Strength notificationStrength=CHANGED)
Executes the callback function set by the constructor.
Strength getNotificationStrength() const
Returns the notification level, i.e., how strong the current notification is.
void detachField()
Detaches the field sensor from the most recently attached field.
Strength
Enumeration type describing the strength of notifications.
Field * getField() const
Returns the field connected to the field sensor.
Base class for all fields used in the ML.
Definition mlField.h:73
#define MLEXPORT
To export symbols from a dll/shared object, we need to mark them with the MLEXPORT symbol.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
void MLSensorCB(void *usrData, void *sensor)