Coin Logo http://www.coin3d.org/
http://www.kongsberg.com/kogt/

SoQtBasic.h

00001 /* src/Inventor/Qt/SoQtBasic.h.  Generated from - by configure.  */
00002 #ifndef SOQT_BASIC_H
00003 #define SOQT_BASIC_H
00004 
00005 // NB: this is not a pure configure-input file, it's also a config header...
00006 
00007 /**************************************************************************\
00008  * Copyright (c) Kongsberg Oil & Gas Technologies AS
00009  * All rights reserved.
00010  * 
00011  * Redistribution and use in source and binary forms, with or without
00012  * modification, are permitted provided that the following conditions are
00013  * met:
00014  * 
00015  * Redistributions of source code must retain the above copyright notice,
00016  * this list of conditions and the following disclaimer.
00017  * 
00018  * Redistributions in binary form must reproduce the above copyright
00019  * notice, this list of conditions and the following disclaimer in the
00020  * documentation and/or other materials provided with the distribution.
00021  * 
00022  * Neither the name of the copyright holder nor the names of its
00023  * contributors may be used to endorse or promote products derived from
00024  * this software without specific prior written permission.
00025  * 
00026  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00027  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00028  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00029  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00030  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00031  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00032  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00033  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00034  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00035  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00036  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 \**************************************************************************/
00038 
00039 // *************************************************************************
00040 
00041 /* Some useful inline template functions:
00042  *   SoQtMin(Val1, Val2)       - returns minimum value
00043  *   SoQtMax(Val1, Val2)       - returns maximum value
00044  *   SoQtClamp(Val, Min, Max)  - returns clamped value
00045  *   SoQtSwap(Val1, Val2)      - swaps the two values (no return value)
00046  */
00047 
00048 template <class Type>
00049 inline Type SoQtAbs(Type Val) {
00050   return (Val < 0) ? -Val : Val;
00051 }
00052 
00053 template <class Type>
00054 inline Type SoQtMin(Type a, Type b) {
00055   return (b < a) ? b : a;
00056 }
00057 
00058 template <class Type>
00059 inline Type SoQtMax(Type a, Type b) {
00060   return (b > a) ? b : a;
00061 }
00062 
00063 template <class Type>
00064 inline Type SoQtClamp(Type val, Type min, Type max) {
00065   return SoQtMax(min, SoQtMin(max, val));
00066 }
00067 
00068 template <class Type>
00069 inline void SoQtSwap(Type & a, Type & b) {
00070   Type t = a; a = b; b = t;
00071 }
00072 
00073 // *************************************************************************
00074 
00075 #define __COIN_SOQT__
00076 
00077 #if ! defined(SOQT_MAJOR_VERSION)
00078 #define SOQT_MAJOR_VERSION 1
00079 #endif /* ! SOQT_MAJOR_VERSION */
00080 #if ! defined(SOQT_MINOR_VERSION)
00081 #define SOQT_MINOR_VERSION 6
00082 #endif /* ! SOQT_MINOR_VERSION */
00083 #if ! defined(SOQT_MICRO_VERSION)
00084 #define SOQT_MICRO_VERSION 0
00085 #endif /* ! SOQT_MICRO_VERSION */
00086 #if ! defined(SOQT_BETA_VERSION)
00087 #define SOQT_BETA_VERSION a
00088 #endif /* ! SOQT_BETA_VERSION */
00089 #if ! defined(SOQT_VERSION)
00090 #define SOQT_VERSION "1.6.0a"
00091 #endif /* ! SOQT_VERSION */
00092 
00093 // *************************************************************************
00094 
00095 /* Precaution to avoid an error easily made by the application programmer. */
00096 #ifdef SOQT_DLL_API
00097 # error Leave the internal SOQT_DLL_API define alone.
00098 #endif /* SOQT_DLL_API */
00099 
00100 /*
00101   On MSWindows platforms, one of these defines must always be set when
00102   building application programs:
00103 
00104    - "SOQT_DLL", when the application programmer is using the
00105      library in the form of a dynamic link library (DLL)
00106 
00107    - "SOQT_NOT_DLL", when the application programmer is using the
00108      library in the form of a static object library (LIB)
00109 
00110   Note that either SOQT_DLL or SOQT_NOT_DLL _must_ be defined by
00111   the application programmer on MSWindows platforms, or else the
00112   #error statement will hit. Set up one or the other of these two
00113   defines in your compiler environment according to how the library
00114   was built -- as a DLL (use "SOQT_DLL") or as a LIB (use
00115   "SOQT_NOT_DLL").
00116 
00117   (Setting up defines for the compiler is typically done by either
00118   adding something like "/DSOQT_DLL" to the compiler's argument
00119   line (for command-line build processes), or by adding the define to
00120   the list of preprocessor symbols in your IDE GUI (in the MSVC IDE,
00121   this is done from the "Project"->"Settings" menu, choose the "C/C++"
00122   tab, then "Preprocessor" from the dropdown box and add the
00123   appropriate define)).
00124 
00125   It is extremely important that the application programmer uses the
00126   correct define, as using "SOQT_NOT_DLL" when "SOQT_DLL" is
00127   correct is likely to cause mysterious crashes.
00128  */
00129 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
00130 # ifdef SOQT_INTERNAL
00131 #  ifdef SOQT_MAKE_DLL
00132 #   define SOQT_DLL_API __declspec(dllexport)
00133 #  endif /* SOQT_MAKE_DLL */
00134 # else /* !SOQT_INTERNAL */
00135 #  ifdef SOQT_DLL
00136 #   define SOQT_DLL_API __declspec(dllimport)
00137 #  else /* !SOQT_DLL */
00138 #   ifndef SOQT_NOT_DLL
00139 #    error Define either SOQT_DLL or SOQT_NOT_DLL as appropriate for your linkage! See Inventor/Qt/SoQtBasic.h for further instructions.
00140 #   endif /* SOQT_NOT_DLL */
00141 #  endif /* !SOQT_DLL */
00142 # endif /* !SOQT_MAKE_DLL */
00143 #endif /* Microsoft Windows */
00144 
00145 /* Empty define to avoid errors when _not_ compiling an MSWindows DLL. */
00146 #ifndef SOQT_DLL_API
00147 # define SOQT_DLL_API
00148 #endif /* !SOQT_DLL_API */
00149 
00150 #ifndef GUI_TOOLKIT_VERSION
00151 #define GUI_TOOLKIT_VERSION qVersion()
00152 #endif /* GUI_TOOLKIT_VERSION */
00153 
00154 #endif // ! SOQT_BASIC_H

Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Wed Mar 2 2016 19:55:25 for SoQt by Doxygen 1.7.3.