IvfDef.h

00001 //
00002 // Copyright 1999-2006 by Structural Mechanics, Lund University.
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Library General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Library General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Library General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00017 // USA.
00018 //
00019 // Please report all bugs and problems to "ivf@byggmek.lth.se".
00020 //
00021 //
00022 // Written by Jonas Lindemann
00023 //
00024 
00025 #ifndef IVFDEF_H
00026 #define IVFDEF_H
00027 
00028 #include <ivf/ivfconfig.h>
00029 
00030 #define IVF_VERSION_MAJOR       1
00031 #define IVF_VERSION_MINOR       0
00032 #define IVF_VERSION_RELEASE 0
00033 
00034 #ifdef IVF_DEBUG_PRINT
00035         #define IvfDbg(txt) \
00036                 std::cout << txt << std::endl;
00037 
00038         #ifdef IVF_DEBUG_LEVEL_1
00039                 #define IvfDbg1(txt) \
00040                         std::cout << txt << std::endl;
00041                 #define IvfDbg2(txt)
00042                 #define IvfDbg3(txt)
00043         #endif
00044 
00045         #ifdef IVF_DEBUG_LEVEL_2
00046                 #define IvfDbg1(txt) \
00047                         std::cout << txt << std::endl;
00048                 #define IvfDbg2(txt) \
00049                         std::cout << txt << std::endl;
00050                 #define IvfDbg3(txt)
00051         #endif
00052 
00053         #ifdef IVF_DEBUG_LEVEL_3
00054                 #define IvfDbg1(txt) \
00055                         std::cout << txt << std::endl;
00056                 #define IvfDbg2(txt) \
00057                         std::cout << txt << std::endl;
00058                 #define IvfDbg3(txt) \
00059                         std::cout << txt << std::endl;
00060         #endif
00061 #else
00062         #define IvfDbg(txt)
00063         #define IvfDbg1(txt)
00064         #define IvfDbg2(txt)
00065         #define IvfDbg3(txt)
00066 #endif
00067 
00068 #ifndef M_PI
00069 #define M_PI 3.1415926535897932384626433832795
00070 #endif
00071 
00072 #ifndef FALSE
00073         #define FALSE 0
00074 #endif
00075 
00076 #ifndef TRUE
00077         #define TRUE 1
00078 #endif
00079 
00080 #ifndef NULL
00081         #ifdef __cplusplus
00082                 #define NULL 0
00083         #else
00084                 #define NULL ((void*) 0)
00085         #endif
00086 #endif
00087 
00088 // DLL-support on Win32
00089 
00090 #ifdef WIN32
00091         #ifdef IVF_DLL
00092                 #ifdef IVFMATH_LIB
00093                         #define IVFMATH_API __declspec(dllexport)
00094                 #else
00095                         #define IVFMATH_API __declspec(dllimport)
00096                 #endif
00097 
00098                 #ifdef IVF_LIB
00099                         #define IVF_API __declspec(dllexport)
00100                 #else
00101                         #define IVF_API __declspec(dllimport)
00102                 #endif
00103 
00104                 #ifdef IVFIMAGE_LIB
00105                         #define IVFIMAGE_API __declspec(dllexport)
00106                 #else
00107                         #define IVFIMAGE_API __declspec(dllimport)
00108                 #endif
00109 
00110                 #ifdef IVFFILE_LIB
00111                         #define IVFFILE_API __declspec(dllexport)
00112                 #else
00113                         #define IVFFILE_API __declspec(dllimport)
00114                 #endif
00115 
00116                 #ifdef IVFFLTK_LIB
00117                         #define IVFFLTK_API __declspec(dllexport)
00118                 #else
00119                         #define IVFFLTK_API __declspec(dllimport)
00120                 #endif
00121 
00122                 #ifdef IVFUI_LIB
00123                         #define IVFUI_API __declspec(dllexport)
00124                 #else
00125                         #define IVFUI_API __declspec(dllimport)
00126                 #endif
00127 
00128                 #ifdef IVFWIDGET_LIB
00129                         #define IVFWIDGET_API __declspec(dllexport)
00130                 #else
00131                         #define IVFWIDGET_API __declspec(dllimport)
00132                 #endif
00133 
00134                 #ifdef IVFCTL_LIB
00135                         #define IVFCTL_API __declspec(dllexport)
00136                 #else
00137                         #define IVFCTL_API __declspec(dllimport)
00138                 #endif
00139 
00140                 #ifdef IVF3DUI_LIB
00141                         #define IVF3DUI_API __declspec(dllexport)
00142                 #else
00143                         #define IVF3DUI_API __declspec(dllimport)
00144                 #endif
00145 
00146                 #ifdef IVFEXT_LIB
00147                         #define IVFEXT_API __declspec(dllexport)
00148                 #else
00149                         #define IVFEXT_API __declspec(dllimport)
00150                 #endif
00151 
00152                 #ifdef IVFWIN32_LIB
00153                         #define IVFWIN32_API __declspec(dllexport)
00154                 #else
00155                         #define IVFWIN32_API __declspec(dllimport)
00156                 #endif
00157 
00158                 #ifdef IVFFONT_LIB
00159                         #define IVFFONT_API __declspec(dllexport)
00160                 #else
00161                         #define IVFFONT_API __declspec(dllimport)
00162                 #endif
00163 
00164                 #ifdef IVFGLE_LIB
00165                         #define IVFGLE_API __declspec(dllexport)
00166                 #else
00167                         #define IVFGLE_API __declspec(dllimport)
00168                 #endif
00169 
00170                 #pragma warning(disable:4251)
00171         #else
00172                 #define IVFMATH_API
00173                 #define IVF_API
00174                 #define IVFIMAGE_API
00175                 #define IVFFILE_API
00176                 #define IVFUI_API
00177                 #define IVFFLTK_API
00178                 #define IVFWIDGET_API
00179                 #define IVF3DUI_API
00180                 #define IVFCTL_API
00181                 #define IVFEXT_API
00182                 #define IVFWIN32_API
00183                 #define IVFFONT_API
00184                 #define IVFGLE_API
00185         #endif
00186 #else
00187                 #define IVFMATH_API
00188                 #define IVF_API
00189                 #define IVFIMAGE_API
00190                 #define IVFFILE_API
00191                 #define IVFUI_API
00192                 #define IVFFLTK_API
00193                 #define IVFWIDGET_API
00194                 #define IVF3DUI_API
00195                 #define IVFCTL_API
00196                 #define IVFEXT_API
00197                 #define IVFWIN32_API
00198                 #define IVFFONT_API
00199                 #define IVFGLE_API
00200 #endif 
00201 
00202 #define IvfStdPointer(classname) \
00203         class classname; \
00204         typedef classname* classname##Ptr
00205 
00206 #define IvfSmartPointer(classname) \
00207         class classname; \
00208         typedef CIvfPointer<classname> classname##Ptr; \
00209         typedef classname* classname##StdPtr;
00210 
00211 #define IvfSmartPointerRefBase(classname,refbase) \
00212         class classname; \
00213         typedef CIvfPointerRefBase<classname,refbase> classname##Ptr; \
00214         typedef classname* classname##StdPtr;
00215 
00216 #define IvfClassInfo(ivfclassname,ivfparent) \
00217         const char* getClassNameThis() { return ivfclassname; } \
00218         virtual const char* getClassName() { return ivfclassname; } \
00219         virtual bool isClass(char* name) { \
00220                 std::string className; \
00221                 className = getClassNameThis(); \
00222                 if (!className.empty()) { \
00223                         if (strcmp(className.c_str(), name)==0) \
00224                                 return true; \
00225                         else \
00226                                 return ivfparent::isClass(name); \
00227                 }\
00228                 else \
00229                         return false; \
00230         }
00231 
00232 #define IvfClassInfoTop(ivfclassname) \
00233         void getClassNameThis(char* name) { strcpy(name, ivfclassname); } \
00234         const char* getClassNameThis() { return ivfclassname; } \
00235         virtual void getClassName(char* name) { strcpy(name, ivfclassname); } \
00236         virtual const char* getClassName() { return ivfclassname; } \
00237         virtual bool isClass(char* name) { \
00238                 char className[30] = ""; \
00239                 getClassNameThis(className); \
00240                 if (className!=NULL) { \
00241                         if (strcmp(className, name)==0) \
00242                                 return true; \
00243                         else \
00244                                 return false; \
00245                 }\
00246                 else \
00247                         return false; \
00248         }
00249 
00250 #endif

Generated on Fri Sep 1 15:36:46 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO