Whole-body human reference model and tools for unifying representations of whole-body human motion
The MMMCore library provides convenient mechanisms for extending the legacy MMM data format.
Therefore interfaces exist, which can be used to implement custom data types with corresponding parser extensions. By default, the Legacy MMM parser ignores all unknwon XML tags, so that any custom extensions can be safely included to the data files without interfering with other users who might want to use the data.
See also the XML processing with rapidXML page.
See also the The Legacy MMM data format page.
Root XML tags are used to define parameters, comments or general purpose data whereas motion-data XML tags specify additional data for a specific timestep of the motion data.
A custom data class can be defined by deriving from MMM::MotionEntry. A short example is given below:
The CustomData class can specify any data as long it implements an XML output method. In the constructor the XML tag name is passed to the parent's constructor in order to store it to the parent's variable tagName. In addition a factory class must be defined and registered to the MMM::LegacyMotionReaderXML in order to allow custom tag parsing. Below you find an exemplary implementation for a custom tag factory.
The processMotionXMLTag method is called during XML parsing of the <Motion> ... </Motion> object when the corresponding XML tag is recognized (as specified on registering, see below). During parsing a Motion object is generated to which all information is stored. This instance is passed to the method, so that a custom factory may add the generated MotionEntry.
Before XML parsing the MMM::XMLMotionTagProcessor has to be registered to the MMM::LegacyMotionReaderXML:
Now, custom tags, as given in the example below, are recognized by the parser.
The motion can be loaded with
MotionFrame XML tags are used to define additional data for a specific timestep of the motion data. Similar to Motion XML tag extensions, custom data classes can be defined by deriving from MMM::MotionDataEntry. A short example is given below:
The CustomMotionData class can specify any data as long it implements an XML output method. In the constructor the XML tag name is passed to the parent's constructor in order to store it to the parent's variable tagName. In addition a factory class must be defined and registered to the MMM::LegacyMotionReaderXML in order to allow custom tag parsing. Below you find an exemplary implementation for a custom tag factory.
The processMotionFrameXMLTag method is called during XML parsing of the MotionFrame object when the corresponding XML MotionFrame tag is recognized (as specified on registering, see below). During parsing a MotionFrame object is generated to which all information is stored. This instance is passed to the method, so that a custom factory may add the generated MotionFrameEntry.
Before XML parsing the MMM::XMLMotionFrameTagProcessor has to be registered to the MMM::LegacyMotionReaderXML:
Now, custom tags, as given in the example below, are recognized by the parser.
Again, the motion can be loaded with