screen_rectangle.cpp
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 #include "rectangle.h"
00019 #include "screen_rectangle.h"
00020
00021 #include <basis/mutex.h>
00022
00023 #include <structures/static_memory_gremlin.h>
00024
00025 using namespace basis;
00026
00027 namespace geometric {
00028
00029 SAFE_STATIC_CONST(screen_point, screen_origin, (0, 0))
00030
00031
00032
00033 #ifdef __WIN32__
00034 screen_point::screen_point(const tagPOINT &original) : point<int>(original.x, original.y) {}
00035
00036 screen_point::operator tagPOINT()
00037 { POINT to_return; to_return.x = x(); to_return.y = y(); return to_return; }
00038 #endif
00039
00041
00042 screen_rectangle::screen_rectangle(const rectangle<int> &init)
00043 : rectangle<int>(init) {}
00044
00045 screen_rectangle::screen_rectangle(const screen_point &vertex_1,
00046 const screen_point &vertex_2)
00047 : rectangle<int>(vertex_1, vertex_2) {}
00048
00049 screen_rectangle::screen_rectangle(int x_1, int y_1, int x_2, int y_2)
00050 : rectangle<int>(x_1, y_1, x_2, y_2) {}
00051
00052 screen_rectangle screen_rectangle::order() const
00053 { return screen_rectangle(top_left(), bottom_right()); }
00054
00055 screen_point screen_rectangle::top_left() const
00056 { return rectangle<int>::bottom_left(); }
00057
00058 screen_point screen_rectangle::bottom_left() const
00059 { return rectangle<int>::top_left(); }
00060
00061 screen_point screen_rectangle::top_right() const
00062 { return rectangle<int>::bottom_right(); }
00063
00064 screen_point screen_rectangle::bottom_right() const
00065 { return rectangle<int>::top_right(); }
00066
00067 #ifdef __WIN32__
00068 screen_rectangle::screen_rectangle(const tagRECT &original)
00069 : rectangle<int>(original.left, original.top, original.right, original.bottom)
00070 {}
00071
00072 screen_rectangle::operator tagRECT() const
00073 {
00074 RECT to_return; to_return.left = left();
00075 to_return.top = top(); to_return.right = right();
00076 to_return.bottom = bottom(); return to_return;
00077 }
00078 #endif
00079
00080 }
00081
00082
00083