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. | |
virtual | ~Base () |
Destructor. | |
virtual Base * | deepCopy () const |
Set addStateToTree version number that can be accessed via getAddStateVersion() | |
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. | |
virtual bool | isRefCountedBase () const |
Returns if the instance is derived from RefCountedBase. | |
virtual std::string | detailString () const |
Return a string describing this object. | |
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. | |
virtual std::string | persistentState () const |
Returns a string describing the object's internal state. | |
virtual void | setPersistentState (const std::string &state) |
Restores the object's internal state from a string that had been previously generated using persistentState() . | |
virtual void | addStateToTree (TreeNode *) const |
Attaches the object state as children of the given parent node. | |
virtual void | readStateFromTree (TreeNode *) |
Reads the object state from the children of the given parent node. | |
virtual void | writeTo (AbstractPersistenceOutputStream *) const |
Write the objects state to the data stream object. | |
virtual void | readFrom (AbstractPersistenceInputStream *, int) |
Read the objects state from the data stream object. | |
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.
Attaches the object state as children of the given parent node.
Reimplemented in ml::CurveData, ml::CSOList, ml::BaseItem, ml::BaseContainerItem, ml::CurveList, ml::ListBase, ml::ListTemplate< T >, ml::ListTemplate< BaseContainerItem >, ml::ListTemplate< BaseItem >, ml::ListTemplate< KeyFrame >, ml::ListTemplate< Matrix3 >, ml::ListTemplate< Matrix4 >, ml::ListTemplate< vec3i >, ml::ListTemplate< vec4i >, ml::ListTemplate< vec6i >, ml::ListTemplate< Vector3 >, ml::ListTemplate< Vector4 >, ml::ListTemplate< Vector6 >, ml::ListTemplate< XMarker >, ml::BaseListTemplate< T >, ml::BaseListTemplate< BaseContainerItem >, ml::BaseListTemplate< BaseItem >, ml::BaseListTemplate< XMarker >, ml::StylePalette, ml::XMarker, ml::CSOVoxelSetList, and ml::LUTFLinear.
Set addStateToTree version number that can be accessed via getAddStateVersion()
Creates a deep copy of the given object. The default implementation returns a NULL pointer and has to be overloaded by derived classes. It can be used to clone Base objects without knowledge of the exact type of object.
Reimplemented in ml::BaseItem, ml::BaseList, ml::CurveData, ml::CurveList, ml::ListBase, ml::ListTemplate< T >, ml::ListTemplate< BaseContainerItem >, ml::ListTemplate< BaseItem >, ml::ListTemplate< KeyFrame >, ml::ListTemplate< Matrix3 >, ml::ListTemplate< Matrix4 >, ml::ListTemplate< vec3i >, ml::ListTemplate< vec4i >, ml::ListTemplate< vec6i >, ml::ListTemplate< Vector3 >, ml::ListTemplate< Vector4 >, ml::ListTemplate< Vector6 >, ml::ListTemplate< XMarker >, ml::StylePalette, ml::CSOList, and ml::WEM.
|
inlinevirtual |
Return a string describing this object.
This is mainly meant to return the sub-type 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 |
Check if 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.
Returns if the instance is derived from RefCountedBase.
Reimplemented in ml::RefCountedBase.
|
virtual |
Returns a string describing the object's internal state.
Reimplemented in ml::BaseItem, ml::BaseContainerItem, ml::ListTemplate< T >, ml::ListTemplate< BaseContainerItem >, ml::ListTemplate< BaseItem >, ml::ListTemplate< KeyFrame >, ml::ListTemplate< Matrix3 >, ml::ListTemplate< Matrix4 >, ml::ListTemplate< vec3i >, ml::ListTemplate< vec4i >, ml::ListTemplate< vec6i >, ml::ListTemplate< Vector3 >, ml::ListTemplate< Vector4 >, ml::ListTemplate< Vector6 >, ml::ListTemplate< XMarker >, ml::RasterFunction, ml::RasterFunctionList, and ml::XMarker.
|
inlinevirtual |
Read the objects state from the data stream object.
version is the version number given through 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 sub-classing from another Base class that implements persistence, use the macro ML_READFROM_SUPER() to load the super-class data, because this takes care of reading and checking the version number of the super class.
Reimplemented in ml::BaseItem, and ml::StandardItemModel.
Reads the object state from the children of the given parent node.
Reimplemented in ml::CurveData, ml::CSOList, ml::BaseItem, ml::BaseContainerItem, ml::CurveList, ml::ListBase, ml::ListTemplate< T >, ml::ListTemplate< BaseContainerItem >, ml::ListTemplate< BaseItem >, ml::ListTemplate< KeyFrame >, ml::ListTemplate< Matrix3 >, ml::ListTemplate< Matrix4 >, ml::ListTemplate< vec3i >, ml::ListTemplate< vec4i >, ml::ListTemplate< vec6i >, ml::ListTemplate< Vector3 >, ml::ListTemplate< Vector4 >, ml::ListTemplate< Vector6 >, ml::ListTemplate< XMarker >, ml::BaseListTemplate< T >, ml::BaseListTemplate< BaseContainerItem >, ml::BaseListTemplate< BaseItem >, ml::BaseListTemplate< XMarker >, ml::StylePalette, ml::XMarker, ml::CSOVoxelSetList, and ml::LUTFLinear.
Restores the object's internal state from a string that had been previously generated using persistentState()
.
Reimplemented in ml::RasterFunction, ml::RasterFunctionList, ml::BaseItem, ml::BaseContainerItem, ml::ListTemplate< T >, ml::ListTemplate< BaseContainerItem >, ml::ListTemplate< BaseItem >, ml::ListTemplate< KeyFrame >, ml::ListTemplate< Matrix3 >, ml::ListTemplate< Matrix4 >, ml::ListTemplate< vec3i >, ml::ListTemplate< vec4i >, ml::ListTemplate< vec6i >, ml::ListTemplate< Vector3 >, ml::ListTemplate< Vector4 >, ml::ListTemplate< Vector6 >, ml::ListTemplate< XMarker >, and ml::XMarker.
|
inlinevirtual |
Write the objects state to the data stream object.
Include mlAbstractPersistenceStream.h for the implementation of this method.
If you are sub-classing from another Base class that implements persistence, use the macro ML_WRITETO_SUPER() to save the super-class data, because this takes care of writing the version number of the super class.
Reimplemented in ml::BaseItem, and ml::StandardItemModel.