Subversion Repositories public iLand

Rev

Rev 102 | Rev 130 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1
 
24 Werner 2
#ifndef GLOBAL_H
3
#define GLOBAL_H
4
 
5
#define MSGRETURN(x) { qDebug() << x; return; }
87 Werner 6
#define WARNINGRETURN(x) { qWarning() << x; return; }
91 Werner 7
#define ERRORRETURN(x) { qError() << x; return; }
24 Werner 8
// conversions rad/degree
9
#define RAD(x) (x*M_PI/180.)
10
#define GRAD(x) (x/M_PI*180.)
32 Werner 11
#define PI2 2*M_PI
33 Werner 12
 
13
 
91 Werner 14
#include "globalsettings.h"
102 Werner 15
#include "exception.h"
33 Werner 16
// general datatypes
39 Werner 17
//typedef int TreeSpecies;
117 Werner 18
 
19
// global debug helpers (used by macros!)
20
void dbg_helper(const char *where, const char *what,const char* file,int line);
21
void dbg_helper_ext(const char *where, const char *what,const char* file,int line, const QString &s);
22
 
23
#if !defined(DBG_IF)
24
#  ifndef QT_NO_DEBUG
25
#    define DBG_IF(cond, where, what) ((cond) ? dbg_helper(where, what, __FILE__, __LINE__) : qt_noop())
26
#  else
27
#    define DBG_IF(cond, where, what) qt_noop()
28
#  endif
29
#endif
30
 
31
#if !defined(DBG_IF_X)
32
#  ifndef QT_NO_DEBUG
33
#    define DBG_IF_X(cond, where, what,more) ((cond) ? dbg_helper_ext(where, what, __FILE__, __LINE__,more) : qt_noop())
34
#  else
35
#    define DBG_IF_X(cond, where, what,more) qt_noop()
36
#  endif
37
#endif
38
 
24 Werner 39
#endif // GLOBAL_H