SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLMath.h
Go to the documentation of this file.
1 /**
2  * \file math/SLMath.h
3  * \brief Container for general algorithm functions
4  * \date November 2020
5  * \remarks Please use clangformat to format the code. See more code style on
6  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
7  * \authors Marcus Hudritsch, Micheal Goettlicher
8  * \copyright http://opensource.org/licenses/GPL-3.0
9 */
10 
11 #ifndef SLMATH_H
12 #define SLMATH_H
13 
14 #include <vector>
15 #include <string>
16 #include <cstdint>
17 
18 //-----------------------------------------------------------------------------
19 // Redefinition of standard types for platform independence
20 typedef std::string SLstring;
21 #ifndef SL_OS_ANDROID
22 typedef std::wstring SLwstring;
23 #endif
24 typedef char SLchar; // analog to GLchar (char is signed [-128 ... 127]!)
25 typedef unsigned char SLuchar; // analog to GLuchar
26 typedef signed long SLlong; // analog to GLlong
27 typedef unsigned long SLulong; // analog to GLulong
28 typedef signed char SLbyte; // analog to GLbyte
29 typedef unsigned char SLubyte; // analog to GLubyte
30 typedef short SLshort; // analog to GLshort
31 typedef unsigned short SLushort; // analog to GLushort
32 typedef int SLint; // analog to GLint
33 typedef unsigned int SLuint; // analog to GLuint
34 typedef int SLsizei; // analog to GLsizei
35 typedef float SLfloat; // analog to GLfloat
36 typedef double SLdouble; // analog to GLdouble
37 typedef bool SLbool; // analog to GLbool
38 typedef unsigned int SLenum; // analog to GLenum
39 typedef unsigned int SLbitfield; // analog to GLbitfield
40 typedef int64_t SLint64;
41 typedef uint64_t SLuint64;
42 
43 // All 1D vectors begin with SLV*
44 typedef std::vector<SLbool> SLVbool;
45 typedef std::vector<SLbyte> SLVbyte;
46 typedef std::vector<SLubyte> SLVubyte;
47 typedef std::vector<SLchar> SLVchar;
48 typedef std::vector<SLuchar> SLVuchar;
49 typedef std::vector<SLshort> SLVshort;
50 typedef std::vector<SLushort> SLVushort;
51 typedef std::vector<SLint> SLVint;
52 typedef std::vector<SLuint> SLVuint;
53 typedef std::vector<SLlong> SLVlong;
54 typedef std::vector<SLulong> SLVulong;
55 typedef std::vector<SLfloat> SLVfloat;
56 typedef std::vector<SLstring> SLVstring;
57 typedef std::vector<size_t> SLVsize_t;
58 
59 // All 2D vectors begin with SLVV*
60 typedef std::vector<std::vector<SLfloat>> SLVVfloat;
61 typedef std::vector<std::vector<SLuchar>> SLVVuchar;
62 typedef std::vector<std::vector<SLushort>> SLVVushort;
63 typedef std::vector<std::vector<SLuint>> SLVVuint;
64 typedef std::vector<std::vector<SLchar>> SLVVchar;
65 typedef std::vector<std::vector<SLshort>> SLVVshort;
66 typedef std::vector<std::vector<SLint>> SLVVint;
67 
68 //-----------------------------------------------------------------------------
69 // Some debugging and error handling macros
70 #define SLMATH_LOG(...) Utils::log("SLProject", __VA_ARGS__)
71 #define SLMATH_EXIT_MSG(message) Utils::exitMsg("SLProject", (message), __LINE__, __FILE__)
72 #define SLMATH_WARN_MSG(message) Utils::warnMsg("SLProject", (message), __LINE__, __FILE__)
73 
74 #endif
std::vector< size_t > SLVsize_t
Definition: SLMath.h:57
float SLfloat
Definition: SLMath.h:35
std::vector< SLshort > SLVshort
Definition: SLMath.h:49
unsigned int SLenum
Definition: SLMath.h:38
std::vector< SLbool > SLVbool
Definition: SLMath.h:44
unsigned int SLbitfield
Definition: SLMath.h:39
uint64_t SLuint64
Definition: SLMath.h:41
unsigned long SLulong
Definition: SLMath.h:27
unsigned int SLuint
Definition: SLMath.h:33
std::vector< SLfloat > SLVfloat
Definition: SLMath.h:55
char SLchar
Definition: SLMath.h:24
std::vector< std::vector< SLuchar > > SLVVuchar
Definition: SLMath.h:61
unsigned char SLuchar
Definition: SLMath.h:25
double SLdouble
Definition: SLMath.h:36
std::vector< std::vector< SLushort > > SLVVushort
Definition: SLMath.h:62
int64_t SLint64
Definition: SLMath.h:40
std::vector< SLubyte > SLVubyte
Definition: SLMath.h:46
bool SLbool
Definition: SLMath.h:37
unsigned short SLushort
Definition: SLMath.h:31
unsigned char SLubyte
Definition: SLMath.h:29
std::vector< std::vector< SLshort > > SLVVshort
Definition: SLMath.h:65
std::vector< SLuchar > SLVuchar
Definition: SLMath.h:48
std::vector< SLlong > SLVlong
Definition: SLMath.h:53
std::vector< std::vector< SLfloat > > SLVVfloat
Definition: SLMath.h:60
std::vector< std::vector< SLuint > > SLVVuint
Definition: SLMath.h:63
std::vector< SLbyte > SLVbyte
Definition: SLMath.h:45
signed long SLlong
Definition: SLMath.h:26
std::vector< std::vector< SLint > > SLVVint
Definition: SLMath.h:66
std::string SLstring
Definition: SLMath.h:20
std::vector< SLushort > SLVushort
Definition: SLMath.h:50
std::vector< SLuint > SLVuint
Definition: SLMath.h:52
short SLshort
Definition: SLMath.h:30
std::vector< SLchar > SLVchar
Definition: SLMath.h:47
std::vector< SLstring > SLVstring
Definition: SLMath.h:56
std::vector< SLulong > SLVulong
Definition: SLMath.h:54
std::vector< SLint > SLVint
Definition: SLMath.h:51
signed char SLbyte
Definition: SLMath.h:28
std::wstring SLwstring
Definition: SLMath.h:22
int SLsizei
Definition: SLMath.h:34
std::vector< std::vector< SLchar > > SLVVchar
Definition: SLMath.h:64
int SLint
Definition: SLMath.h:32