screen_rectangle.h

Go to the documentation of this file.
00001 #ifndef SCREEN_RECTANGLE_CLASS
00002 #define SCREEN_RECTANGLE_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : screen_rectangle                                                  *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1992-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "geometric_dll.h"
00019 #include "rectangle.h"
00020 
00021 #ifdef __WIN32__
00022   // forward.
00023   struct tagPOINT; struct tagRECT;
00024 #endif
00025 
00026 namespace geometric {
00027 
00028 // forward.
00029 class double_angle;
00030 
00032 
00033 class GEOMETRIC_CLASS_STYLE screen_point : public point<int>
00034 {
00035 public:
00036   screen_point(int x = 0, int y = 0) : point<int>(x, y) {}
00037   screen_point(int r, double_angle theta) : point<int>(r, theta) {}
00038   screen_point(const point<int> &original) : point<int>(original) {}
00039   IMPLEMENT_CLASS_NAME("screen_point");
00040 
00041 #ifdef __WIN32__
00042   screen_point(const tagPOINT &original);
00044   operator tagPOINT();
00046 #endif
00047 };
00048 
00049 const screen_point GEOMETRIC_FUNCTION_STYLE &screen_origin();
00051 
00053 
00055 
00061 class GEOMETRIC_CLASS_STYLE screen_rectangle : public rectangle<int>
00062 {
00063 public:
00064   screen_rectangle(const screen_point &vertex_1, const screen_point &vertex_2);
00065   screen_rectangle(int x_1 = 0, int y_1 = 0, int x_2 = 0, int y_2 = 0);
00066   screen_rectangle(const rectangle<int> &init);
00067 
00068   screen_rectangle order() const;
00070 
00073   screen_point top_left() const;
00074   screen_point bottom_left() const;
00075   screen_point top_right() const;
00076   screen_point bottom_right() const;
00077 
00078   int left() const { return top_left().x(); }
00079   int top() const { return top_left().y(); }
00080   int right() const { return bottom_right().x(); }
00081   int bottom() const { return bottom_right().y(); }
00082 
00083 #ifdef __WIN32__
00084   screen_rectangle(const tagRECT &original);
00086   operator tagRECT() const;
00088 #endif
00089 };
00090 
00091 } // namespace.
00092 
00093 #endif
00094 

Generated on Fri Nov 21 04:29:44 2008 for HOOPLE Libraries by  doxygen 1.5.1