Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

basic.h

00001 /* include/Inventor/C/basic.h. Generated by configure. */ 00002 /**************************************************************************\ 00003 * 00004 * This file is part of the Coin 3D visualization library. 00005 * Copyright (C) 1998-2003 by Systems in Motion. All rights reserved. 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License 00009 * version 2.1 as published by the Free Software Foundation. See the 00010 * file LICENSE.LGPL at the root directory of the distribution for 00011 * more details. 00012 * 00013 * If you want to use Coin for applications not compatible with the 00014 * LGPL, please contact SIM to acquire a Professional Edition license. 00015 * 00016 * Systems in Motion, Teknobyen, Abels Gate 5, 7030 Trondheim, NORWAY 00017 * http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097 00018 * 00019 \**************************************************************************/ 00020 00021 #ifndef COIN_BASIC_H 00022 #define COIN_BASIC_H 00023 00024 /* 00025 NOTE: basic.h is automatically generated from basic.h.in, so don't 00026 edit basic.h directly. 00027 */ 00028 00029 /* *********************************************************************** */ 00030 00031 /* Documented for Doxygen in SoDB.cpp. */ 00032 typedef int SbBool; 00033 00034 #ifndef FALSE 00035 #define FALSE 0 00036 #endif /* !FALSE */ 00037 #ifndef TRUE 00038 #define TRUE 1 00039 #endif /* !TRUE */ 00040 00041 /* *********************************************************************** */ 00042 00043 /* Include this to 1) be compatible with Open Inventor's SbBasic.h, 2) 00044 * provide a way for application programmers to get hold of the type 00045 * definitions without explicitly including inttypes.h. 00046 * 00047 * The latter point is important because the inttypes.h file in SGI 00048 * and TGS Open Inventor is placed _below_ the Inventor/ directory in 00049 * the header files hierarchy. This is a stupid thing to do because it 00050 * could easily conflict with the inttypes.h file installed as part of 00051 * the C library on many systems (like GNU/Linux's glibc, for 00052 * instance). 00053 */ 00054 #include <Inventor/system/inttypes.h> 00055 00056 /* Internal note for Coin developers: in other sourcefiles in Coin, we 00057 * depend on math.h being included through SbBasic.h. It is done this 00058 * way to always make sure we have the M_* symbols available under 00059 * MSWin (see below). So don't remove the following line unless you 00060 * know very well what you are doing. 00061 */ 00062 #include <math.h> 00063 00064 /* Define misc values if they are not available from math.h. UNIX 00065 * systems typically have these defines, and MSWindows systems don't. 00066 */ 00067 #ifndef M_E 00068 #define M_E 2.7182818284590452354 00069 #endif /* !M_E */ 00070 #ifndef M_LOG2E 00071 #define M_LOG2E 1.4426950408889634074 00072 #endif /* !M_LOG2E */ 00073 #ifndef M_LOG10E 00074 #define M_LOG10E 0.43429448190325182765 00075 #endif /* !M_LOG10E */ 00076 #ifndef M_LN2 00077 #define M_LN2 0.69314718055994530942 00078 #endif /* !M_LN2 */ 00079 #ifndef M_LN10 00080 #define M_LN10 2.30258509299404568402 00081 #endif /* !M_LN10 */ 00082 #ifndef M_PI 00083 #define M_PI 3.14159265358979323846 00084 #endif /* !M_PI */ 00085 #ifndef M_TWOPI 00086 #define M_TWOPI (M_PI * 2.0) 00087 #endif /* !M_TWOPI */ 00088 #ifndef M_PI_2 00089 #define M_PI_2 1.57079632679489661923 00090 #endif /* !M_PI_2 */ 00091 #ifndef M_PI_4 00092 #define M_PI_4 0.78539816339744830962 00093 #endif /* !M_PI_4 */ 00094 #ifndef M_3PI_4 00095 #define M_3PI_4 2.3561944901923448370E0 00096 #endif /* !M_3PI_4 */ 00097 #ifndef M_SQRTPI 00098 #define M_SQRTPI 1.77245385090551602792981 00099 #endif /* !M_SQRTPI */ 00100 #ifndef M_1_PI 00101 #define M_1_PI 0.31830988618379067154 00102 #endif /* !M_1_PI */ 00103 #ifndef M_2_PI 00104 #define M_2_PI 0.63661977236758134308 00105 #endif /* !M_2_PI */ 00106 #ifndef M_2_SQRTPI 00107 #define M_2_SQRTPI 1.12837916709551257390 00108 #endif /* !M_2_SQRTPI */ 00109 #ifndef M_SQRT2 00110 #define M_SQRT2 1.41421356237309504880 00111 #endif /* !M_SQRT2 */ 00112 #ifndef M_SQRT1_2 00113 #define M_SQRT1_2 0.70710678118654752440 00114 #endif /* !M_SQRT1_2 */ 00115 #ifndef M_LN2LO 00116 #define M_LN2LO 1.9082149292705877000E-10 00117 #endif /* !M_LN2LO */ 00118 #ifndef M_LN2HI 00119 #define M_LN2HI 6.9314718036912381649E-1 00120 #endif /* !M_LN2HI */ 00121 #ifndef M_SQRT3 00122 #define M_SQRT3 1.73205080756887719000 00123 #endif /* !M_SQRT3 */ 00124 #ifndef M_IVLN10 00125 #define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */ 00126 #endif /* !M_IVLN10 */ 00127 #ifndef M_LOG2_E 00128 #define M_LOG2_E 0.693147180559945309417 00129 #endif /* !M_LOG2_E */ 00130 #ifndef M_INVLN2 00131 #define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ 00132 #endif /* !M_INVLN2 */ 00133 00134 /* *********************************************************************** */ 00135 00136 /* A unique identifier to recognize whether or not we're running under 00137 * Systems in Motion's Coin library. 00138 */ 00139 #define __COIN__ 00140 00141 /* The following #undef'ed defines are automatically defined and 00142 * synchronized with the settings in configure.in when ``configure'' 00143 * is executed. 00144 * 00145 * The #ifndef wrapper is necessary because during development, these 00146 * are also defined in the config.h file generated by ``configure''. 00147 */ 00148 #ifndef COIN_VERSION 00149 00150 /* These are available for adding or omitting features based on Coin 00151 * version numbers in client application sources. */ 00152 #define COIN_MAJOR_VERSION 1 00153 #define COIN_MINOR_VERSION 0 00154 #define COIN_MICRO_VERSION 4 00155 #define COIN_VERSION "1.0.4" 00156 00157 /* This define is set by the configure script if singleprecision math 00158 functions are available from the C library API headers. */ 00159 #define HAVE_SINGLEPRECISION_MATH 1 00160 00161 /* Most compilers should have "hash quoting", as it is part of the 00162 ANSI standard. */ 00163 #define HAVE_HASH_QUOTING 1 00164 /* #undef HAVE_APOSTROPHES_QUOTING */ 00165 00166 /* IN_PATH define in HPUX's sys/unistd.h conflicts with SoAction::IN_PATH */ 00167 /* #undef COIN_UNDEF_IN_PATH_HACK */ 00168 00169 #endif /* !COIN_VERSION */ /* Ends configure-generated defines. */ 00170 00171 00172 /* *********************************************************************** */ 00173 00174 #ifndef HAVE_SINGLEPRECISION_MATH 00175 /* If singleprecision math functions are missing, define them to their 00176 doubleprecision counterparts. This is done to be consistent with 00177 SbBasic.h in Open Inventor (application programmers might rely on 00178 the float-versions being set up from the Inventor SbBasic.h). */ 00179 #define cosf cos 00180 #define sinf sin 00181 #define tanf tan 00182 #define powf pow 00183 #define sqrtf sqrt 00184 #define acosf acos 00185 #define asinf asin 00186 #define atanf atan 00187 #define atan2f atan2 00188 #endif /* HAVE_SINGLEPRECISION_MATH */ 00189 00190 00191 /* *********************************************************************** */ 00192 00193 /* SO__QUOTE(str) - use the preprocessor to quote a string. 00194 * SO__CONCAT(str1,str2) - use the preprocessor to concatenate two strings. 00195 */ 00196 00197 #ifdef HAVE_HASH_QUOTING 00198 #define SO__QUOTE(str) #str 00199 #define SO__CONCAT(str1, str2) str1##str2 00200 #elif defined(HAVE_APOSTROPHES_QUOTING) 00201 #define SO__QUOTE(str) "str" 00202 #define SO__CONCAT(str1, str2) str1str2 00203 #else 00204 #error No valid way to do macro quoting! 00205 #endif 00206 00207 /* *********************************************************************** */ 00208 00209 /* Precaution to avoid an some errors easily made by the application 00210 programmer. */ 00211 #ifdef COIN_DLL_API 00212 # error Leave the internal COIN_DLL_API define alone. 00213 #endif /* COIN_DLL_API */ 00214 #ifdef COIN_INTERNAL 00215 # ifdef COIN_NOT_DLL 00216 # error The COIN_NOT_DLL define is not supposed to be used when building the library, only when building Win32 applications. 00217 # endif /* COIN_INTERNAL && COIN_NOT_DLL */ 00218 # ifdef COIN_DLL 00219 # error The COIN_DLL define is not supposed to be used when building the library, only when building Win32 applications. 00220 # endif /* COIN_INTERNAL && COIN_DLL */ 00221 #endif /* COIN_INTERNAL */ 00222 00223 /* 00224 On MSWindows platforms, one of these defines must always be set when 00225 building application programs: 00226 00227 - "COIN_DLL", when the application programmer is using the library 00228 in the form of a dynamic link library (DLL) 00229 00230 - "COIN_NOT_DLL", when the application programmer is using the 00231 library in the form of a static object library (LIB) 00232 00233 Note that either COIN_DLL or COIN_NOT_DLL _must_ be defined by the 00234 application programmer on MSWindows platforms, or else the #error 00235 statement will hit. Set up one or the other of these two defines in 00236 your compiler environment according to how the library was built -- 00237 as a DLL (use "COIN_DLL") or as a LIB (use "COIN_NOT_DLL"). 00238 00239 (Setting up defines for the compiler is typically done by either 00240 adding something like "/DCOIN_DLL" to the compiler's argument line 00241 (for command-line build processes), or by adding the define to the 00242 list of preprocessor symbols in your IDE GUI (in the MSVC IDE, this 00243 is done from the "Project"->"Settings" menu, choose the "C/C++" tab, 00244 then "Preprocessor" from the dropdown box and add the appropriate 00245 define)). 00246 00247 It is extremely important that the application programmer uses the 00248 correct define, as using "COIN_NOT_DLL" when "COIN_DLL" is correct 00249 will cause mysterious crashes. 00250 */ 00251 /* FIXME: use a feature check to see if this is a platform which can 00252 recognize the __declspec keyword instead of the crap #if below. 00253 20011201 mortene. */ 00254 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) 00255 # ifdef COIN_INTERNAL 00256 # ifdef COIN_MAKE_DLL 00257 # define COIN_DLL_API __declspec(dllexport) 00258 # endif /* COIN_MAKE_DLL */ 00259 # else /* !COIN_INTERNAL */ 00260 # ifdef COIN_DLL 00261 # define COIN_DLL_API __declspec(dllimport) 00262 # else /* !COIN_DLL */ 00263 # ifndef COIN_NOT_DLL 00264 # error Define either COIN_DLL or COIN_NOT_DLL as appropriate for your linkage! See Inventor/C/basic.h for further instructions. 00265 # endif /* COIN_NOT_DLL */ 00266 # endif /* !COIN_DLL */ 00267 # endif /* !COIN_INTERNAL */ 00268 #endif /* Microsoft Windows */ 00269 00270 /* Empty define to avoid errors when _not_ compiling an MSWindows DLL. */ 00271 #ifndef COIN_DLL_API 00272 # define COIN_DLL_API 00273 #endif /* !COIN_DLL_API */ 00274 00275 00276 #endif /* !COIN_BASIC_H */

Generated on Tue Jul 27 23:53:00 2004 for Coin by doxygen 1.3.7