MeVisLabToolboxReference
|
Base class for performing modifications on the CSOs of a CSOList. More...
#include <CSOModificator.h>
Public Member Functions | |
CSOModificator (const std::string &type="CSOModificator", int numInImages=0, int numOutImages=0) | |
Standard constructor. | |
Protected Member Functions | |
virtual | ~CSOModificator () |
Standard destructor. | |
virtual void | activateAttachments () |
Initialize module after loading. | |
virtual void | handleNotification (Field *field) |
Called when input changes. | |
virtual void | reset () |
Resets parameteres of the modificator. | |
virtual void | process () |
Sets up the CSOList, applies the modificator to the CSOList and notifies other modules that processing has finished. | |
virtual void | _setupCSOList () |
Sets the _outCSOList correctly. | |
virtual bool | _applyModificator () |
Applies the modification to the CSOs of the attached list. | |
virtual void | _notifyObservers () |
Notifies other modules that processing has finished. | |
bool | _isInIdList (CSO *cso) |
Checks if the given CSO is in the list of IDs given by _csoIdListFld. | |
void | _parseCSOIds (std::set< unsigned int > &ids) |
Parse the CSO id field into the given vector of ids. | |
void | _applyChangedSettings (CSO *cso) const |
Changes the settings of the given CSO (only if _changeSettingsForModifiedCSOsFld is true). | |
ML_MODULE_CLASS_HEADER (CSOModificator) | |
Static Protected Member Functions | |
static void | _csoListNotifyObserverCB (void *userData, int notificationFlag) |
Can be called from anywhere from the network. | |
Protected Attributes | |
BaseField * | _inputCSOListFld |
The input CSOList. | |
BaseField * | _outputCSOListFld |
The filtered output CSOList. | |
StringField * | _csoIdListFld |
The list of ids of the CSOs to be transformed; if this list is empty, all CSOs are transformed. | |
BoolField * | _workDirectlyOnInputListFld |
Shall the module work directly on the input CSOList? Otherwise, it would work on a copy which is returned by the output field. | |
BoolField * | _listenToFinishingNotificationsFld |
Shall the module listen to finishing events? | |
BoolField * | _listenToSelectionNotificationsFld |
Shall the module listen to selection change notifications? | |
BoolField * | _changeSettingsForModifiedCSOsFld |
Shall the module's user settings be used for modified CSOs? | |
CSOList * | _inCSOList |
A pointer to the input CSOList. | |
CSOListPtr | _outCSOList |
A pointer to the output CSOList. | |
bool | _isInNotificationCB |
Locking variable for removing/adding a notification observer. | |
bool | _isNotifyingMyself |
Is this module notifying itself? Locking variable to avoid infinite loops. | |
std::set< unsigned int > | _parsedIDs |
The IDs of the CSOs that should be processed according to the _csoIdListFld. | |
bool | _parsedIDsValid |
Flag that indicates if _parsedIDs is valid. | |
bool | _didSomething |
Flag that indicates that the modificator did something (i.e. it modified the attached CSOList). | |
bool | _outCSOListChanged |
Flag that indicates that _outCSOList has been changed and thus that _outputCSOListFld has to be updated. | |
bool | _isOutputCSOListOwner |
Flag that indicates whether this module is the owner of the output CSO list. | |
bool | _isWorkingDirectlyOnInputCSOList |
Flag that indicates whether this module should work on its input CSO list directly. |
Base class for performing modifications on the CSOs of a CSOList.
Definition at line 22 of file CSOModificator.h.
ml::CSOModificator::CSOModificator | ( | const std::string & | type = "CSOModificator" , |
int | numInImages = 0 , |
||
int | numOutImages = 0 |
||
) |
Standard constructor.
virtual ml::CSOModificator::~CSOModificator | ( | ) | [protected, virtual] |
Standard destructor.
void ml::CSOModificator::_applyChangedSettings | ( | CSO * | cso | ) | const [protected] |
Changes the settings of the given CSO (only if _changeSettingsForModifiedCSOsFld is true).
virtual bool ml::CSOModificator::_applyModificator | ( | ) | [protected, virtual] |
Applies the modification to the CSOs of the attached list.
Use _outCSOList to access the CSO list that should be modified here. Typically this is the only function a derived class has to override. Return true if the modificator did something - and be sure the modificator does this even it is applied to no CSO in the list but it has been applied on the previous processing (necessary when _csoIdListFld has been set to an invalid value - see CSOAffineTransformation for example).
static void ml::CSOModificator::_csoListNotifyObserverCB | ( | void * | userData, |
int | notificationFlag | ||
) | [static, protected] |
Can be called from anywhere from the network.
bool ml::CSOModificator::_isInIdList | ( | CSO * | cso | ) | [protected] |
Checks if the given CSO is in the list of IDs given by _csoIdListFld.
If _csoIdListFld is empty this function always returns true.
virtual void ml::CSOModificator::_notifyObservers | ( | ) | [protected, virtual] |
Notifies other modules that processing has finished.
void ml::CSOModificator::_parseCSOIds | ( | std::set< unsigned int > & | ids | ) | [protected] |
Parse the CSO id field into the given vector of ids.
virtual void ml::CSOModificator::_setupCSOList | ( | ) | [protected, virtual] |
Sets the _outCSOList correctly.
virtual void ml::CSOModificator::activateAttachments | ( | ) | [protected, virtual] |
Initialize module after loading.
Reimplemented from ml::CSOBaseModule.
virtual void ml::CSOModificator::handleNotification | ( | Field * | field | ) | [protected, virtual] |
Called when input changes.
Reimplemented from ml::CSOBaseModule.
ml::CSOModificator::ML_MODULE_CLASS_HEADER | ( | CSOModificator | ) | [protected] |
virtual void ml::CSOModificator::process | ( | ) | [protected, virtual] |
virtual void ml::CSOModificator::reset | ( | ) | [protected, virtual] |
Resets parameteres of the modificator.
Shall the module's user settings be used for modified CSOs?
Definition at line 87 of file CSOModificator.h.
StringField* ml::CSOModificator::_csoIdListFld [protected] |
The list of ids of the CSOs to be transformed; if this list is empty, all CSOs are transformed.
Definition at line 75 of file CSOModificator.h.
bool ml::CSOModificator::_didSomething [protected] |
Flag that indicates that the modificator did something (i.e. it modified the attached CSOList).
Definition at line 106 of file CSOModificator.h.
CSOList* ml::CSOModificator::_inCSOList [protected] |
A pointer to the input CSOList.
Definition at line 92 of file CSOModificator.h.
BaseField* ml::CSOModificator::_inputCSOListFld [protected] |
The input CSOList.
Definition at line 69 of file CSOModificator.h.
bool ml::CSOModificator::_isInNotificationCB [protected] |
Locking variable for removing/adding a notification observer.
Definition at line 96 of file CSOModificator.h.
bool ml::CSOModificator::_isNotifyingMyself [protected] |
Is this module notifying itself? Locking variable to avoid infinite loops.
Definition at line 98 of file CSOModificator.h.
bool ml::CSOModificator::_isOutputCSOListOwner [protected] |
Flag that indicates whether this module is the owner of the output CSO list.
Definition at line 114 of file CSOModificator.h.
bool ml::CSOModificator::_isWorkingDirectlyOnInputCSOList [protected] |
Flag that indicates whether this module should work on its input CSO list directly.
Definition at line 116 of file CSOModificator.h.
Shall the module listen to finishing events?
Definition at line 82 of file CSOModificator.h.
Shall the module listen to selection change notifications?
Definition at line 84 of file CSOModificator.h.
CSOListPtr ml::CSOModificator::_outCSOList [protected] |
A pointer to the output CSOList.
Definition at line 94 of file CSOModificator.h.
bool ml::CSOModificator::_outCSOListChanged [protected] |
Flag that indicates that _outCSOList has been changed and thus that _outputCSOListFld has to be updated.
Because ML_CHECK_NEW might assign the same memory block (i.e. the same pointer value) it is not enough to compare _outCSOList with _outputCSOListFld->getBaseValue() (see _notifyObservers()).
Definition at line 111 of file CSOModificator.h.
BaseField* ml::CSOModificator::_outputCSOListFld [protected] |
The filtered output CSOList.
Definition at line 71 of file CSOModificator.h.
std::set<unsigned int> ml::CSOModificator::_parsedIDs [protected] |
The IDs of the CSOs that should be processed according to the _csoIdListFld.
Definition at line 101 of file CSOModificator.h.
bool ml::CSOModificator::_parsedIDsValid [protected] |
Flag that indicates if _parsedIDs is valid.
Definition at line 103 of file CSOModificator.h.
BoolField* ml::CSOModificator::_workDirectlyOnInputListFld [protected] |
Shall the module work directly on the input CSOList? Otherwise, it would work on a copy which is returned by the output field.
Definition at line 79 of file CSOModificator.h.