Added definitions for Importer::GetMemoryRequirements

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@89 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2008-08-08 11:48:50 +00:00
parent 4244602895
commit 1d57539d20
8 changed files with 213 additions and 31 deletions

View File

@ -94,10 +94,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# endif # endif
#endif #endif
#ifdef _DEBUG // helper macro that sets a pointer to NULL in debug builds
# define AI_DEBUG_INVALIDATE_PTR(ptr) ptr = 0; #if (!defined AI_DEBUG_INVALIDATE_PTR)
#else # if (defined _DEBUG)
# define AI_DEBUG_INVALIDATE_PTR(ptr) # define AI_DEBUG_INVALIDATE_PTR(x) x = NULL;
# else
# define AI_DEBUG_INVALIDATE_PTR(x)
# endif
#endif #endif
#endif // !! AI_DEFINES_H_INC #endif // !! AI_DEFINES_H_INC

View File

@ -1,3 +1,44 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (ASSIMP)
---------------------------------------------------------------------------
Copyright (c) 2006-2008, ASSIMP Development Team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the ASSIMP team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the ASSIMP Development Team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
/** @file Definition of a 3x3 matrix, including operators when compiling in C++ */ /** @file Definition of a 3x3 matrix, including operators when compiling in C++ */
#ifndef AI_MATRIX3x3_H_INC #ifndef AI_MATRIX3x3_H_INC
#define AI_MATRIX3x3_H_INC #define AI_MATRIX3x3_H_INC

View File

@ -1,3 +1,43 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (ASSIMP)
---------------------------------------------------------------------------
Copyright (c) 2006-2008, ASSIMP Development Team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the ASSIMP team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the ASSIMP Development Team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
/** @file 4x4 matrix structure, including operators when compiling in C++ */ /** @file 4x4 matrix structure, including operators when compiling in C++ */
#ifndef AI_MATRIX4X4_H_INC #ifndef AI_MATRIX4X4_H_INC
#define AI_MATRIX4X4_H_INC #define AI_MATRIX4X4_H_INC

View File

@ -63,9 +63,6 @@ struct aiQuaternion
/** Construct from euler angles */ /** Construct from euler angles */
aiQuaternion( float rotx, float roty, float rotz); aiQuaternion( float rotx, float roty, float rotz);
/** Construct from an axis angle pair */
aiQuaternion( aiVector3D axis, float angle);
/** Construct from a normalized quaternion stored in a vec3 */ /** Construct from a normalized quaternion stored in a vec3 */
aiQuaternion( aiVector3D normalized); aiQuaternion( aiVector3D normalized);

View File

@ -113,7 +113,7 @@ struct aiNode
}; };
//! @def AI_SCENE_FLAGS_ANIM_SKELETON_ONLY //! @def AI_SCENE_FLAGS_ANIM_SKELETON_ONLY
//! Specifies that no model but only an animation skeleton has been //! Specifies that no full model but only an animation skeleton has been
//! imported. There are no materials in this case. There are no //! imported. There are no materials in this case. There are no
//! textures in this case. But there is a node graph, animation channels //! textures in this case. But there is a node graph, animation channels
//! and propably meshes with bones. //! and propably meshes with bones.

View File

@ -1,27 +1,50 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (ASSIMP)
---------------------------------------------------------------------------
/** Copyright (c) 2006-2008, ASSIMP Development Team
** This file is part of the Open Asset Import Library ASSIMP.
** ------------------------------------------------------------------------- All rights reserved.
**
** ASSIMP is free software: you can redistribute it and/or modify it Redistribution and use of this software in source and binary forms,
** under the terms of the GNU Lesser General Public License as published with or without modification, are permitted provided that the following
** by the Free Software Foundation, either version 3 of the License, or conditions are met:
** (at your option) any later version.
** * Redistributions of source code must retain the above
** ASSIMP is distributed in the hope that it will be useful, copyright notice, this list of conditions and the
** but WITHOUT ANY WARRANTY; without even the implied warranty of following disclaimer.
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU Lesser General Public License for more details. * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the
** You should have received a copy of the GNU Lesser General Public License following disclaimer in the documentation and/or other
** along with ASSIMP. If not, see <http://www.gnu.org/licenses/>. materials provided with the distribution.
**
** ------------------------------------------------------------------------- * Neither the name of the ASSIMP team, nor the names of its
**/ contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the ASSIMP Development Team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
/** @file Defines texture helper structures for the library /** @file Defines texture helper structures for the library
* *
* Used for file formats that embedd their textures into the file * Used for file formats which embedd their textures into the model file.
* Supported are both normal textures, which are stored as uncompressed
* pixels, and "compressed" textures, which are stored in a file format
* such as PNG or TGA.
*/ */
#ifndef AI_TEXTURE_H_INC #ifndef AI_TEXTURE_H_INC
@ -122,7 +145,7 @@ struct aiTexture
* will be set to '\0\0\0\0' if the loader has no additional * will be set to '\0\0\0\0' if the loader has no additional
* information about the texture file format used OR the * information about the texture file format used OR the
* file extension of the format without a leading dot. * file extension of the format without a leading dot.
* E.g. 'dds\0', 'pcx\0' * E.g. 'dds\0', 'pcx\0'. All characters are lower-case.
*/ */
char achFormatHint[4]; char achFormatHint[4];
@ -157,6 +180,7 @@ struct aiTexture
#endif #endif
}; };
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -216,6 +216,43 @@ enum aiReturn
}; };
// ---------------------------------------------------------------------------
/** Stores the memory requirements for different parts (e.g. meshes, materials,
* animations) of an import.
* @see Importer::GetMemoryRequirements()
*/
// ---------------------------------------------------------------------------
struct aiMemoryInfo
{
#ifdef __cplusplus
//! Default constructor
inline aiMemoryInfo()
: textures (0)
, materials (0)
, meshes (0)
, nodes (0)
, animations (0)
, total (0)
{}
#endif
//! Storage allocated for texture data, in bytes
unsigned int textures;
//! Storage allocated for material data, in bytes
unsigned int materials;
//! Storage allocated for mesh data, in bytes
unsigned int meshes;
//! Storage allocated for node data, in bytes
unsigned int nodes;
//! Storage allocated for animation data, in bytes
unsigned int animations;
//! Storage allocated for the import, in bytes
unsigned int total;
};
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif //! __cplusplus #endif //! __cplusplus

View File

@ -1,3 +1,43 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (ASSIMP)
---------------------------------------------------------------------------
Copyright (c) 2006-2008, ASSIMP Development Team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the ASSIMP team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the ASSIMP Development Team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
/** @file 3D vector structure, including operators when compiling in C++ */ /** @file 3D vector structure, including operators when compiling in C++ */
#ifndef AI_VECTOR3D_H_INC #ifndef AI_VECTOR3D_H_INC
#define AI_VECTOR3D_H_INC #define AI_VECTOR3D_H_INC