47 #ifndef AI_TYPES_H_INC 48 #define AI_TYPES_H_INC 51 #include <sys/types.h> 89 struct ASSIMP_API AllocateFromAssimpHeap {
93 void *
operator new (
size_t num_bytes) ;
94 void *
operator new (
size_t num_bytes,
const std::nothrow_t& )
throw();
95 void operator delete (
void* data);
98 void *
operator new[] (
size_t num_bytes) ;
99 void *
operator new[] (
size_t num_bytes,
const std::nothrow_t& )
throw();
100 void operator delete[] (
void* data);
114 const size_t MAXLEN = 1024;
125 aiPlane () : a(0.f), b(0.f), c(0.f), d(0.f) {}
126 aiPlane (ai_real _a, ai_real _b, ai_real _c, ai_real _d)
127 : a(_a), b(_b), c(_c), d(_d) {}
131 #endif // !__cplusplus 145 : pos(_pos), dir(_dir) {}
149 #endif // !__cplusplus 161 aiColor3D () : r(0.0f), g(0.0f), b(0.0f) {}
162 aiColor3D (ai_real _r, ai_real _g, ai_real _b) : r(_r), g(_g), b(_b) {}
163 explicit aiColor3D (ai_real _r) : r(_r), g(_r), b(_r) {}
168 bool operator == (
const aiColor3D& other)
const 169 {
return r == other.
r && g == other.g && b == other.b;}
173 bool operator != (
const aiColor3D& other)
const 174 {
return r != other.
r || g != other.g || b != other.b;}
178 bool operator < (
const aiColor3D& other)
const {
179 return r < other.
r || ( r == other.
r && (g < other.g || (g == other.g && b < other.b ) ) );
203 ai_real operator[](
unsigned int i)
const {
208 ai_real& operator[](
unsigned int i) {
211 }
else if ( 1 == i ) {
213 }
else if ( 2 == i ) {
220 bool IsBlack()
const {
221 static const ai_real
epsilon = ai_real(10
e-3);
222 return std::fabs( r ) < epsilon && std::fabs( g ) < epsilon && std::fabs( b ) <
epsilon;
225 #endif // !__cplusplus 261 #ifdef ASSIMP_BUILD_DEBUG 263 memset(data+1,27,MAXLEN-1);
272 length = length>=MAXLEN?MAXLEN-1:
length;
273 memcpy( data, rOther.
data, length);
278 explicit aiString(
const std::string& pString) :
281 length = length>=MAXLEN?MAXLEN-1:
length;
282 memcpy( data, pString.c_str(),
length);
287 void Set(
const std::string& pString) {
288 if( pString.length() > MAXLEN - 1) {
291 length = pString.length();
292 memcpy( data, pString.c_str(),
length);
297 void Set(
const char* sz) {
298 const size_t len = ::strlen(sz);
299 if( len > MAXLEN - 1) {
303 memcpy( data, sz, len);
308 aiString& operator = (
const char* sz) {
314 aiString& operator = (
const std::string& pString) {
320 bool operator==(
const aiString& other)
const {
321 return (length == other.
length && 0 == memcmp(data,other.
data,length));
325 bool operator!=(
const aiString& other)
const {
326 return (length != other.
length || 0 != memcmp(data,other.
data,length));
330 void Append (
const char* app) {
331 const size_t len = ::strlen(app);
335 if (length + len >= MAXLEN) {
339 memcpy(&data[length],app,len+1);
348 #ifdef ASSIMP_BUILD_DEBUG 350 memset(data+1,27,MAXLEN-1);
355 const char* C_Str()
const {
359 #endif // !__cplusplus 391 _AI_ENFORCE_ENUM_SIZE = 0x7fffffff
397 #define AI_SUCCESS aiReturn_SUCCESS 398 #define AI_FAILURE aiReturn_FAILURE 399 #define AI_OUTOFMEMORY aiReturn_OUTOFMEMORY 419 _AI_ORIGIN_ENFORCE_ENUM_SIZE = 0x7fffffff
448 _AI_DLS_ENFORCE_ENUM_SIZE = 0x7fffffff
453 #define DLS_FILE aiDefaultLogStream_FILE 454 #define DLS_STDOUT aiDefaultLogStream_STDOUT 455 #define DLS_STDERR aiDefaultLogStream_STDERR 456 #define DLS_DEBUGGER aiDefaultLogStream_DEBUGGER 514 #include "quaternion.inl" 518 #endif // AI_TYPES_H_INC Beginning of the file.
Definition: types.h:408
3D vector structure, including operators when compiling in C++
Assimp's CPP-API and all internal APIs.
Definition: DefaultIOStream.h:51
ai_real r
Red, green and blue color values.
Definition: types.h:228
Stream the log to std::cout.
Definition: types.h:435
Represents a plane in a three-dimensional, euclidean space.
Definition: types.h:122
unsigned int lights
Storage allocated for light data.
Definition: types.h:500
Definition of a 3x3 matrix, including operators when compiling in C++.
Represents a ray.
Definition: types.h:140
unsigned int total
Total storage allocated for the full import.
Definition: types.h:503
Assimp build configuration setup.
Stream the log to std::cerr.
Definition: types.h:438
Stores the memory requirements for different components (e.g.
Definition: types.h:463
C_STRUCT aiVector3D pos
Position and direction of the ray.
Definition: types.h:152
aiReturn
Standard return type for some library functions.
Definition: types.h:375
unsigned int animations
Storage allocated for animation data.
Definition: types.h:494
Inline implementation of the 3x3 matrix operators.
unsigned int meshes
Storage allocated for mesh data.
Definition: types.h:488
GLM_FUNC_QUALIFIER T length(vec< L, T, Q > const &v)
Returns the length of x, i.e., sqrt(x * x).
Definition: func_geometric.inl:136
GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon()
Return the epsilon constant for floating point types.
Definition: scalar_constants.inl:6
aiOrigin
Seek origins (for the virtual file system API).
Definition: types.h:405
unsigned int textures
Storage allocated for texture data.
Definition: types.h:482
Indicates that not enough memory was available to perform the requested operation.
Definition: types.h:386
MSVC only: Stream the log the the debugger (this relies on OutputDebugString from the Win32 SDK) ...
Definition: types.h:443
End of the file, offsets must be negative.
Definition: types.h:414
Represents an UTF-8 string, zero byte terminated.
Definition: types.h:252
Current position of the file pointer.
Definition: types.h:411
#define MAXLEN
Maximum dimension for strings, ASSIMP strings are zero terminated.
Definition: types.h:116
Inline implementation of the 4x4 matrix operators.
unsigned int cameras
Storage allocated for camera data.
Definition: types.h:497
4x4 matrix structure, including operators when compiling in C++
Inline implementation of aiVector2t<TReal> operators.
size_t length
Binary length of the string excluding the terminal 0.
Definition: types.h:364
Stream the log to a file.
Definition: types.h:432
aiDefaultLogStream
Enumerates predefined log streaming destinations.
Definition: types.h:429
Definition: vector3.h:135
GLM_FUNC_DECL GLM_CONSTEXPR genType e()
Return e constant.
Definition: constants.inl:102
Represents a color in Red-Green-Blue space.
Definition: types.h:158
Inline implementation of aiColor4t<TReal> operators.
Indicates that a function was successful.
Definition: types.h:378
unsigned int nodes
Storage allocated for node data.
Definition: types.h:491
ai_real a
Plane equation.
Definition: types.h:134
Inline implementation of aiVector3t<TReal> operators.
aiMemoryInfo()
Default constructor.
Definition: types.h:468
Quaternion structure, including operators when compiling in C++.
char data[MAXLEN]
String buffer.
Definition: types.h:367
RGBA color structure, including operators when compiling in C++.
Indicates that a function failed.
Definition: types.h:381
2D vector structure, including operators when compiling in C++
unsigned int materials
Storage allocated for material data.
Definition: types.h:485