rectangle.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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