31 enum { NumInheritModes = 5 };
43 static const char *
const InheritModeStrings[NumInheritModes];
46 enum { NumAutoCreateValueModes = 3 };
56 static const char *
const AutoCreateValueModeStrings[NumAutoCreateValueModes];
76 const std::string &valueFieldName,
77 const std::string &fieldSuffix,
79 const std::string &dicomModuleInfoString,
80 const bool useDefaultField=
false,
81 const std::string &defaultFieldValue=
""
Project global and OS specific declarations.
#define MLDICOMTAGINTERFACES_EXPORT
DLL export macro definition.
The class DicomModifyFieldAddOnBase is dedicated to manage fields for ML modules and instances derive...
FieldAddOn class supporting inheritance and auto creating tag values (for example DICOM UIDs or tag v...
virtual const StringField * getDefaultFieldFld() const
Constant read-only access, see _defaultFieldFld, returns nullptr if not available.
virtual StringField & getValueFld()
See _valueFld.
virtual NotifyField & getCreateValueFld()
See _createValueFld.
virtual const NotifyField & getCreateValueFld() const
Constant read-only access, see _createValueFld.
const std::string _valueFieldName
Name of the value field.
virtual bool isDefaultFieldUsed() const
See _useDefaultField.
const std::string _defaultInitValue
Default value passed to constructor.
virtual EnumField & getAutoCreateValueFld()
See _autoCreateValueFld.
StringField * _defaultFieldFld
Used as default value for the hidden default field if _useDefaultFieldFld is true,...
bool _useDefaultField
If enabled then a hidden default field is generated and/or used its value is used instead of a genera...
const DCMTree::RawTagId _tagId
Stores the ID of the DICOM tag to be managed.
EnumField * _inheritModeFld
Controls whether or how the value is inherited.
void addFields() override
Add fields to field container of module.
EnumField * _autoCreateValueFld
Controls whether or when a new value is generated.
virtual const StringField & getValueFld() const
Constant read-only access, see _valueFld.
const bool _valueIsType1
If true then the value is handled as Type 1 (mandatory and not empty) tag, otherwise it is allowed to...
virtual void setDefaultCreateFunction(DefaultValueCreatorBase *newDefaultCreator)
Sets a new object to create default values if not nullptr, otherwise a CreateDefaultDICOMUID instance...
virtual const DefaultValueCreatorBase & getDefaultCreateFunction() const
Returns the current default value creator; returned pointer is never nullptr.
virtual const EnumField & getInheritModeFld() const
Constant read-only access, see _inheritModeFld.
virtual const EnumField & getAutoCreateValueFld() const
Constant read-only access, see _autoCreateValueFld.
DicomValueInheritAndCreateTagInterface(Module &modRef, DCMTree::RawTagId tagId, const std::string &valueFieldName, const std::string &fieldSuffix, bool valueIsType1, const std::string &dicomModuleInfoString, const bool useDefaultField=false, const std::string &defaultFieldValue="")
Constructor, setting the reference of the module for which the fields shall be managed.
virtual void setUseDefaultField(bool useDefaultField)
On true sets the default field is used or otherwise the default value function.
virtual void createValueIfNeeded()
Same as createValue() but creates a value only if getValueFld() is empty.
std::string applyModifications(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos=nullptr) override
See DicomModifyFieldAddOnBase::applyModifications() for documentation.
StringField * _valueFld
The (tag) value to be managed.
DefaultValueCreatorBase * _createDefaultValuePtr
The function to create default values if no default field is available.
void inheritValues(DCMTree::Const_TreePtr dcmTree) override
Implements the copy of tag values from the given dcmTree to the fields.
~DicomValueInheritAndCreateTagInterface() override
Destructor.
virtual StringField * getDefaultFieldFld()
See _defaultFieldFld, returns nullptr if not available.
NotifyField * _createValueFld
If notified a new value is created.
virtual void createValue()
Set _valueFld to a new value according to settings of isDefaultFieldUsed() and getDefaultCreatFunctio...
const std::string _dicomModuleInfoString
Stores the description of the DICOM module for error message generation.
const std::string _fieldSuffix
Field suffix.
std::string checkConsistency() const override
Checks for invalid parameters; return textual description on error, or empty string on success.
virtual EnumField & getInheritModeFld()
See _inheritModeFld.
@ CreateNew
Create a new value on inheritance instead of inheriting one.
@ InheritRecursively
Inherit value from recursively search in DCMTree or set empty if not found.
@ InheritFromTopLevel
Inherit value from top level of DCMTree or set empty if not found.
@ AutoCreateAlways
Always create a new value even if another valid one is set.
FieldAddOnBase::FieldChangeState handleFieldChanges(Field *field) override
Handle field notifications.
Field to encapsulate an enumerated value.
FieldChangeState
Describes the type of a field changes detected in handleFieldChanges(Field *field).
Defines the class FieldContainer to encapsulate a vector of fields for (see class Field).
Base class for all fields used in the ML.
Base class for an image processing module of the ML.
Field without value for notifications.
Field to encapsulate a string value.
Header file of the DicomModifyFieldAddOnBase class dedicated to manage fields for ML modules and inst...
boost::shared_ptr< const Tree > Const_TreePtr
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Base class for classes creating default values.