openmbvcppinterface  3.1.0
OpenMBV C++ Interface
OpenMBV::DynamicAttributes Class Reference

Control attributes of other objects dynamically. More...

#include <dynamicattributes.h>

Inheritance diagram for OpenMBV::DynamicAttributes:
[legend]

Classes

struct  PathData
 

Public Types

using PathDataList = std::vector< PathData >
 
- Public Types inherited from OpenMBV::Body
enum  DrawStyle { filled , lines , points }
 

Public Member Functions

int getRows () override
 
std::vector< Float > getRow (int i) override
 
int getDataSize ()
 
void setObjectEnable (const PathDataList &p)
 
const PathDataList getObjectEnable () const
 
void addObjectEnable (const std::string &p, bool skip=false)
 
void setBodyDrawMethod (const PathDataList &p)
 
const PathDataList getBodyDrawMethod () const
 
void addBodyDrawMethod (const std::string &p, bool skip=false)
 
void setDynamicColoredBodyTransparency (const PathDataList &p)
 
const PathDataList getDynamicColoredBodyTransparency () const
 
void addDynamicColoredBodyTransparency (const std::string &p, bool skip=false)
 
void initializeUsingXML (xercesc::DOMElement *element) override
 
xercesc::DOMElement * writeXMLFile (xercesc::DOMNode *parent) override
 
template<typename T >
void append (const T &row)
 
- Public Member Functions inherited from OpenMBV::Body
void setOutLine (bool ol)
 
bool getOutLine ()
 
void setShilouetteEdge (bool ol)
 
bool getShilouetteEdge ()
 
void setDrawMethod (DrawStyle ds)
 
DrawStyle getDrawMethod ()
 
void setPointSize (double ps)
 
double getPointSize ()
 
void setLineWidth (double lw)
 
double getLineWidth ()
 
void initializeUsingXML (xercesc::DOMElement *element) override
 
xercesc::DOMElement * writeXMLFile (xercesc::DOMNode *parent) override
 
virtual int getRows ()=0
 
virtual std::vector< Float > getRow (int i)=0
 
- Public Member Functions inherited from OpenMBV::Object
void setEnable (bool enable)
 
bool getEnable ()
 
void setBoundingBox (bool bbox)
 
bool getBoundingBox ()
 
void setName (const std::string &name_)
 
std::string getName ()
 
virtual std::string getFullName ()
 
void setEnvironment (bool env)
 
bool getEnvironment ()
 
virtual void initializeUsingXML (xercesc::DOMElement *element)
 
virtual xercesc::DOMElement * writeXMLFile (xercesc::DOMNode *parent)
 
std::shared_ptr< GroupgetTopLevelGroup ()
 
std::weak_ptr< GroupgetParent ()
 
H5::GroupBasegetHDF5Group ()
 
std::string getID () const
 
void setID (std::string ID_)
 

Protected Member Functions

void createHDF5File () override
 
void openHDF5File () override
 
void updateDataSize ()
 
void createHDF5File () override
 
void openHDF5File () override
 
virtual void createHDF5File ()=0
 
virtual void openHDF5File ()=0
 

Protected Attributes

PathDataList objectEnable
 
PathDataList bodyDrawMethod
 
PathDataList dynamicColoredBodyTransparency
 
H5::VectorSerie< Float > * data {nullptr}
 
int dataSize { 1 }
 
- Protected Attributes inherited from OpenMBV::Body
std::string outLineStr
 
std::string shilouetteEdgeStr
 
DrawStyle drawMethod {filled}
 
double pointSize {0}
 
double lineWidth {0}
 
- Protected Attributes inherited from OpenMBV::Object
std::string name
 
std::string enableStr
 
std::string boundingBoxStr
 
std::string ID
 
std::string environmentStr
 
std::weak_ptr< Groupparent
 
H5::GroupBasehdf5Group {nullptr}
 
std::string fullName
 

Friends

class ObjectFactory
 

Detailed Description

Control attributes of other objects dynamically.

With this class you can define a list of objects, by its path, for which a specific attribute should be controlled by the HDF5 data of this object.

See the setter/adder methods which attributes of which objects can be controlled.

HDF5-Dataset: The HDF5 dataset of this object is a 2D array of single or double precision values. Each row represents one dataset in time. A row consists of the following columns in order:

  • time
  • enable-attribute of 1st,2nd,... objectEnable (round(0.0)=disabled, else enabled; a float value is misused)
  • draw-method-attribute of 1st,2nd,... bodyDrawMethod (round(0.0)=filled, round(1.0)=lines, round(2.0)=points; a float value is misused)
  • transparency-attribute of 1st,2nd,... dynamicColoredBodyTransparency (0.0=opaque to 1.0=full-transparent) If skip is true for a entry than this entry does not count in the HDF5 data, it uses the same data as the first skip=false entry before. A path can start with

"../": Then the path is relative to the current object. More "../" items can follow to go to a further parent and the multiple "<objectName>/" items can follow to walk down.

  • "//": Then the path is a absolute path and start which starts at the root element. Multiple "<objectName>/" items can be follow to walk down. Note that the file name is not part of the absolute path, this is already meant by "//".

Member Function Documentation

◆ addBodyDrawMethod()

void OpenMBV::DynamicAttributes::addBodyDrawMethod ( const std::string &  p,
bool  skip = false 
)

Add a body, by its path, for which the draw-method attribute should be controlled using HDF5 data.

◆ addDynamicColoredBodyTransparency()

void OpenMBV::DynamicAttributes::addDynamicColoredBodyTransparency ( const std::string &  p,
bool  skip = false 
)

Add a dynamic-colored-body, by its path, for which the transparency attribute should be controlled using HDF5 data.

◆ addObjectEnable()

void OpenMBV::DynamicAttributes::addObjectEnable ( const std::string &  p,
bool  skip = false 
)

Add a object, by its path, for which the enable attribute should be controlled using HDF5 data.

◆ append()

template<typename T >
void OpenMBV::DynamicAttributes::append ( const T &  row)
inline

Append a data vector the the h5 datsset

◆ createHDF5File()

void OpenMBV::DynamicAttributes::createHDF5File ( )
overrideprotectedvirtual

Reimplemented from OpenMBV::Body.

◆ getRow()

std::vector< Float > OpenMBV::DynamicAttributes::getRow ( int  i)
inlineoverridevirtual

Get row number i of the default data. NOTE: see also append()

Implements OpenMBV::Body.

◆ getRows()

int OpenMBV::DynamicAttributes::getRows ( )
inlineoverridevirtual

Get the number of rows of the default data. Returns 0, if no default data is avaliable. NOTE: see also append()

Implements OpenMBV::Body.

◆ initializeUsingXML()

void OpenMBV::DynamicAttributes::initializeUsingXML ( xercesc::DOMElement *  element)
overridevirtual

Initializes the time invariant part of the object using a XML node

Reimplemented from OpenMBV::Body.

◆ openHDF5File()

void OpenMBV::DynamicAttributes::openHDF5File ( )
overrideprotectedvirtual

Reimplemented from OpenMBV::Body.

◆ setBodyDrawMethod()

void OpenMBV::DynamicAttributes::setBodyDrawMethod ( const PathDataList &  p)

Set the bodies, by its path, for which the draw-method attribute should be controlled using HDF5 data.

◆ setDynamicColoredBodyTransparency()

void OpenMBV::DynamicAttributes::setDynamicColoredBodyTransparency ( const PathDataList &  p)

Set the dynamic-colored-bodies, by its path, for which the transparency attribute should be controlled using HDF5 data.

◆ setObjectEnable()

void OpenMBV::DynamicAttributes::setObjectEnable ( const PathDataList &  p)

Set the objects, by its path, for which the enable attribute should be controlled using HDF5 data.

◆ writeXMLFile()

DOMElement * OpenMBV::DynamicAttributes::writeXMLFile ( xercesc::DOMNode *  parent)
overridevirtual

Reimplemented from OpenMBV::Body.


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