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

SoQtBasic.h
1 /* src/Inventor/Qt/SoQtBasic.h. Generated from - by configure. */
2 #ifndef SOQT_BASIC_H
3 #define SOQT_BASIC_H
4 
5 // NB: this is not a pure configure-input file, it's also a config header...
6 
7 /**************************************************************************\
8  *
9  * This file is part of the Coin 3D visualization library.
10  * Copyright (C) by Kongsberg Oil & Gas Technologies.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * ("GPL") version 2 as published by the Free Software Foundation.
15  * See the file LICENSE.GPL at the root directory of this source
16  * distribution for additional information about the GNU GPL.
17  *
18  * For using Coin with software that can not be combined with the GNU
19  * GPL, and for taking advantage of the additional benefits of our
20  * support services, please contact Kongsberg Oil & Gas Technologies
21  * about acquiring a Coin Professional Edition License.
22  *
23  * See http://www.coin3d.org/ for more information.
24  *
25  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
26  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
27  *
28 \**************************************************************************/
29 
30 // *************************************************************************
31 
32 /* Some useful inline template functions:
33  * SoQtMin(Val1, Val2) - returns minimum value
34  * SoQtMax(Val1, Val2) - returns maximum value
35  * SoQtClamp(Val, Min, Max) - returns clamped value
36  * SoQtSwap(Val1, Val2) - swaps the two values (no return value)
37  */
38 
39 template <class Type>
40 inline Type SoQtAbs(Type Val) {
41  return (Val < 0) ? -Val : Val;
42 }
43 
44 template <class Type>
45 inline Type SoQtMin(Type a, Type b) {
46  return (b < a) ? b : a;
47 }
48 
49 template <class Type>
50 inline Type SoQtMax(Type a, Type b) {
51  return (b > a) ? b : a;
52 }
53 
54 template <class Type>
55 inline Type SoQtClamp(Type val, Type min, Type max) {
56  return SoQtMax(min, SoQtMin(max, val));
57 }
58 
59 template <class Type>
60 inline void SoQtSwap(Type & a, Type & b) {
61  Type t = a; a = b; b = t;
62 }
63 
64 // *************************************************************************
65 
66 #define __COIN_SOQT__
67 
68 #if ! defined(SOQT_MAJOR_VERSION)
69 #define SOQT_MAJOR_VERSION 1
70 #endif /* ! SOQT_MAJOR_VERSION */
71 #if ! defined(SOQT_MINOR_VERSION)
72 #define SOQT_MINOR_VERSION 5
73 #endif /* ! SOQT_MINOR_VERSION */
74 #if ! defined(SOQT_MICRO_VERSION)
75 #define SOQT_MICRO_VERSION 0
76 #endif /* ! SOQT_MICRO_VERSION */
77 #if ! defined(SOQT_BETA_VERSION)
78 /* #undef SOQT_BETA_VERSION */
79 #endif /* ! SOQT_BETA_VERSION */
80 #if ! defined(SOQT_VERSION)
81 #define SOQT_VERSION "1.5.0"
82 #endif /* ! SOQT_VERSION */
83 
84 // *************************************************************************
85 
86 /* Precaution to avoid an error easily made by the application programmer. */
87 #ifdef SOQT_DLL_API
88 # error Leave the internal SOQT_DLL_API define alone.
89 #endif /* SOQT_DLL_API */
90 
91 /*
92  On MSWindows platforms, one of these defines must always be set when
93  building application programs:
94 
95  - "SOQT_DLL", when the application programmer is using the
96  library in the form of a dynamic link library (DLL)
97 
98  - "SOQT_NOT_DLL", when the application programmer is using the
99  library in the form of a static object library (LIB)
100 
101  Note that either SOQT_DLL or SOQT_NOT_DLL _must_ be defined by
102  the application programmer on MSWindows platforms, or else the
103  #error statement will hit. Set up one or the other of these two
104  defines in your compiler environment according to how the library
105  was built -- as a DLL (use "SOQT_DLL") or as a LIB (use
106  "SOQT_NOT_DLL").
107 
108  (Setting up defines for the compiler is typically done by either
109  adding something like "/DSOQT_DLL" to the compiler's argument
110  line (for command-line build processes), or by adding the define to
111  the list of preprocessor symbols in your IDE GUI (in the MSVC IDE,
112  this is done from the "Project"->"Settings" menu, choose the "C/C++"
113  tab, then "Preprocessor" from the dropdown box and add the
114  appropriate define)).
115 
116  It is extremely important that the application programmer uses the
117  correct define, as using "SOQT_NOT_DLL" when "SOQT_DLL" is
118  correct is likely to cause mysterious crashes.
119  */
120 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
121 # ifdef SOQT_INTERNAL
122 # ifdef SOQT_MAKE_DLL
123 # define SOQT_DLL_API __declspec(dllexport)
124 # endif /* SOQT_MAKE_DLL */
125 # else /* !SOQT_INTERNAL */
126 # ifdef SOQT_DLL
127 # define SOQT_DLL_API __declspec(dllimport)
128 # else /* !SOQT_DLL */
129 # ifndef SOQT_NOT_DLL
130 # error Define either SOQT_DLL or SOQT_NOT_DLL as appropriate for your linkage! See Inventor/Qt/SoQtBasic.h for further instructions.
131 # endif /* SOQT_NOT_DLL */
132 # endif /* !SOQT_DLL */
133 # endif /* !SOQT_MAKE_DLL */
134 #endif /* Microsoft Windows */
135 
136 /* Empty define to avoid errors when _not_ compiling an MSWindows DLL. */
137 #ifndef SOQT_DLL_API
138 # define SOQT_DLL_API
139 #endif /* !SOQT_DLL_API */
140 
141 #ifndef GUI_TOOLKIT_VERSION
142 #define GUI_TOOLKIT_VERSION qVersion()
143 #endif /* GUI_TOOLKIT_VERSION */
144 
145 #endif // ! SOQT_BASIC_H

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

Generated on Fri Jul 3 2015 for SoQt by Doxygen 1.8.9.1.