libgnomecanvasmm
point.h
Go to the documentation of this file.
1 #ifndef _LIBGNOMECANVASMM_POINT_H
2 #define _LIBGNOMECANVASMM_POINT_H
3 
4 // -*- C++ -*-
5 /* $Id: point.h 2019 2009-01-27 08:29:42Z murrayc $ */
6 
7 /* point.h
8  *
9  * Copyright (C) 1999 The gnomemm Development Team
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free
23  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 #include <libgnomecanvas/gnome-canvas.h>
27 //#include <libgnomecanvasmm/types.h>
28 #include <iostream>
29 
30 namespace Gnome
31 {
32 
33 namespace Art
34 {
35 
39 class Point
40 {
41 public:
42  Point(gdouble x = 0.0, gdouble y = 0.0);
43  Point(const ArtPoint& artpoint);
44  Point(const Point& src);
45  Point& operator=(const Point& src);
46  ~Point();
47 
48  gdouble get_x() const;
49  void set_x(gdouble x);
50  gdouble get_y() const;
51  void set_y(gdouble y);
52 
53  Point operator+(const Point& p2);
54  Point operator-(const Point& p2);
55  Point const & operator+=(const Point& other);
56  Point const & operator-=(const Point& other);
57 
58  ArtPoint* gobj();
59  const ArtPoint* gobj() const;
60 
61  protected:
62  //GnomeCanvasPoints uses arrays of double, 2 at a time, which is the same as a set of ArtPoints
63  //because an ArtPoint struct only has 2 double members.
64  ArtPoint m_ArtPoint;
65 };
66 
67 } //namespace Art
68 
69 } //namespace Gnome
70 
71 std::ostream& operator<<(std::ostream& out, const Gnome::Art::Point& p);
72 
73 #endif /* _LIBGNOMECANVASMM_POINT_H */
74 
gdouble get_x() const
Definition: affinetrans.h:29
Point(gdouble x=0.0, gdouble y=0.0)
Point & operator=(const Point &src)
void set_x(gdouble x)
std::ostream & operator<<(std::ostream &out, const Gnome::Art::Point &p)
gdouble get_y() const
Wrapper for ArtPoint struct.
Definition: point.h:39
Point const & operator-=(const Point &other)
Point operator-(const Point &p2)
Point operator+(const Point &p2)
Point const & operator+=(const Point &other)
ArtPoint * gobj()
void set_y(gdouble y)
ArtPoint m_ArtPoint
Definition: point.h:64