Major API cleanup. Unified formatting & doxygen tags in the public API.
Added factory provider for default log streams. Added default log streams to std::out and std::cerr. Updated VC8 project config, boost workarounds is now working for the viewer. Updated unit test suite. Fixed some minor issues in the postprocessing-framework. BROKEN: DebugDLL build. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@292 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -43,13 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define AI_MATERIALSYSTEM_H_INC
|
||||
|
||||
#include "../include/aiMaterial.h"
|
||||
|
||||
namespace Assimp
|
||||
{
|
||||
namespace Assimp {
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** Internal material helper class. Can be used to fill an aiMaterial
|
||||
// ----------------------------------------------------------------------------------------
|
||||
/** Internal material helper class. Intended to be used to fill an aiMaterial
|
||||
structure easily. */
|
||||
class ASSIMP_API MaterialHelper : public ::aiMaterial
|
||||
{
|
||||
@@ -58,95 +56,102 @@ public:
|
||||
MaterialHelper();
|
||||
~MaterialHelper();
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Add a property with a given key and type info to the material
|
||||
// ------------------------------------------------------------------------------
|
||||
/** @brief Add a property with a given key and type info to the material
|
||||
* structure
|
||||
*
|
||||
* \param pInput Pointer to input data
|
||||
* \param pSizeInBytes Size of input data
|
||||
* \param pKey Key/Usage of the property (AI_MATKEY_XXX)
|
||||
* \param type Set by the AI_MATKEY_XXX macro
|
||||
* \param index Set by the AI_MATKEY_XXX macro
|
||||
* \param pType Type information hint
|
||||
* @param pInput Pointer to input data
|
||||
* @param pSizeInBytes Size of input data
|
||||
* @param pKey Key/Usage of the property (AI_MATKEY_XXX)
|
||||
* @param type Set by the AI_MATKEY_XXX macro
|
||||
* @param index Set by the AI_MATKEY_XXX macro
|
||||
* @param pType Type information hint
|
||||
*/
|
||||
aiReturn AddBinaryProperty (const void* pInput,
|
||||
unsigned int pSizeInBytes,
|
||||
const char* pKey,
|
||||
unsigned int type,
|
||||
unsigned int index,
|
||||
unsigned int type ,
|
||||
unsigned int index ,
|
||||
aiPropertyTypeInfo pType);
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Add a string property with a given key and type info to the
|
||||
// ------------------------------------------------------------------------------
|
||||
/** @brief Add a string property with a given key and type info to the
|
||||
* material structure
|
||||
*
|
||||
* \param pInput Input string
|
||||
* \param pKey Key/Usage of the property (AI_MATKEY_XXX)
|
||||
* \param type Set by the AI_MATKEY_XXX macro
|
||||
* \param index Set by the AI_MATKEY_XXX macro
|
||||
* @param pInput Input string
|
||||
* @param pKey Key/Usage of the property (AI_MATKEY_XXX)
|
||||
* @param type Set by the AI_MATKEY_XXX macro
|
||||
* @param index Set by the AI_MATKEY_XXX macro
|
||||
*/
|
||||
aiReturn AddProperty (const aiString* pInput,
|
||||
const char* pKey,
|
||||
unsigned int type,
|
||||
unsigned int index);
|
||||
unsigned int type = 0,
|
||||
unsigned int index = 0);
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Add a property with a given key to the material structure
|
||||
* \param pInput Pointer to the input data
|
||||
* \param pNumValues Number of values in the array
|
||||
* \param pKey Key/Usage of the property (AI_MATKEY_XXX)
|
||||
* \param type Set by the AI_MATKEY_XXX macro
|
||||
* \param index Set by the AI_MATKEY_XXX macro
|
||||
// ------------------------------------------------------------------------------
|
||||
/** @brief Add a property with a given key to the material structure
|
||||
* @param pInput Pointer to the input data
|
||||
* @param pNumValues Number of values in the array
|
||||
* @param pKey Key/Usage of the property (AI_MATKEY_XXX)
|
||||
* @param type Set by the AI_MATKEY_XXX macro
|
||||
* @param index Set by the AI_MATKEY_XXX macro
|
||||
*/
|
||||
template<class TYPE>
|
||||
aiReturn AddProperty (const TYPE* pInput,
|
||||
unsigned int pNumValues,
|
||||
const char* pKey,
|
||||
unsigned int type,
|
||||
unsigned int index);
|
||||
unsigned int type = 0,
|
||||
unsigned int index = 0);
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Remove a given key from the list
|
||||
* The function fails if the key isn't found
|
||||
// ------------------------------------------------------------------------------
|
||||
/** @brief Remove a given key from the list.
|
||||
*
|
||||
* \param pKey Key to be deleted
|
||||
* The function fails if the key isn't found
|
||||
* @param pKey Key to be deleted
|
||||
*/
|
||||
aiReturn RemoveProperty (const char* pKey,
|
||||
unsigned int type,
|
||||
unsigned int index);
|
||||
unsigned int type = 0,
|
||||
unsigned int index = 0);
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Removes all properties from the material
|
||||
// ------------------------------------------------------------------------------
|
||||
/** @brief Removes all properties from the material.
|
||||
*
|
||||
* The array remains allocated, so adding new properties is quite fast.
|
||||
*/
|
||||
void Clear();
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------
|
||||
/** Computes a hash (hopefully unique) from all material properties
|
||||
* The hash value must be updated after material properties have
|
||||
* been changed.
|
||||
* The hash value reflects the current property state, so if you add any
|
||||
* proprty and call this method again, the resulting hash value will be
|
||||
* different.
|
||||
*
|
||||
* \return Unique hash
|
||||
* @param includeMatName Set to 'true' to take the #AI_MATKEY_NAME property
|
||||
* into account. The default value is false.
|
||||
* @return Unique hash
|
||||
*/
|
||||
uint32_t ComputeHash();
|
||||
uint32_t ComputeHash(bool includeMatName = false);
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------
|
||||
/** Copy the property list of a material
|
||||
* \param pcDest Destination material
|
||||
* \param pcSrc Source material
|
||||
*/
|
||||
static void CopyPropertyList(MaterialHelper* pcDest,
|
||||
const MaterialHelper* pcSrc);
|
||||
|
||||
// For internal use
|
||||
void _InternDestruct();
|
||||
};
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------------------
|
||||
template<class TYPE>
|
||||
aiReturn MaterialHelper::AddProperty (const TYPE* pInput,
|
||||
const unsigned int pNumValues,
|
||||
@@ -154,14 +159,12 @@ aiReturn MaterialHelper::AddProperty (const TYPE* pInput,
|
||||
unsigned int type,
|
||||
unsigned int index)
|
||||
{
|
||||
return this->AddBinaryProperty((const void*)pInput,
|
||||
return AddBinaryProperty((const void*)pInput,
|
||||
pNumValues * sizeof(TYPE),
|
||||
pKey,type,index,aiPTI_Buffer);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------------------
|
||||
template<>
|
||||
inline aiReturn MaterialHelper::AddProperty<float> (const float* pInput,
|
||||
const unsigned int pNumValues,
|
||||
@@ -169,14 +172,12 @@ inline aiReturn MaterialHelper::AddProperty<float> (const float* pInput,
|
||||
unsigned int type,
|
||||
unsigned int index)
|
||||
{
|
||||
return this->AddBinaryProperty((const void*)pInput,
|
||||
return AddBinaryProperty((const void*)pInput,
|
||||
pNumValues * sizeof(float),
|
||||
pKey,type,index,aiPTI_Float);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------------------
|
||||
template<>
|
||||
inline aiReturn MaterialHelper::AddProperty<aiColor4D> (const aiColor4D* pInput,
|
||||
const unsigned int pNumValues,
|
||||
@@ -184,14 +185,12 @@ inline aiReturn MaterialHelper::AddProperty<aiColor4D> (const aiColor4D* pInput,
|
||||
unsigned int type,
|
||||
unsigned int index)
|
||||
{
|
||||
return this->AddBinaryProperty((const void*)pInput,
|
||||
return AddBinaryProperty((const void*)pInput,
|
||||
pNumValues * sizeof(aiColor4D),
|
||||
pKey,type,index,aiPTI_Float);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------------------
|
||||
template<>
|
||||
inline aiReturn MaterialHelper::AddProperty<aiColor3D> (const aiColor3D* pInput,
|
||||
const unsigned int pNumValues,
|
||||
@@ -199,14 +198,12 @@ inline aiReturn MaterialHelper::AddProperty<aiColor3D> (const aiColor3D* pInput,
|
||||
unsigned int type,
|
||||
unsigned int index)
|
||||
{
|
||||
return this->AddBinaryProperty((const void*)pInput,
|
||||
return AddBinaryProperty((const void*)pInput,
|
||||
pNumValues * sizeof(aiColor3D),
|
||||
pKey,type,index,aiPTI_Float);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------------------
|
||||
template<>
|
||||
inline aiReturn MaterialHelper::AddProperty<int> (const int* pInput,
|
||||
const unsigned int pNumValues,
|
||||
@@ -214,11 +211,10 @@ inline aiReturn MaterialHelper::AddProperty<int> (const int* pInput,
|
||||
unsigned int type,
|
||||
unsigned int index)
|
||||
{
|
||||
return this->AddBinaryProperty((const void*)pInput,
|
||||
return AddBinaryProperty((const void*)pInput,
|
||||
pNumValues * sizeof(int),
|
||||
pKey,type,index,aiPTI_Integer);
|
||||
}
|
||||
}
|
||||
|
||||
} // ! namespace Assimp
|
||||
|
||||
#endif //!! AI_MATERIALSYSTEM_H_INC
|
||||
|
||||
Reference in New Issue
Block a user