MeVisLab Toolbox Reference
WEMGenerator.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 #pragma once
14 
15 #include "WEMBase/WEM.h"
16 #include "WEMModule.h"
17 
18 
19 ML_START_NAMESPACE
20 
22 
28 {
29 public:
30 
32  WEMGenerator(std::string type="WEMGenerator", int numInImages=0,int numOutImages=0, bool shouldGenerateApplyField=true);
33 
34 protected:
35 
37  ~WEMGenerator() override;
38 
39 
40  /* FIELDS */
41 
47 
54 
57 
60 
61  /* STATE VARIABLES */
62 
64  WEMPtr _outWEM;
65 
66 
67  /* METHODS */
68 
70  void handleNotification(Field *field) override;
72  void activateAttachments() override;
75  virtual void _process();
77  virtual void _finish(WEMPatch *wemPatch);
79  virtual void _addWEMPatch(WEMPatch *wemPatch);
81  void _applyFields(WEMPatch *wemPatch);
83  void _applyMetaFields(WEMPatch* wemPatch);
85  virtual void _notifyObservers();
88  void _finishProcessing() override;
89 
90  /* FIELDS */
91 
96 
97 private:
100  IntField* _idFld;
101 
102  /* STATE VARIABLES */
103 
104  std::vector <WEMEventContainer> _delayedEvents;
105 
106  /* METHODS */
107 
110  void _setLabelDescriptionIfOverwrite(bool shouldUpdateImmediately);
111 
113  static void _WEMOwnerCB(void* userData, int notificationFlag, int dataFlag = 0);
114 
117 };
118 
120 
121 ML_END_NAMESPACE
#define MLWEM_EXPORT
Definition: MLWEMSystem.h:18
Field to encapsulate a pointer to an ML base object.
Definition: mlFields.h:1187
Field to encapsulate a boolean value.
Definition: mlFields.h:62
Base class for all fields used in the ML.
Definition: mlField.h:73
Field to encapsulate an integer value.
Definition: mlFields.h:161
Field without value for notifications.
Definition: mlFields.h:1049
Field to encapsulate a string value.
Definition: mlFields.h:1000
The WEMGenerator is the base class for all modules that generate WEMs, be it automatically or interac...
Definition: WEMGenerator.h:28
NotifyField * _applyFld
Apply field, click to start generation.
Definition: WEMGenerator.h:93
void _applyMetaFields(WEMPatch *wemPatch)
Applies meta information parameters to the given WEMPatch.
StringField * _labelFld
Field for changing the 'label' attribute of a WEM.
Definition: WEMGenerator.h:51
BaseField * _outputWEMFld
WEM output field.
Definition: WEMGenerator.h:59
void activateAttachments() override
Initialize module after loading.
WEMGenerator(std::string type="WEMGenerator", int numInImages=0, int numOutImages=0, bool shouldGenerateApplyField=true)
Standard constructor.
void handleNotification(Field *field) override
Called when input changes.
virtual void _finish(WEMPatch *wemPatch)
Finish generation of given WEMPatch.
WEMPtr _outWEM
A pointer to the output WEM.
Definition: WEMGenerator.h:64
virtual void _addWEMPatch(WEMPatch *wemPatch)
Adds a new WEMPatch to the output list and applies the default attributes.
virtual void _process()
Triggers the computation of the generation.
StringField * _descriptionFld
Field for changing the 'description' attribute of a WEM.
Definition: WEMGenerator.h:53
TypedEnumField< WEMUpdateMode > * _updateModeFld
Update mode: defines how the module reacts on any input change.
Definition: WEMGenerator.h:46
void _applyFields(WEMPatch *wemPatch)
Applies the default parameters to the given WEMPatch.
BoolField * _autoApplyFld
Auto apply field.
Definition: WEMGenerator.h:44
virtual void _notifyObservers()
Notify observers with FINISHED | SELECTION | REPAINT message.
BoolField * _overwriteLabelDescriptionFld
Shall the label and the description be overwritten?
Definition: WEMGenerator.h:49
void _finishProcessing() override
Finishing processing: measuring time and optionally apply meta field values.
NotifyField * _clearFld
Clear field, click to clear a module's WEM output (WEM is empty).
Definition: WEMGenerator.h:95
BoolField * _shouldComputeNormalsFld
Should the normals be computed anew on finishing a process?
Definition: WEMGenerator.h:56
~WEMGenerator() override
Standard destructor.
The WEMModule class provides some common fields and methods for WEMProcessors, WEMGenerators and WEMI...
Definition: WEMModule.h:27
Base class for triangle and quad patches.
Definition: WEMPatch.h:48
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.