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

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-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 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, Teknobyen, Abels Gate 5, 7030 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 0
00073 #endif /* ! SOQT_MINOR_VERSION */
00074 #if ! defined(SOQT_MICRO_VERSION)
00075 #define SOQT_MICRO_VERSION 2
00076 #endif /* ! SOQT_MICRO_VERSION */
00077 #if ! defined(SOQT_VERSION)
00078 #define SOQT_VERSION "1.0.2"
00079 #endif /* ! SOQT_VERSION */
00080 
00081 // *************************************************************************
00082 
00083 /* Precaution to avoid an error easily made by the application programmer. */
00084 #ifdef SOQT_DLL_API
00085 # error Leave the internal SOQT_DLL_API define alone.
00086 #endif /* SOQT_DLL_API */
00087 
00088 /*
00089   On MSWindows platforms, one of these defines must always be set when
00090   building application programs:
00091 
00092    - "SOQT_DLL", when the application programmer is using the
00093      library in the form of a dynamic link library (DLL)
00094 
00095    - "SOQT_NOT_DLL", when the application programmer is using the
00096      library in the form of a static object library (LIB)
00097 
00098   Note that either SOQT_DLL or SOQT_NOT_DLL _must_ be defined by
00099   the application programmer on MSWindows platforms, or else the
00100   #error statement will hit. Set up one or the other of these two
00101   defines in your compiler environment according to how the library
00102   was built -- as a DLL (use "SOQT_DLL") or as a LIB (use
00103   "SOQT_NOT_DLL").
00104 
00105   (Setting up defines for the compiler is typically done by either
00106   adding something like "/DSOQT_DLL" to the compiler's argument
00107   line (for command-line build processes), or by adding the define to
00108   the list of preprocessor symbols in your IDE GUI (in the MSVC IDE,
00109   this is done from the "Project"->"Settings" menu, choose the "C/C++"
00110   tab, then "Preprocessor" from the dropdown box and add the
00111   appropriate define)).
00112 
00113   It is extremely important that the application programmer uses the
00114   correct define, as using "SOQT_NOT_DLL" when "SOQT_DLL" is
00115   correct is likely to cause mysterious crashes.
00116  */
00117 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
00118 # ifdef SOQT_INTERNAL
00119 #  ifdef SOQT_MAKE_DLL
00120 #   define SOQT_DLL_API __declspec(dllexport)
00121 #  endif /* SOQT_MAKE_DLL */
00122 # else /* !SOQT_INTERNAL */
00123 #  ifdef SOQT_DLL
00124 #   define SOQT_DLL_API __declspec(dllimport)
00125 #  else /* !SOQT_DLL */
00126 #   ifndef SOQT_NOT_DLL
00127 #    error Define either SOQT_DLL or SOQT_NOT_DLL as appropriate for your linkage! See Inventor/Qt/SoQtBasic.h for further instructions.
00128 #   endif /* SOQT_NOT_DLL */
00129 #  endif /* !SOQT_DLL */
00130 # endif /* !SOQT_MAKE_DLL */
00131 #endif /* Microsoft Windows */
00132 
00133 /* Empty define to avoid errors when _not_ compiling an MSWindows DLL. */
00134 #ifndef SOQT_DLL_API
00135 # define SOQT_DLL_API
00136 #endif /* !SOQT_DLL_API */
00137 
00138 // *************************************************************************
00139 
00140 #endif // ! SOQT_BASIC_H

Generated on Sat Dec 6 22:19:05 2003 for SoQt by doxygen 1.3.4