All Classes Namespaces Functions Variables Typedefs Enumerations Pages
polygonpoint.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_POLYGONPOINT_H_
21 #define _OPENMBV_POLYGONPOINT_H_
22 
23 #include <vector>
24 #include <fstream>
25 #include <iostream>
26 #include "openmbvcppinterface/body.h"
27 #include <stdexcept>
28 
29 namespace OpenMBV {
30 
37  class PolygonPoint {
38  protected:
39  PolygonPoint(double x_, double y_, int b_) : x(x_), y(y_), b(b_) {}
40  ~PolygonPoint() {}
41  static void deleter(PolygonPoint *pp) { delete pp; }
42  public:
43  static boost::shared_ptr<PolygonPoint> create(double x_, double y_, int b_) {
44  return boost::shared_ptr<PolygonPoint>(new PolygonPoint(x_, y_, b_), &deleter);
45  };
46 
47  /* GETTER / SETTER */
48  double getXComponent() { return x; }
49  double getYComponent() { return y; }
50  int getBorderValue() { return b; }
51  /***************************************************/
52 
53  /* CONVENIENCE */
55  static void serializePolygonPointContour(xercesc::DOMElement *parent,
56  const boost::shared_ptr<std::vector<boost::shared_ptr<PolygonPoint> > > &cont);
57 
58  static boost::shared_ptr<std::vector<boost::shared_ptr<PolygonPoint> > > initializeUsingXML(xercesc::DOMElement *element);
59 
60  private:
61  double x, y;
62  int b;
63  };
64 
65 }
66 
67 #endif /* POLYGONPOINT_H */
68 
Definition: polygonpoint.h:37
static void serializePolygonPointContour(xercesc::DOMElement *parent, const boost::shared_ptr< std::vector< boost::shared_ptr< PolygonPoint > > > &cont)
Definition: polygonpoint.cc:28

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML