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
00028 namespace OpenMBV {
00029
00031 class Body : public Object {
00032 public:
00033 enum DrawStyle { filled, lines, points };
00034 private:
00035 std::string getRelPathTo(Body* destBody);
00036 protected:
00037 std::string outLineStr, shilouetteEdgeStr;
00038 DrawStyle drawMethod;
00039 Body* hdf5LinkBody;
00040 std::string hdf5LinkStr;
00041 void createHDF5File();
00042 void openHDF5File();
00043 void terminate();
00044 ~Body() {}
00045 public:
00047 Body();
00048
00050 std::string getClassName() { return "Body"; }
00051
00053 void setHDF5LinkTarget(Body* dest) { hdf5LinkBody=dest; }
00054
00055 Body* getHDF5LinkTarget() { return hdf5LinkBody; }
00056
00058 bool isHDF5Link() { return (hdf5LinkBody!=0 || hdf5LinkStr!=""); }
00059
00061 void setOutLine(bool ol) { outLineStr=(ol==true)?"true":"false"; }
00062
00063 bool getOutLine() { return outLineStr=="true"?true:false; }
00064
00066 void setShilouetteEdge(bool ol) { shilouetteEdgeStr=(ol==true)?"true":"false"; }
00067
00068 bool getShilouetteEdge() { return shilouetteEdgeStr=="true"?true:false; }
00069
00071 void setDrawMethod(DrawStyle ds) { drawMethod=ds; }
00072
00073 DrawStyle getDrawMethod() { return drawMethod; }
00074
00076 virtual void initializeUsingXML(xercesc::DOMElement *element);
00077
00078 xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *parent);
00079
00085 virtual void append(const std::vector<double>& row)=0;
00086
00091 virtual int getRows()=0;
00092
00096 virtual std::vector<double> getRow(int i)=0;
00097 };
00098
00099 }
00100
00101 #endif
00102