46 #ifndef AI_TYPES_H_INC
47 #define AI_TYPES_H_INC
50 #pragma GCC system_header
58 #include <sys/types.h>
71 typedef int32_t ai_int32;
72 typedef uint32_t ai_uint32;
97 struct ASSIMP_API AllocateFromAssimpHeap {
101 void *
operator new(
size_t num_bytes) ;
102 void *
operator new(
size_t num_bytes,
const std::nothrow_t &)
throw();
103 void operator delete(
void *data);
106 void *
operator new[](
size_t num_bytes) ;
107 void *
operator new[](
size_t num_bytes,
const std::nothrow_t &)
throw();
108 void operator delete[](
void *data);
121 static const size_t MAXLEN = 1024;
131 aiPlane() AI_NO_EXCEPT :
a(0.f), b(0.f), c(0.f), d(0.f) {}
132 aiPlane(ai_real _a, ai_real _b, ai_real _c, ai_real _d) :
133 a(_a), b(_b), c(_c), d(_d) {}
136 a(o.
a), b(o.b), c(o.c), d(o.d) {}
138 #endif // !__cplusplus
149 aiRay() AI_NO_EXCEPT {}
151 pos(_pos), dir(_dir) {}
156 #endif // !__cplusplus
167 aiColor3D() AI_NO_EXCEPT :
r(0.0f), g(0.0f), b(0.0f) {}
168 aiColor3D(ai_real _r, ai_real _g, ai_real _b) :
169 r(_r), g(_g), b(_b) {}
171 r(_r), g(_r), b(_r) {}
173 r(o.
r), g(o.g), b(o.b) {}
184 bool operator==(
const aiColor3D &other)
const {
return r == other.
r && g == other.g && b == other.b; }
188 bool operator!=(
const aiColor3D &other)
const {
return r != other.
r || g != other.g || b != other.b; }
192 bool operator<(
const aiColor3D &other)
const {
193 return r < other.
r || (
r == other.
r && (g < other.g || (g == other.g && b < other.b)));
217 ai_real operator[](
unsigned int i)
const {
222 ai_real &operator[](
unsigned int i) {
234 bool IsBlack()
const {
235 static const ai_real epsilon = ai_real(10e-3);
236 return std::fabs(
r) < epsilon && std::fabs(g) < epsilon && std::fabs(b) < epsilon;
239 #endif // !__cplusplus
273 #ifdef ASSIMP_BUILD_DEBUG
289 explicit aiString(
const std::string &pString) :
290 length((ai_uint32)pString.length()) {
297 void Set(
const std::string &pString) {
298 if (pString.length() >
MAXLEN - 1) {
301 length = (ai_uint32)pString.length();
307 void Set(
const char *sz) {
308 const ai_int32 len = (ai_uint32)::strlen(sz);
309 if (len > (ai_int32)
MAXLEN - 1) {
313 memcpy(
data, sz, len);
319 if (
this == &rOther) {
331 aiString &operator=(
const char *sz) {
337 aiString &operator=(
const std::string &pString) {
343 bool operator==(
const aiString &other)
const {
348 bool operator!=(
const aiString &other)
const {
353 void Append(
const char *app) {
354 const ai_uint32 len = (ai_uint32)::strlen(app);
371 #ifdef ASSIMP_BUILD_DEBUG
378 const char *C_Str()
const {
382 #endif // !__cplusplus
412 _AI_ENFORCE_ENUM_SIZE = 0x7fffffff
418 #define AI_SUCCESS aiReturn_SUCCESS
419 #define AI_FAILURE aiReturn_FAILURE
420 #define AI_OUTOFMEMORY aiReturn_OUTOFMEMORY
439 _AI_ORIGIN_ENFORCE_ENUM_SIZE = 0x7fffffff
467 _AI_DLS_ENFORCE_ENUM_SIZE = 0x7fffffff
472 #define DLS_FILE aiDefaultLogStream_FILE
473 #define DLS_STDOUT aiDefaultLogStream_STDOUT
474 #define DLS_STDERR aiDefaultLogStream_STDERR
475 #define DLS_DEBUGGER aiDefaultLogStream_DEBUGGER
535 #endif // AI_TYPES_H_INC