MeVisLab Toolbox Reference
ml::FieldContainer Class Reference

Defines the class FieldContainer to encapsulate a vector of fields for (see class Field). More...

#include <mlFieldContainer.h>

Inheritance diagram for ml::FieldContainer:
ml::Base ml::Module ml::AccessDirectDicomImportCache ml::AlgorithmModule ml::ApplyDicomPixelModifiers ml::BackgroundTaskBaseModule ml::BaseToMultiFileVolumeList ml::CSOBaseModule ml::CSOLabelPlacement ml::CSOLabelRenderer ml::CSOManager ml::DICOMFileListFilter ml::DicomConfigurableMessageFilter ml::DicomModifyCreateTree ml::DicomModifyImageTagsPlugin ml::DicomModifyMultiFileVolumeExport ml::DicomModifySubTreeSelectorPlugin ml::DicomModifyTagsPlugin ml::DicomModifyTreeAndImage ml::DicomSaveBase ml::DicomTreeCompare ml::DicomTreeInfo ml::DicomTreeToRTObject ml::DicomTreeValidate ml::DicomTreeValidationBase ml::DirectDicomImport ml::DynamicStylePalette ml::Engine ml::FileListFilterPluginBase ml::ITKFlatStructElement ml::KernelBaseModule ml::KernelEditor ml::ListContainerBase ml::MLImageFormatIOBase ml::MainThreadCommunicatorTestSupport ml::ModuleLoaderBackendsControl ml::MultiFileVolumeListBaseOutput ml::MultiFileVolumeListFilterOutputs ml::ObjMgrBase ml::PCLModule ml::RTObjectToDicomTree ml::StylePaletteOp ml::VTKModule ml::WEMModule

Public Member Functions

 FieldContainer ()
 Constructor. More...
 
 ~FieldContainer () override
 Destructor: Deletes all added fields. More...
 
std::string whoAmI (bool withInstanceName=true) const
 Returns type and instance name of format "ClassTypeName(instanceName)" if the instance name is not empty and withInstanceName is true. More...
 
FieldaddField (const char *name, const char *type, const char *value)
 Adds a new field with name name, type type and value value (coded as string) to the container. More...
 
FieldaddField (Field *field)
 Adds a field, the ownership of the field is passed to the FieldContainer. More...
 
BoolFieldaddBool (const char *name)
 Creates a BoolField with name and adds it to the container. Default value is false. More...
 
BoolFieldaddBool (const char *name, bool value)
 Creates a BoolField with name and adds it to the container. More...
 
IntFieldaddInt (const char *name)
 Creates an IntField with name and adds it to the container. Default value is 0. More...
 
IntFieldaddInt (const char *name, MLint value)
 Creates an IntField with name and adds it to the container. More...
 
EnumFieldaddEnum (const char *name, const char *const *enumerationItemNames, MLint numEnumerationItems)
 Creates an EnumField field with name and adds it to the container. More...
 
EnumFieldaddEnum (const char *name, const std::vector< std::string > &enumerationItemNames)
 Creates an EnumField field with name and adds it to the container. More...
 
template<typename EnumType >
TypedEnumField< EnumType > * addEnum (const char *name, const EnumValues< EnumType > &values, EnumType initialValue)
 Creates a TypedEnumField field with name and adds it to the container. More...
 
FloatFieldaddFloat (const char *name)
 Creates a FloatField with name and adds it to the container. Default value is 0.f. More...
 
FloatFieldaddFloat (const char *name, float value)
 Creates a FloatField with name and adds it to the container. More...
 
ProgressFieldaddProgress (const char *name)
 Creates a float ProgressField with name and adds it to the container. Default value is 0.f. More...
 
ProgressFieldaddProgress (const char *name, float value)
 Creates a float ProgressField with name and adds it to the container. More...
 
DoubleFieldaddDouble (const char *name)
 Creates a DoubleField with name and adds it to the container. Default value is 0. More...
 
DoubleFieldaddDouble (const char *name, double value)
 Creates a DoubleField with name and adds it to the container. More...
 
StringFieldaddString (const char *name)
 Creates a StringField with name and adds it to the container. Default value is empty string. More...
 
StringFieldaddString (const char *name, const std::string &value)
 Creates a StringField with name and adds it to the container. More...
 
NotifyFieldaddNotify (const char *name)
 Creates a NotifyField field with name and adds it to the container. More...
 
TriggerFieldaddTrigger (const char *name)
 Creates a TriggerField field with name and adds it to the container. More...
 
BaseFieldaddBase (const char *name)
 Creates a Base field with name and adds it to the container. Default value is NULL. More...
 
BaseFieldaddBase (const char *name, Base *value)
 Creates a Base field with name and adds it to the container. More...
 
BaseFieldaddBase (const char *name, const RefCountedBasePtr &value)
 Creates a Base field with name and adds it to the container. Sets the value from intrusive pointer. More...
 
template<typename T >
BaseFieldaddBaseWithAllowedType (const char *name, T *value=nullptr)
 As above, but also sets the allowed type of the field. More...
 
template<typename T >
BaseFieldaddBaseWithAllowedType (const char *name, const ::boost::intrusive_ptr< T > &value)
 As above, but also sets the allowed type of the field. More...
 
template<typename T >
TypedBaseField< T > * addTypedBase (const char *name)
 Creates a TypedBaseField with name and adds it to the container. Default value is NULL. More...
 
template<typename T >
TypedBaseField< T > * addTypedBase (const char *name, T *value)
 Creates a TypedBaseField with name and adds it to the container. More...
 
template<typename T >
TypedBaseField< T > * addTypedBase (const char *name, const ::boost::intrusive_ptr< T > &value)
 Creates a TypedBaseField with name and adds it to the container. Sets the value from intrusive pointer. More...
 
SoNodeFieldaddSoNode (const char *name)
 Creates a SoNodeField with name and adds it to the container. Default value is NULL. More...
 
SoNodeFieldaddSoNode (const char *name, SoNode *value)
 Creates a SoNodeField with name and adds it to the container. More...
 
PointerFieldaddPointer (const char *name)
 Creates a PointerField with name and adds it to the container. More...
 
Vector2FieldaddVector2 (const char *name)
 Creates a Vector2Field with name and adds it to the container. More...
 
Vector2FieldaddVector2 (const char *name, const Vector2 &value)
 Creates a Vector2Field with name and adds it to the container. More...
 
Vector2FieldaddVector2 (const char *name, double x, double y)
 Creates a Vector2Field with name and adds it to the container. More...
 
Vector3FieldaddVector3 (const char *name)
 Creates a Vector3Field with name and adds it to the container. More...
 
Vector3FieldaddVector3 (const char *name, const Vector3 &value)
 Creates a Vector3Field with name and adds it to the container. More...
 
Vector3FieldaddVector3 (const char *name, double x, double y, double z)
 Creates a Vector3Field with name and adds it to the container. More...
 
Vector4FieldaddVector4 (const char *name)
 Creates a Vector4Field with name and adds it to the container. More...
 
Vector4FieldaddVector4 (const char *name, const Vector4 &value)
 Creates a Vector4Field with name and adds it to the container. More...
 
Vector4FieldaddVector4 (const char *name, double x, double y, double z, double w)
 Creates a Vector4Field with name and adds it to the container. More...
 
Vector5FieldaddVector5 (const char *name)
 Creates a Vector5Field with name and adds it to the container. More...
 
Vector5FieldaddVector5 (const char *name, const Vector5 &value)
 Creates a Vector5Field with name and adds it to the container. More...
 
Vector6FieldaddVector6 (const char *name)
 Creates a Vector6Field with name and adds it to the container. More...
 
Vector6FieldaddVector6 (const char *name, const Vector6 &value)
 Creates a Vector6Field with name and adds it to the container. More...
 
Vector10FieldaddVector10 (const char *name)
 Creates a Vector10Field with name and adds it to the container. More...
 
Vector10FieldaddVector10 (const char *name, const Vector10 &value)
 Creates a Vector10Field with name and adds it to the container. More...
 
ImageVectorFieldaddImageVector (const char *name)
 Creates a ImageVectorField with name and adds it to the container. More...
 
ImageVectorFieldaddImageVector (const char *name, const ImageVector &value)
 Creates a ImageVectorField with name and adds it to the container. More...
 
ImageVectorFieldaddImageVector (const char *name, MLint x, MLint y, MLint z, MLint c, MLint t, MLint u)
 Creates a ImageVectorField with name and adds it to the container. More...
 
SubImageBoxFieldaddSubImageBox (const char *name)
 Creates a SubImageBoxField with name and adds it to the container. More...
 
SubImageBoxFieldaddSubImageBox (const char *name, const SubImageBox &value)
 Creates a SubImageBoxField with name and adds it to the container. More...
 
SubImageBoxdFieldaddSubImageBoxd (const char *name)
 Creates a SubImageBoxd field with name and adds it to the container. More...
 
SubImageBoxdFieldaddSubImageBoxd (const char *name, const SubImageBoxd &value)
 Creates a SubImageBoxd field with name and adds it to the container. More...
 
ColorFieldaddColor (const char *name)
 Creates a ColorField with name and adds it to the container. More...
 
ColorFieldaddColor (const char *name, float r, float g, float b)
 Creates a ColorField with name and adds it to the container. More...
 
ColorFieldaddColor (const char *name, const Vector3 &value)
 Creates a ColorField with name and adds it to the container. More...
 
PlaneFieldaddPlane (const char *name)
 Creates a PlaneField with name and adds it to the container. More...
 
PlaneFieldaddPlane (const char *name, double f0, double f1, double f2, double f3)
 Creates a PlaneField with name and adds it to the container. More...
 
PlaneFieldaddPlane (const char *name, const Plane &value)
 Creates a PlaneField with name and adds it to the container. More...
 
RotationFieldaddRotation (const char *name)
 Creates a RotationField with name and adds it to the container. More...
 
RotationFieldaddRotation (const char *name, const Rotation &value)
 Creates a RotationField with name and adds it to the container. More...
 
Matrix2FieldaddMatrix2 (const char *name)
 Creates a Matrix2Field with name and adds it to the container. More...
 
Matrix2FieldaddMatrix2 (const char *name, const Matrix2 &value)
 Creates a Matrix2Field with name and adds it to the container. More...
 
Matrix3FieldaddMatrix3 (const char *name)
 Creates a Matrix3Field with name and adds it to the container. More...
 
Matrix3FieldaddMatrix3 (const char *name, const Matrix3 &value)
 Creates a Matrix3Field with name and adds it to the container. More...
 
Matrix4FieldaddMatrix4 (const char *name)
 Creates a Matrix4Field with name and adds it to the container. More...
 
Matrix4FieldaddMatrix4 (const char *name, const Matrix4 &value)
 Creates a Matrix4Field with name and adds it to the container. More...
 
Matrix5FieldaddMatrix5 (const char *name)
 Creates a Matrix5Field with name and adds it to the container. More...
 
Matrix5FieldaddMatrix5 (const char *name, const Matrix5 &value)
 Creates a Matrix5Field with name and adds it to the container. More...
 
Matrix6FieldaddMatrix6 (const char *name)
 Creates a Matrix6Field with name and adds it to the container. More...
 
Matrix6FieldaddMatrix6 (const char *name, const Matrix6 &value)
 Creates a Matrix6Field with name and adds it to the container. More...
 
MatrixFieldaddMatrix (const char *name)
 Creates a MatrixField with name and adds it to the container. More...
 
MatrixFieldaddMatrix (const char *name, const Matrix4 &value)
 Creates a MatrixField with name and adds it to the container. More...
 
MLDataTypeFieldaddMLDataType (const char *name)
 Creates a MTDataTypeField with name and adds it to the container. More...
 
MLDataTypeFieldaddMLDataType (const char *name, MLDataType value)
 Creates a MTDataTypeField with name and adds it to the container. More...
 
UniversalTypeFieldaddUniversalType (const char *name)
 Creates an UniversalTypeField field with name and adds it to the container. More...
 
IntListFieldaddIntList (const char *name)
 Creates an IntListField field with name and empty list value and adds it to the container. More...
 
IntListFieldaddIntList (const char *name, const std::vector< MLint > &value)
 Creates an IntListField field with name and given list value and adds it to the container. More...
 
DoubleListFieldaddDoubleList (const char *name)
 Creates an DoubleListField field with name and empty list value and adds it to the container. More...
 
DoubleListFieldaddDoubleList (const char *name, const std::vector< double > &value)
 Creates an DoubleListField field with name and given list value and adds it to the container. More...
 
Vector2ListFieldaddVector2List (const char *name)
 Creates an Vector2ListField field with name and empty list value and adds it to the container. More...
 
Vector2ListFieldaddVector2List (const char *name, const std::vector< Vector2 > &value)
 Creates an Vector2ListField field with name and given list value and adds it to the container. More...
 
Vector3ListFieldaddVector3List (const char *name)
 Creates an Vector3ListField field with name and empty list value and adds it to the container. More...
 
Vector3ListFieldaddVector3List (const char *name, const std::vector< Vector3 > &value)
 Creates an Vector3ListField field with name and given list value and adds it to the container. More...
 
Vector4ListFieldaddVector4List (const char *name)
 Creates an Vector4ListField field with name and empty list value and adds it to the container. More...
 
Vector4ListFieldaddVector4List (const char *name, const std::vector< Vector4 > &value)
 Creates an Vector4ListField field with name and given list value and adds it to the container. More...
 
size_t getNumFields () const
 Returns the number of added fields. More...
 
bool hasField (const std::string &name) const
 Returns true if the field with name name exists; otherwise false is returned. More...
 
FieldgetField (const std::string &name) const
 Returns the pointer to the field with name name. More...
 
FieldgetField (MLint index) const
 Returns pointer of field at index if it exists. If not, -1 is returned. More...
 
MLint getFieldIndex (Field *field) const
 Returns index of field if it exists. If not, -1 is returned. More...
 
void setFieldStringValue (const std::string &name, const std::string &value)
 Sets the value of the field with name if it exists. More...
 
std::string getFieldStringValue (const std::string &name) const
 Returns the string value of the field with name if it is found. More...
 
virtual void activateAttachments ()
 Reactivates notification handling, i.e., all fields of this module will send notifications again to attached sensors and fields if their value is set or changed. More...
 
virtual void deactivateAttachments ()
 Disables notification handling, i.e., all fields of this module will not send notifications to attached sensors and fields any more if their values are set or changed. More...
 
DeprecatedVirtuals

These methods can no be inside of ML_DEPRECATED, since they would change binary compatibility.

Deprecated:
Use Module::addInputImage() instead.
virtual InputConnectorFieldaddInputConnector (const char *, Module *, MLint)
 
virtual OutputConnectorFieldaddOutputConnector (const char *, Module *, MLint)
 
- Public Member Functions inherited from ml::Base
 Base ()
 Constructor. More...
 
virtual ~Base ()
 Destructor. More...
 
virtual BasedeepCopy () const
 Set addStateToTree version number that can be accessed via getAddStateVersion() More...
 
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
 Check if this object's type is equal to or derived from one of the types given in the argument. More...
 
virtual bool isRefCountedBase () const
 Returns if the instance is derived from RefCountedBase. More...
 
virtual std::string detailString () const
 Return a string describing this object. More...
 
virtual bool implementsPersistence (PersistenceInterface) const
 Override this method to declare which persistence interfaces are implemented by your derived class. More...
 
virtual std::string persistentState () const
 Returns a string describing the object's internal state. More...
 
virtual void setPersistentState (const std::string &state)
 Restores the object's internal state from a string that had been previously generated using persistentState(). More...
 
virtual void addStateToTree (TreeNode *) const
 Attaches the object state as children of the given parent node. More...
 
virtual void readStateFromTree (TreeNode *)
 Reads the object state from the children of the given parent node. More...
 
virtual void writeTo (AbstractPersistenceOutputStream *) const
 Write the objects state to the data stream object. More...
 
virtual void readFrom (AbstractPersistenceInputStream *, int)
 Read the objects state from the data stream object. More...
 

Protected Member Functions

virtual void handleNotificationInternal (Field *, FieldSensor::Strength)
 Called when field has changed. More...
 
- Protected Member Functions inherited from ml::Base
virtual char * getPersistentState () const
 Returns a C string describing the object's internal state. More...
 
virtual void setPersistentState (const char *)
 Restores the object's internal state from a string that had been previously generated using getPersistentState(). More...
 
virtual void clearPersistentState (char *) const
 Disposes a string previously allocated by getPersistentState(). More...
 

Friends

class Field
 

Additional Inherited Members

- Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...
 

Detailed Description

Defines the class FieldContainer to encapsulate a vector of fields for (see class Field).

It is usually used as a parameter interface for the Module class. In its constructor a Module usually adds all the interface parameters to its field container.

Definition at line 62 of file mlFieldContainer.h.

Constructor & Destructor Documentation

◆ FieldContainer()

ml::FieldContainer::FieldContainer ( )

Constructor.

◆ ~FieldContainer()

ml::FieldContainer::~FieldContainer ( )
override

Destructor: Deletes all added fields.

Member Function Documentation

◆ activateAttachments()

virtual void ml::FieldContainer::activateAttachments ( )
inlinevirtual

Reactivates notification handling, i.e., all fields of this module will send notifications again to attached sensors and fields if their value is set or changed.

Overload this method to be notified when e.g., a module load or clone process has finished. During module load and clone processes the field values are restored but handleNotification calls are blocked so that the module cannot update itself to those field changes (see deactivateAttachments()). When activateAttachment is called, the module can have a look at its new field settings and update its internal state to the new field states. Note that the overloaded method has to be called; otherwise notification handling is not activated correctly.

Reimplemented in ml::WEMProcessor, ml::WEMModule, ml::WEMInspector, ml::WEMGenerator, ml::LoadBase, ml::EditObject, ml::ObjMgr, ml::SigmaFilter, ml::RankFilter, ml::KernelModule, ml::KernelEditor, ml::CloseGapFilter, ml::MLImageFormatSave, ml::MLImageFormatLoad, ml::MLImageFormatIOBase, ml::MLImageFormatInfo, ml::MLImageFormatFileCache, ml::CSOModificator, ml::CSOConvertor, ml::CSOBaseModule, ml::CSOManager, ml::StylePaletteOp, ml::MergeLists, ml::ListContainerBase, ml::ExtractObjectFromList, ml::DynamicStylePalette, ml::DecomposeBaseList, ml::ComposeBaseList, ml::CSOLabelRenderer, ml::CSOModifyProcessor, ml::CSOLiveWireProcessor, ml::CSOIsoProcessor, ml::CSOFreehandProcessor, ml::CSOBulgeProcessor, ml::ITKFlatStructElement, ml::MultiFileVolumeListDraftView, ml::DicomTreeToRTObject, ml::DicomTreeValidate, ml::MultiFileVolumeListWaveformOutput, ml::MultiFileVolumeListSEGOutput, ml::MultiFileVolumeListREGOutput, ml::MultiFileVolumeListIteratorOutput, ml::MultiFileVolumeListFilterOutputs, ml::MultiFileVolumeListFIDOutput, ml::MultiFileVolumeListDOCOutput, ml::MultiFileVolumeListDiagnosisOutput, ml::MultiFileVolumeListBaseOutput, ml::BaseToMultiFileVolumeList, ml::FileListFilterPlugin, ml::DICOMFileListFilter, ml::DirectDicomImport, ml::DicomSRSave, ml::DicomSEGSave, ml::DicomSCSave, ml::DicomSaveBase, ml::DicomEnhancedSave, ml::DicomDOCSave, ml::DicomModifyTreeAndImage, ml::DicomModifyTagsPlugin, ml::DicomModifySubTreeSelectorPlugin, ml::DicomModifyMultiFileVolumeExport, ml::DicomModifyImageTagsPlugin, ml::DicomModifyCreateTree, ml::ApplyDicomPixelModifiers, ml::DicomTreeInfo, ml::DicomTreeCompare, ml::AlgorithmModule, ml::PCLMovingLeastSquares, ml::PCLMarchingCubesRBF, ml::PCLMarchingCubesHoppe, ml::PCLConvexHull, ml::PCLConcaveHull, ml::PCLPointMemberArithmetic, ml::PCLInfo, ml::PCLCompare, ml::PCLEuclideanClusterExtraction, ml::PCLSampleConsensusModels, ml::PCLSampleConsensus, ml::PCLRegistration, ml::PCLR2SonicWCLoader, ml::PCLPointCloudToXMarkerList, ml::PCLMLImageToPointCloud, ml::PCLBaseListToPointCloud, ml::PCLSave, ml::PCLLoad, ml::PCLToInventor, ml::PCLVoxelGrid, ml::PCLStatisticalOutlierRemoval, ml::PCLRadiusOutlierRemoval, ml::PCLPassThrough, ml::PCLMemberCopy, ml::PCLIntensityRankFilter, ml::PCLIndexFilter, ml::PCLCropBox, ml::PCLCopy, ml::PCLBilateralFilter, ml::PCLNormalEstimation, ml::PCLPCA, ml::PCLFeatureHistogram, ml::PCLCloudDistances, ml::PCLClusterStatisticsToInventor, ml::PCLClusterStatistics, and ml::RTObjectToDicomTree.

Definition at line 395 of file mlFieldContainer.h.

◆ addBase() [1/3]

◆ addBase() [2/3]

BaseField* ml::FieldContainer::addBase ( const char *  name,
Base value 
)

Creates a Base field with name and adds it to the container.

◆ addBase() [3/3]

BaseField* ml::FieldContainer::addBase ( const char *  name,
const RefCountedBasePtr &  value 
)

Creates a Base field with name and adds it to the container. Sets the value from intrusive pointer.

◆ addBaseWithAllowedType() [1/2]

template<typename T >
BaseField* ml::FieldContainer::addBaseWithAllowedType ( const char *  name,
const ::boost::intrusive_ptr< T > &  value 
)
inline

As above, but also sets the allowed type of the field.

Definition at line 184 of file mlFieldContainer.h.

◆ addBaseWithAllowedType() [2/2]

template<typename T >
BaseField* ml::FieldContainer::addBaseWithAllowedType ( const char *  name,
T value = nullptr 
)
inline

As above, but also sets the allowed type of the field.

Definition at line 176 of file mlFieldContainer.h.

References ml::BaseField::setBaseValueAndAddAllowedType().

◆ addBool() [1/2]

BoolField* ml::FieldContainer::addBool ( const char *  name)

Creates a BoolField with name and adds it to the container. Default value is false.

Referenced by ml::CopyBase< BASE_DERIVED_CLASS >::CopyBase().

◆ addBool() [2/2]

BoolField* ml::FieldContainer::addBool ( const char *  name,
bool  value 
)

Creates a BoolField with name and adds it to the container.

◆ addColor() [1/3]

ColorField* ml::FieldContainer::addColor ( const char *  name)

Creates a ColorField with name and adds it to the container.

◆ addColor() [2/3]

ColorField* ml::FieldContainer::addColor ( const char *  name,
const Vector3 value 
)

Creates a ColorField with name and adds it to the container.

◆ addColor() [3/3]

ColorField* ml::FieldContainer::addColor ( const char *  name,
float  r,
float  g,
float  b 
)

Creates a ColorField with name and adds it to the container.

◆ addDouble() [1/2]

DoubleField* ml::FieldContainer::addDouble ( const char *  name)

Creates a DoubleField with name and adds it to the container. Default value is 0.

Referenced by ml::MultiFileVolumeListImageOutput::OutputImageProperties::addFields().

◆ addDouble() [2/2]

DoubleField* ml::FieldContainer::addDouble ( const char *  name,
double  value 
)

Creates a DoubleField with name and adds it to the container.

◆ addDoubleList() [1/2]

DoubleListField* ml::FieldContainer::addDoubleList ( const char *  name)

Creates an DoubleListField field with name and empty list value and adds it to the container.

◆ addDoubleList() [2/2]

DoubleListField* ml::FieldContainer::addDoubleList ( const char *  name,
const std::vector< double > &  value 
)

Creates an DoubleListField field with name and given list value and adds it to the container.

◆ addEnum() [1/3]

EnumField* ml::FieldContainer::addEnum ( const char *  name,
const char *const *  enumerationItemNames,
MLint  numEnumerationItems 
)

Creates an EnumField field with name and adds it to the container.

The names of the enum entries are defined by the string array enumerationItemNames. It MUST have at least numEnumerationItems entries. The value range for the enum value is [0, numEnumerationItems-1].

Referenced by ml::CopyBase< BASE_DERIVED_CLASS >::CopyBase().

◆ addEnum() [2/3]

template<typename EnumType >
TypedEnumField<EnumType>* ml::FieldContainer::addEnum ( const char *  name,
const EnumValues< EnumType > &  values,
EnumType  initialValue 
)
inline

Creates a TypedEnumField field with name and adds it to the container.

The type of the EnumField is inferred via the passed enumValues. The initial value is set to initialValue.

enum ExampleEnum
{
TEST1 = -1,
TEST2 = 4,
TEST3 = 5
};
...
EnumValues<ExampleEnum> values;
values << ML_ENUM_VALUE(TEST1)
<< ML_ENUM_VALUE(TEST2)
<< ML_ENUM_VALUE(TEST3);
TypedEnumField<ExampleEnum>* field = addEnum("example", values, TEST2);
EnumField * addEnum(const char *name, const char *const *enumerationItemNames, MLint numEnumerationItems)
Creates an EnumField field with name and adds it to the container.
#define ML_ENUM_VALUE(enumValue)
This macro allows to create a enum name and value, using macro magic to create the string value.
Definition: mlFields.h:576

Definition at line 136 of file mlFieldContainer.h.

◆ addEnum() [3/3]

EnumField* ml::FieldContainer::addEnum ( const char *  name,
const std::vector< std::string > &  enumerationItemNames 
)

Creates an EnumField field with name and adds it to the container.

The names of the enum entries are defined by the string vector enumerationItemNames. The value range for the enum value is [0, enumerationItemNames.size()-1].

◆ addField() [1/2]

Field* ml::FieldContainer::addField ( const char *  name,
const char *  type,
const char *  value 
)

Adds a new field with name name, type type and value value (coded as string) to the container.

The field manages its memory itself, i.e., it copies the value from the string constant. The ownership of the returned field stays with the FieldContainer.

◆ addField() [2/2]

Field* ml::FieldContainer::addField ( Field field)

Adds a field, the ownership of the field is passed to the FieldContainer.

◆ addFloat() [1/2]

FloatField* ml::FieldContainer::addFloat ( const char *  name)

Creates a FloatField with name and adds it to the container. Default value is 0.f.

◆ addFloat() [2/2]

FloatField* ml::FieldContainer::addFloat ( const char *  name,
float  value 
)

Creates a FloatField with name and adds it to the container.

◆ addImageVector() [1/3]

ImageVectorField* ml::FieldContainer::addImageVector ( const char *  name)

Creates a ImageVectorField with name and adds it to the container.

◆ addImageVector() [2/3]

ImageVectorField* ml::FieldContainer::addImageVector ( const char *  name,
const ImageVector value 
)

Creates a ImageVectorField with name and adds it to the container.

◆ addImageVector() [3/3]

ImageVectorField* ml::FieldContainer::addImageVector ( const char *  name,
MLint  x,
MLint  y,
MLint  z,
MLint  c,
MLint  t,
MLint  u 
)

Creates a ImageVectorField with name and adds it to the container.

◆ addInputConnector()

virtual InputConnectorField* ml::FieldContainer::addInputConnector ( const char *  ,
Module ,
MLint   
)
inlinevirtual

Reimplemented in ml::Module.

Definition at line 437 of file mlFieldContainer.h.

◆ addInt() [1/2]

IntField* ml::FieldContainer::addInt ( const char *  name)

Creates an IntField with name and adds it to the container. Default value is 0.

Referenced by ml::MultiFileVolumeListImageOutput::OutputImageProperties::addFields().

◆ addInt() [2/2]

IntField* ml::FieldContainer::addInt ( const char *  name,
MLint  value 
)

Creates an IntField with name and adds it to the container.

◆ addIntList() [1/2]

IntListField* ml::FieldContainer::addIntList ( const char *  name)

Creates an IntListField field with name and empty list value and adds it to the container.

◆ addIntList() [2/2]

IntListField* ml::FieldContainer::addIntList ( const char *  name,
const std::vector< MLint > &  value 
)

Creates an IntListField field with name and given list value and adds it to the container.

◆ addMatrix() [1/2]

MatrixField* ml::FieldContainer::addMatrix ( const char *  name)

Creates a MatrixField with name and adds it to the container.

◆ addMatrix() [2/2]

MatrixField* ml::FieldContainer::addMatrix ( const char *  name,
const Matrix4 value 
)

Creates a MatrixField with name and adds it to the container.

◆ addMatrix2() [1/2]

Matrix2Field* ml::FieldContainer::addMatrix2 ( const char *  name)

Creates a Matrix2Field with name and adds it to the container.

◆ addMatrix2() [2/2]

Matrix2Field* ml::FieldContainer::addMatrix2 ( const char *  name,
const Matrix2 value 
)

Creates a Matrix2Field with name and adds it to the container.

◆ addMatrix3() [1/2]

Matrix3Field* ml::FieldContainer::addMatrix3 ( const char *  name)

Creates a Matrix3Field with name and adds it to the container.

◆ addMatrix3() [2/2]

Matrix3Field* ml::FieldContainer::addMatrix3 ( const char *  name,
const Matrix3 value 
)

Creates a Matrix3Field with name and adds it to the container.

◆ addMatrix4() [1/2]

Matrix4Field* ml::FieldContainer::addMatrix4 ( const char *  name)

Creates a Matrix4Field with name and adds it to the container.

◆ addMatrix4() [2/2]

Matrix4Field* ml::FieldContainer::addMatrix4 ( const char *  name,
const Matrix4 value 
)

Creates a Matrix4Field with name and adds it to the container.

◆ addMatrix5() [1/2]

Matrix5Field* ml::FieldContainer::addMatrix5 ( const char *  name)

Creates a Matrix5Field with name and adds it to the container.

◆ addMatrix5() [2/2]

Matrix5Field* ml::FieldContainer::addMatrix5 ( const char *  name,
const Matrix5 value 
)

Creates a Matrix5Field with name and adds it to the container.

◆ addMatrix6() [1/2]

Matrix6Field* ml::FieldContainer::addMatrix6 ( const char *  name)

Creates a Matrix6Field with name and adds it to the container.

◆ addMatrix6() [2/2]

Matrix6Field* ml::FieldContainer::addMatrix6 ( const char *  name,
const Matrix6 value 
)

Creates a Matrix6Field with name and adds it to the container.

◆ addMLDataType() [1/2]

MLDataTypeField* ml::FieldContainer::addMLDataType ( const char *  name)

Creates a MTDataTypeField with name and adds it to the container.

◆ addMLDataType() [2/2]

MLDataTypeField* ml::FieldContainer::addMLDataType ( const char *  name,
MLDataType  value 
)

Creates a MTDataTypeField with name and adds it to the container.

◆ addNotify()

NotifyField* ml::FieldContainer::addNotify ( const char *  name)

Creates a NotifyField field with name and adds it to the container.

Referenced by ml::CopyBase< BASE_DERIVED_CLASS >::CopyBase().

◆ addOutputConnector()

virtual OutputConnectorField* ml::FieldContainer::addOutputConnector ( const char *  ,
Module ,
MLint   
)
inlinevirtual
Deprecated:
Use Module::addOutputImage() instead.

Reimplemented in ml::Module.

Definition at line 441 of file mlFieldContainer.h.

◆ addPlane() [1/3]

PlaneField* ml::FieldContainer::addPlane ( const char *  name)

Creates a PlaneField with name and adds it to the container.

◆ addPlane() [2/3]

PlaneField* ml::FieldContainer::addPlane ( const char *  name,
const Plane value 
)

Creates a PlaneField with name and adds it to the container.

◆ addPlane() [3/3]

PlaneField* ml::FieldContainer::addPlane ( const char *  name,
double  f0,
double  f1,
double  f2,
double  f3 
)

Creates a PlaneField with name and adds it to the container.

◆ addPointer()

PointerField* ml::FieldContainer::addPointer ( const char *  name)

Creates a PointerField with name and adds it to the container.

◆ addProgress() [1/2]

ProgressField* ml::FieldContainer::addProgress ( const char *  name)

Creates a float ProgressField with name and adds it to the container. Default value is 0.f.

◆ addProgress() [2/2]

ProgressField* ml::FieldContainer::addProgress ( const char *  name,
float  value 
)

Creates a float ProgressField with name and adds it to the container.

◆ addRotation() [1/2]

RotationField* ml::FieldContainer::addRotation ( const char *  name)

Creates a RotationField with name and adds it to the container.

◆ addRotation() [2/2]

RotationField* ml::FieldContainer::addRotation ( const char *  name,
const Rotation value 
)

Creates a RotationField with name and adds it to the container.

◆ addSoNode() [1/2]

SoNodeField* ml::FieldContainer::addSoNode ( const char *  name)

Creates a SoNodeField with name and adds it to the container. Default value is NULL.

◆ addSoNode() [2/2]

SoNodeField* ml::FieldContainer::addSoNode ( const char *  name,
SoNode *  value 
)

Creates a SoNodeField with name and adds it to the container.

◆ addString() [1/2]

StringField* ml::FieldContainer::addString ( const char *  name)

Creates a StringField with name and adds it to the container. Default value is empty string.

Referenced by ml::MultiFileVolumeListImageOutput::OutputImageProperties::addFields(), and ml::CopyBase< BASE_DERIVED_CLASS >::CopyBase().

◆ addString() [2/2]

StringField* ml::FieldContainer::addString ( const char *  name,
const std::string &  value 
)

Creates a StringField with name and adds it to the container.

◆ addSubImageBox() [1/2]

SubImageBoxField* ml::FieldContainer::addSubImageBox ( const char *  name)

Creates a SubImageBoxField with name and adds it to the container.

◆ addSubImageBox() [2/2]

SubImageBoxField* ml::FieldContainer::addSubImageBox ( const char *  name,
const SubImageBox value 
)

Creates a SubImageBoxField with name and adds it to the container.

◆ addSubImageBoxd() [1/2]

SubImageBoxdField* ml::FieldContainer::addSubImageBoxd ( const char *  name)

Creates a SubImageBoxd field with name and adds it to the container.

◆ addSubImageBoxd() [2/2]

SubImageBoxdField* ml::FieldContainer::addSubImageBoxd ( const char *  name,
const SubImageBoxd value 
)

Creates a SubImageBoxd field with name and adds it to the container.

◆ addTrigger()

TriggerField* ml::FieldContainer::addTrigger ( const char *  name)

Creates a TriggerField field with name and adds it to the container.

TriggerField is an alias for the NotifyField.

◆ addTypedBase() [1/3]

template<typename T >
TypedBaseField<T>* ml::FieldContainer::addTypedBase ( const char *  name)
inline

Creates a TypedBaseField with name and adds it to the container. Default value is NULL.

Definition at line 191 of file mlFieldContainer.h.

◆ addTypedBase() [2/3]

template<typename T >
TypedBaseField<T>* ml::FieldContainer::addTypedBase ( const char *  name,
const ::boost::intrusive_ptr< T > &  value 
)
inline

Creates a TypedBaseField with name and adds it to the container. Sets the value from intrusive pointer.

Definition at line 209 of file mlFieldContainer.h.

References ml::TypedBaseField< T >::setValue().

◆ addTypedBase() [3/3]

template<typename T >
TypedBaseField<T>* ml::FieldContainer::addTypedBase ( const char *  name,
T value 
)
inline

Creates a TypedBaseField with name and adds it to the container.

Definition at line 201 of file mlFieldContainer.h.

References ml::TypedBaseField< T >::setValue().

◆ addUniversalType()

UniversalTypeField* ml::FieldContainer::addUniversalType ( const char *  name)

Creates an UniversalTypeField field with name and adds it to the container.

◆ addVector10() [1/2]

Vector10Field* ml::FieldContainer::addVector10 ( const char *  name)

Creates a Vector10Field with name and adds it to the container.

◆ addVector10() [2/2]

Vector10Field* ml::FieldContainer::addVector10 ( const char *  name,
const Vector10 value 
)

Creates a Vector10Field with name and adds it to the container.

◆ addVector2() [1/3]

Vector2Field* ml::FieldContainer::addVector2 ( const char *  name)

Creates a Vector2Field with name and adds it to the container.

◆ addVector2() [2/3]

Vector2Field* ml::FieldContainer::addVector2 ( const char *  name,
const Vector2 value 
)

Creates a Vector2Field with name and adds it to the container.

◆ addVector2() [3/3]

Vector2Field* ml::FieldContainer::addVector2 ( const char *  name,
double  x,
double  y 
)

Creates a Vector2Field with name and adds it to the container.

◆ addVector2List() [1/2]

Vector2ListField* ml::FieldContainer::addVector2List ( const char *  name)

Creates an Vector2ListField field with name and empty list value and adds it to the container.

◆ addVector2List() [2/2]

Vector2ListField* ml::FieldContainer::addVector2List ( const char *  name,
const std::vector< Vector2 > &  value 
)

Creates an Vector2ListField field with name and given list value and adds it to the container.

◆ addVector3() [1/3]

Vector3Field* ml::FieldContainer::addVector3 ( const char *  name)

Creates a Vector3Field with name and adds it to the container.

◆ addVector3() [2/3]

Vector3Field* ml::FieldContainer::addVector3 ( const char *  name,
const Vector3 value 
)

Creates a Vector3Field with name and adds it to the container.

◆ addVector3() [3/3]

Vector3Field* ml::FieldContainer::addVector3 ( const char *  name,
double  x,
double  y,
double  z 
)

Creates a Vector3Field with name and adds it to the container.

◆ addVector3List() [1/2]

Vector3ListField* ml::FieldContainer::addVector3List ( const char *  name)

Creates an Vector3ListField field with name and empty list value and adds it to the container.

◆ addVector3List() [2/2]

Vector3ListField* ml::FieldContainer::addVector3List ( const char *  name,
const std::vector< Vector3 > &  value 
)

Creates an Vector3ListField field with name and given list value and adds it to the container.

◆ addVector4() [1/3]

Vector4Field* ml::FieldContainer::addVector4 ( const char *  name)

Creates a Vector4Field with name and adds it to the container.

◆ addVector4() [2/3]

Vector4Field* ml::FieldContainer::addVector4 ( const char *  name,
const Vector4 value 
)

Creates a Vector4Field with name and adds it to the container.

◆ addVector4() [3/3]

Vector4Field* ml::FieldContainer::addVector4 ( const char *  name,
double  x,
double  y,
double  z,
double  w 
)

Creates a Vector4Field with name and adds it to the container.

◆ addVector4List() [1/2]

Vector4ListField* ml::FieldContainer::addVector4List ( const char *  name)

Creates an Vector4ListField field with name and empty list value and adds it to the container.

◆ addVector4List() [2/2]

Vector4ListField* ml::FieldContainer::addVector4List ( const char *  name,
const std::vector< Vector4 > &  value 
)

Creates an Vector4ListField field with name and given list value and adds it to the container.

◆ addVector5() [1/2]

Vector5Field* ml::FieldContainer::addVector5 ( const char *  name)

Creates a Vector5Field with name and adds it to the container.

◆ addVector5() [2/2]

Vector5Field* ml::FieldContainer::addVector5 ( const char *  name,
const Vector5 value 
)

Creates a Vector5Field with name and adds it to the container.

◆ addVector6() [1/2]

Vector6Field* ml::FieldContainer::addVector6 ( const char *  name)

Creates a Vector6Field with name and adds it to the container.

◆ addVector6() [2/2]

Vector6Field* ml::FieldContainer::addVector6 ( const char *  name,
const Vector6 value 
)

Creates a Vector6Field with name and adds it to the container.

◆ deactivateAttachments()

virtual void ml::FieldContainer::deactivateAttachments ( )
inlinevirtual

Disables notification handling, i.e., all fields of this module will not send notifications to attached sensors and fields any more if their values are set or changed.

This normally indicates that a field restore process (due to a module load or clone) has been started and many field values will be set. During that process no field notifications are sent, i.e., handleNotification is not called. The process then is completed by the call of activateAttachments which can be used to update the internal module state to the new field state then. Note that the overloaded method has to be called; otherwise notification handling is not deactivated correctly. See activateAttachments().

Definition at line 406 of file mlFieldContainer.h.

◆ getField() [1/2]

Field* ml::FieldContainer::getField ( const std::string &  name) const

Returns the pointer to the field with name name.

A warning is printed if not found and NULL is returned.

◆ getField() [2/2]

Field* ml::FieldContainer::getField ( MLint  index) const

Returns pointer of field at index if it exists. If not, -1 is returned.

◆ getFieldIndex()

MLint ml::FieldContainer::getFieldIndex ( Field field) const

Returns index of field if it exists. If not, -1 is returned.

◆ getFieldStringValue()

std::string ml::FieldContainer::getFieldStringValue ( const std::string &  name) const

Returns the string value of the field with name if it is found.

Otherwise a pointer to the empty temporary string "" is returned and a warning is printed.

◆ getNumFields()

size_t ml::FieldContainer::getNumFields ( ) const

Returns the number of added fields.

◆ handleNotificationInternal()

virtual void ml::FieldContainer::handleNotificationInternal ( Field ,
FieldSensor::Strength   
)
inlineprotectedvirtual

Called when field has changed.

Reimplemented in ml::Module.

Definition at line 425 of file mlFieldContainer.h.

◆ hasField()

bool ml::FieldContainer::hasField ( const std::string &  name) const

Returns true if the field with name name exists; otherwise false is returned.

◆ setFieldStringValue()

void ml::FieldContainer::setFieldStringValue ( const std::string &  name,
const std::string &  value 
)

Sets the value of the field with name if it exists.

Otherwise a warning is printed.

◆ whoAmI()

std::string ml::FieldContainer::whoAmI ( bool  withInstanceName = true) const

Returns type and instance name of format "ClassTypeName(instanceName)" if the instance name is not empty and withInstanceName is true.

If withInstanceName is false or no instance name exists, the name is returned in the format "ModuleTypeName".

Friends And Related Function Documentation

◆ Field

friend class Field
friend

Definition at line 422 of file mlFieldContainer.h.


The documentation for this class was generated from the following file: