TerraLib 4.1
E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeDefines.h
Go to the documentation of this file.
00001 /************************************************************************************
00002 TerraLib - a library for developing GIS applications.
00003 Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
00004 
00005 This code is part of the TerraLib library.
00006 This library is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU Lesser General Public
00008 License as published by the Free Software Foundation; either
00009 version 2.1 of the License, or (at your option) any later version.
00010 
00011 You should have received a copy of the GNU Lesser General Public
00012 License along with this library.
00013 
00014 The authors reassure the license terms regarding the warranties.
00015 They specifically disclaim any warranties, including, but not limited to,
00016 the implied warranties of merchantability and fitness for a particular purpose.
00017 The library provided hereunder is on an "as is" basis, and the authors have no
00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
00020 indirect, special, incidental, or consequential damages arising out of the use
00021 of this library and its documentation.
00022 *************************************************************************************/
00026 #ifndef  __TERRALIB_INTERNAL_DEFINES_H
00027 #define  __TERRALIB_INTERNAL_DEFINES_H
00028 
00029 #include <string> 
00030 
00040 #define TePLATFORMCODE_MSWINDOWS 1
00041 
00042 #define TePLATFORMCODE_LINUX 2
00043 
00044 #define TePLATFORMCODE_SOLARIS 3
00045 
00046 #define TePLATFORMCODE_APPLE 4
00047 
00048 #define TePLATFORMCODE_AIX 5
00049 
00050 #if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
00051   #define TePLATFORM TePLATFORMCODE_MSWINDOWS
00052 #elif defined( __LINUX__ ) || defined( linux ) || defined( __linux__ ) ||defined( __FreeBSD__ ) //FAMI
00053   #define TePLATFORM TePLATFORMCODE_LINUX
00054 #elif defined( __APPLE_CC__ ) || defined( APPLE_CC )
00055   #define TePLATFORM TePLATFORMCODE_APPLE
00056 #elif defined(sparc) && defined(sun) && defined(unix) 
00057   #define TePLATFORM TePLATFORMCODE_SOLARIS
00058 #elif defined(_AIX)
00059   #define TePLATFORM TePLATFORMCODE_AIX
00060   #ifndef __unix__
00061     #define __unix__
00062   #endif
00063 #else
00064   #error "ERROR: Unknown platform"
00065 #endif
00066 
00072 #define TeCOMPILERCODE_VCPLUSPLUS 1
00073 
00074 #define TeCOMPILERCODE_BCPLUSPLUS 2
00075 
00076 #define TeCOMPILERCODE_GNUC 3
00077 
00078 #define TeCOMPILERCODE_CODEWARRIOR 4
00079 
00080 #define TeCOMPILERCODE_SUNFORTE7 5
00081 
00082 #define TeCOMPILERCODE_XLC 6
00083 
00084 #if defined( _MSC_VER )
00085   #define TeCOMPILER TeCOMPILERCODE_VCPLUSPLUS
00086 #elif defined( __BORLANDC__ ) || defined( __BCPLUSPLUS__ )
00087   #define TeCOMPILER TeCOMPILERCODE_BCPLUSPLUS
00088 #elif defined( __GNUC__ )
00089   #define TeCOMPILER TeCOMPILERCODE_GNUC
00090 #elif defined( __MWERKS__ )
00091   #define TeCOMPILER TeCOMPILERCODE_CODEWARRIOR
00092 #elif defined( __SUNPRO_CC)
00093   #define TeCOMPILER TeCOMPILERCODE_SUNFORTE7
00094 #elif defined( __xlC__ )
00095   #define TeCOMPILER TeCOMPILERCODE_XLC
00096 #else
00097   #error "ERROR: Unknown compiler"
00098 #endif
00099 
00101 /* Including platform dependent definitions */
00102 
00103 #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
00104   #include "TeWindowsPlatformDefines.h"
00105 #elif TePLATFORM == TePLATFORMCODE_LINUX
00106   #ifdef HAVE_CONFIG_H
00107     #include "TeUnixPlatformDefines.h"
00108   #endif
00109 #elif TePLATFORM == TePLATFORMCODE_AIX
00110   #ifdef HAVE_CONFIG_H
00111     #include "TeUnixPlatformDefines.h"
00112   #endif
00113 #elif TePLATFORM == TePLATFORMCODE_APPLE
00114   #ifdef HAVE_CONFIG_H
00115     #include "TeUnixPlatformDefines.h"
00116   #endif
00117 #else
00118   #error "ERROR: Unsupported platform"
00119 #endif
00120 
00121 
00125 
00126 const int  TeNAME_LENGTH = 2000;                       
00127 const double          TeMAXFLOAT =          3.4E37;                          
00128 const double          TeMINFLOAT =          3.4E-37;              
00129 const double          TePI  =    3.14159265358979323846;                     
00130 const double          TeCDR =    0.01745329251994329576;                     
00131 const double          TeCRD = 57.29577951308232087679; 
00132 const double          TeEARTHRADIUS   = 6378160.;                 
00133 
00134 #ifndef MAX
00135 #define MAX(a,b) ( (a>b) ? a : b )          //!< Macro that returns max between two values
00136 #endif
00137 
00138 #ifndef MIN
00139 #define MIN(a,b) ( (a<b) ? a : b )          //!< Macro that returns min between two values
00140 #endif
00141 
00142 #ifndef ABS
00143 #define ABS(x)        ( ((x) >= 0) ? (x) : -(x) )      //!< Macro that returns the absolute value
00144 #endif
00145 
00151 #define TeDEFAULT                           0          //!< default selection
00152 #define TePOINTED                           1          //!< object pointed
00153 #define TeQUERIED                2          //!< object queried
00154 #define TePOINTED_QUERIED        3          //!< object pointed and queried
00155            // end Selection Mode
00156 
00157 
00161 #define TeNOTURN                             0         //!< Unknown orientation
00162 #define TeCOLLINEAR                          0         //!< Collinear
00163 #define TeCLOCKWISE                         -1         //!< Clockwise orientation
00164 #define TeCOUNTERCLOCKWISE        1         //!< Counter-Clockwise orientation
00165            // end Orientation
00166 
00174 #define    TeUNKNOWNPOSITION  0  //!< unknown position
00175 #define    TeINSIDE                 1       //!< inside position
00176 #define    TeOUTSIDE                2       //!< outside position
00177 #define    TeBOUNDARY               4       //!< on the boundary position
00178 
00189 #define TeINTERIORINTERIOR 8     //!< interior and interior intersection
00190 #define TeINTERIORBOUNDARY 16    //!< interior and boundary intersection
00191 #define TeINTERIOREXTERIOR 32    //!< interior and exterior intersection
00192 #define TeBOUNDARYINTERIOR 64    //!< boundary and interior intersection
00193 #define TeBOUNDARYBOUNDARY 128   //!< boundary and boundary intersection
00194 #define TeBOUNDARYEXTERIOR 256   //!< boundary and exterior intersection
00195 #define TeEXTERIORINTERIOR 512   //!< exterior and interior intersection
00196 #define TeEXTERIORBOUNDARY 1024  //!< exterior and boundary intersection
00197 #define TeEXTERIOREXTERIOR 2048  //!< exterior and exterior intersection
00198  // end GeneralInter
00199 
00204 #define TeDONT_INTERSECT 0                  //!< segments don't intersects
00205 #define TeDO_INTERSECT   1                  //!< segments intersects
00206 #define TeAT_ENDPOINT    4                  //!< segments intersects at end points
00207            // end SegInter  // end Inte
00209 
00213 #define TeDIFFERENCE   1         //!< Difference operation
00214 #define TeUNION        2         //!< Union operation
00215 #define TeINTERSECTION 4         //!< Intersection operation
00216  // end TopOper // end TopDefines // end Defines
00219 
00221 const std::string TeDBVERSION = "4.1.2";
00222 
00223 /* @brief TeISNAN definition */
00224 
00225 #if TePLATFORM == TePLATFORMCODE_MSWINDOWS
00226   #include <float.h>
00227   #define TeISNAN( x ) _isnan( x )
00228 #elif TePLATFORM == TePLATFORMCODE_LINUX || TePLATFORM == TePLATFORMCODE_AIX || TePLATFORM == TePLATFORMCODE_APPLE
00229   #include <math.h>
00230   #define TeISNAN( x ) isnan( x )
00231 #else
00232   #error "ERROR: Unsupported platform"
00233 #endif
00234 
00238 #if defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )
00239 
00240 #if defined(_MSC_VER) /* MSVC Compiler */
00241 #pragma warning(disable: 4251)
00242 #endif
00243 
00244 #ifdef TL_AS_DLL
00245 #define TL_DLL __declspec(dllexport)
00246 #else
00247 #define TL_DLL __declspec(dllimport)
00248 #endif
00249 
00250 #else
00251 #define TL_DLL
00252 #endif
00253 
00263 #endif
00264 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines