MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
WEMProcessor.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 "WEMGenerator.h"
18
19
21
23
30{
31public:
33 WEMProcessor(std::string type = "WEMProcessor", bool useInput = true, int numInImages = 0, int numOutImages = 0,
34 std::string inWEMFieldName = "inWEM");
35
36protected:
38 ~WEMProcessor() override;
39
40
41 /* FIELDS */
42
46
49
50
51 /* STATE VARIABLES */
52
57
60
63 {
64 return _requirements;
65 }
66
68 inline bool areEdgesRequired()
69 {
70 return _requirements->areEdgesRequired();
71 }
74 {
75 return _requirements->isSinglePatchRequired();
76 }
79 {
80 return _requirements->isPatchTypeRequired(patchType);
81 }
84 {
85 return _requirements->isOrientationTypeRequired(orientationType);
86 }
87
89 inline void requireEdges(bool requireEdgesFlag = true)
90 {
91 _requirements->requireEdges(requireEdgesFlag);
92 }
95 {
96 _requirements->requireSinglePatch(requireSinglePatchFlag);
97 }
100 {
101 _requirements->requirePatchType(patchType);
102 }
105 {
106 _requirements->requireOrientationType(orientationType);
107 }
108
112
113
114 /* METHODS */
115
119 void activateAttachments() override;
121 void _process() override;
122
126 virtual void _addWEMPatch(WEMPatch* wemPatch, bool mergeAllPatches = false);
128 void _notifyObservers() override;
129
131 static void _wemInputNotificationCB(void* userData, std::vector<WEMEventContainer> ecList);
132
137
140
141private:
142 void _addWEMPatch(ml::WEMPatch*) override
143 {}
144 /* FIELDS */
145
147 BoolField* _listenToFinishNotificationsFld;
149 BoolField* _listenToRepaintNotificationsFld;
151 BoolField* _listenToSelectionChangedNotificationsFld;
152
153 /* METHODS */
154
158 void _warnAboutInvalidUpdateModeOrAutoApplyFieldConfiguration();
159
162 void _setupOutputWEM();
164 void _copyInputWEMToOutputWEMMakeCompatible();
166 bool _doesMakeCompatibleCreateNew(WEMPatch* wemPatch);
167
168 /* VARIABLES */
169
171 WEMRequirements* _requirements;
172
175};
176
178
#define MLWEM_EXPORT
Definition MLWEMSystem.h:18
Field to encapsulate a pointer to an ML base object.
Definition mlFields.h:813
Field to encapsulate a boolean value.
Definition mlFields.h:56
Base class for all fields used in the ML.
Definition mlField.h:73
Field to encapsulate an increasing float value from range [0,1].
Definition mlFields.h:519
TypedEnumField is used to encapsulate a C++ enum value and work with a real enum value instead of int...
Definition mlFields.h:398
The WEMGenerator is the base class for all modules that generate WEMs, be it automatically or interac...
virtual void _addWEMPatch(WEMPatch *wemPatch)
Adds a new WEMPatch to the output list and applies the default attributes.
Base class for triangle and quad patches.
Definition WEMPatch.h:61
The WEMProcessor is the base class for all modules that process WEMs, be it automatically or interact...
void _copyWEMPatch(WEMPatch *wemPatch)
Copy given WEM.
bool _forceCompatible
Make compatible during creation of _outWEM? If new patches are created, _copyInputWEMs is set to true...
TypedEnumField< TriangulationModes > * _triangulationModeFld
Triangulation mode (used to get compatible patch on requireTriangulation).
bool _isNotifyingMyself
Is this module notifying itself?
bool _isInNotificationCB
Is this module currently in the notification callback?
bool isOrientationTypeRequired(OrientationTypes orientationType)
Is orientation type required?
void _process() override
Triggers the computation of the preprocessing.
bool areEdgesRequired()
Are edges required?
void requirePatchType(PatchTypes patchType)
Require patch type.
WEMPatch * _makeCompatible(WEMPatch *wemPatch)
Make given WEMPatch compatible with module requirements.
static void _wemInputNotificationCB(void *userData, std::vector< WEMEventContainer > ecList)
Callback method that gets triggered on notifications sent to the input WEM.
WEMRequirements * getRequirements()
Get requirements.
bool isSinglePatchRequired()
Is a single patch required?
void requireOrientationType(OrientationTypes orientationType)
Require orientation type.
bool isPatchTypeRequired(PatchTypes patchType)
Is patch type required?
~WEMProcessor() override
Standard destructor.
void requireSinglePatch(bool requireSinglePatchFlag=true)
Require single patch.
void _notifyObservers() override
Notify observers with FINISHED | SELECTION | REPAINT message.
virtual void _addWEMPatch(WEMPatch *wemPatch, bool mergeAllPatches=false)
Adds a new WEMPatch to the output list and optionally applies the default attributes.
void handleNotification(Field *field) override
Called when input changes.
BaseField * _inputWEMFld
Input WEM list field.
void activateAttachments() override
Initialize module after loading.
void requireEdges(bool requireEdgesFlag=true)
Require edges.
WEM * _inWEM
Pointer to inWEM.
WEMProcessor(std::string type="WEMProcessor", bool useInput=true, int numInImages=0, int numOutImages=0, std::string inWEMFieldName="inWEM")
Standard constructor.
BoolField * _workDirectlyOnInputWEMsFld
ProgressField * _progressFld
Progress field.
This class represents WEMPatch requirements to be used by WEMProcessor.
A WEM comprises a number of WEMPatches.
Definition WEM.h:86
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non-existing export symbol.
OrientationTypes
Enumeration of orientation types.
PatchTypes
Enumeration of mesh types.