Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

point.h

Go to the documentation of this file.
00001 #ifndef _LIBGNOMECANVASMM_POINT_H
00002 #define _LIBGNOMECANVASMM_POINT_H
00003 
00004 // -*- C++ -*-
00005 /* $Id: point.h,v 1.6 2002/12/09 08:53:15 murrayc Exp $ */
00006 
00007 /* point.h
00008  * 
00009  * Copyright (C) 1999 The gnomemm Development Team
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Library General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Library General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Library General Public
00022  * License along with this library; if not, write to the Free
00023  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024  */
00025 
00026 #include <libgnomecanvas/gnome-canvas.h>
00027 //#include <libgnomecanvasmm/types.h>
00028 #include <iostream>
00029 
00030 namespace Gnome
00031 {
00032 
00033 namespace Art
00034 {
00035 
00039 class Point
00040 {
00041 public:
00042   Point(gdouble x = 0.0, gdouble y = 0.0);
00043   Point(const ArtPoint& artpoint);
00044   Point(const Point& src);
00045   Point& operator=(const Point& src);
00046   ~Point();
00047 
00048   gdouble get_x() const;
00049   void set_x(gdouble x);
00050   gdouble get_y() const;
00051   void set_y(gdouble y);
00052   
00053   Point operator+(const Point& p2);
00054   Point operator-(const Point& p2);
00055   Point const & operator+=(const Point& other);
00056   Point const & operator-=(const Point& other);
00057 
00058   ArtPoint* gobj();
00059   const ArtPoint* gobj() const;
00060 
00061   protected:
00062     //GnomeCanvasPoints uses arrays of double, 2 at a time, which is the same as a set of ArtPoints
00063     //because an ArtPoint struct only has 2 double members.
00064     ArtPoint m_ArtPoint;
00065 };
00066 
00067 } //namespace Art
00068 
00069 } //namespace Gnome
00070 
00071 std::ostream& operator<<(std::ostream& out, const Gnome::Art::Point& p);
00072 
00073 #endif /* _LIBGNOMECANVASMM_POINT_H */
00074 

Generated on Fri Nov 12 14:55:52 2004 for libgnomecanvasmm by doxygen 1.3.5