ML-Module base class to simplify development of modules encapsulating an algorithm with dedicated input and output interface.
More...
#include <mlAlgorithmModule.h>
|
virtual void | validateInput ()=0 |
| Validates the values of module's input fields (object and parameter fields).
|
|
virtual void | update ()=0 |
| Executes the algorithm and updates the values of module's output fields with results.
|
|
virtual void | clear ()=0 |
| Clears the values of module's output fields (object and parameter fields).
|
|
virtual void | setOutputImageProperties (int outputIndex, PagedImage *outputImage) |
| Sets properties of the output image at output outputIndex .
|
|
ML-Module base class to simplify development of modules encapsulating an algorithm with dedicated input and output interface.
The class AlgorithmModule already implements an update behavior and status feedback mechanism including a field interface. A developer of a derivative class has to declare module's input and output fields: The name of an input field has to start with prefix "in" followed by an uppercase letter. The name of an output field has to start with prefix "out" followed by an uppercase letter. Beside this the developer has to overwrite interface methods of base class:
- to validate values of the input fields: validateInput(),
- to update values of the output fields: update(),
- to clear values of the output fields: clear(), and if the module owns output image field(s):
- the interface method to set the properties of the output image(s): setOutputImageProperties().
◆ EStatusCode
Contains possible values of field statusCode
.
Enumerator |
---|
SC_OK | No error occurred.
|
SC_ERROR_INPUT_OBJECT | An invalid input object caused abort of update.
|
SC_ERROR_INPUT_PARAMETER | An invalid input parameter caused abort of update.
|
SC_ERROR_INTERNAL | An internal error caused abort of update.
|
◆ AlgorithmModule()
AlgorithmModule::AlgorithmModule |
( |
int |
numInputImages, |
|
|
int |
numOutputImages |
|
) |
| |
Forwards given parameters to base class constructor.
Creates fields of update control and status feedback interface.
- Parameters
-
numInputImages | Number of input images. |
numOutputImages | Number of output images. |
◆ ~AlgorithmModule()
AlgorithmModule::~AlgorithmModule |
( |
| ) |
|
|
override |
◆ activateAttachments()
void AlgorithmModule::activateAttachments |
( |
| ) |
|
|
override |
Never overwrite this method in derivative!
Updates the internal module state after loading or cloning the module, and enables notification handling again. Related to current value of field onInputChangeBehavior
an update or clear is initiated.
◆ calculateOutputImageProperties()
void AlgorithmModule::calculateOutputImageProperties |
( |
int |
outputIndex, |
|
|
PagedImage * |
outputImage |
|
) |
| |
|
override |
Never overwrite this method in derivative!
Makes sure to call derivative's implementation of setOutputImageProperties() only if update succeeded. Otherwise the output image is invalidated. Handles occurring AlgorithmModule::Error or invalidated output image as result of setOutputImageProperties() and sets status fields accordingly.
- Parameters
-
outputIndex | Index of affected output image field. |
outputImage | Affected output image. |
◆ clear()
virtual void AlgorithmModule::clear |
( |
| ) |
|
|
protectedpure virtual |
◆ handleNotification()
void AlgorithmModule::handleNotification |
( |
Field * |
field | ) |
|
|
override |
Never overwrite this method in derivative!
Handles field changes. When affected field
is identified as an input field than update or clear of module's output fields related to current value of field onInputChangeBehavior
is initiated. Interface fields are also considered:
- update: Initiates update.
- clear: Initiates clear.
- onInputChangeBehavior: Initiates update if value is "Update".
- Parameters
-
field | Affected field whose value was changed. |
◆ setOutputImageProperties()
void AlgorithmModule::setOutputImageProperties |
( |
int |
outputIndex, |
|
|
PagedImage * |
outputImage |
|
) |
| |
|
protectedvirtual |
Sets properties of the output image at output outputIndex
.
- Parameters
-
outputIndex | Index of affected output image field. |
outputImage | Affected output image. |
- Exceptions
-
Reimplemented in AlgorithmModuleExampleWithOutputImage.
◆ update()
virtual void AlgorithmModule::update |
( |
| ) |
|
|
protectedpure virtual |
◆ validateInput()
virtual void AlgorithmModule::validateInput |
( |
| ) |
|
|
protectedpure virtual |
The documentation for this class was generated from the following files:
- C:/jh/mevislab/4.0.2_1/source/FMEstable/ReleaseMeVis/Projects/AlgorithmModule/MLAlgorithmModule/Sources/mlAlgorithmModule.h
- C:/jh/mevislab/4.0.2_1/source/FMEstable/ReleaseMeVis/Projects/AlgorithmModule/MLAlgorithmModule/Sources/mlAlgorithmModule.cpp