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 *************************************************************************************/
00023 /*! \file TeDefines.h
00024     \brief Provides a set of general definitions used by Terralib
00025 */
00026 #ifndef  __TERRALIB_INTERNAL_DEFINES_H
00027 #define  __TERRALIB_INTERNAL_DEFINES_H
00028 
00029 #include <string> 
00030 
00031 /** @defgroup Defines Defines and constants
00032   @{
00033  */
00034 
00035  
00036 /** @defgroup PlatformDetection Platform detection macros.
00037   @{
00038  */
00039 /** @brief Microsoft Windows platform code */ 
00040 #define TePLATFORMCODE_MSWINDOWS 1
00041 /** @brief Generic Linux platform code */ 
00042 #define TePLATFORMCODE_LINUX 2
00043 /** @brief Solaris platform code */ 
00044 #define TePLATFORMCODE_SOLARIS 3
00045 /** @brief Apple platform code */ 
00046 #define TePLATFORMCODE_APPLE 4
00047 /** @brief IBM AIX platform code */ 
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 /** @} */ 
00067 
00068 /** @defgroup CompilerDetection Compiler detection macros.
00069   @{
00070  */
00071 /** @brief MS Visual Studio c++ code */ 
00072 #define TeCOMPILERCODE_VCPLUSPLUS 1
00073 /** @brief Borland c++ code */ 
00074 #define TeCOMPILERCODE_BCPLUSPLUS 2
00075 /** @brief GNU Compiler code */ 
00076 #define TeCOMPILERCODE_GNUC 3
00077 /** @brief CodeWarrior code */ 
00078 #define TeCOMPILERCODE_CODEWARRIOR 4
00079 /** @brief Sun Forte code */ 
00080 #define TeCOMPILERCODE_SUNFORTE7 5
00081 /** @brief AIX xlC code */ 
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 /** @} */ 
00100 
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 
00122 /** @defgroup MathConst Mathematical constants and macro definitions
00123   @{
00124  */
00125 //! A default name length
00126 const int       TeNAME_LENGTH = 2000;                   //!< A default name length
00127 const double    TeMAXFLOAT =    3.4E37;                 //!< Maximum float value
00128 const double    TeMINFLOAT =    3.4E-37;                //!< Minimum float value
00129 const double    TePI  = 3.14159265358979323846;         //!< The ratio of the circumference to the diameter of a circle
00130 const double    TeCDR = 0.01745329251994329576;         //!< Conversion factor: degrees to radians
00131 const double    TeCRD = 57.29577951308232087679;        //!< Conversion factor: radians to degrees
00132 const double    TeEARTHRADIUS   = 6378160.;             //!< Int. Astronomical Union - 1965
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 /** @} */
00146 
00147 
00148 /** @defgroup Selection Mode for the objects
00149         @{
00150  */
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 
00158 /** @defgroup Orient Ring orientation
00159         @{
00160  */
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 
00167 /** @defgroup TopDefines Topology related defines
00168     @{
00169  */
00170 /** @defgroup InOut Inside/Outside positioning
00171         @ingroup TopDefines
00172     @{
00173  */
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 /** @} */
00179 
00180 
00181 /** @defgroup Inter Intersection types
00182         @ingroup TopDefines
00183     @{
00184  */
00185 /** @defgroup GeneralInter General intersection
00186         @ingroup Inter
00187         @{
00188  */
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 
00200 /** @defgroup SegInter Segments intersection
00201         @ingroup Inter
00202         @{
00203  */
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
00208 /** @} */  // end Inte
00209 
00210 /** @defgroup TopOper Topological operations
00211         @{
00212  */
00213 #define TeDIFFERENCE   1        //!< Difference operation
00214 #define TeUNION        2        //!< Union operation
00215 #define TeINTERSECTION 4        //!< Intersection operation
00216 /** @} */ // end TopOper
00217 /** @} */ // end TopDefines
00218 /** @} */ // end Defines
00219 
00220 //! Current terralib database version
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 
00235 /** @defgroup TerraLib_AS_DLL macros.
00236   @{
00237  */
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 /** @} */ 
00254                
00255 /**
00256  * @defgroup MultProgToolsGroup Multi-programming tools.
00257  */                
00258   
00259 /**
00260  * @defgroup GeometricTransformationGroup Geometric transformation.
00261  */       
00262 
00263 #endif
00264 

Generated on Sun Jul 29 04:01:20 2012 for TerraLib - Development Source by  doxygen 1.5.3