openmbvcppinterface  3.1.0
OpenMBV C++ Interface
body.h
1 /*
2  OpenMBV - Open Multi Body Viewer.
3  Copyright (C) 2009 Markus Friedrich
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library 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 GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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  protected:
35  std::string outLineStr, shilouetteEdgeStr;
36  DrawStyle drawMethod{filled};
37  double pointSize{0};
38  double lineWidth{0};
39  void createHDF5File() override;
40  void openHDF5File() override;
41  Body();
42  ~Body() override = default;
43  public:
45  void setOutLine(bool ol) { outLineStr=(ol)?"true":"false"; }
46 
47  bool getOutLine() { return outLineStr=="true"?true:false; }
48 
50  void setShilouetteEdge(bool ol) { shilouetteEdgeStr=(ol)?"true":"false"; }
51 
52  bool getShilouetteEdge() { return shilouetteEdgeStr=="true"?true:false; }
53 
55  void setDrawMethod(DrawStyle ds) { drawMethod=ds; }
56 
57  DrawStyle getDrawMethod() { return drawMethod; }
58 
60  void setPointSize(double ps) { pointSize=ps; }
61 
62  double getPointSize() { return pointSize; }
63 
65  void setLineWidth(double lw) { lineWidth=lw; }
66 
67  double getLineWidth() { return lineWidth; }
68 
70  void initializeUsingXML(xercesc::DOMElement *element) override;
71 
72  xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *parent) override;
73 
78  virtual int getRows()=0;
79 
83  virtual std::vector<double> getRow(int i)=0;
84  };
85 
86 }
87 
88 #endif /* _OPENMBV_BODY_H_ */
89 
virtual std::vector< double > getRow(int i)=0
void setLineWidth(double lw)
Definition: body.h:65
void setShilouetteEdge(bool ol)
Definition: body.h:50
void setPointSize(double ps)
Definition: body.h:60
Definition: object.h:43
virtual int getRows()=0
void setDrawMethod(DrawStyle ds)
Definition: body.h:55
void setOutLine(bool ol)
Definition: body.h:45
void initializeUsingXML(xercesc::DOMElement *element) override
Definition: body.cc:67
Definition: body.h:31