Coin Logo http://www.sim.no
http://www.coin3d.org

SoQtBasic.h

00001 /* src/Inventor/Qt/SoQtBasic.h.  Generated by configure.  */
00002 /**************************************************************************\
00003  *
00004  *  This file is part of the Coin 3D visualization library.
00005  *  Copyright (C) 1998-2005 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 General Public License
00009  *  ("GPL") version 2 as published by the Free Software Foundation.
00010  *  See the file LICENSE.GPL at the root directory of this source
00011  *  distribution for additional information about the GNU GPL.
00012  *
00013  *  For using Coin with software that can not be combined with the GNU
00014  *  GPL, and for taking advantage of the additional benefits of our
00015  *  support services, please contact Systems in Motion about acquiring
00016  *  a Coin Professional Edition License.
00017  *
00018  *  See <URL:http://www.coin3d.org/> for more information.
00019  *
00020  *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
00021  *  <URL:http://www.sim.no/>.
00022  *
00023 \**************************************************************************/
00024 
00025 // Generated from SoGuiBasic.h.in by configure.
00026 
00027 #ifndef SOQT_BASIC_H
00028 #define SOQT_BASIC_H
00029 
00030 // *************************************************************************
00031 
00032 /* Some useful inline template functions:
00033  *   SoQtMin(Val1, Val2)       - returns minimum value
00034  *   SoQtMax(Val1, Val2)       - returns maximum value
00035  *   SoQtClamp(Val, Min, Max)  - returns clamped value
00036  *   SoQtSwap(Val1, Val2)      - swaps the two values (no return value)
00037  */
00038 
00039 template <class Type>
00040 inline Type SoQtAbs(Type Val) {
00041   return (Val < 0) ? -Val : Val;
00042 }
00043 
00044 template <class Type>
00045 inline Type SoQtMin(Type a, Type b) {
00046   return (b < a) ? b : a;
00047 }
00048 
00049 template <class Type>
00050 inline Type SoQtMax(Type a, Type b) {
00051   return (b > a) ? b : a;
00052 }
00053 
00054 template <class Type>
00055 inline Type SoQtClamp(Type val, Type min, Type max) {
00056   return SoQtMax(min, SoQtMin(max, val));
00057 }
00058 
00059 template <class Type>
00060 inline void SoQtSwap(Type & a, Type & b) {
00061   Type t = a; a = b; b = t;
00062 }
00063 
00064 // *************************************************************************
00065 
00066 #define __COIN_SOQT__
00067 
00068 #if ! defined(SOQT_MAJOR_VERSION)
00069 #define SOQT_MAJOR_VERSION 1
00070 #endif /* ! SOQT_MAJOR_VERSION */
00071 #if ! defined(SOQT_MINOR_VERSION)
00072 #define SOQT_MINOR_VERSION 3
00073 #endif /* ! SOQT_MINOR_VERSION */
00074 #if ! defined(SOQT_MICRO_VERSION)
00075 #define SOQT_MICRO_VERSION 0
00076 #endif /* ! SOQT_MICRO_VERSION */
00077 #if ! defined(SOQT_BETA_VERSION)
00078 /* #undef SOQT_BETA_VERSION */
00079 #endif /* ! SOQT_BETA_VERSION */
00080 #if ! defined(SOQT_VERSION)
00081 #define SOQT_VERSION "1.3.0"
00082 #endif /* ! SOQT_VERSION */
00083 
00084 // *************************************************************************
00085 
00086 /* Precaution to avoid an error easily made by the application programmer. */
00087 #ifdef SOQT_DLL_API
00088 # error Leave the internal SOQT_DLL_API define alone.
00089 #endif /* SOQT_DLL_API */
00090 
00091 /*
00092   On MSWindows platforms, one of these defines must always be set when
00093   building application programs:
00094 
00095    - "SOQT_DLL", when the application programmer is using the
00096      library in the form of a dynamic link library (DLL)
00097 
00098    - "SOQT_NOT_DLL", when the application programmer is using the
00099      library in the form of a static object library (LIB)
00100 
00101   Note that either SOQT_DLL or SOQT_NOT_DLL _must_ be defined by
00102   the application programmer on MSWindows platforms, or else the
00103   #error statement will hit. Set up one or the other of these two
00104   defines in your compiler environment according to how the library
00105   was built -- as a DLL (use "SOQT_DLL") or as a LIB (use
00106   "SOQT_NOT_DLL").
00107 
00108   (Setting up defines for the compiler is typically done by either
00109   adding something like "/DSOQT_DLL" to the compiler's argument
00110   line (for command-line build processes), or by adding the define to
00111   the list of preprocessor symbols in your IDE GUI (in the MSVC IDE,
00112   this is done from the "Project"->"Settings" menu, choose the "C/C++"
00113   tab, then "Preprocessor" from the dropdown box and add the
00114   appropriate define)).
00115 
00116   It is extremely important that the application programmer uses the
00117   correct define, as using "SOQT_NOT_DLL" when "SOQT_DLL" is
00118   correct is likely to cause mysterious crashes.
00119  */
00120 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
00121 # ifdef SOQT_INTERNAL
00122 #  ifdef SOQT_MAKE_DLL
00123 #   define SOQT_DLL_API __declspec(dllexport)
00124 #  endif /* SOQT_MAKE_DLL */
00125 # else /* !SOQT_INTERNAL */
00126 #  ifdef SOQT_DLL
00127 #   define SOQT_DLL_API __declspec(dllimport)
00128 #  else /* !SOQT_DLL */
00129 #   ifndef SOQT_NOT_DLL
00130 #    error Define either SOQT_DLL or SOQT_NOT_DLL as appropriate for your linkage! See Inventor/Qt/SoQtBasic.h for further instructions.
00131 #   endif /* SOQT_NOT_DLL */
00132 #  endif /* !SOQT_DLL */
00133 # endif /* !SOQT_MAKE_DLL */
00134 #endif /* Microsoft Windows */
00135 
00136 /* Empty define to avoid errors when _not_ compiling an MSWindows DLL. */
00137 #ifndef SOQT_DLL_API
00138 # define SOQT_DLL_API
00139 #endif /* !SOQT_DLL_API */
00140 
00141 // *************************************************************************
00142 
00143 #endif // ! SOQT_BASIC_H

Copyright © 1998-2005 by Systems in Motion AS. All rights reserved.

Generated on Mon Mar 27 00:38:51 2006 for SoQt by Doxygen. 1.4.6