Main Page | Class List | File List | Class Members | Related Pages

global.h

00001 /***************************************************************************
00002                            global.h
00003                            -------------------
00004     begin                : 2004-04-16
00005     copyright            : (C) 2004-2005 by Michael Menne
00006     email                : menne@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  This program is free software; you can redistribute it and/or
00011  modify it under the terms of the GNU General Public License
00012  as published by the Free Software Foundation; either version 2
00013  of the License, or (at your option) any later version.
00014 
00015  This program is distributed in the hope that it will be useful,
00016  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  GNU General Public License for more details.
00019 
00020  You should have received a copy of the GNU General Public License
00021  along with this program; if not, write to the Free Software
00022  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023  ***************************************************************************/
00024 
00025 #ifndef GLOBAL_H
00026 #define GLOBAL_H
00027 
00028 //BEGIN includes and defines
00029 #define WDSMAP_VERSION "0.3"
00030 
00031 #ifdef WIN32
00032 #define WIN32_LEAN_AND_MEAN
00033 //#include <windows.h>
00034 #pragma warning(disable: 4786)  // disable map warnings
00035 
00036 // show toolstips, this does not work for wxGTK properly
00037 #define SHOW_TOOLTIPS
00038 #endif
00039 
00040 // wxWidgets
00041 #include <wx/wx.h>
00042 #include <wx/image.h>
00043 #include <wx/glcanvas.h>
00044 #include <wx/busyinfo.h>
00045 #include <wx/tipwin.h>
00046 #include <wx/confbase.h>
00047 #include <wx/fileconf.h>
00048 
00049 #define PI 3.1415926535897932384626433832795029
00050 
00052 //#if defined(__APPLE__) && defined(__MACH__)
00053 //#include <OpenGL/gl.h>
00054 //#include <OpenGL/glu.h>
00055 //#else
00056 //#include <GL/gl.h>
00057 //#include <GL/glu.h>
00058 //#endif
00059 
00060 // STL
00061 #include <algorithm>
00062 #include <iostream>
00063 #include <fstream>
00064 #include <string>
00065 #include <vector>
00066 #include <map>
00067 // #include <hash_map>      // Leider nicht in VC6 vorhanden
00068 using namespace std;
00069 //END includes
00070 
00071 // Typen
00072 typedef unsigned int  UINT;
00073 typedef unsigned char BYTE;
00074 
00090 class Rect  // We can't use wxRect, because it doesn't allow negativ coordinates
00091 {
00092 public:
00094     Rect() {}
00102     Rect(int _x, int _y, int _w, int _h) : x(_x), y(_y), w(_w),  h(_h) { }
00103 
00105     int Left  () const { return x; }
00107     int Top   () const { return y; }
00109     int Right () const { return x+w; }
00111     int Bottom() const { return y+h; }
00112 
00118     bool RectIntersect(const Rect *rcSrc ) const
00119     {
00120         return (max(x, rcSrc->x) < min(x + w, rcSrc->x + rcSrc->w) &&
00121                 max(y, rcSrc->y) < min(y + h, rcSrc->y + rcSrc->h));
00122     }
00123 
00129     void Inflate( int dx, int dy )
00130     {
00131         x -= dx;
00132         w += 2*dx;
00133         y -= dy;
00134         h += 2*dy;
00135     }
00136 
00144     void Set( int x, int y, int w, int h )
00145     {
00146         this->x = x;
00147         this->y = y;
00148         this->w = w;
00149         this->h = h;
00150     }
00151 
00152 public:
00153         // internal purpose
00154     int x, y;
00155     int w, h;
00156 };
00157 
00164 inline istream& eatwhite( istream& is )
00165 {
00166     char c;
00167     while( is.get(c) )
00168     {
00169         if( !isspace(c) )
00170         {
00171             is.putback(c);
00172             break;
00173         }
00174     }
00175     return is;
00176 }
00177 
00178 #endif // GLOBAL_H
00179 
00180 // kate: space-indent off; tab-width 4; replace-tabs off;

Generated on Sun Jan 16 18:20:26 2005 for WDSMap by  doxygen 1.3.9.1