MeVisLab Toolbox Reference
mlEditObject.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_EDIT_OBJECT_H
14 #define ML_EDIT_OBJECT_H
15 
16 
18 
19 #include "mlParserSystem.h"
20 #include "mlEngine.h"
21 #include "mlModuleIncludes.h"
22 
23 #include <string>
24 
25 ML_START_NAMESPACE
26 
30  {
31  public:
32 
34  typedef enum {
35  AutoUpdateModeDoNothing = 0,
38  AutoUpdateModeCount
39  } AutoUpdateMode;
40 
43 
45  ~EditObject() override;
46 
48  virtual void deleteObject(void);
49 
51  virtual int loadObject(void);
52 
54  virtual int updateObject(void);
55 
59 
61 
64 
66 
69 
71 
72  protected:
73 
76  void activateAttachments() override;
77 
79  void handleNotification (Field *field) override;
80 
83 
86 
88  std::string _objectString;
89 
90  private:
91 
94 
96  static const char* AutoUpdateModeNames[];
97 
98  }; // class EditObject
99 
100 ML_END_NAMESPACE
101 
102 #endif
Field to encapsulate a pointer to an ML base object.
Definition: mlFields.h:1187
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Definition: mlBase.h:62
Field to encapsulate a boolean value.
Definition: mlFields.h:62
allows to edit an ml::base-derived object via its XML description.
Definition: mlEditObject.h:30
Base * _outputObject
object behind _fldBaseOutput
Definition: mlEditObject.h:82
void handleNotification(Field *field) override
Handle field notifications.
StringField * _fldStatus
oper status
Definition: mlEditObject.h:70
Base * _inputObject
object behind _fldBaseInput
Definition: mlEditObject.h:85
BaseField * _fldBaseInput
Input connection.
Definition: mlEditObject.h:68
BoolField * _fldAutoLoad
Auto-load input object on notify.
Definition: mlEditObject.h:62
virtual int updateObject(void)
creates a new output object from the editor
virtual void deleteObject(void)
deletes the current output object
BaseField * _fldBaseOutput
Output connection.
Definition: mlEditObject.h:67
EditObject()
constructor:
NotifyField * _fldDeleteButton
Delete output object.
Definition: mlEditObject.h:58
StringField * _fldObjectString
String representation of object, and thus current editor state.
Definition: mlEditObject.h:65
NotifyField * _fldLoadButton
Load input object to editor.
Definition: mlEditObject.h:57
~EditObject() override
destructor:
NotifyField * _fldUpdateButton
Update output object.
Definition: mlEditObject.h:56
std::string _objectString
current editor string
Definition: mlEditObject.h:88
EnumField * _fldAutoUpdateMode
Auto-update mode. Use anything other than Auto-Delete with care.
Definition: mlEditObject.h:60
@ AutoUpdateModeAutoUpdate
Definition: mlEditObject.h:37
virtual int loadObject(void)
loads the input object into editor
BoolField * _fldUpToDate
Indicates whether the current output is consistent with the editor representation.
Definition: mlEditObject.h:63
void activateAttachments() override
resets fldUpToDate, calls handleNotification once after the module is loaded on the network and all f...
Base class for all ML Engines which are derived from Module, which have no inputs or outputs and whic...
Definition: mlEngine.h:30
Field to encapsulate an enumerated value.
Definition: mlFields.h:363
Base class for all fields used in the ML.
Definition: mlField.h:73
Field without value for notifications.
Definition: mlFields.h:1049
Field to encapsulate a string value.
Definition: mlFields.h:1000
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
#define PARSER_EXPORT
Definiert systemspezifische Macros, die f"ur diese DLL gelten sollen.