All Classes Namespaces Functions Variables Typedefs Enumerations Pages
body.h
1 /*
2  OpenMBV - Open Multi Body Viewer.
3  Copyright (C) 2009 Markus Friedrich
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */
19 
20 #ifndef _OPENMBV_BODY_H_
21 #define _OPENMBV_BODY_H_
22 
23 #include <string>
24 #include <sstream>
25 #include <vector>
26 #include <openmbvcppinterface/object.h>
27 
28 namespace OpenMBV {
29 
31  class Body : public Object {
32  public:
33  enum DrawStyle { filled, lines, points };
34  private:
35  std::string getRelPathTo(const boost::shared_ptr<Body> &destBody);
36  protected:
37  std::string outLineStr, shilouetteEdgeStr;
38  DrawStyle drawMethod;
39  boost::shared_ptr<Body> hdf5LinkBody;
40  std::string hdf5LinkStr;
41  void createHDF5File();
42  void openHDF5File();
43  void terminate();
44  Body();
45  ~Body() {}
46  public:
47 
49  std::string getClassName() { return "Body"; }
50 
52  void setHDF5LinkTarget(const boost::shared_ptr<Body> &dest) { hdf5LinkBody=dest; }
53 
54  boost::shared_ptr<Body>& getHDF5LinkTarget() { return hdf5LinkBody; }
55 
57  bool isHDF5Link() { return (hdf5LinkBody || hdf5LinkStr!=""); }
58 
60  void setOutLine(bool ol) { outLineStr=(ol==true)?"true":"false"; }
61 
62  bool getOutLine() { return outLineStr=="true"?true:false; }
63 
65  void setShilouetteEdge(bool ol) { shilouetteEdgeStr=(ol==true)?"true":"false"; }
66 
67  bool getShilouetteEdge() { return shilouetteEdgeStr=="true"?true:false; }
68 
70  void setDrawMethod(DrawStyle ds) { drawMethod=ds; }
71 
72  DrawStyle getDrawMethod() { return drawMethod; }
73 
75  virtual void initializeUsingXML(xercesc::DOMElement *element);
76 
77  xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *parent);
78 
83  virtual int getRows()=0;
84 
88  virtual std::vector<double> getRow(int i)=0;
89  };
90 
91 }
92 
93 #endif /* _OPENMBV_BODY_H_ */
94 
virtual std::vector< double > getRow(int i)=0
void setShilouetteEdge(bool ol)
Definition: body.h:65
virtual void initializeUsingXML(xercesc::DOMElement *element)
Definition: body.cc:101
std::string getClassName()
Definition: body.h:49
Definition: object.h:48
bool isHDF5Link()
Definition: body.h:57
virtual int getRows()=0
void setDrawMethod(DrawStyle ds)
Definition: body.h:70
void setOutLine(bool ol)
Definition: body.h:60
void setHDF5LinkTarget(const boost::shared_ptr< Body > &dest)
Definition: body.h:52
Definition: body.h:31

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML