Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

/otk/point.hh

Go to the documentation of this file.
00001 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
00002 #ifndef __point_hh
00003 #define __point_hh
00004 
00005 /*! @file point.hh
00006   @brief The Point class contains an x/y pair
00007 */
00008 
00009 namespace otk {
00010 
00011 //! The Point class is an x/y coordinate or size pair
00012 class Point {
00013 private:
00014   //! The x value
00015   int _x;
00016   //! The y value
00017   int _y;
00018 
00019 public:
00020   //! Constructs a new Point with 0,0 values
00021   Point() : _x(0), _y(0) {}
00022   //! Constructs a new Point with given values
00023   Point(int x, int y) : _x(x), _y(y) {}
00024 
00025   //! Changes the x value to the new value specified
00026   void setX(int x) { _x = x; }
00027   //! Returns the x value
00028   int x() const { return _x; }
00029 
00030   //! Changes the y value to the new value specified
00031   void setY(int y) { _y = y; }
00032   //! Returns the y value
00033   int y() const { return _y; }
00034 
00035   //! Changes the x and y values
00036   void setPoint(int x, int y) { _x = x; _y = y; }
00037 };
00038 
00039 }
00040 
00041 #endif /* __point_hh */

Generated on Tue Feb 4 22:58:56 2003 for Openbox by doxygen1.3-rc2