openmbvcppinterface  3.1.0
OpenMBV C++ Interface
rigidspineextrusion.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_RIGIDSPINEEXTRUSION_H_
21#define _OPENMBV_RIGIDSPINEEXTRUSION_H_
22
23#include <openmbvcppinterface/rigidbody.h>
24#include <openmbvcppinterface/polygonpoint.h>
25
26namespace OpenMBV {
27
37 friend class ObjectFactory;
38 public:
41 void setContour(const std::shared_ptr<std::vector<std::shared_ptr<PolygonPoint> > > &contour_) { contour = contour_; }
42
43 std::shared_ptr<std::vector<std::shared_ptr<PolygonPoint> > > getContour() { return contour; }
44
45 void setCounterClockWise(bool f) { ccw = f; }
46 bool getCounterClockWise() { return ccw; }
47
48 struct Spine {
49 Spine(float x_, float y_, float z_, float a, float b, float g) : x(x_), y(y_), z(z_), alpha(a), beta(b), gamma(g) {}
50 float x, y, z;
51 float alpha, beta, gamma;
52 };
53 void setSpine(const std::vector<Spine>& spine_) { spine = spine_; };
54 std::vector<Spine> getSpine() { return spine; }
55
57 void initializeUsingXML(xercesc::DOMElement *element) override;
58
60 xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *parent) override;
61 protected:
62 RigidSpineExtrusion();
63 ~RigidSpineExtrusion() override;
64
65 std::vector<Spine> spine;
66
68 std::shared_ptr<std::vector<std::shared_ptr<PolygonPoint> > > contour;
69
70 bool ccw { true };
71 };
72
73}
74
75#endif /* _OPENMBV_RIGIDSPINEEXTRUSION_H_ */
76
Definition: objectfactory.h:38
Abstract base class for all rigid bodies.
Definition: rigidbody.h:68
Class for all rigid bodies extruded along a curve.
Definition: rigidspineextrusion.h:36
xercesc::DOMElement * writeXMLFile(xercesc::DOMNode *parent) override
Definition: rigidspineextrusion.cc:35
std::shared_ptr< std::vector< std::shared_ptr< PolygonPoint > > > contour
Definition: rigidspineextrusion.h:68
void setContour(const std::shared_ptr< std::vector< std::shared_ptr< PolygonPoint > > > &contour_)
Definition: rigidspineextrusion.h:41
void initializeUsingXML(xercesc::DOMElement *element) override
Definition: rigidspineextrusion.cc:51
Definition: rigidspineextrusion.h:48