MeVisLab Toolbox Reference
|
Class representing general ML objects that support import/export via strings (setPersistentState() and getPersistentState()), arbitrary tree structures (using addStateToTree() and readStateFromTree()), or a data stream (using writeTo() and readFrom()). More...
#include <mlBase.h>
Public Member Functions | |
Base () | |
Constructor. More... | |
virtual | ~Base () |
Destructor. More... | |
virtual Base * | deepCopy () const |
Creates a deep copy of the given object. More... | |
bool | isOfAllowedType (const std::vector< const RuntimeType * > &types) const |
Checks whether this object's type is equal to or derived from one of the types given in the argument. More... | |
virtual bool | isRefCountedBase () const |
Returns whether the instance is derived from RefCountedBase. More... | |
virtual std::string | detailString () const |
Returns a string describing this object. More... | |
Persistence interfaces | |
enum | PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream } |
This enum describes the different persistence interfaces available. 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 |
Writes the objects state to the data stream object. More... | |
virtual void | readFrom (AbstractPersistenceInputStream *, int) |
Reads the objects state from the data stream object. More... | |
Class representing general ML objects that support import/export via strings (setPersistentState() and getPersistentState()), arbitrary tree structures (using addStateToTree() and readStateFromTree()), or a data stream (using writeTo() and readFrom()).
Objects of class Base
BaseField
)Remark: This class is base class for Module
and all derived modules.
ml::Base::Base | ( | ) |
Constructor.
|
virtual |
Destructor.
|
inlinevirtual |
Attaches the object state as children of the given parent node.
Reimplemented in ml::LUTFLinear, ml::CSOVoxelSetList, ml::XMarker, ml::StylePalette, ml::BaseListTemplate< T >, ml::BaseListTemplate< BaseItem >, ml::BaseListTemplate< BaseContainerItem >, ml::BaseListTemplate< XMarker >, ml::ListTemplate< T >, ml::ListTemplate< KeyFrame >, ml::ListTemplate< Matrix4 >, ml::ListTemplate< Matrix3 >, ml::ListBase, ml::CurveList, ml::BaseContainerItem, ml::BaseItem, ml::CSOList, and ml::CurveData.
|
inlinevirtual |
Creates a deep copy of the given object.
The default implementation returns a NULL pointer and has to be overridden by derived classes. It can be used to clone Base objects without knowledge of the exact type of object.
Reimplemented in ml::WEM, ml::CSOList, ml::StylePalette, ml::ListTemplate< T >, ml::ListTemplate< KeyFrame >, ml::ListTemplate< Matrix4 >, ml::ListTemplate< Matrix3 >, ml::ListBase, ml::CurveList, ml::CurveData, ml::BaseList, and ml::BaseItem.
|
inlinevirtual |
Returns a string describing this object.
This is mainly meant to return the subtype of wrapped objects, which are not reflected in the Base type system.
Reimplemented in ml::VTKObjectWrapper.
|
inlinevirtual |
Override this method to declare which persistence interfaces are implemented by your derived class.
Reimplemented in ml::StandardItemModel.
bool ml::Base::isOfAllowedType | ( | const std::vector< const RuntimeType * > & | types | ) | const |
Checks whether this object's type is equal to or derived from one of the types given in the argument.
This method will also return true
if the vector is empty, since this denotes that any type is allowed.
|
inlinevirtual |
Returns whether the instance is derived from RefCountedBase.
Reimplemented in ml::RefCountedBase.
|
virtual |
Returns a string describing the object's internal state.
Reimplemented in ml::XMarker, ml::RasterFunctionList, ml::RasterFunction, ml::ListTemplate< T >, ml::ListTemplate< KeyFrame >, ml::ListTemplate< Matrix4 >, ml::ListTemplate< Matrix3 >, ml::BaseContainerItem, and ml::BaseItem.
|
inlinevirtual |
Reads the objects state from the data stream object.
version
is the version number given by ML_PERSISTENCE_VERSION at the time the object was written to the AbstractPersistenceOutStream.
Include mlAbstractPersistenceStream.h for the implementation of this method.
If you are subclassing from another Base class that implements persistence, use the macro ML_READFROM_SUPER() to load the superclass data, because this takes care of reading and checking the version number of the superclass.
Reimplemented in ml::StandardItemModel, and ml::BaseItem.
|
inlinevirtual |
Reads the object state from the children of the given parent node.
Reimplemented in ml::LUTFLinear, ml::CSOVoxelSetList, ml::XMarker, ml::StylePalette, ml::BaseListTemplate< T >, ml::BaseListTemplate< BaseItem >, ml::BaseListTemplate< BaseContainerItem >, ml::BaseListTemplate< XMarker >, ml::ListTemplate< T >, ml::ListTemplate< KeyFrame >, ml::ListTemplate< Matrix4 >, ml::ListTemplate< Matrix3 >, ml::ListBase, ml::CurveList, ml::BaseContainerItem, ml::BaseItem, ml::CSOList, and ml::CurveData.
|
virtual |
Restores the object's internal state from a string that had been previously generated using persistentState().
Reimplemented in ml::XMarker, ml::ListTemplate< T >, ml::ListTemplate< KeyFrame >, ml::ListTemplate< Matrix4 >, ml::ListTemplate< Matrix3 >, ml::BaseContainerItem, ml::BaseItem, ml::RasterFunctionList, and ml::RasterFunction.
|
inlinevirtual |
Writes the objects state to the data stream object.
Include mlAbstractPersistenceStream.h for the implementation of this method.
If you are subclassing from another Base class that implements persistence, use the macro ML_WRITETO_SUPER() to save the superclass data, because this takes care of writing the version number of the superclass.
Reimplemented in ml::StandardItemModel, and ml::BaseItem.