00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _OPENMBV_BODY_H_
00021 #define _OPENMBV_BODY_H_
00022
00023 #include <string>
00024 #include <sstream>
00025 #include <vector>
00026 #include <openmbvcppinterface/object.h>
00027 #include "openmbvcppinterface/simpleparameter.h"
00028
00029 namespace OpenMBV {
00030
00032 class Body : public Object {
00033 public:
00034 enum DrawStyle { filled, lines, points };
00035 private:
00036 std::string getRelPathTo(Body* destBody);
00037 protected:
00038 std::string outLineStr, shilouetteEdgeStr;
00039 DrawStyle drawMethod;
00040 Body* hdf5LinkBody;
00041 std::string hdf5LinkStr;
00042 void createHDF5File();
00043 void openHDF5File();
00044 void terminate();
00045 ~Body() {}
00046 public:
00048 Body();
00049
00051 std::string getClassName() { return "Body"; }
00052
00054 void setHDF5LinkTarget(Body* dest) { hdf5LinkBody=dest; }
00055
00056 Body* getHDF5LinkTarget() { return hdf5LinkBody; }
00057
00059 bool isHDF5Link() { return (hdf5LinkBody!=0 || hdf5LinkStr!=""); }
00060
00062 void setOutLine(bool ol) { outLineStr=(ol==true)?"true":"false"; }
00063
00064 bool getOutLine() { return outLineStr=="true"?true:false; }
00065
00067 void setShilouetteEdge(bool ol) { shilouetteEdgeStr=(ol==true)?"true":"false"; }
00068
00069 bool getShilouetteEdge() { return shilouetteEdgeStr=="true"?true:false; }
00070
00072 void setDrawMethod(DrawStyle ds) { drawMethod=ds; }
00073
00074 DrawStyle getDrawMethod() { return drawMethod; }
00075
00077 virtual void initializeUsingXML(MBXMLUtils::TiXmlElement *element);
00078
00079 MBXMLUtils::TiXmlElement* writeXMLFile(MBXMLUtils::TiXmlNode *parent);
00080
00086 virtual void append(const std::vector<double>& row)=0;
00087
00092 virtual int getRows()=0;
00093
00097 virtual std::vector<double> getRow(int i)=0;
00098 };
00099
00100 }
00101
00102 #endif
00103