itom 1.0.14
D:/git-itom/sources/itom/Common/typeDefs.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2013, Institut für Technische Optik (ITO),
00005     Universität Stuttgart, Germany
00006 
00007     This file is part of itom and its software development toolkit (SDK).
00008 
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013    
00014     In addition, as a special exception, the Institut für Technische
00015     Optik (ITO) gives you certain additional rights.
00016     These rights are described in the ITO LGPL Exception version 1.0,
00017     which can be found in the file LGPL_EXCEPTION.txt in this package.
00018 
00019     itom is distributed in the hope that it will be useful, but
00020     WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00022     General Public Licence for more details.
00023 
00024     You should have received a copy of the GNU Library General Public License
00025     along with itom. If not, see <http://www.gnu.org/licenses/>.
00026 *********************************************************************** */
00027 
00028 #ifndef __TYPEDEFS
00029 #define __TYPEDEFS
00030 
00031 #include <stdint.h>
00032 #include <complex>
00033 
00034 // WARNING it is very EVIL to include ANY QT STUFF here!!!
00035 
00036 namespace ito
00037 {
00038     #define PLUGINWAIT 5000
00039 
00040     
00041 
00046     enum tLogLevel
00047     {
00048         logNone     = 0x0,
00049         logError    = 0x1,
00050         logWarning  = 0x2,
00051         logInfo     = 0x4,
00052         logAll      = logInfo | logWarning | logError
00053     };
00054 
00055 
00060     enum tRetValue
00061     {
00062         retOk       = 0x0,  
00063         retWarning  = 0x1,  
00064         retError    = 0x2   
00065     };
00066 
00071     enum tMsgType
00072     { 
00073         msgReturnInfo, 
00074         msgReturnWarning, 
00075         msgReturnError, 
00076         msgTextInfo,
00077         msgTextWarning, 
00078         msgTextError
00079     };
00080 
00081     enum tPythonDbgCmd
00082     { 
00083         pyDbgNone=0, 
00084         pyDbgContinue=1, 
00085         pyDbgStep=2, 
00086         pyDbgStepOut=4, 
00087         pyDbgStepOver=8,
00088         pyDbgQuit=16
00089     };
00090 
00091     enum tPythonTransitions
00092     {
00093         pyTransBeginRun = 1,
00094         pyTransEndRun = 2,
00095         pyTransBeginDebug = 4,
00096         pyTransEndDebug = 8,
00097         pyTransDebugWaiting = 16,
00098         pyTransDebugContinue = 32,
00099                 pyTransDebugExecCmdBegin = 64,
00100                 pyTransDebugExecCmdEnd = 128
00101     };
00102 
00103     enum tCompareResult 
00104     { 
00105         tCmpEqual, 
00106         tCmpCompatible, 
00107         tCmpFailed 
00108     };
00109 
00110     enum tPythonState
00111     {
00112         pyStateIdle = 1,
00113         pyStateRunning = 2,
00114         pyStateDebugging = 4,
00115         pyStateDebuggingWaiting = 8,
00116                 pyStateDebuggingWaitingButBusy = 16
00117     };
00118 
00123     enum tDataType
00124     {
00125         tInt8 = 0,      
00126         tUInt8 = 1,     
00127         tInt16 = 2,     
00128         tUInt16 = 3,    
00129         tInt32 = 4,     
00130         tUInt32 = 5,    
00131         tFloat32 = 6,   
00132         tFloat64 = 7,   
00133         tComplex64 = 8, 
00134         tComplex128 = 9 
00135     };
00136 
00141     enum tPCLPointType
00142     {
00143         pclInvalid      = 0x0000, 
00144         pclXYZ          = 0x0001, 
00145         pclXYZI         = 0x0002, 
00146         pclXYZRGBA      = 0x0004, 
00147         pclXYZNormal    = 0x0008, 
00148         pclXYZINormal   = 0x0010, 
00149         pclXYZRGBNormal = 0x0020  
00150     };  
00151 
00152     // data types for images should always be the same size
00153     // so define them to fixed byte sizes here
00154 
00155    // data types for images should always be the same size
00156     // so define them to fixed byte sizes here
00157 
00158 
00159     /*< \todo #define bool bool */
00160     typedef int8_t  int8;  //__int8
00161     typedef int16_t int16; //__int16
00162     typedef int32_t int32; //__int32
00163 
00164 #ifdef _WIN64
00165     //typedef int64_t int64;
00166     //typedef uint64_t uint64;
00167 #endif
00168 
00169     //#define int int32 //commented by M. Gronle, 10.10.2011, since this caused problems while compiling with gcc and qtCreator
00170     //#define uint uint32   // impossible to define this, as in qglobal uint is also defined which causes problems
00171 
00172     typedef uint8_t uint8; //unsigned __int8
00173     typedef uint16_t uint16; //unsigned __int16
00174     typedef uint32_t uint32; //unsigned __int32
00175 
00176     typedef float float32;
00177     typedef double float64;
00178 
00179     //#define complex std::complex<double>
00180     typedef std::complex<ito::float32> complex64;
00181     typedef std::complex<ito::float64> complex128;
00182 
00183 
00184     #define GLOBAL_LOG_LEVEL tLogLevel(logAll)
00185 
00186 #ifdef linux
00187     #define _strdup strdup
00188     #define _itoa itoa
00189     #define _snprintf snprintf
00190     #define Sleep(TIME) usleep(TIME*1000.0)
00191 #endif
00192 
00193 // this will be set on Visual Studio only, so this code is added for all other compilers
00194 #ifndef _MSC_VER
00195     #define vsprintf_s(b,l,f,v) vsprintf(b,f,v);
00196     #define sprintf_s(b,l,f,v) sprintf(b,f,v);
00197     #define strcat_s(dest,len,source) strcat(dest,source);
00198 #endif
00199 
00200     
00201 
00202 } // namespace ito
00203 
00204 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends