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/objectfactory.h>
27 #include <openmbvcppinterface/object.h>
28
29 namespace OpenMBV {
30
32 class Body : public Object {
33 public:
34 enum DrawStyle { filled, lines, points };
35 protected:
36 std::string outLineStr, shilouetteEdgeStr;
37 DrawStyle drawMethod{filled};
38 double pointSize{0};
39 double lineWidth{0};
40 void createHDF5File() override;
41 void openHDF5File() override;
42 Body();
43 ~Body() override = default;
44 public:
46 void setOutLine(bool ol) { outLineStr=(ol)?"true":"false"; }
47
48 bool getOutLine() { return outLineStr=="true"?true:false; }
49
51 void setShilouetteEdge(bool ol) { shilouetteEdgeStr=(ol)?"true":"false"; }
52
53 bool getShilouetteEdge() { return shilouetteEdgeStr=="true"?true:false; }
54
56 void setDrawMethod(DrawStyle ds) { drawMethod=ds; }
57
58 DrawStyle getDrawMethod() { return drawMethod; }
59
61 void setPointSize(double ps) { pointSize=ps; }
62
63 double getPointSize() { return pointSize; }
64
66 void setLineWidth(double lw) { lineWidth=lw; }
67
68 double getLineWidth() { return lineWidth; }
69
71 void initializeUsingXML(xercesc::DOMElement *element) override;
72
73 xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *parent) override;
74
79 virtual int getRows()=0;
80
84 virtual std::vector<double> getRow(int i)=0;
85 };
86
87 }
88
89 #endif /* _OPENMBV_BODY_H_ */
90
OpenMBV::Body::getRow
virtual std::vector< double > getRow(int i)=0
OpenMBV::Body::setLineWidth
void setLineWidth(double lw)
Definition: body.h:66
OpenMBV::Body::setShilouetteEdge
void setShilouetteEdge(bool ol)
Definition: body.h:51
OpenMBV::Body::setPointSize
void setPointSize(double ps)
Definition: body.h:61
OpenMBV::Object
Definition: object.h:42
OpenMBV::Body::getRows
virtual int getRows()=0
OpenMBV::Body::setDrawMethod
void setDrawMethod(DrawStyle ds)
Definition: body.h:56
OpenMBV::Body::setOutLine
void setOutLine(bool ol)
Definition: body.h:46
OpenMBV::Body::initializeUsingXML
void initializeUsingXML(xercesc::DOMElement *element) override
Definition: body.cc:67
OpenMBV::Body
Definition: body.h:32