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

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  * Copyright (c) Kongsberg Oil & Gas Technologies AS
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are
13  * met:
14  *
15  * Redistributions of source code must retain the above copyright notice,
16  * this list of conditions and the following disclaimer.
17  *
18  * Redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution.
21  *
22  * Neither the name of the copyright holder nor the names of its
23  * contributors may be used to endorse or promote products derived from
24  * this software without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 \**************************************************************************/
38 
39 // *************************************************************************
40 
41 /* Some useful inline template functions:
42  * SoQtMin(Val1, Val2) - returns minimum value
43  * SoQtMax(Val1, Val2) - returns maximum value
44  * SoQtClamp(Val, Min, Max) - returns clamped value
45  * SoQtSwap(Val1, Val2) - swaps the two values (no return value)
46  */
47 
48 template <class Type>
49 inline Type SoQtAbs(Type Val) {
50  return (Val < 0) ? -Val : Val;
51 }
52 
53 template <class Type>
54 inline Type SoQtMin(Type a, Type b) {
55  return (b < a) ? b : a;
56 }
57 
58 template <class Type>
59 inline Type SoQtMax(Type a, Type b) {
60  return (b > a) ? b : a;
61 }
62 
63 template <class Type>
64 inline Type SoQtClamp(Type val, Type min, Type max) {
65  return SoQtMax(min, SoQtMin(max, val));
66 }
67 
68 template <class Type>
69 inline void SoQtSwap(Type & a, Type & b) {
70  Type t = a; a = b; b = t;
71 }
72 
73 // *************************************************************************
74 
75 #define __COIN_SOQT__
76 
77 #if ! defined(SOQT_MAJOR_VERSION)
78 #define SOQT_MAJOR_VERSION 1
79 #endif /* ! SOQT_MAJOR_VERSION */
80 #if ! defined(SOQT_MINOR_VERSION)
81 #define SOQT_MINOR_VERSION 6
82 #endif /* ! SOQT_MINOR_VERSION */
83 #if ! defined(SOQT_MICRO_VERSION)
84 #define SOQT_MICRO_VERSION 0
85 #endif /* ! SOQT_MICRO_VERSION */
86 #if ! defined(SOQT_BETA_VERSION)
87 #define SOQT_BETA_VERSION a
88 #endif /* ! SOQT_BETA_VERSION */
89 #if ! defined(SOQT_VERSION)
90 #define SOQT_VERSION "1.6.0a"
91 #endif /* ! SOQT_VERSION */
92 
93 // *************************************************************************
94 
95 /* Precaution to avoid an error easily made by the application programmer. */
96 #ifdef SOQT_DLL_API
97 # error Leave the internal SOQT_DLL_API define alone.
98 #endif /* SOQT_DLL_API */
99 
100 /*
101  On MSWindows platforms, one of these defines must always be set when
102  building application programs:
103 
104  - "SOQT_DLL", when the application programmer is using the
105  library in the form of a dynamic link library (DLL)
106 
107  - "SOQT_NOT_DLL", when the application programmer is using the
108  library in the form of a static object library (LIB)
109 
110  Note that either SOQT_DLL or SOQT_NOT_DLL _must_ be defined by
111  the application programmer on MSWindows platforms, or else the
112  #error statement will hit. Set up one or the other of these two
113  defines in your compiler environment according to how the library
114  was built -- as a DLL (use "SOQT_DLL") or as a LIB (use
115  "SOQT_NOT_DLL").
116 
117  (Setting up defines for the compiler is typically done by either
118  adding something like "/DSOQT_DLL" to the compiler's argument
119  line (for command-line build processes), or by adding the define to
120  the list of preprocessor symbols in your IDE GUI (in the MSVC IDE,
121  this is done from the "Project"->"Settings" menu, choose the "C/C++"
122  tab, then "Preprocessor" from the dropdown box and add the
123  appropriate define)).
124 
125  It is extremely important that the application programmer uses the
126  correct define, as using "SOQT_NOT_DLL" when "SOQT_DLL" is
127  correct is likely to cause mysterious crashes.
128  */
129 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
130 # ifdef SOQT_INTERNAL
131 # ifdef SOQT_MAKE_DLL
132 # define SOQT_DLL_API __declspec(dllexport)
133 # endif /* SOQT_MAKE_DLL */
134 # else /* !SOQT_INTERNAL */
135 # ifdef SOQT_DLL
136 # define SOQT_DLL_API __declspec(dllimport)
137 # else /* !SOQT_DLL */
138 # ifndef SOQT_NOT_DLL
139 # error Define either SOQT_DLL or SOQT_NOT_DLL as appropriate for your linkage! See Inventor/Qt/SoQtBasic.h for further instructions.
140 # endif /* SOQT_NOT_DLL */
141 # endif /* !SOQT_DLL */
142 # endif /* !SOQT_MAKE_DLL */
143 #endif /* Microsoft Windows */
144 
145 /* Empty define to avoid errors when _not_ compiling an MSWindows DLL. */
146 #ifndef SOQT_DLL_API
147 # define SOQT_DLL_API
148 #endif /* !SOQT_DLL_API */
149 
150 #ifndef GUI_TOOLKIT_VERSION
151 #define GUI_TOOLKIT_VERSION qVersion()
152 #endif /* GUI_TOOLKIT_VERSION */
153 
154 #endif // ! SOQT_BASIC_H

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

Generated on Sat May 6 2017 19:04:47 for SoQt by Doxygen 1.8.6.