rectangle.hpp

Go to the documentation of this file.
00001 /*
00002     RenderStack  Support library for OpenGL 3+
00003     Copyright (C) 2010  Timo Suoranta
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2.1 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 */
00019 
00027 #ifndef RECTANGLE_HPP
00028 #define RECTANGLE_HPP
00029 
00030 #include "renderstack/rs.h"
00031 
00032 namespace renderstack {
00033 
00035 class rectangle
00036 {
00037 public:
00038     rectangle(int x = 0, int y = 0, int width = 0, int height = 0)
00039     :   m_x(x)
00040     ,   m_y(y)
00041     ,   m_width(width)
00042     ,   m_height(height)
00043     {
00044     }
00045 
00046 public:
00047     void extend_by_point(int x, int y);
00048 
00049     void set(int x, int y, int width, int height);
00050 
00051 public:
00052     void set_x(int x){ m_x = x; }
00053     void set_y(int y){ m_y = y; }
00054     void set_width(int width){ m_width = width; }
00055     void set_height(int height){ m_height = height; }
00056 
00057     int x() const { return m_x; }
00058     int y() const { return m_y; }
00059     int width() const { return m_width; }
00060     int height() const { return m_height; }
00061 
00062 private:
00063     int m_x;
00064     int m_y;
00065     int m_width;
00066     int m_height;
00067 };
00068 
00069 }
00070 
00071 #endif
00072 
Generated on Sun Apr 11 12:23:08 2010 for RenderStack by  doxygen 1.6.3