Refactor: Trim trailing whitespace

pull/566/head
Richard 2015-05-18 21:52:10 -06:00
parent 4c1a0507fe
commit a96a595a7a
313 changed files with 7022 additions and 7022 deletions

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -59,7 +59,7 @@ using namespace Assimp;
// Setup final material indices, generae a default material if necessary
void Discreet3DSImporter::ReplaceDefaultMaterial()
{
// Try to find an existing material that matches the
// typical default material setting:
// - no textures
@ -81,7 +81,7 @@ void Discreet3DSImporter::ReplaceDefaultMaterial()
mScene->mMaterials[i].mDiffuse.b)continue;
if (mScene->mMaterials[i].sTexDiffuse.mMapName.length() != 0 ||
mScene->mMaterials[i].sTexBump.mMapName.length() != 0 ||
mScene->mMaterials[i].sTexBump.mMapName.length() != 0 ||
mScene->mMaterials[i].sTexOpacity.mMapName.length() != 0 ||
mScene->mMaterials[i].sTexEmissive.mMapName.length() != 0 ||
mScene->mMaterials[i].sTexSpecular.mMapName.length() != 0 ||
@ -159,7 +159,7 @@ void Discreet3DSImporter::CheckIndices(D3DS::Mesh& sMesh)
void Discreet3DSImporter::MakeUnique(D3DS::Mesh& sMesh)
{
// TODO: really necessary? I don't think. Just a waste of memory and time
// to do it now in a separate buffer.
// to do it now in a separate buffer.
// Allocate output storage
std::vector<aiVector3D> vNew (sMesh.mFaces.size() * 3);
@ -202,7 +202,7 @@ void CopyTexture(aiMaterial& mat, D3DS::Texture& texture, aiTextureType type)
mat.AddProperty<int>((int*)&texture.mMapMode,1,AI_MATKEY_MAPPINGMODE_U(type,0));
mat.AddProperty<int>((int*)&texture.mMapMode,1,AI_MATKEY_MAPPINGMODE_V(type,0));
// Mirroring - double the scaling values
// Mirroring - double the scaling values
// FIXME: this is not really correct ...
if (texture.mMapMode == aiTextureMapMode_Mirror)
{
@ -211,7 +211,7 @@ void CopyTexture(aiMaterial& mat, D3DS::Texture& texture, aiTextureType type)
texture.mOffsetU /= 2.f;
texture.mOffsetV /= 2.f;
}
// Setup texture UV transformations
mat.AddProperty<float>(&texture.mOffsetU,5,AI_MATKEY_UVTRANSFORM(type,0));
}
@ -249,7 +249,7 @@ void Discreet3DSImporter::ConvertMaterial(D3DS::Material& oldMat,
mat.AddProperty( &oldMat.mEmissive, 1, AI_MATKEY_COLOR_EMISSIVE);
// Phong shininess and shininess strength
if (D3DS::Discreet3DS::Phong == oldMat.mShading ||
if (D3DS::Discreet3DS::Phong == oldMat.mShading ||
D3DS::Discreet3DS::Metal == oldMat.mShading)
{
if (!oldMat.mSpecularExponent || !oldMat.mShininessStrength)
@ -456,7 +456,7 @@ void Discreet3DSImporter::AddNodeToGraph(aiScene* pcSOut,aiNode* pcOut,
}
if (!iArray.empty())
{
// The matrix should be identical for all meshes with the
// The matrix should be identical for all meshes with the
// same name. It HAS to be identical for all meshes .....
D3DS::Mesh* imesh = ((D3DS::Mesh*)pcSOut->mMeshes[iArray[0]]->mColors[0]);
@ -537,7 +537,7 @@ void Discreet3DSImporter::AddNodeToGraph(aiScene* pcSOut,aiNode* pcOut,
pcOut->mTransformation = aiMatrix4x4( pcIn->aRotationKeys[0].mValue.GetMatrix() );
}
else if (pcIn->aCameraRollKeys.size())
else if (pcIn->aCameraRollKeys.size())
{
aiMatrix4x4::RotationZ(AI_DEG_TO_RAD(- pcIn->aCameraRollKeys[0].mValue),
pcOut->mTransformation);
@ -684,7 +684,7 @@ void Discreet3DSImporter::AddNodeToGraph(aiScene* pcSOut,aiNode* pcOut,
}
}
// Allocate storage for children
// Allocate storage for children
pcOut->mNumChildren = (unsigned int)pcIn->mChildren.size();
pcOut->mChildren = new aiNode*[pcIn->mChildren.size()];
@ -735,12 +735,12 @@ void Discreet3DSImporter::GenerateNodeGraph(aiScene* pcOut)
// ROOT_NODE
// |
// ----------------------------------------
// | | | | |
// | | | | |
// MESH_0 MESH_1 MESH_2 ... MESH_N CAMERA_0 ....
//
DefaultLogger::get()->warn("No hierarchy information has been found in the file. ");
pcOut->mRootNode->mNumChildren = pcOut->mNumMeshes +
pcOut->mRootNode->mNumChildren = pcOut->mNumMeshes +
mScene->mCameras.size() + mScene->mLights.size();
pcOut->mRootNode->mChildren = new aiNode* [ pcOut->mRootNode->mNumChildren ];
@ -757,7 +757,7 @@ void Discreet3DSImporter::GenerateNodeGraph(aiScene* pcOut)
pcNode->mNumMeshes = 1;
// Build a name for the node
pcNode->mName.length = sprintf(pcNode->mName.data,"3DSMesh_%u",i);
pcNode->mName.length = sprintf(pcNode->mName.data,"3DSMesh_%u",i);
}
// Build dummy nodes for all cameras
@ -796,7 +796,7 @@ void Discreet3DSImporter::GenerateNodeGraph(aiScene* pcOut)
anim->mName.Set("3DSMasterAnim");
// Allocate enough storage for all node animation channels,
// Allocate enough storage for all node animation channels,
// but don't set the mNumChannels member - we'll use it to
// index into the array
anim->mChannels = new aiNodeAnim*[numChannel];

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -88,7 +88,7 @@ namespace {
writer.PutU4(chunk_size);
writer.SetCurrentPos(head_pos);
}
private:
StreamWriterLE& writer;
std::size_t chunk_start_pos;
@ -153,7 +153,7 @@ void ExportScene3DS(const char* pFile, IOSystem* pIOSystem, const aiScene* pScen
boost::shared_ptr<IOStream> outfile (pIOSystem->Open(pFile, "wb"));
if(!outfile) {
throw DeadlyExportError("Could not open output .3ds file: " + std::string(pFile));
}
}
// TODO: This extra copy should be avoided and all of this made a preprocess
// requirement of the 3DS exporter.
@ -174,7 +174,7 @@ void ExportScene3DS(const char* pFile, IOSystem* pIOSystem, const aiScene* pScen
vert_splitter.SetLimit(0xffff);
vert_splitter.Execute(scenecopy.get());
// Invoke the actual exporter
// Invoke the actual exporter
Discreet3DSExporter exporter(outfile, scenecopy.get());
}
@ -347,7 +347,7 @@ void Discreet3DSExporter::WriteMaterials()
ChunkWriter chunk(writer, Discreet3DS::CHUNK_MAT_TWO_SIDE);
writer.PutI2(1);
}
WriteTexture(mat, aiTextureType_DIFFUSE, Discreet3DS::CHUNK_MAT_TEXTURE);
WriteTexture(mat, aiTextureType_HEIGHT, Discreet3DS::CHUNK_MAT_BUMPMAP);
WriteTexture(mat, aiTextureType_OPACITY, Discreet3DS::CHUNK_MAT_OPACMAP);
@ -359,7 +359,7 @@ void Discreet3DSExporter::WriteMaterials()
}
// ------------------------------------------------------------------------------------------------
void Discreet3DSExporter::WriteTexture(const aiMaterial& mat, aiTextureType type, uint16_t chunk_flags)
void Discreet3DSExporter::WriteTexture(const aiMaterial& mat, aiTextureType type, uint16_t chunk_flags)
{
aiString path;
aiTextureMapMode map_mode[2] = {

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -55,7 +55,7 @@ struct aiNode;
struct aiMaterial;
struct aiMesh;
namespace Assimp
namespace Assimp
{
// ------------------------------------------------------------------------------------------------

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -113,7 +113,7 @@ public:
KEY_USE_EASE_FROM = 0x10
} ;
enum
enum
{
// ********************************************************************
@ -153,7 +153,7 @@ public:
// Specifies the background image for the whole scene
// This value is passed through the material system
// to the viewer
// to the viewer
CHUNK_BIT_MAP = 0x1100,
CHUNK_BIT_MAP_EXISTS = 0x1101,
@ -195,33 +195,33 @@ public:
CHUNK_MAT_MATERIAL = 0xAFFF,
// asciiz containing the name of the material
CHUNK_MAT_MATNAME = 0xA000,
CHUNK_MAT_MATNAME = 0xA000,
CHUNK_MAT_AMBIENT = 0xA010, // followed by color chunk
CHUNK_MAT_DIFFUSE = 0xA020, // followed by color chunk
CHUNK_MAT_SPECULAR = 0xA030, // followed by color chunk
// Specifies the shininess of the material
// followed by percentage chunk
CHUNK_MAT_SHININESS = 0xA040,
CHUNK_MAT_SHININESS = 0xA040,
CHUNK_MAT_SHININESS_PERCENT = 0xA041 ,
// Specifies the shading mode to be used
// followed by a short
CHUNK_MAT_SHADING = 0xA100,
CHUNK_MAT_SHADING = 0xA100,
// NOTE: Emissive color (self illumination) seems not
// to be a color but a single value, type is unknown.
// Make the parser accept both of them.
// followed by percentage chunk (?)
CHUNK_MAT_SELF_ILLUM = 0xA080,
CHUNK_MAT_SELF_ILLUM = 0xA080,
// Always followed by percentage chunk (?)
CHUNK_MAT_SELF_ILPCT = 0xA084,
CHUNK_MAT_SELF_ILPCT = 0xA084,
// Always followed by percentage chunk
CHUNK_MAT_TRANSPARENCY = 0xA050,
CHUNK_MAT_TRANSPARENCY = 0xA050,
// Diffuse texture channel 0
// Diffuse texture channel 0
CHUNK_MAT_TEXTURE = 0xA200,
// Contains opacity information for each texel
@ -232,7 +232,7 @@ public:
CHUNK_MAT_REFLMAP = 0xA220,
// Self Illumination map (emissive colors)
CHUNK_MAT_SELFIMAP = 0xA33d,
CHUNK_MAT_SELFIMAP = 0xA33d,
// Bumpmap. Not specified whether it is a heightmap
// or a normal map. Assme it is a heightmap since
@ -242,17 +242,17 @@ public:
// Specular map. Seems to influence the specular color
CHUNK_MAT_SPECMAP = 0xA204,
// Holds shininess data.
// Holds shininess data.
CHUNK_MAT_MAT_SHINMAP = 0xA33C,
// Scaling in U/V direction.
// (need to gen separate UV coordinate set
// (need to gen separate UV coordinate set
// and do this by hand)
CHUNK_MAT_MAP_USCALE = 0xA354,
CHUNK_MAT_MAP_VSCALE = 0xA356,
// Translation in U/V direction.
// (need to gen separate UV coordinate set
// (need to gen separate UV coordinate set
// and do this by hand)
CHUNK_MAT_MAP_UOFFSET = 0xA358,
CHUNK_MAT_MAP_VOFFSET = 0xA35a,
@ -268,7 +268,7 @@ public:
CHUNK_MAPFILE = 0xA300,
// Specifies whether a materail requires two-sided rendering
CHUNK_MAT_TWO_SIDE = 0xA081,
CHUNK_MAT_TWO_SIDE = 0xA081,
// ********************************************************************
// Main keyframer chunk. Contains translation/rotation/scaling data
@ -366,7 +366,7 @@ struct Material
{
//! Default constructor. Builds a default name for the material
Material()
:
:
mDiffuse (0.6f,0.6f,0.6f), // FIX ... we won't want object to be black
mSpecularExponent (0.0f),
mShininessStrength (1.0f),
@ -376,7 +376,7 @@ struct Material
mTwoSided (false)
{
static int iCnt = 0;
char szTemp[128];
sprintf(szTemp,"UNNAMED_%i",iCnt++);
mName = szTemp;
@ -431,7 +431,7 @@ struct Mesh : public MeshWithSmoothingGroups<D3DS::Face>
Mesh()
{
static int iCnt = 0;
// Generate a default name for the mesh
char szTemp[128];
::sprintf(szTemp,"UNNAMED_%i",iCnt++);
@ -454,7 +454,7 @@ struct Mesh : public MeshWithSmoothingGroups<D3DS::Face>
// ---------------------------------------------------------------------------
/** Float key - quite similar to aiVectorKey and aiQuatKey. Both are in the
C-API, so it would be difficult to make them a template. */
struct aiFloatKey
struct aiFloatKey
{
double mTime; ///< The time of this key
float mValue; ///< The value of this key
@ -491,7 +491,7 @@ struct Node
{
static int iCnt = 0;
// Generate a default name for the node
char szTemp[128];
::sprintf(szTemp,"UNNAMED_%i",iCnt++);
@ -520,7 +520,7 @@ struct Node
//! InstanceNumber of the node
int32_t mInstanceNumber;
//! Dummy nodes: real name to be combined with the $$$DUMMY
//! Dummy nodes: real name to be combined with the $$$DUMMY
std::string mDummyName;
//! Position of the node in the hierarchy (tree depth)

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -68,10 +68,10 @@ static const aiImporterDesc desc = {
0,
0,
0,
"3ds prj"
"3ds prj"
};
// ------------------------------------------------------------------------------------------------
// Begins a new parsing block
// - Reads the current chunk and validates it
@ -88,7 +88,7 @@ static const aiImporterDesc desc = {
continue; \
const int oldReadLimit = stream->GetReadLimit(); \
stream->SetReadLimit(stream->GetCurrentPos() + chunkSize); \
// ------------------------------------------------------------------------------------------------
// End a parsing block
@ -106,12 +106,12 @@ Discreet3DSImporter::Discreet3DSImporter()
{}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
// Destructor, private as well
Discreet3DSImporter::~Discreet3DSImporter()
{}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Returns whether the class can handle the format of the given file.
bool Discreet3DSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
{
std::string extension = GetExtension(pFile);
@ -143,8 +143,8 @@ void Discreet3DSImporter::SetupProperties(const Importer* /*pImp*/)
}
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void Discreet3DSImporter::InternReadFile( const std::string& pFile,
// Imports the given file into the given scene structure.
void Discreet3DSImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
StreamReaderLE stream(pIOHandler->Open(pFile,"rb"));
@ -174,7 +174,7 @@ void Discreet3DSImporter::InternReadFile( const std::string& pFile,
ParseMainChunk();
// Process all meshes in the file. First check whether all
// face indices haev valid values. The generate our
// face indices haev valid values. The generate our
// internal verbose representation. Finally compute normal
// vectors from the smoothing groups we read from the
// file.
@ -225,7 +225,7 @@ void Discreet3DSImporter::ApplyMasterScale(aiScene* pScene)
else mMasterScale = 1.0f / mMasterScale;
// Construct an uniform scaling matrix and multiply with it
pScene->mRootNode->mTransformation *= aiMatrix4x4(
pScene->mRootNode->mTransformation *= aiMatrix4x4(
mMasterScale,0.0f, 0.0f, 0.0f,
0.0f, mMasterScale,0.0f, 0.0f,
0.0f, 0.0f, mMasterScale,0.0f,
@ -245,7 +245,7 @@ void Discreet3DSImporter::ReadChunk(Discreet3DS::Chunk* pcOut)
if (pcOut->Size - sizeof(Discreet3DS::Chunk) > stream->GetRemainingSize())
throw DeadlyImportError("Chunk is too large");
if (pcOut->Size - sizeof(Discreet3DS::Chunk) > stream->GetRemainingSizeToLimit())
DefaultLogger::get()->error("3DS: Chunk overflow");
}
@ -256,7 +256,7 @@ void Discreet3DSImporter::SkipChunk()
{
Discreet3DS::Chunk psChunk;
ReadChunk(&psChunk);
stream->IncPtr(psChunk.Size-sizeof(Discreet3DS::Chunk));
return;
}
@ -270,7 +270,7 @@ void Discreet3DSImporter::ParseMainChunk()
// get chunk type
switch (chunk.Flag)
{
case Discreet3DS::CHUNK_PRJ:
bIsPrj = true;
case Discreet3DS::CHUNK_MAIN:
@ -356,7 +356,7 @@ void Discreet3DSImporter::ParseObjectChunk()
case Discreet3DS::CHUNK_BIT_MAP:
{
// Specifies the background image. The string should already be
// Specifies the background image. The string should already be
// properly 0 terminated but we need to be sure
unsigned int cnt = 0;
const char* sz = (const char*)stream->GetPtr();
@ -404,7 +404,7 @@ void Discreet3DSImporter::ParseChunk(const char* name, unsigned int num)
}
break;
case Discreet3DS::CHUNK_LIGHT:
case Discreet3DS::CHUNK_LIGHT:
{
// This starts a new light
aiLight* light = new aiLight();
@ -453,7 +453,7 @@ void Discreet3DSImporter::ParseChunk(const char* name, unsigned int num)
camera->mLookAt.z = stream->GetF4() - camera->mPosition.z;
float len = camera->mLookAt.Length();
if (len < 1e-5f) {
// There are some files with lookat == position. Don't know why or whether it's ok or not.
DefaultLogger::get()->error("3DS: Unable to read proper camera look-at vector");
camera->mLookAt = aiVector3D(0.f,1.f,0.f);
@ -461,7 +461,7 @@ void Discreet3DSImporter::ParseChunk(const char* name, unsigned int num)
}
else camera->mLookAt /= len;
// And finally - the camera rotation angle, in counter clockwise direction
// And finally - the camera rotation angle, in counter clockwise direction
const float angle = AI_DEG_TO_RAD( stream->GetF4() );
aiQuaternion quat(camera->mLookAt,angle);
camera->mUp = quat.GetMatrix() * aiVector3D(0.f,1.f,0.f);
@ -472,7 +472,7 @@ void Discreet3DSImporter::ParseChunk(const char* name, unsigned int num)
camera->mHorizontalFOV = AI_DEG_TO_RAD(45.f);
}
// Now check for further subchunks
// Now check for further subchunks
if (!bIsPrj) /* fixme */ {
ParseCameraChunk();
}}
@ -505,7 +505,7 @@ void Discreet3DSImporter::ParseLightChunk()
// FIX: the falloff angle is just an offset
light->mAngleOuterCone = light->mAngleInnerCone+AI_DEG_TO_RAD( stream->GetF4() );
break;
break;
// intensity multiplier
case Discreet3DS::CHUNK_DL_MULTIPLIER:
@ -521,7 +521,7 @@ void Discreet3DSImporter::ParseLightChunk()
break;
// light attenuation
case Discreet3DS::CHUNK_DL_ATTENUATE:
case Discreet3DS::CHUNK_DL_ATTENUATE:
light->mAttenuationLinear = stream->GetF4();
break;
};
@ -665,7 +665,7 @@ void Discreet3DSImporter::ParseHierarchyChunk(uint16_t parent)
while (stream->GetI1())++cnt;
std::string name = std::string(sz,cnt);
// Now find out whether we have this node already (target animation channels
// Now find out whether we have this node already (target animation channels
// are stored with a separate object ID)
D3DS::Node* pcNode = FindNode(mRootNode,name);
int instanceNumber = 1;
@ -698,7 +698,7 @@ void Discreet3DSImporter::ParseHierarchyChunk(uint16_t parent)
// add to the parent of the last touched node
mCurrentNode->mParent->push_back(pcNode);
mLastNodeIndex++;
mLastNodeIndex++;
}
else if(hierarchy >= mLastNodeIndex) {
@ -709,7 +709,7 @@ void Discreet3DSImporter::ParseHierarchyChunk(uint16_t parent)
else {
// need to go back to the specified position in the hierarchy.
InverseNodeSearch(pcNode,mCurrentNode);
mLastNodeIndex++;
mLastNodeIndex++;
}
// Make this node the current node
mCurrentNode = pcNode;
@ -734,7 +734,7 @@ void Discreet3DSImporter::ParseHierarchyChunk(uint16_t parent)
case Discreet3DS::CHUNK_TRACKPIVOT:
if ( Discreet3DS::CHUNK_TRACKINFO != parent)
if ( Discreet3DS::CHUNK_TRACKINFO != parent)
{
DefaultLogger::get()->warn("3DS: Skipping pivot subchunk for non usual object");
break;
@ -814,7 +814,7 @@ void Discreet3DSImporter::ParseHierarchyChunk(uint16_t parent)
aiFloatKey v;
v.mTime = (double)fidx;
// This is just a single float
// This is just a single float
SkipTCBInfo();
v.mValue = stream->GetF4();
@ -917,7 +917,7 @@ void Discreet3DSImporter::ParseHierarchyChunk(uint16_t parent)
// check whether we'll need to sort the keys
if (!l->empty() && v.mTime <= l->back().mTime)
sortKeys = true;
// Remove zero-scalings on singular axes - they've been reported to be there erroneously in some strange files
if (!v.mValue.x) v.mValue.x = 1.f;
if (!v.mValue.y) v.mValue.y = 1.f;
@ -950,7 +950,7 @@ void Discreet3DSImporter::ParseFaceChunk()
{
case Discreet3DS::CHUNK_SMOOLIST:
{
// This is the list of smoothing groups - a bitfield for every face.
// This is the list of smoothing groups - a bitfield for every face.
// Up to 32 smoothing groups assigned to a single face.
unsigned int num = chunkSize/4, m = 0;
if (num > mMesh.mFaces.size()) {
@ -1071,7 +1071,7 @@ void Discreet3DSImporter::ParseMeshChunk()
stream->IncPtr(2); // skip edge visibility flag
}
// Resize the material array (0xcdcdcdcd marks the default material; so if a face is
// Resize the material array (0xcdcdcdcd marks the default material; so if a face is
// not referenced by a material, $$DEFAULT will be assigned to it)
mMesh.mFaceMaterials.resize(mMesh.mFaces.size(),0xcdcdcdcd);
@ -1314,10 +1314,10 @@ void Discreet3DSImporter::ParseTextureChunk(D3DS::Texture* pcOut)
// Get the mapping mode (for both axes)
if (iFlags & 0x2u)
pcOut->mMapMode = aiTextureMapMode_Mirror;
else if (iFlags & 0x10u)
pcOut->mMapMode = aiTextureMapMode_Decal;
// wrapping in all remaining cases
else pcOut->mMapMode = aiTextureMapMode_Wrap;
}

View File

@ -6,8 +6,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -24,16 +24,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -73,8 +73,8 @@ public:
public:
// -------------------------------------------------------------------
/** Returns whether the class can handle the format of the given file.
* See BaseImporter::CanRead() for details.
/** Returns whether the class can handle the format of the given file.
* See BaseImporter::CanRead() for details.
*/
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
bool checkSig) const;
@ -95,14 +95,14 @@ protected:
const aiImporterDesc* GetInfo () const;
// -------------------------------------------------------------------
/** Imports the given file into the given scene structure.
/** Imports the given file into the given scene structure.
* See BaseImporter::InternReadFile() for details
*/
void InternReadFile( const std::string& pFile, aiScene* pScene,
void InternReadFile( const std::string& pFile, aiScene* pScene,
IOSystem* pIOHandler);
// -------------------------------------------------------------------
/** Converts a temporary material to the outer representation
/** Converts a temporary material to the outer representation
*/
void ConvertMaterial(D3DS::Material& p_cMat,
aiMaterial& p_pcOut);

View File

@ -8,8 +8,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -26,16 +26,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -84,7 +84,7 @@ static const aiImporterDesc desc = {
{ \
DefaultLogger::get()->error("AC3D: Unexpected EOF/EOL"); \
continue; \
}
}
// ------------------------------------------------------------------------------------------------
// read a string (may be enclosed in double quotation marks). buffer must point to "
@ -107,7 +107,7 @@ static const aiImporterDesc desc = {
// ------------------------------------------------------------------------------------------------
// read 1 to n floats prefixed with an optional predefined identifier
// read 1 to n floats prefixed with an optional predefined identifier
#define AI_AC_CHECKED_LOAD_FLOAT_ARRAY(name,name_length,num,out) \
AI_AC_SKIP_TO_NEXT_TOKEN(); \
if (name_length) \
@ -134,14 +134,14 @@ AC3DImporter::AC3DImporter()
}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
// Destructor, private as well
AC3DImporter::~AC3DImporter()
{
// nothing to be done here
}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Returns whether the class can handle the format of the given file.
bool AC3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
{
std::string extension = GetExtension(pFile);
@ -168,7 +168,7 @@ const aiImporterDesc* AC3DImporter::GetInfo () const
// Get a pointer to the next line from the file
bool AC3DImporter::GetNextLine( )
{
SkipLine(&buffer);
SkipLine(&buffer);
return SkipSpaces(&buffer);
}
@ -309,7 +309,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
else if (TokenMatch(buffer,"numsurf",7))
{
SkipSpaces(&buffer);
bool Q3DWorkAround = false;
const unsigned int t = strtoul10(buffer,&buffer);
@ -319,7 +319,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
GetNextLine();
if (!TokenMatch(buffer,"SURF",4))
{
// FIX: this can occur for some files - Quick 3D for
// FIX: this can occur for some files - Quick 3D for
// example writes no surf chunks
if (!Q3DWorkAround)
{
@ -335,7 +335,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
obj.surfaces.push_back(Surface());
Surface& surf = obj.surfaces.back();
surf.flags = strtoul_cppstyle(buffer);
while (1)
{
if(!GetNextLine())
@ -381,7 +381,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
AI_AC_CHECKED_LOAD_FLOAT_ARRAY("",0,2,&entry.second);
}
}
else
else
{
--buffer; // make sure the line is processed a second time
@ -455,8 +455,8 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
{
if (!object.surfaces.size() || !object.numRefs)
{
/* " An object with 7 vertices (no surfaces, no materials defined).
This is a good way of getting point data into AC3D.
/* " An object with 7 vertices (no surfaces, no materials defined).
This is a good way of getting point data into AC3D.
The Vertex->create convex-surface/object can be used on these
vertices to 'wrap' a 3d shape around them "
(http://www.opencity.info/html/ac3dfileformat.html)
@ -598,7 +598,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
const Surface& src = *it;
// closed polygon
unsigned int type = (*it).flags & 0xf;
unsigned int type = (*it).flags & 0xf;
if (!type)
{
aiFace& face = *faces++;
@ -617,7 +617,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
*vertices = object.vertices[entry.first] + object.translation;
// copy texture coordinates
// copy texture coordinates
if (uv)
{
uv->x = entry.second.x;
@ -629,7 +629,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
}
else
{
it2 = (*it).entries.begin();
// either a closed or an unclosed line
@ -650,8 +650,8 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
}
ai_assert((*it2).first < object.vertices.size());
*vertices++ = object.vertices[(*it2).first];
// copy texture coordinates
// copy texture coordinates
if (uv)
{
uv->x = (*it2).second.x;
@ -722,7 +722,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
break;
// there shouldn't be more than one world, but we don't care
case Object::World:
case Object::World:
node->mName.length = ::sprintf(node->mName.data,"ACWorld_%i",worlds++);
break;
}
@ -762,8 +762,8 @@ void AC3DImporter::SetupProperties(const Importer* pImp)
}
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void AC3DImporter::InternReadFile( const std::string& pFile,
// Imports the given file into the given scene structure.
void AC3DImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -129,7 +129,7 @@ public:
, vertices()
, surfaces()
, numRefs (0)
, subDiv (0)
, subDiv (0)
{}
// Type description
@ -168,7 +168,7 @@ public:
// number of indices (= num verts in verbose format)
unsigned int numRefs;
// number of subdivisions to be performed on the
// number of subdivisions to be performed on the
// imported data
unsigned int subDiv;
@ -180,7 +180,7 @@ public:
public:
// -------------------------------------------------------------------
/** Returns whether the class can handle the format of the given file.
/** Returns whether the class can handle the format of the given file.
* See BaseImporter::CanRead() for details.
*/
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
@ -194,9 +194,9 @@ protected:
const aiImporterDesc* GetInfo () const;
// -------------------------------------------------------------------
/** Imports the given file into the given scene structure.
/** Imports the given file into the given scene structure.
* See BaseImporter::InternReadFile() for details*/
void InternReadFile( const std::string& pFile, aiScene* pScene,
void InternReadFile( const std::string& pFile, aiScene* pScene,
IOSystem* pIOHandler);
// -------------------------------------------------------------------
@ -214,7 +214,7 @@ private:
// -------------------------------------------------------------------
/** Load the object section. This method is called recursively to
* load subobjects, the method returns after a 'kids 0' was
* load subobjects, the method returns after a 'kids 0' was
* encountered.
* @objects List of output objects*/
void LoadObjectSection(std::vector<Object>& objects);
@ -248,7 +248,7 @@ private:
const char* buffer;
// Configuration option: if enabled, up to two meshes
// are generated per material: those faces who have
// are generated per material: those faces who have
// their bf cull flags set are separated.
bool configSplitBFCull;

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -73,7 +73,7 @@ static const aiImporterDesc desc = {
0,
0,
0,
"ase ask"
"ase ask"
};
// ------------------------------------------------------------------------------------------------
@ -83,17 +83,17 @@ ASEImporter::ASEImporter()
{}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
// Destructor, private as well
ASEImporter::~ASEImporter()
{}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Returns whether the class can handle the format of the given file.
bool ASEImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const
{
// check file extension
// check file extension
const std::string extension = GetExtension(pFile);
if( extension == "ase" || extension == "ask")
return true;
@ -122,8 +122,8 @@ void ASEImporter::SetupProperties(const Importer* pImp)
}
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void ASEImporter::InternReadFile( const std::string& pFile,
// Imports the given file into the given scene structure.
void ASEImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
@ -164,7 +164,7 @@ void ASEImporter::InternReadFile( const std::string& pFile,
//------------------------------------------------------------------
// Check whether we god at least one mesh. If we did - generate
// materials and copy meshes.
// materials and copy meshes.
// ------------------------------------------------------------------
if ( !mParser->m_vMeshes.empty()) {
@ -221,10 +221,10 @@ void ASEImporter::InternReadFile( const std::string& pFile,
+ mParser->m_vCameras.size() + mParser->m_vDummies.size());
// Lights
for (std::vector<ASE::Light>::iterator it = mParser->m_vLights.begin(),
for (std::vector<ASE::Light>::iterator it = mParser->m_vLights.begin(),
end = mParser->m_vLights.end();it != end; ++it)nodes.push_back(&(*it));
// Cameras
for (std::vector<ASE::Camera>::iterator it = mParser->m_vCameras.begin(),
for (std::vector<ASE::Camera>::iterator it = mParser->m_vCameras.begin(),
end = mParser->m_vCameras.end();it != end; ++it)nodes.push_back(&(*it));
// Meshes
for (std::vector<ASE::Mesh>::iterator it = mParser->m_vMeshes.begin(),
@ -325,7 +325,7 @@ void ASEImporter::BuildAnimations(const std::vector<BaseNode*>& nodes)
pcAnim->mTicksPerSecond = mParser->iFrameSpeed * mParser->iTicksPerFrame;
iNum = 0;
// Now iterate through all meshes and collect all data we can find
for (i = nodes.begin();i != nodes.end();++i) {
@ -349,7 +349,7 @@ void ASEImporter::BuildAnimations(const std::vector<BaseNode*>& nodes)
}
else helper.SetMainAnimationChannel (&me->mAnim.akeyPositions);
helper.SetTargetAnimationChannel (&me->mTargetAnim.akeyPositions);
helper.Process(&me->mTargetAnim.akeyPositions);*/
// Allocate the key array and fill it
@ -383,7 +383,7 @@ void ASEImporter::BuildAnimations(const std::vector<BaseNode*>& nodes)
// --------------------------------------------------------------------
// Rotation keys are offsets to the previous keys.
// We have the quaternion representations of all
// We have the quaternion representations of all
// of them, so we just need to concatenate all
// (unit-length) quaternions to get the absolute
// rotations.
@ -398,7 +398,7 @@ void ASEImporter::BuildAnimations(const std::vector<BaseNode*>& nodes)
cur = (a ? cur*q.mValue : q.mValue);
q.mValue = cur.Normalize();
}
nd->mRotationKeys[a] = q;
nd->mRotationKeys[a] = q;
// need this to get to Assimp quaternion conventions
nd->mRotationKeys[a].mValue.w *= -1.f;
@ -432,7 +432,7 @@ void ASEImporter::BuildCameras()
// copy members
out->mClipPlaneFar = in.mFar;
out->mClipPlaneNear = (in.mNear ? in.mNear : 0.1f);
out->mClipPlaneNear = (in.mNear ? in.mNear : 0.1f);
out->mHorizontalFOV = in.mFOV;
out->mName.Set(in.mName);
@ -452,9 +452,9 @@ void ASEImporter::BuildLights()
aiLight* out = pcScene->mLights[i] = new aiLight();
ASE::Light& in = mParser->m_vLights[i];
// The direction is encoded in the transformation matrix of the node.
// In 3DS MAX the light source points into negative Z direction if
// the node transformation is the identity.
// The direction is encoded in the transformation matrix of the node.
// In 3DS MAX the light source points into negative Z direction if
// the node transformation is the identity.
out->mDirection = aiVector3D(0.f,0.f,-1.f);
out->mName.Set(in.mName);
@ -511,7 +511,7 @@ void ASEImporter::AddMeshes(const ASE::BaseNode* snode,aiNode* node)
if (mesh == snode) {
node->mMeshes[p++] = i;
// Transform all vertices of the mesh back into their local space ->
// Transform all vertices of the mesh back into their local space ->
// at the moment they are pretransformed
aiMatrix4x4 m = mesh->mTransform;
m.Inverse();
@ -612,10 +612,10 @@ void ASEImporter::AddNodes (const std::vector<BaseNode*>& nodes,
nd->mParent = node;
// The .Target node is always the first child node
// The .Target node is always the first child node
for (unsigned int m = 0; m < node->mNumChildren;++m)
node->mChildren[m+1] = node->mChildren[m];
node->mChildren[m+1] = node->mChildren[m];
node->mChildren[0] = nd;
node->mNumChildren++;
@ -671,7 +671,7 @@ void ASEImporter::BuildNodes(std::vector<BaseNode*>& nodes) {
// check whether our parent is known
bool bKnowParent = false;
// search the list another time, starting *here* and try to find out whether
// there is a node that references *us* as a parent
for (std::vector<BaseNode*>::const_iterator it2 = nodes.begin();it2 != end; ++it2) {
@ -701,7 +701,7 @@ void ASEImporter::BuildNodes(std::vector<BaseNode*>& nodes) {
for (std::vector<const BaseNode*>::/*const_*/iterator i = aiList.begin();i != aiList.end();++i) {
const ASE::BaseNode* src = *i;
// The parent is not known, so we can assume that we must add
// The parent is not known, so we can assume that we must add
// this node to the root node of the whole scene
aiNode* pcNode = new aiNode();
pcNode->mParent = pcScene->mRootNode;
@ -727,7 +727,7 @@ void ASEImporter::BuildNodes(std::vector<BaseNode*>& nodes) {
if (!pcScene->mRootNode->mNumChildren) {
throw DeadlyImportError("ASE: No nodes loaded. The file is either empty or corrupt");
}
// Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system
pcScene->mRootNode->mTransformation = aiMatrix4x4(1.f,0.f,0.f,0.f,
0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f);
@ -994,7 +994,7 @@ void ASEImporter::ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOutMesh
if (!mesh.mBones.empty()) {
avOutputBones = new std::vector<std::pair<unsigned int, float> >[mesh.mBones.size()];
}
// allocate enough storage for faces
p_pcOut->mFaces = new aiFace[p_pcOut->mNumFaces];
@ -1102,7 +1102,7 @@ void ASEImporter::ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOutMesh
{
// Otherwise we can simply copy the data to one output mesh
// This codepath needs less memory and uses fast memcpy()s
// to do the actual copying. So I think it is worth the
// to do the actual copying. So I think it is worth the
// effort here.
aiMesh* p_pcOut = new aiMesh();
@ -1167,7 +1167,7 @@ void ASEImporter::ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOutMesh
p_pcOut->mFaces[iFace].mNumIndices = 3;
p_pcOut->mFaces[iFace].mIndices = new unsigned int[3];
// copy indices
// copy indices
p_pcOut->mFaces[iFace].mIndices[0] = mesh.mFaces[iFace].mIndices[0];
p_pcOut->mFaces[iFace].mIndices[1] = mesh.mFaces[iFace].mIndices[1];
p_pcOut->mFaces[iFace].mIndices[2] = mesh.mFaces[iFace].mIndices[2];

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -66,8 +66,8 @@ public:
public:
// -------------------------------------------------------------------
/** Returns whether the class can handle the format of the given file.
* See BaseImporter::CanRead() for details.
/** Returns whether the class can handle the format of the given file.
* See BaseImporter::CanRead() for details.
*/
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
bool checkSig) const;
@ -82,7 +82,7 @@ protected:
// -------------------------------------------------------------------
/** Imports the given file into the given scene structure.
/** Imports the given file into the given scene structure.
* See BaseImporter::InternReadFile() for details
*/
void InternReadFile( const std::string& pFile, aiScene* pScene,

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,22 +25,22 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 ASEParser.cpp
* @brief Implementation of the ASE parser class
* @brief Implementation of the ASE parser class
*/
@ -86,7 +86,7 @@ using namespace Assimp::ASE;
++iLineNumber; \
bLastWasEndLine = true; \
} else bLastWasEndLine = false; \
++filePtr;
++filePtr;
// ------------------------------------------------------------------------------------------------
// Handle a nested section in the file. EOF is an error in this case
@ -114,7 +114,7 @@ using namespace Assimp::ASE;
++iLineNumber; \
bLastWasEndLine = true; \
} else bLastWasEndLine = false; \
++filePtr;
++filePtr;
// ------------------------------------------------------------------------------------------------
Parser::Parser (const char* szFile, unsigned int fileFormatDefault)
@ -229,7 +229,7 @@ bool Parser::SkipSection()
}
else if ('\0' == *filePtr)
{
LogWarning("Unable to parse block: Unexpected EOF, closing bracket \'}\' was expected [#1]");
LogWarning("Unable to parse block: Unexpected EOF, closing bracket \'}\' was expected [#1]");
return false;
}
else if(IsLineEnd(*filePtr))++iLineNumber;
@ -276,50 +276,50 @@ void Parser::Parse()
}
// "group" - no implementation yet, in facte
// we're just ignoring them for the moment
if (TokenMatch(filePtr,"GROUP",5))
if (TokenMatch(filePtr,"GROUP",5))
{
Parse();
continue;
}
// material list
if (TokenMatch(filePtr,"MATERIAL_LIST",13))
if (TokenMatch(filePtr,"MATERIAL_LIST",13))
{
ParseLV1MaterialListBlock();
continue;
}
// geometric object (mesh)
if (TokenMatch(filePtr,"GEOMOBJECT",10))
if (TokenMatch(filePtr,"GEOMOBJECT",10))
{
m_vMeshes.push_back(Mesh());
ParseLV1ObjectBlock(m_vMeshes.back());
continue;
}
// helper object = dummy in the hierarchy
if (TokenMatch(filePtr,"HELPEROBJECT",12))
if (TokenMatch(filePtr,"HELPEROBJECT",12))
{
m_vDummies.push_back(Dummy());
ParseLV1ObjectBlock(m_vDummies.back());
continue;
}
// light object
if (TokenMatch(filePtr,"LIGHTOBJECT",11))
if (TokenMatch(filePtr,"LIGHTOBJECT",11))
{
m_vLights.push_back(Light());
ParseLV1ObjectBlock(m_vLights.back());
continue;
}
// camera object
if (TokenMatch(filePtr,"CAMERAOBJECT",12))
if (TokenMatch(filePtr,"CAMERAOBJECT",12))
{
m_vCameras.push_back(Camera());
ParseLV1ObjectBlock(m_vCameras.back());
continue;
}
// comment - print it on the console
if (TokenMatch(filePtr,"COMMENT",7))
if (TokenMatch(filePtr,"COMMENT",7))
{
std::string out = "<unknown>";
ParseString(out,"*COMMENT");
@ -327,7 +327,7 @@ void Parser::Parse()
continue;
}
// ASC bone weights
if (AI_ASE_IS_OLD_FILE_FORMAT() && TokenMatch(filePtr,"MESH_SOFTSKINVERTS",18))
if (AI_ASE_IS_OLD_FILE_FORMAT() && TokenMatch(filePtr,"MESH_SOFTSKINVERTS",18))
{
ParseLV1SoftSkinBlock();
}
@ -347,7 +347,7 @@ void Parser::ParseLV1SoftSkinBlock()
// nested sections supported and the single elements aren't
// marked by keywords starting with an asterisk.
/**
/**
FORMAT BEGIN
*MESH_SOFTSKINVERTS {
@ -358,7 +358,7 @@ void Parser::ParseLV1SoftSkinBlock()
<number of weights> [for <number of weights> times:] <bone name> <weight>
}
FORMAT END
FORMAT END
*/
// **************************************************************
while (true)
@ -433,7 +433,7 @@ void Parser::ParseLV1SoftSkinBlock()
// Find the bone in the mesh's list
std::pair<int,float> me;
me.first = -1;
for (unsigned int n = 0; n < curMesh->mBones.size();++n)
{
if (curMesh->mBones[n].mName == bone)
@ -471,21 +471,21 @@ void Parser::ParseLV1SceneBlock()
if ('*' == *filePtr)
{
++filePtr;
if (TokenMatch(filePtr,"SCENE_BACKGROUND_STATIC",23))
if (TokenMatch(filePtr,"SCENE_BACKGROUND_STATIC",23))
{
// parse a color triple and assume it is really the bg color
ParseLV4MeshFloatTriple( &m_clrBackground.r );
continue;
}
if (TokenMatch(filePtr,"SCENE_AMBIENT_STATIC",20))
if (TokenMatch(filePtr,"SCENE_AMBIENT_STATIC",20))
{
// parse a color triple and assume it is really the bg color
ParseLV4MeshFloatTriple( &m_clrAmbient.r );
continue;
}
if (TokenMatch(filePtr,"SCENE_FIRSTFRAME",16))
if (TokenMatch(filePtr,"SCENE_FIRSTFRAME",16))
{
ParseLV4MeshLong(iFirstFrame);
continue;
@ -495,7 +495,7 @@ void Parser::ParseLV1SceneBlock()
ParseLV4MeshLong(iLastFrame);
continue;
}
if (TokenMatch(filePtr,"SCENE_FRAMESPEED",16))
if (TokenMatch(filePtr,"SCENE_FRAMESPEED",16))
{
ParseLV4MeshLong(iFrameSpeed);
continue;
@ -709,7 +709,7 @@ void Parser::ParseLV2MaterialBlock(ASE::Material& mat)
// submaterial chunks
if (TokenMatch(filePtr,"SUBMATERIAL",11))
{
unsigned int iIndex = 0;
ParseLV4MeshLong(iIndex);
@ -741,7 +741,7 @@ void Parser::ParseLV3MapBlock(Texture& map)
// but we need to expect that case ... if the path is
// empty the texture won't be used later.
// ***********************************************************
bool parsePath = true;
bool parsePath = true;
while (true)
{
if ('*' == *filePtr)
@ -756,7 +756,7 @@ void Parser::ParseLV3MapBlock(Texture& map)
if (temp != "Bitmap" && temp != "Normal Bump")
{
DefaultLogger::get()->warn("ASE: Skipping unknown map type: " + temp);
parsePath = false;
parsePath = false;
}
continue;
}
@ -844,7 +844,7 @@ bool Parser::ParseString(std::string& out,const char* szName)
{
if ('\"' == *sz)break;
else if ('\0' == *sz)
{
{
sprintf(szBuffer,"Unable to parse %s block: Strings are expected to "
"be enclosed in double quotation marks but EOF was reached before "
"a closing quotation mark was encountered",szName);
@ -959,7 +959,7 @@ void Parser::ParseLV1ObjectBlock(ASE::BaseNode& node)
{
// mesh data
// FIX: Older files use MESH_SOFTSKIN
if (TokenMatch(filePtr,"MESH" ,4) ||
if (TokenMatch(filePtr,"MESH" ,4) ||
TokenMatch(filePtr,"MESH_SOFTSKIN",13))
{
ParseLV2MeshBlock((ASE::Mesh&)node);
@ -1060,14 +1060,14 @@ void Parser::ParseLV2AnimationBlock(ASE::BaseNode& mesh)
if(!ParseString(temp,"*NODE_NAME"))
SkipToNextToken();
// If the name of the node contains .target it
// If the name of the node contains .target it
// represents an animated camera or spot light
// target.
if (std::string::npos != temp.find(".Target"))
{
if ((mesh.mType != BaseNode::Camera || ((ASE::Camera&)mesh).mCameraType != ASE::Camera::TARGET) &&
( mesh.mType != BaseNode::Light || ((ASE::Light&)mesh).mLightType != ASE::Light::TARGET))
{
{
DefaultLogger::get()->error("ASE: Found target animation channel "
"but the node is neither a camera nor a spot light");
@ -1176,7 +1176,7 @@ void Parser::ParseLV3PosAnimationBlock(ASE::Animation& anim)
if ('*' == *filePtr)
{
++filePtr;
bool b = false;
// For the moment we're just reading the three floats -
@ -1265,7 +1265,7 @@ void Parser::ParseLV3RotAnimationBlock(ASE::Animation& anim)
void Parser::ParseLV2NodeTransformBlock(ASE::BaseNode& mesh)
{
AI_ASE_PARSER_INIT();
int mode = 0;
int mode = 0;
while (true)
{
if ('*' == *filePtr)
@ -1304,7 +1304,7 @@ void Parser::ParseLV2NodeTransformBlock(ASE::BaseNode& mesh)
}
if (mode)
{
// fourth row of the transformation matrix - and also the
// fourth row of the transformation matrix - and also the
// only information here that is interesting for targets
if (TokenMatch(filePtr,"TM_ROW3" ,7))
{
@ -1491,7 +1491,7 @@ void Parser::ParseLV2MeshBlock(ASE::Mesh& mesh)
// mesh animation keyframe. Not supported
if (TokenMatch(filePtr,"MESH_ANIMATION" ,14))
{
LogWarning("Found *MESH_ANIMATION element in ASE/ASK file. "
"Keyframe animation is not supported by Assimp, this element "
"will be ignored");
@ -1571,7 +1571,7 @@ void Parser::ParseLV4MeshBones(unsigned int iNumBones,ASE::Mesh& mesh)
LogWarning("Bone index is out of bounds");
continue;
}
if (!ParseString(mesh.mBones[iIndex].mName,"*MESH_BONE_NAME"))
if (!ParseString(mesh.mBones[iIndex].mName,"*MESH_BONE_NAME"))
SkipToNextToken();
continue;
}
@ -1648,7 +1648,7 @@ void Parser::ParseLV3MeshVertexListBlock(
// Vertex entry
if (TokenMatch(filePtr,"MESH_VERTEX" ,11))
{
aiVector3D vTemp;
unsigned int iIndex;
ParseLV4MeshFloatTriple(&vTemp.x,iIndex);
@ -1904,7 +1904,7 @@ void Parser::ParseLV3MeshNormalListBlock(ASE::Mesh& sMesh)
ParseLV4MeshFloatTriple(&vNormal.x,index);
if (faceIdx >= sMesh.mFaces.size())
continue;
// Make sure we assign it to the correct face
const ASE::Face& face = sMesh.mFaces[faceIdx];
if (index == face.mIndices[0])
@ -1943,7 +1943,7 @@ void Parser::ParseLV3MeshNormalListBlock(ASE::Mesh& sMesh)
}
// ------------------------------------------------------------------------------------------------
void Parser::ParseLV4MeshFace(ASE::Face& out)
{
{
// skip spaces and tabs
if(!SkipSpaces(&filePtr))
{
@ -1963,7 +1963,7 @@ void Parser::ParseLV4MeshFace(ASE::Face& out)
SkipToNextToken();
return;
}
// FIX: There are some ASE files which haven't got ':' here
// FIX: There are some ASE files which haven't got ':' here
if(':' == *filePtr)++filePtr;
// Parse all mesh indices
@ -1989,7 +1989,7 @@ void Parser::ParseLV4MeshFace(ASE::Face& out)
case 'c':
iIndex = 2;
break;
default:
default:
LogWarning("Unable to parse *MESH_FACE Element: Unexpected EOL. "
"A,B or C expected [#3]");
SkipToNextToken();
@ -2017,7 +2017,7 @@ void Parser::ParseLV4MeshFace(ASE::Face& out)
out.mIndices[iIndex] = strtoul10(filePtr,&filePtr);
}
// now we need to skip the AB, BC, CA blocks.
// now we need to skip the AB, BC, CA blocks.
while (true)
{
if ('*' == *filePtr)break;
@ -2039,7 +2039,7 @@ void Parser::ParseLV4MeshFace(ASE::Face& out)
SkipToNextToken();
return;
}
// Parse smoothing groups until we don't anymore see commas
// FIX: There needn't always be a value, sad but true
while (true)
@ -2108,7 +2108,7 @@ void Parser::ParseLV4MeshFloatTriple(float* apOut, unsigned int& rIndexOut)
// parse the index
ParseLV4MeshLong(rIndexOut);
// parse the three others
ParseLV4MeshFloatTriple(apOut);
}
@ -2126,7 +2126,7 @@ void Parser::ParseLV4MeshFloat(float& fOut)
// skip spaces and tabs
if(!SkipSpaces(&filePtr))
{
// LOG
// LOG
LogWarning("Unable to parse float: unexpected EOL [#1]");
fOut = 0.0f;
++iLineNumber;
@ -2141,7 +2141,7 @@ void Parser::ParseLV4MeshLong(unsigned int& iOut)
// Skip spaces and tabs
if(!SkipSpaces(&filePtr))
{
// LOG
// LOG
LogWarning("Unable to parse long: unexpected EOL [#1]");
iOut = 0;
++iLineNumber;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -130,7 +130,7 @@ struct Bone
Bone()
{
static int iCnt = 0;
// Generate a default name for the bone
char szTemp[128];
::sprintf(szTemp,"UNNAMED_%i",iCnt++);
@ -263,7 +263,7 @@ struct BaseNode
struct Mesh : public MeshWithSmoothingGroups<ASE::Face>, public BaseNode
{
//! Constructor.
Mesh()
Mesh()
: BaseNode (BaseNode::Mesh)
, bSkip (false)
{
@ -309,15 +309,15 @@ struct Light : public BaseNode
DIRECTIONAL
};
//! Constructor.
Light()
//! Constructor.
Light()
: BaseNode (BaseNode::Light)
, mLightType (OMNI)
, mColor (1.f,1.f,1.f)
, mIntensity (1.f) // light is white by default
, mAngle (45.f)
, mFalloff (0.f)
{
{
}
LightType mLightType;
@ -338,10 +338,10 @@ struct Camera : public BaseNode
};
//! Constructor
Camera()
Camera()
: BaseNode (BaseNode::Camera)
, mFOV (0.75f) // in radians
, mNear (0.1f)
, mNear (0.1f)
, mFar (1000.f) // could be zero
, mCameraType (FREE)
{
@ -356,7 +356,7 @@ struct Camera : public BaseNode
struct Dummy : public BaseNode
{
//! Constructor
Dummy()
Dummy()
: BaseNode (BaseNode::Dummy)
{
}
@ -492,7 +492,7 @@ private:
unsigned int iNumFaces,Mesh& mesh, unsigned int iChannel = 0);
// -------------------------------------------------------------------
//! Parse an additional mapping channel
//! Parse an additional mapping channel
//! (specified via *MESH_MAPPINGCHANNEL)
//! \param iChannel Channel index to be filled
//! \param mesh Mesh object to be filled
@ -571,12 +571,12 @@ private:
void ParseLV4MeshLongTriple(unsigned int* apOut);
// -------------------------------------------------------------------
//! Parse a single float element
//! Parse a single float element
//! \param fOut Output float
void ParseLV4MeshFloat(float& fOut);
// -------------------------------------------------------------------
//! Parse a single int element
//! Parse a single int element
//! \param iOut Output integer
void ParseLV4MeshLong(unsigned int& iOut);

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -65,7 +65,7 @@ using namespace Assimp;
namespace Assimp {
template <typename T>
template <typename T>
size_t Write(IOStream * stream, const T& v)
{
return stream->Write( &v, sizeof(T), 1 );
@ -245,7 +245,7 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
private:
// -------------------------------------------------------------------
void Grow(size_t need = 0)
void Grow(size_t need = 0)
{
size_t new_size = std::max(initial, std::max( need, cur_size+(cur_size>>1) ));
@ -262,12 +262,12 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
public:
AssbinChunkWriter( IOStream * container, uint32_t magic, size_t initial = 4096)
AssbinChunkWriter( IOStream * container, uint32_t magic, size_t initial = 4096)
: buffer(NULL), magic(magic), container(container), cur_size(0), cursor(0), initial(initial)
{
}
virtual ~AssbinChunkWriter()
virtual ~AssbinChunkWriter()
{
if (container) {
container->Write( &magic, sizeof(uint32_t), 1 );
@ -291,7 +291,7 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
}
// -------------------------------------------------------------------
virtual size_t Write(const void* pvBuffer, size_t pSize, size_t pCount)
virtual size_t Write(const void* pvBuffer, size_t pSize, size_t pCount)
{
pSize *= pCount;
if (cursor + pSize > cur_size) {
@ -301,7 +301,7 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
memcpy(buffer+cursor, pvBuffer, pSize);
cursor += pSize;
return pCount;
return pCount;
}
};
@ -580,7 +580,7 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
for (unsigned int a = 0; a < anim->mNumChannels;++a) {
const aiNodeAnim* nd = anim->mChannels[a];
WriteBinaryNodeAnim(&chunk,nd);
WriteBinaryNodeAnim(&chunk,nd);
}
}
@ -592,7 +592,7 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
Write<aiString>(&chunk,l->mName);
Write<unsigned int>(&chunk,l->mType);
if (l->mType != aiLightSource_DIRECTIONAL) {
if (l->mType != aiLightSource_DIRECTIONAL) {
Write<float>(&chunk,l->mAttenuationConstant);
Write<float>(&chunk,l->mAttenuationLinear);
Write<float>(&chunk,l->mAttenuationQuadratic);
@ -681,7 +681,7 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
}
public:
AssbinExport()
AssbinExport()
: shortened(false), compressed(false) // temporary settings until properties are introduced for exporters
{
}
@ -715,7 +715,7 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
Write<uint16_t>( out, compressed );
// == 20 bytes
char buff[256];
char buff[256];
strncpy(buff,pFile,256);
out->Write(buff,sizeof(char),256);

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -74,7 +74,7 @@ static const aiImporterDesc desc = {
0,
0,
0,
"assbin"
"assbin"
};
const aiImporterDesc* AssbinImporter::GetInfo() const
@ -187,7 +187,7 @@ aiQuatKey Read<aiQuatKey>(IOStream * stream)
template <typename T>
void ReadArray(IOStream * stream, T * out, unsigned int size)
{
{
for (unsigned int i=0; i<size; i++) out[i] = Read<T>(stream);
}
@ -241,11 +241,11 @@ void AssbinImporter::ReadBinaryBone( IOStream * stream, aiBone* b )
// for the moment we write dumb min/max values for the bones, too.
// maybe I'll add a better, hash-like solution later
if (shortened)
if (shortened)
{
ReadBounds(stream,b->mWeights,b->mNumWeights);
} // else write as usual
else
else
{
b->mWeights = new aiVertexWeight[b->mNumWeights];
ReadArray<aiVertexWeight>(stream,b->mWeights,b->mNumWeights);
@ -268,35 +268,35 @@ void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh )
// first of all, write bits for all existent vertex components
unsigned int c = Read<unsigned int>(stream);
if (c & ASSBIN_MESH_HAS_POSITIONS)
if (c & ASSBIN_MESH_HAS_POSITIONS)
{
if (shortened) {
ReadBounds(stream,mesh->mVertices,mesh->mNumVertices);
} // else write as usual
else
else
{
mesh->mVertices = new aiVector3D[mesh->mNumVertices];
ReadArray<aiVector3D>(stream,mesh->mVertices,mesh->mNumVertices);
}
}
if (c & ASSBIN_MESH_HAS_NORMALS)
if (c & ASSBIN_MESH_HAS_NORMALS)
{
if (shortened) {
ReadBounds(stream,mesh->mNormals,mesh->mNumVertices);
} // else write as usual
else
else
{
mesh->mNormals = new aiVector3D[mesh->mNumVertices];
ReadArray<aiVector3D>(stream,mesh->mNormals,mesh->mNumVertices);
}
}
if (c & ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS)
if (c & ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS)
{
if (shortened) {
ReadBounds(stream,mesh->mTangents,mesh->mNumVertices);
ReadBounds(stream,mesh->mBitangents,mesh->mNumVertices);
} // else write as usual
else
else
{
mesh->mTangents = new aiVector3D[mesh->mNumVertices];
ReadArray<aiVector3D>(stream,mesh->mTangents,mesh->mNumVertices);
@ -304,22 +304,22 @@ void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh )
ReadArray<aiVector3D>(stream,mesh->mBitangents,mesh->mNumVertices);
}
}
for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n)
for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS;++n)
{
if (!(c & ASSBIN_MESH_HAS_COLOR(n)))
break;
if (shortened)
if (shortened)
{
ReadBounds(stream,mesh->mColors[n],mesh->mNumVertices);
} // else write as usual
else
else
{
mesh->mColors[n] = new aiColor4D[mesh->mNumVertices];
ReadArray<aiColor4D>(stream,mesh->mColors[n],mesh->mNumVertices);
}
}
for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n)
for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n)
{
if (!(c & ASSBIN_MESH_HAS_TEXCOORD(n)))
break;
@ -330,7 +330,7 @@ void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh )
if (shortened) {
ReadBounds(stream,mesh->mTextureCoords[n],mesh->mNumVertices);
} // else write as usual
else
else
{
mesh->mTextureCoords[n] = new aiVector3D[mesh->mNumVertices];
ReadArray<aiVector3D>(stream,mesh->mTextureCoords[n],mesh->mNumVertices);
@ -356,11 +356,11 @@ void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh )
f.mIndices = new unsigned int[f.mNumIndices];
for (unsigned int a = 0; a < f.mNumIndices;++a) {
if (mesh->mNumVertices < (1u<<16))
if (mesh->mNumVertices < (1u<<16))
{
f.mIndices[a] = Read<uint16_t>(stream);
}
else
else
{
f.mIndices[a] = Read<unsigned int>(stream);
}
@ -404,7 +404,7 @@ void AssbinImporter::ReadBinaryMaterial(IOStream * stream, aiMaterial* mat)
mat->mNumAllocated = mat->mNumProperties = Read<unsigned int>(stream);
if (mat->mNumProperties)
{
if (mat->mProperties)
if (mat->mProperties)
{
delete[] mat->mProperties;
}
@ -445,7 +445,7 @@ void AssbinImporter::ReadBinaryNodeAnim(IOStream * stream, aiNodeAnim* nd)
ReadBounds(stream,nd->mRotationKeys,nd->mNumRotationKeys);
} // else write as usual
else
else
{
nd->mRotationKeys = new aiQuatKey[nd->mNumRotationKeys];
ReadArray<aiQuatKey>(stream,nd->mRotationKeys,nd->mNumRotationKeys);
@ -456,7 +456,7 @@ void AssbinImporter::ReadBinaryNodeAnim(IOStream * stream, aiNodeAnim* nd)
ReadBounds(stream,nd->mScalingKeys,nd->mNumScalingKeys);
} // else write as usual
else
else
{
nd->mScalingKeys = new aiVectorKey[nd->mNumScalingKeys];
ReadArray<aiVectorKey>(stream,nd->mScalingKeys,nd->mNumScalingKeys);
@ -520,7 +520,7 @@ void AssbinImporter::ReadBinaryLight( IOStream * stream, aiLight* l )
l->mName = Read<aiString>(stream);
l->mType = (aiLightSourceType)Read<unsigned int>(stream);
if (l->mType != aiLightSource_DIRECTIONAL) {
if (l->mType != aiLightSource_DIRECTIONAL) {
l->mAttenuationConstant = Read<float>(stream);
l->mAttenuationLinear = Read<float>(stream);
l->mAttenuationQuadratic = Read<float>(stream);
@ -680,7 +680,7 @@ void AssbinImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
{
ReadBinaryScene(stream,pScene);
}
pIOHandler->Close(stream);
}

View File

@ -6,8 +6,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -24,16 +24,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -74,15 +74,15 @@ private:
protected:
public:
virtual bool CanRead(
const std::string& pFile,
IOSystem* pIOHandler,
virtual bool CanRead(
const std::string& pFile,
IOSystem* pIOHandler,
bool checkSig
) const;
virtual const aiImporterDesc* GetInfo() const;
virtual void InternReadFile(
const std::string& pFile,
aiScene* pScene,
virtual void InternReadFile(
const std::string& pFile,
aiScene* pScene,
IOSystem* pIOHandler
);
void ReadBinaryScene( IOStream * stream, aiScene* pScene );

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -110,7 +110,7 @@ static boost::mutex gLogStreamMutex;
class LogToCallbackRedirector : public LogStream
{
public:
LogToCallbackRedirector(const aiLogStream& s)
LogToCallbackRedirector(const aiLogStream& s)
: stream (s) {
ai_assert(NULL != s.callback);
}
@ -121,10 +121,10 @@ public:
#endif
// (HACK) Check whether the 'stream.user' pointer points to a
// custom LogStream allocated by #aiGetPredefinedLogStream.
// In this case, we need to delete it, too. Of course, this
// In this case, we need to delete it, too. Of course, this
// might cause strange problems, but the chance is quite low.
PredefLogStreamMap::iterator it = std::find(gPredefinedStreams.begin(),
PredefLogStreamMap::iterator it = std::find(gPredefinedStreams.begin(),
gPredefinedStreams.end(), (Assimp::LogStream*)stream.user);
if (it != gPredefinedStreams.end()) {
@ -152,7 +152,7 @@ void ReportSceneNotFoundError()
}
// ------------------------------------------------------------------------------------------------
// Reads the given file and returns its content.
// Reads the given file and returns its content.
const aiScene* aiImportFile( const char* pFile, unsigned int pFlags)
{
return aiImportFileEx(pFile,pFlags,NULL);
@ -165,7 +165,7 @@ const aiScene* aiImportFileEx( const char* pFile, unsigned int pFlags, aiFileIO
}
// ------------------------------------------------------------------------------------------------
const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFlags,
const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFlags,
aiFileIO* pFS,
const aiPropertyStore* props)
{
@ -198,7 +198,7 @@ const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFl
if( scene) {
ScenePrivateData* priv = const_cast<ScenePrivateData*>( ScenePriv(scene) );
priv->mOrigImporter = imp;
}
}
else {
// if failed, extract error code and destroy the import
gLastErrorString = imp->GetErrorString();
@ -211,7 +211,7 @@ const aiScene* aiImportFileExWithProperties( const char* pFile, unsigned int pFl
}
// ------------------------------------------------------------------------------------------------
const aiScene* aiImportFileFromMemory(
const aiScene* aiImportFileFromMemory(
const char* pBuffer,
unsigned int pLength,
unsigned int pFlags,
@ -221,7 +221,7 @@ const aiScene* aiImportFileFromMemory(
}
// ------------------------------------------------------------------------------------------------
const aiScene* aiImportFileFromMemoryWithProperties(
const aiScene* aiImportFileFromMemoryWithProperties(
const char* pBuffer,
unsigned int pLength,
unsigned int pFlags,
@ -253,7 +253,7 @@ const aiScene* aiImportFileFromMemoryWithProperties(
if( scene) {
ScenePrivateData* priv = const_cast<ScenePrivateData*>( ScenePriv(scene) );
priv->mOrigImporter = imp;
}
}
else {
// if failed, extract error code and destroy the import
gLastErrorString = imp->GetErrorString();
@ -265,7 +265,7 @@ const aiScene* aiImportFileFromMemoryWithProperties(
}
// ------------------------------------------------------------------------------------------------
// Releases all resources associated with the given import process.
// Releases all resources associated with the given import process.
void aiReleaseImport( const aiScene* pScene)
{
if (!pScene) {
@ -273,7 +273,7 @@ void aiReleaseImport( const aiScene* pScene)
}
ASSIMP_BEGIN_EXCEPTION_REGION();
// find the importer associated with this data
const ScenePrivateData* priv = ScenePriv(pScene);
if( !priv || !priv->mOrigImporter) {
@ -286,7 +286,7 @@ void aiReleaseImport( const aiScene* pScene)
Importer* importer = priv->mOrigImporter;
delete importer;
}
ASSIMP_END_EXCEPTION_REGION(void);
}
@ -295,7 +295,7 @@ ASSIMP_API const aiScene* aiApplyPostProcessing(const aiScene* pScene,
unsigned int pFlags)
{
const aiScene* sc = NULL;
ASSIMP_BEGIN_EXCEPTION_REGION();
@ -417,7 +417,7 @@ ASSIMP_API void aiEnableVerboseLogging(aiBool d)
}
// ------------------------------------------------------------------------------------------------
// Returns the error text of the last failed import process.
// Returns the error text of the last failed import process.
const char* aiGetErrorString()
{
return gLastErrorString.c_str();
@ -439,14 +439,14 @@ size_t aiGetImportFormatCount(void)
// ------------------------------------------------------------------------------------------------
// Returns the error text of the last failed import process.
// Returns the error text of the last failed import process.
aiBool aiIsExtensionSupported(const char* szExtension)
{
ai_assert(NULL != szExtension);
aiBool candoit=AI_FALSE;
ASSIMP_BEGIN_EXCEPTION_REGION();
// FIXME: no need to create a temporary Importer instance just for that ..
// FIXME: no need to create a temporary Importer instance just for that ..
Assimp::Importer tmp;
candoit = tmp.IsExtensionSupported(std::string(szExtension)) ? AI_TRUE : AI_FALSE;
@ -461,7 +461,7 @@ void aiGetExtensionList(aiString* szOut)
ai_assert(NULL != szOut);
ASSIMP_BEGIN_EXCEPTION_REGION();
// FIXME: no need to create a temporary Importer instance just for that ..
// FIXME: no need to create a temporary Importer instance just for that ..
Assimp::Importer tmp;
tmp.GetExtensionList(*szOut);
@ -582,7 +582,7 @@ ASSIMP_API void aiTransposeMatrix4(aiMatrix4x4* mat)
// ------------------------------------------------------------------------------------------------
// Vector transformation
ASSIMP_API void aiTransformVecByMatrix3(aiVector3D* vec,
ASSIMP_API void aiTransformVecByMatrix3(aiVector3D* vec,
const aiMatrix3x3* mat)
{
ai_assert(NULL != mat && NULL != vec);
@ -590,7 +590,7 @@ ASSIMP_API void aiTransformVecByMatrix3(aiVector3D* vec,
}
// ------------------------------------------------------------------------------------------------
ASSIMP_API void aiTransformVecByMatrix4(aiVector3D* vec,
ASSIMP_API void aiTransformVecByMatrix4(aiVector3D* vec,
const aiMatrix4x4* mat)
{
ai_assert(NULL != mat && NULL != vec);
@ -600,7 +600,7 @@ ASSIMP_API void aiTransformVecByMatrix4(aiVector3D* vec,
// ------------------------------------------------------------------------------------------------
// Matrix multiplication
ASSIMP_API void aiMultiplyMatrix4(
aiMatrix4x4* dst,
aiMatrix4x4* dst,
const aiMatrix4x4* src)
{
ai_assert(NULL != dst && NULL != src);
@ -609,7 +609,7 @@ ASSIMP_API void aiMultiplyMatrix4(
// ------------------------------------------------------------------------------------------------
ASSIMP_API void aiMultiplyMatrix3(
aiMatrix3x3* dst,
aiMatrix3x3* dst,
const aiMatrix3x3* src)
{
ai_assert(NULL != dst && NULL != src);

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -193,7 +193,7 @@ void WriteDump(const aiScene* scene, IOStream* io, bool shortened)
"-->"
" \n\n"
"<Scene flags=\"%i\" postprocessing=\"%i\">\n",
aiGetVersionMajor(),aiGetVersionMinor(),aiGetVersionRevision(),asctime(p),
scene->mFlags,
0 /*globalImporter->GetEffectivePostProcessing()*/);
@ -578,7 +578,7 @@ void WriteDump(const aiScene* scene, IOStream* io, bool shortened)
ioprintf(io,"\t\t<TextureCoords num=\"%i\" set=\"%i\" num_components=\"%i\"> \n",mesh->mNumVertices,
a,mesh->mNumUVComponents[a]);
if (!shortened) {
if (mesh->mNumUVComponents[a] == 3) {
for (unsigned int n = 0; n < mesh->mNumVertices; ++n) {

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -70,11 +70,11 @@ static const aiImporterDesc desc = {
0,
0,
0,
"b3d"
"b3d"
};
// (fixme, Aramis) quick workaround to get rid of all those signed to unsigned warnings
#ifdef _MSC_VER
#ifdef _MSC_VER
# pragma warning (disable: 4018)
#endif
@ -279,12 +279,12 @@ void B3DImporter::ReadBRUS(){
aiMaterial *mat=new aiMaterial;
_materials.push_back( mat );
// Name
aiString ainame( name );
mat->AddProperty( &ainame,AI_MATKEY_NAME );
// Diffuse color
// Diffuse color
mat->AddProperty( &color,1,AI_MATKEY_COLOR_DIFFUSE );
// Opacity
@ -293,16 +293,16 @@ void B3DImporter::ReadBRUS(){
// Specular color
aiColor3D speccolor( shiny,shiny,shiny );
mat->AddProperty( &speccolor,1,AI_MATKEY_COLOR_SPECULAR );
// Specular power
float specpow=shiny*128;
mat->AddProperty( &specpow,1,AI_MATKEY_SHININESS );
// Double sided
if( fx & 0x10 ){
int i=1;
int i=1;
mat->AddProperty( &i,1,AI_MATKEY_TWOSIDED );
}
}
//Textures
for( int i=0;i<n_texs;++i ){
@ -568,7 +568,7 @@ void B3DImporter::ReadBB3D( aiScene *scene ){
string t=ReadChunk();
if( t=="BB3D" ){
int version=ReadInt();
if (!DefaultLogger::isNullLogger()) {
char dmp[128];
sprintf(dmp,"B3D file format version: %i",version);
@ -668,7 +668,7 @@ void B3DImporter::ReadBB3D( aiScene *scene ){
}
scene->mNumMaterials=_materials.size();
scene->mMaterials=to_array( _materials );
//meshes
scene->mNumMeshes=_meshes.size();
scene->mMeshes=to_array( _meshes );

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -112,7 +112,7 @@ private:
// unsigned _size;
std::vector<unsigned char> _buf;
std::vector<unsigned> _stack;
std::vector<std::string> _textures;
std::vector<aiMaterial*> _materials;

View File

@ -8,8 +8,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -26,16 +26,16 @@ contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -79,12 +79,12 @@ BVHLoader::~BVHLoader()
{}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Returns whether the class can handle the format of the given file.
bool BVHLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const
{
// check file extension
// check file extension
const std::string extension = GetExtension(pFile);
if( extension == "bvh")
return true;
@ -109,7 +109,7 @@ const aiImporterDesc* BVHLoader::GetInfo () const
}
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
// Imports the given file into the given scene structure.
void BVHLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
{
mFileName = pFile;
@ -207,7 +207,7 @@ aiNode* BVHLoader::ReadNode()
aiNode* child = ReadNode();
child->mParent = node;
childNodes.push_back( child);
}
}
else if( token == "End")
{
// The real symbol is "End Site". Second part comes in a separate token
@ -218,7 +218,7 @@ aiNode* BVHLoader::ReadNode()
aiNode* child = ReadEndSite( nodeName);
child->mParent = node;
childNodes.push_back( child);
}
}
else if( token == "}")
{
// we're done with that part of the hierarchy
@ -263,7 +263,7 @@ aiNode* BVHLoader::ReadEndSite( const std::string& pParentName)
if( token == "OFFSET")
{
ReadNodeOffset( node);
}
}
else if( token == "}")
{
// we're done with the end node
@ -468,7 +468,7 @@ void BVHLoader::CreateAnimation( aiScene* pScene)
for( unsigned int channel = 0; channel < 3; ++channel)
{
switch( node.mChannels[channel])
{
{
case Channel_PositionX: poskey->mValue.x = node.mChannelValues[fr * node.mChannels.size() + channel]; break;
case Channel_PositionY: poskey->mValue.y = node.mChannelValues[fr * node.mChannels.size() + channel]; break;
case Channel_PositionZ: poskey->mValue.z = node.mChannelValues[fr * node.mChannels.size() + channel]; break;
@ -494,7 +494,7 @@ void BVHLoader::CreateAnimation( aiScene* pScene)
{
// Offset all further calculations
rotOffset = 3;
}
}
// Then create the number of rotation keys
nodeAnim->mNumRotationKeys = mAnimNumFrames;
@ -511,7 +511,7 @@ void BVHLoader::CreateAnimation( aiScene* pScene)
const float angle = node.mChannelValues[fr * node.mChannels.size() + rotOffset + channel] * float( AI_MATH_PI) / 180.0f;
// Compute rotation transformations in the right order
switch (node.mChannels[rotOffset+channel])
switch (node.mChannels[rotOffset+channel])
{
case Channel_RotationX: aiMatrix4x4::RotationX( angle, temp); rotMatrix *= aiMatrix3x3( temp); break;
case Channel_RotationY: aiMatrix4x4::RotationY( angle, temp); rotMatrix *= aiMatrix3x3( temp); break;

View File

@ -7,8 +7,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -25,16 +25,16 @@ contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -55,7 +55,7 @@ namespace Assimp
{
// --------------------------------------------------------------------------------
/** Loader class to read Motion Capturing data from a .bvh file.
/** Loader class to read Motion Capturing data from a .bvh file.
*
* This format only contains a hierarchy of joints and a series of keyframes for
* the hierarchy. It contains no actual mesh data, but we generate a dummy mesh
@ -92,7 +92,7 @@ public:
~BVHLoader();
public:
/** Returns whether the class can handle the format of the given file.
/** Returns whether the class can handle the format of the given file.
* See BaseImporter::CanRead() for details. */
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const;
@ -102,7 +102,7 @@ public:
protected:
/** Imports the given file into the given scene structure.
/** Imports the given file into the given scene structure.
* See BaseImporter::InternReadFile() for details
*/
void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,22 +25,22 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 BaseImporter.cpp
* @brief Implementation of BaseImporter
* @brief Implementation of BaseImporter
*/
#include "BaseImporter.h"
@ -103,7 +103,7 @@ aiScene* BaseImporter::ReadFile(const Importer* pImp, const std::string& pFile,
return NULL;
}
// return what we gathered from the import.
// return what we gathered from the import.
sc.dismiss();
return sc;
}
@ -140,7 +140,7 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
// ------------------------------------------------------------------------------------------------
/*static*/ bool BaseImporter::SearchFileHeaderForToken(IOSystem* pIOHandler,
const std::string& pFile,
const char** tokens,
const char** tokens,
unsigned int numTokens,
unsigned int searchBytes /* = 200 */,
bool tokensSol /* false */)
@ -200,7 +200,7 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
// ------------------------------------------------------------------------------------------------
// Simple check for file extension
/*static*/ bool BaseImporter::SimpleExtensionCheck (const std::string& pFile,
/*static*/ bool BaseImporter::SimpleExtensionCheck (const std::string& pFile,
const char* ext0,
const char* ext1,
const char* ext2)
@ -210,7 +210,7 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
// no file extension - can't read
if( pos == std::string::npos)
return false;
const char* ext_real = & pFile[ pos+1 ];
if( !ASSIMP_stricmp(ext_real,ext0) )
return true;
@ -242,7 +242,7 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
// ------------------------------------------------------------------------------------------------
// Check for magic bytes at the beginning of the file.
/* static */ bool BaseImporter::CheckMagicToken(IOSystem* pIOHandler, const std::string& pFile,
/* static */ bool BaseImporter::CheckMagicToken(IOSystem* pIOHandler, const std::string& pFile,
const void* _magic, unsigned int num, unsigned int offset, unsigned int size)
{
ai_assert(size <= 16 && _magic);
@ -277,7 +277,7 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
// that's just for convinience, the chance that we cause conflicts
// is quite low and it can save some lines and prevent nasty bugs
if (2 == size) {
uint16_t rev = *magic_u16;
uint16_t rev = *magic_u16;
ByteSwap::Swap(&rev);
if (data_u16[0] == *magic_u16 || data_u16[0] == rev) {
return true;
@ -335,13 +335,13 @@ void BaseImporter::ConvertToUTF8(std::vector<char>& data)
// UTF 32 BE with BOM
if(*((uint32_t*)&data.front()) == 0xFFFE0000) {
// swap the endianess ..
for(uint32_t* p = (uint32_t*)&data.front(), *end = (uint32_t*)&data.back(); p <= end; ++p) {
AI_SWAP4P(p);
}
}
// UTF 32 LE with BOM
if(*((uint32_t*)&data.front()) == 0x0000FFFE) {
DefaultLogger::get()->debug("Found UTF-32 BOM ...");
@ -358,7 +358,7 @@ void BaseImporter::ConvertToUTF8(std::vector<char>& data)
ReportResult(result);
// copy to output buffer.
// copy to output buffer.
const size_t outlen = (size_t)(dstart-&output.front());
data.assign(output.begin(),output.begin()+outlen);
return;
@ -366,13 +366,13 @@ void BaseImporter::ConvertToUTF8(std::vector<char>& data)
// UTF 16 BE with BOM
if(*((uint16_t*)&data.front()) == 0xFFFE) {
// swap the endianess ..
for(uint16_t* p = (uint16_t*)&data.front(), *end = (uint16_t*)&data.back(); p <= end; ++p) {
ByteSwap::Swap2(p);
}
}
// UTF 16 LE with BOM
if(*((uint16_t*)&data.front()) == 0xFEFF) {
DefaultLogger::get()->debug("Found UTF-16 BOM ...");
@ -444,8 +444,8 @@ void BaseImporter::TextFileToBuffer(IOStream* stream,
throw DeadlyImportError("File is empty");
}
data.reserve(fileSize+1);
data.resize(fileSize);
data.reserve(fileSize+1);
data.resize(fileSize);
if(fileSize != stream->Read( &data[0], 1, fileSize)) {
throw DeadlyImportError("File read error");
}
@ -540,7 +540,7 @@ unsigned int BatchLoader::AddLoadRequest (const std::string& file,
unsigned int steps /*= 0*/, const PropertyMap* map /*= NULL*/)
{
ai_assert(!file.empty());
// check whether we have this loading request already
std::list<LoadRequest>::iterator it;
for (it = data->requests.begin();it != data->requests.end(); ++it) {

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -76,7 +76,7 @@ struct ScopeGuard
delete obj;
}
obj = NULL;
}
}
T* dismiss() {
mdismiss=true;
@ -104,13 +104,13 @@ private:
// ---------------------------------------------------------------------------
/** FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface
/** FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface
* for all importer worker classes.
*
* The interface defines two functions: CanRead() is used to check if the
* importer can handle the format of the given file. If an implementation of
* this function returns true, the importer then calls ReadFile() which
* imports the given file. ReadFile is not overridable, it just calls
* The interface defines two functions: CanRead() is used to check if the
* importer can handle the format of the given file. If an implementation of
* this function returns true, the importer then calls ReadFile() which
* imports the given file. ReadFile is not overridable, it just calls
* InternReadFile() and catches any ImportErrorException that might occur.
*/
class ASSIMP_API BaseImporter
@ -144,39 +144,39 @@ public:
* to be able to load files with unknown/not existent file extensions.
* @return true if the class can read this file, false if not.
*/
virtual bool CanRead(
const std::string& pFile,
IOSystem* pIOHandler,
virtual bool CanRead(
const std::string& pFile,
IOSystem* pIOHandler,
bool checkSig
) const = 0;
// -------------------------------------------------------------------
/** Imports the given file and returns the imported data.
* If the import succeeds, ownership of the data is transferred to
* If the import succeeds, ownership of the data is transferred to
* the caller. If the import fails, NULL is returned. The function
* takes care that any partially constructed data is destroyed
* beforehand.
*
* @param pImp #Importer object hosting this loader.
* @param pFile Path of the file to be imported.
* @param pFile Path of the file to be imported.
* @param pIOHandler IO-Handler used to open this and possible other files.
* @return The imported data or NULL if failed. If it failed a
* human-readable error description can be retrieved by calling
* @return The imported data or NULL if failed. If it failed a
* human-readable error description can be retrieved by calling
* GetErrorText()
*
* @note This function is not intended to be overridden. Implement
* InternReadFile() to do the import. If an exception is thrown somewhere
* @note This function is not intended to be overridden. Implement
* InternReadFile() to do the import. If an exception is thrown somewhere
* in InternReadFile(), this function will catch it and transform it into
* a suitable response to the caller.
*/
aiScene* ReadFile(
const Importer* pImp,
const std::string& pFile,
const Importer* pImp,
const std::string& pFile,
IOSystem* pIOHandler
);
// -------------------------------------------------------------------
/** Returns the error description of the last error that occured.
/** Returns the error description of the last error that occured.
* @return A description of the last error that occured. An empty
* string if there was no error.
*/
@ -194,9 +194,9 @@ public:
const Importer* pImp
);
// -------------------------------------------------------------------
/** Called by #Importer::GetImporterInfo to get a description of
/** Called by #Importer::GetImporterInfo to get a description of
* some loader features. Importers must provide this information. */
virtual const aiImporterDesc* GetInfo() const = 0;
@ -212,10 +212,10 @@ public:
protected:
// -------------------------------------------------------------------
/** Imports the given file into the given scene structure. The
* function is expected to throw an ImportErrorException if there is
* an error. If it terminates normally, the data in aiScene is
* expected to be correct. Override this function to implement the
/** Imports the given file into the given scene structure. The
* function is expected to throw an ImportErrorException if there is
* an error. If it terminates normally, the data in aiScene is
* expected to be correct. Override this function to implement the
* actual importing.
* <br>
* The output scene must meet the following requirements:<br>
@ -240,7 +240,7 @@ protected:
* default material setting for the file format better than Assimp's
* generic default material. Note that default materials *should*
* be named AI_DEFAULT_MATERIAL_NAME if they're just color-shaded
* or AI_DEFAULT_TEXTURED_MATERIAL_NAME if they define a (dummy)
* or AI_DEFAULT_TEXTURED_MATERIAL_NAME if they define a (dummy)
* texture. </li>
* </ul>
* If the AI_SCENE_FLAGS_INCOMPLETE-Flag is <b>not</b> set:<ul>
@ -255,9 +255,9 @@ protected:
* NULL is not a valid parameter.
* @param pIOHandler The IO handler to use for any file access.
* NULL is not a valid parameter. */
virtual void InternReadFile(
const std::string& pFile,
aiScene* pScene,
virtual void InternReadFile(
const std::string& pFile,
aiScene* pScene,
IOSystem* pIOHandler
) = 0;
@ -278,9 +278,9 @@ public: // static utilities
* @param searchBytes Number of bytes to be searched for the tokens.
*/
static bool SearchFileHeaderForToken(
IOSystem* pIOSystem,
IOSystem* pIOSystem,
const std::string& file,
const char** tokens,
const char** tokens,
unsigned int numTokens,
unsigned int searchBytes = 200,
bool tokensSol = false);
@ -294,7 +294,7 @@ public: // static utilities
* @note Case-insensitive
*/
static bool SimpleExtensionCheck (
const std::string& pFile,
const std::string& pFile,
const char* ext0,
const char* ext1 = NULL,
const char* ext2 = NULL);
@ -322,8 +322,8 @@ public: // static utilities
* tokens of size 2,4.
*/
static bool CheckMagicToken(
IOSystem* pIOHandler,
const std::string& pFile,
IOSystem* pIOHandler,
const std::string& pFile,
const void* magic,
unsigned int num,
unsigned int offset = 0,
@ -333,7 +333,7 @@ public: // static utilities
/** An utility for all text file loaders. It converts a file to our
* UTF8 character set. Errors are reported, but ignored.
*
* @param data File buffer to be converted to UTF8 data. The buffer
* @param data File buffer to be converted to UTF8 data. The buffer
* is resized as appropriate. */
static void ConvertToUTF8(
std::vector<char>& data);
@ -351,7 +351,7 @@ public: // static utilities
/** Utility for text file loaders which copies the contents of the
* file into a memory buffer and converts it to our UTF8
* representation.
* @param stream Stream to read from.
* @param stream Stream to read from.
* @param data Output buffer to be resized and filled with the
* converted text file data. The buffer is terminated with
* a binary 0. */

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -106,7 +106,7 @@ public:
public:
//! Destructor
~SharedPostProcessInfo()
~SharedPostProcessInfo()
{
Clean();
}
@ -188,7 +188,7 @@ private:
*
* For future use.
*/
struct PPDependencyTable
struct PPDependencyTable
{
unsigned int execute_me_before_these;
unsigned int execute_me_after_these;
@ -204,14 +204,14 @@ private:
// ---------------------------------------------------------------------------
/** The BaseProcess defines a common interface for all post processing steps.
* A post processing step is run after a successful import if the caller
* specified the corresponding flag when calling ReadFile().
* Enum #aiPostProcessSteps defines which flags are available.
* After a successful import the Importer iterates over its internal array
* of processes and calls IsActive() on each process to evaluate if the step
* should be executed. If the function returns true, the class' Execute()
* specified the corresponding flag when calling ReadFile().
* Enum #aiPostProcessSteps defines which flags are available.
* After a successful import the Importer iterates over its internal array
* of processes and calls IsActive() on each process to evaluate if the step
* should be executed. If the function returns true, the class' Execute()
* function is called subsequently.
*/
class ASSIMP_API_WINONLY BaseProcess
class ASSIMP_API_WINONLY BaseProcess
{
friend class Importer;
@ -229,13 +229,13 @@ public:
/** Returns whether the processing step is present in the given flag.
* @param pFlags The processing flags the importer was called with. A
* bitwise combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields,
* @return true if the process is present in this flag fields,
* false if not.
*/
virtual bool IsActive( unsigned int pFlags) const = 0;
// -------------------------------------------------------------------
/** Check whether this step expects its input vertex data to be
/** Check whether this step expects its input vertex data to be
* in verbose format. */
virtual bool RequireVerboseFormat() const;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2013, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -190,12 +190,12 @@ void BlenderBMeshConverter::AddTFace( const float* uv1, const float *uv2, const
memcpy( &mtface.uv[ 0 ], uv1, sizeof(float) * 2 );
memcpy( &mtface.uv[ 1 ], uv2, sizeof(float) * 2 );
memcpy( &mtface.uv[ 2 ], uv3, sizeof(float) * 2 );
if ( uv4 )
{
memcpy( &mtface.uv[ 3 ], uv4, sizeof(float) * 2 );
}
triMesh->mtface.push_back( mtface );
}

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2013, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -56,10 +56,10 @@ using namespace Assimp::Formatter;
#define for_each BOOST_FOREACH
bool match4(StreamReaderAny& stream, const char* string) {
char tmp[] = {
(stream).GetI1(),
(stream).GetI1(),
(stream).GetI1(),
char tmp[] = {
(stream).GetI1(),
(stream).GetI1(),
(stream).GetI1(),
(stream).GetI1()
};
return (tmp[0]==string[0] && tmp[1]==string[1] && tmp[2]==string[2] && tmp[3]==string[3]);
@ -71,7 +71,7 @@ struct Type {
};
// ------------------------------------------------------------------------------------------------
void DNAParser :: Parse ()
void DNAParser :: Parse ()
{
StreamReaderAny& stream = *db.reader.get();
DNA& dna = db.dna;
@ -84,7 +84,7 @@ void DNAParser :: Parse ()
if(!match4(stream,"NAME")) {
throw DeadlyImportError("BlenderDNA: Expected NAME field");
}
std::vector<std::string> names (stream.GetI4());
for_each(std::string& s, names) {
while (char c = stream.GetI1()) {
@ -97,7 +97,7 @@ void DNAParser :: Parse ()
if(!match4(stream,"TYPE")) {
throw DeadlyImportError("BlenderDNA: Expected TYPE field");
}
std::vector<Type> types (stream.GetI4());
for_each(Type& s, types) {
while (char c = stream.GetI1()) {
@ -110,7 +110,7 @@ void DNAParser :: Parse ()
if(!match4(stream,"TLEN")) {
throw DeadlyImportError("BlenderDNA: Expected TLEN field");
}
for_each(Type& s, types) {
s.size = stream.GetI2();
}
@ -125,11 +125,11 @@ void DNAParser :: Parse ()
dna.structures.reserve(end);
for(size_t i = 0; i != end; ++i) {
uint16_t n = stream.GetI2();
if (n >= types.size()) {
throw DeadlyImportError((format(),
"BlenderDNA: Invalid type index in structure name" ,n,
"BlenderDNA: Invalid type index in structure name" ,n,
" (there are only ", types.size(), " entries)"
));
}
@ -150,8 +150,8 @@ void DNAParser :: Parse ()
uint16_t j = stream.GetI2();
if (j >= types.size()) {
throw DeadlyImportError((format(),
"BlenderDNA: Invalid type index in structure field ", j,
throw DeadlyImportError((format(),
"BlenderDNA: Invalid type index in structure field ", j,
" (there are only ", types.size(), " entries)"
));
}
@ -164,15 +164,15 @@ void DNAParser :: Parse ()
j = stream.GetI2();
if (j >= names.size()) {
throw DeadlyImportError((format(),
"BlenderDNA: Invalid name index in structure field ", j,
throw DeadlyImportError((format(),
"BlenderDNA: Invalid name index in structure field ", j,
" (there are only ", names.size(), " entries)"
));
}
f.name = names[j];
f.flags = 0u;
// pointers always specify the size of the pointee instead of their own.
// The pointer asterisk remains a property of the lookup name.
if (f.name[0] == '*') {
@ -184,18 +184,18 @@ void DNAParser :: Parse ()
// need to parse the (possibly multi-dimensional) array declaration
// in order to obtain the actual size of the array in the file.
// Also we need to alter the lookup name to include no array
// brackets anymore or size fixup won't work (if our size does
// brackets anymore or size fixup won't work (if our size does
// not match the size read from the DNA).
if (*f.name.rbegin() == ']') {
const std::string::size_type rb = f.name.find('[');
if (rb == std::string::npos) {
throw DeadlyImportError((format(),
throw DeadlyImportError((format(),
"BlenderDNA: Encountered invalid array declaration ",
f.name
));
}
f.flags |= FieldFlag_Array;
f.flags |= FieldFlag_Array;
DNA::ExtractArraySize(f.name,f.array_sizes);
f.name = f.name.substr(0,rb);
@ -251,7 +251,7 @@ void DNA :: DumpToFile()
// ------------------------------------------------------------------------------------------------
/*static*/ void DNA :: ExtractArraySize(
const std::string& out,
const std::string& out,
size_t array_sizes[2]
)
{
@ -273,7 +273,7 @@ void DNA :: DumpToFile()
boost::shared_ptr< ElemBase > DNA :: ConvertBlobToStructure(
const Structure& structure,
const FileDatabase& db
) const
) const
{
std::map<std::string, FactoryPair >::const_iterator it = converters.find(structure.name);
if (it == converters.end()) {
@ -282,7 +282,7 @@ boost::shared_ptr< ElemBase > DNA :: ConvertBlobToStructure(
boost::shared_ptr< ElemBase > ret = (structure.*((*it).second.first))();
(structure.*((*it).second.second))(ret,db);
return ret;
}
@ -290,7 +290,7 @@ boost::shared_ptr< ElemBase > DNA :: ConvertBlobToStructure(
DNA::FactoryPair DNA :: GetBlobToStructureConverter(
const Structure& structure,
const FileDatabase& /*db*/
) const
) const
{
std::map<std::string, FactoryPair>::const_iterator it = converters.find(structure.name);
return it == converters.end() ? FactoryPair() : (*it).second;
@ -302,7 +302,7 @@ void DNA :: AddPrimitiveStructures()
{
// NOTE: these are just dummies. Their presence enforces
// Structure::Convert<target_type> to be called on these
// empty structures. These converters are special
// empty structures. These converters are special
// overloads which scan the name of the structure and
// perform the required data type conversion if one
// of these special names is found in the structure

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,23 +23,23 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 BlenderDNA.h
* @brief Blender `DNA` (file format specification embedded in
* @brief Blender `DNA` (file format specification embedded in
* blend file itself) loader.
*/
#ifndef INCLUDED_AI_BLEND_DNA_H
@ -89,16 +89,16 @@ struct Error : DeadlyImportError
/** The only purpose of this structure is to feed a virtual dtor into its
* descendents. It serves as base class for all data structure fields. */
// -------------------------------------------------------------------------------
struct ElemBase
struct ElemBase
{
virtual ~ElemBase() {}
/** Type name of the element. The type
* string points is the `c_str` of the `name` attribute of the
* corresponding `Structure`, that is, it is only valid as long
/** Type name of the element. The type
* string points is the `c_str` of the `name` attribute of the
* corresponding `Structure`, that is, it is only valid as long
* as the DNA is not modified. The dna_type is only set if the
* data type is not static, i.e. a boost::shared_ptr<ElemBase>
* in the scene description would have its type resolved
* in the scene description would have its type resolved
* at runtime, so this member is always set. */
const char* dna_type;
};
@ -107,7 +107,7 @@ struct ElemBase
// -------------------------------------------------------------------------------
/** Represents a generic pointer to a memory location, which can be either 32
* or 64 bits. These pointers are loaded from the BLEND file and finally
* fixed to point to the real, converted representation of the objects
* fixed to point to the real, converted representation of the objects
* they used to point to.*/
// -------------------------------------------------------------------------------
struct Pointer
@ -127,7 +127,7 @@ struct FileOffset
// -------------------------------------------------------------------------------
/** Dummy derivate of std::vector to be able to use it in templates simultaenously
* with boost::shared_ptr, which takes only one template argument
* with boost::shared_ptr, which takes only one template argument
* while std::vector takes three. Also we need to provide some special member
* functions of shared_ptr */
// -------------------------------------------------------------------------------
@ -150,7 +150,7 @@ public:
// -------------------------------------------------------------------------------
/** Mixed flags for use in #Field */
// -------------------------------------------------------------------------------
enum FieldFlags
enum FieldFlags
{
FieldFlag_Pointer = 0x1,
FieldFlag_Array = 0x2
@ -159,8 +159,8 @@ enum FieldFlags
// -------------------------------------------------------------------------------
/** Represents a single member of a data structure in a BLEND file */
// -------------------------------------------------------------------------------
struct Field
{
struct Field
{
std::string name;
std::string type;
@ -180,7 +180,7 @@ struct Field
* mission critical so we need them, while others can silently be default
* initialized and no animations are harmed. */
// -------------------------------------------------------------------------------
enum ErrorPolicy
enum ErrorPolicy
{
/** Substitute default value and ignore */
ErrorPolicy_Igno,
@ -202,7 +202,7 @@ enum ErrorPolicy
* binary `blob` read from the file to such a structure instance with
* meaningful contents. */
// -------------------------------------------------------------------------------
class Structure
class Structure
{
template <template <typename> class> friend class ObjectCache;
@ -271,7 +271,7 @@ public:
// --------------------------------------------------------
// field parsing for 1d arrays
template <int error_policy, typename T, size_t M>
void ReadFieldArray(T (& out)[M], const char* name,
void ReadFieldArray(T (& out)[M], const char* name,
const FileDatabase& db) const;
// --------------------------------------------------------
@ -281,11 +281,11 @@ public:
const FileDatabase& db) const;
// --------------------------------------------------------
// field parsing for pointer or dynamic array types
// field parsing for pointer or dynamic array types
// (boost::shared_ptr or boost::shared_array)
// The return value indicates whether the data was already cached.
template <int error_policy, template <typename> class TOUT, typename T>
bool ReadFieldPtr(TOUT<T>& out, const char* name,
bool ReadFieldPtr(TOUT<T>& out, const char* name,
const FileDatabase& db,
bool non_recursive = false) const;
@ -294,31 +294,31 @@ public:
// array types (boost::shared_ptr[] or boost::shared_array[])
// The return value indicates whether the data was already cached.
template <int error_policy, template <typename> class TOUT, typename T, size_t N>
bool ReadFieldPtr(TOUT<T> (&out)[N], const char* name,
bool ReadFieldPtr(TOUT<T> (&out)[N], const char* name,
const FileDatabase& db) const;
// --------------------------------------------------------
// field parsing for `normal` values
// The return value indicates whether the data was already cached.
template <int error_policy, typename T>
void ReadField(T& out, const char* name,
void ReadField(T& out, const char* name,
const FileDatabase& db) const;
private:
// --------------------------------------------------------
template <template <typename> class TOUT, typename T>
bool ResolvePointer(TOUT<T>& out, const Pointer & ptrval,
bool ResolvePointer(TOUT<T>& out, const Pointer & ptrval,
const FileDatabase& db, const Field& f,
bool non_recursive = false) const;
// --------------------------------------------------------
template <template <typename> class TOUT, typename T>
bool ResolvePointer(vector< TOUT<T> >& out, const Pointer & ptrval,
bool ResolvePointer(vector< TOUT<T> >& out, const Pointer & ptrval,
const FileDatabase& db, const Field& f, bool) const;
// --------------------------------------------------------
bool ResolvePointer( boost::shared_ptr< FileOffset >& out, const Pointer & ptrval,
bool ResolvePointer( boost::shared_ptr< FileOffset >& out, const Pointer & ptrval,
const FileDatabase& db, const Field& f, bool) const;
// --------------------------------------------------------
@ -347,7 +347,7 @@ private:
template <typename T, unsigned int N>
void operator ()(T (& out)[N], const char* = NULL) {
for (unsigned int i = 0; i < N; ++i) {
out[i] = T();
out[i] = T();
}
}
@ -355,7 +355,7 @@ private:
void operator ()(T (& out)[N][M], const char* = NULL) {
for (unsigned int i = 0; i < N; ++i) {
for (unsigned int j = 0; j < M; ++j) {
out[i][j] = T();
out[i][j] = T();
}
}
}
@ -387,16 +387,16 @@ template <> struct Structure :: _defaultInitializer<ErrorPolicy_Fail> {
template <typename T>
void operator ()(T& /*out*/,const char* = "") {
// obviously, it is crucial that _DefaultInitializer is used
// obviously, it is crucial that _DefaultInitializer is used
// only from within a catch clause.
throw;
}
};
// -------------------------------------------------------------------------------------------------------
template <> inline bool Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(boost::shared_ptr<ElemBase>& out,
const Pointer & ptrval,
const FileDatabase& db,
template <> inline bool Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(boost::shared_ptr<ElemBase>& out,
const Pointer & ptrval,
const FileDatabase& db,
const Field& f,
bool
) const;
@ -405,7 +405,7 @@ template <> inline bool Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(
// -------------------------------------------------------------------------------
/** Represents the full data structure information for a single BLEND file.
* This data is extracted from the DNA1 chunk in the file.
* #DNAParser does the reading and represents currently the only place where
* #DNAParser does the reading and represents currently the only place where
* DNA is altered.*/
// -------------------------------------------------------------------------------
class DNA
@ -413,13 +413,13 @@ class DNA
public:
typedef void (Structure::*ConvertProcPtr) (
boost::shared_ptr<ElemBase> in,
boost::shared_ptr<ElemBase> in,
const FileDatabase&
) const;
typedef boost::shared_ptr<ElemBase> (
Structure::*AllocProcPtr) () const;
typedef std::pair< AllocProcPtr, ConvertProcPtr > FactoryPair;
public:
@ -431,7 +431,7 @@ public:
public:
// --------------------------------------------------------
/** Access a structure by its canonical name, the pointer version returns NULL on failure
/** Access a structure by its canonical name, the pointer version returns NULL on failure
* while the reference version raises an error. */
inline const Structure& operator [] (const std::string& ss) const;
inline const Structure* Get (const std::string& ss) const;
@ -448,19 +448,19 @@ public:
void AddPrimitiveStructures();
// --------------------------------------------------------
/** Fill the @c converters member with converters for all
/** Fill the @c converters member with converters for all
* known data types. The implementation of this method is
* in BlenderScene.cpp and is machine-generated.
* Converters are used to quickly handle objects whose
* exact data type is a runtime-property and not yet
* exact data type is a runtime-property and not yet
* known at compile time (consier Object::data).*/
void RegisterConverters();
// --------------------------------------------------------
/** Take an input blob from the stream, interpret it according to
/** Take an input blob from the stream, interpret it according to
* a its structure name and convert it to the intermediate
* representation.
* representation.
* @param structure Destination structure definition
* @param db File database.
* @return A null pointer if no appropriate converter is available.*/
@ -471,7 +471,7 @@ public:
// --------------------------------------------------------
/** Find a suitable conversion function for a given Structure.
* Such a converter function takes a blob from the input
* Such a converter function takes a blob from the input
* stream, reads as much as it needs, and builds up a
* complete object in intermediate representation.
* @param structure Destination structure definition
@ -485,7 +485,7 @@ public:
#ifdef ASSIMP_BUILD_BLENDER_DEBUG
// --------------------------------------------------------
/** Dump the DNA to a text file. This is for debugging purposes.
/** Dump the DNA to a text file. This is for debugging purposes.
* The output file is `dna.txt` in the current working folder*/
void DumpToFile();
#endif
@ -500,7 +500,7 @@ public:
* @throw DeadlyImportError if more than 2 dimensions are
* encountered. */
static void ExtractArraySize(
const std::string& out,
const std::string& out,
size_t array_sizes[2]
);
};
@ -517,7 +517,7 @@ template <> inline void Structure :: Convert<Pointer> (Pointer& dest,const FileD
/** Describes a master file block header. Each master file sections holds n
* elements of a certain SDNA structure (or otherwise unspecified data). */
// -------------------------------------------------------------------------------
struct FileBlockHead
struct FileBlockHead
{
// points right after the header of the file block
StreamReaderAny::pos start;
@ -555,14 +555,14 @@ inline bool operator< (const Pointer& a, const Pointer& b) {
// -------------------------------------------------------------------------------
/** Utility to read all master file blocks in turn. */
// -------------------------------------------------------------------------------
class SectionParser
class SectionParser
{
public:
// --------------------------------------------------------
/** @param stream Inout stream, must point to the
/** @param stream Inout stream, must point to the
* first section in the file. Call Next() once
* to have it read.
* to have it read.
* @param ptr64 Pointer size in file is 64 bits? */
SectionParser(StreamReaderAny& stream,bool ptr64)
: stream(stream)
@ -577,12 +577,12 @@ public:
const FileBlockHead& GetCurrent() const {
return current;
}
public:
// --------------------------------------------------------
/** Advance to the next section.
/** Advance to the next section.
* @throw DeadlyImportError if the last chunk was passed. */
void Next();
@ -602,7 +602,7 @@ class Statistics {
public:
Statistics ()
Statistics ()
: fields_read ()
, pointers_resolved ()
, cache_hits ()
@ -621,7 +621,7 @@ public:
/** number of pointers resolved from the cache */
unsigned int cache_hits;
/** number of blocks (from FileDatabase::entries)
/** number of blocks (from FileDatabase::entries)
we did actually read from. */
// unsigned int blocks_read;
@ -635,7 +635,7 @@ public:
* avoids circular references and avoids object duplication. */
// -------------------------------------------------------------------------------
template <template <typename> class TOUT>
class ObjectCache
class ObjectCache
{
public:
@ -661,21 +661,21 @@ public:
* cache doens't know the item yet.
* @param ptr Item address to look for. */
template <typename T> void get (
const Structure& s,
TOUT<T>& out,
const Structure& s,
TOUT<T>& out,
const Pointer& ptr) const;
// --------------------------------------------------------
/** Add an item to the cache after the item has
/** Add an item to the cache after the item has
* been fully read. Do not insert anything that
* may be faulty or might cause the loading
* to abort.
* to abort.
* @param s Data type of the item
* @param out Item to insert into the cache
* @param ptr address (cache key) of the item. */
template <typename T> void set
(const Structure& s,
const TOUT<T>& out,
template <typename T> void set
(const Structure& s,
const TOUT<T>& out,
const Pointer& ptr);
private:
@ -686,7 +686,7 @@ private:
// -------------------------------------------------------------------------------
// -------------------------------------------------------------------------------
template <> class ObjectCache<Blender::vector>
template <> class ObjectCache<Blender::vector>
{
public:
@ -704,7 +704,7 @@ public:
/** Memory representation of a full BLEND file and all its dependencies. The
* output aiScene is constructed from an instance of this data structure. */
// -------------------------------------------------------------------------------
class FileDatabase
class FileDatabase
{
template <template <typename> class TOUT> friend class ObjectCache;
@ -715,7 +715,7 @@ public:
: _cacheArrays(*this)
, _cache(*this)
, next_cache_idx()
{}
{}
public:
@ -735,7 +735,7 @@ public:
// For all our templates to work on both shared_ptr's and vector's
// using the same code, a dummy cache for arrays is provided. Actually,
// arrays of objects are never cached because we can't easily
// arrays of objects are never cached because we can't easily
// ensure their proper destruction.
template <typename T>
ObjectCache<boost::shared_ptr>& cache(boost::shared_ptr<T>& /*in*/) const {
@ -749,7 +749,7 @@ public:
private:
#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
mutable Statistics _stats;
#endif
@ -767,7 +767,7 @@ private:
// -------------------------------------------------------------------------------
/** Factory to extract a #DNA from the DNA1 file block in a BLEND file. */
// -------------------------------------------------------------------------------
class DNAParser
class DNAParser
{
public:

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -119,7 +119,7 @@ namespace Blender {
private:
mywrap arr;
};
#ifdef _MSC_VER
# pragma warning(disable:4351)
#endif
@ -137,7 +137,7 @@ namespace Blender {
/** ConversionData acts as intermediate storage location for
* the various ConvertXXX routines in BlenderImporter.*/
// --------------------------------------------------------------------
struct ConversionData
struct ConversionData
{
ConversionData(const FileDatabase& db)
: sentinel_cnt()
@ -179,20 +179,20 @@ namespace Blender {
inline const char* GetTextureTypeDisplayString(Tex::Type t)
{
switch (t) {
case Tex::Type_CLOUDS : return "Clouds";
case Tex::Type_WOOD : return "Wood";
case Tex::Type_MARBLE : return "Marble";
case Tex::Type_MAGIC : return "Magic";
case Tex::Type_BLEND : return "Blend";
case Tex::Type_STUCCI : return "Stucci";
case Tex::Type_NOISE : return "Noise";
case Tex::Type_PLUGIN : return "Plugin";
case Tex::Type_MUSGRAVE : return "Musgrave";
case Tex::Type_VORONOI : return "Voronoi";
case Tex::Type_DISTNOISE : return "DistortedNoise";
case Tex::Type_ENVMAP : return "EnvMap";
case Tex::Type_IMAGE : return "Image";
default:
case Tex::Type_CLOUDS : return "Clouds";
case Tex::Type_WOOD : return "Wood";
case Tex::Type_MARBLE : return "Marble";
case Tex::Type_MAGIC : return "Magic";
case Tex::Type_BLEND : return "Blend";
case Tex::Type_STUCCI : return "Stucci";
case Tex::Type_NOISE : return "Noise";
case Tex::Type_PLUGIN : return "Plugin";
case Tex::Type_MUSGRAVE : return "Musgrave";
case Tex::Type_VORONOI : return "Voronoi";
case Tex::Type_DISTNOISE : return "DistortedNoise";
case Tex::Type_ENVMAP : return "EnvMap";
case Tex::Type_IMAGE : return "Image";
default:
break;
}
return "<Unknown>";

View File

@ -6,8 +6,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -24,16 +24,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -60,7 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <cctype>
// zlib is needed for compressed blend files
// zlib is needed for compressed blend files
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
# ifdef ASSIMP_BUILD_NO_OWN_ZLIB
# include <zlib.h>
@ -98,14 +98,14 @@ BlenderImporter::BlenderImporter()
{}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
// Destructor, private as well
BlenderImporter::~BlenderImporter()
{
delete modifier_cache;
}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Returns whether the class can handle the format of the given file.
bool BlenderImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
{
const std::string& extension = GetExtension(pFile);
@ -123,7 +123,7 @@ bool BlenderImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, b
// ------------------------------------------------------------------------------------------------
// List all extensions handled by this loader
void BlenderImporter::GetExtensionList(std::set<std::string>& app)
void BlenderImporter::GetExtensionList(std::set<std::string>& app)
{
app.insert("blend");
}
@ -153,8 +153,8 @@ struct free_it
};
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void BlenderImporter::InternReadFile( const std::string& pFile,
// Imports the given file into the given scene structure.
void BlenderImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
@ -162,7 +162,7 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
free_it free_it_really(dest);
#endif
FileDatabase file;
FileDatabase file;
boost::shared_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb"));
if (!stream) {
ThrowException("Could not open file for reading");
@ -222,14 +222,14 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
total += have;
dest = reinterpret_cast<Bytef*>( realloc(dest,total) );
memcpy(dest + total - have,block,have);
}
}
while (ret != Z_STREAM_END);
// terminate zlib
inflateEnd(&zstream);
// replace the input stream with a memory stream
stream.reset(new MemoryIOStream(reinterpret_cast<uint8_t*>(dest),total));
stream.reset(new MemoryIOStream(reinterpret_cast<uint8_t*>(dest),total));
// .. and retry
stream->Read(magic,7,1);
@ -259,7 +259,7 @@ void BlenderImporter::InternReadFile( const std::string& pFile,
}
// ------------------------------------------------------------------------------------------------
void BlenderImporter::ParseBlendFile(FileDatabase& out, boost::shared_ptr<IOStream> stream)
void BlenderImporter::ParseBlendFile(FileDatabase& out, boost::shared_ptr<IOStream> stream)
{
out.reader = boost::shared_ptr<StreamReaderAny>(new StreamReaderAny(stream,out.little));
@ -293,7 +293,7 @@ void BlenderImporter::ParseBlendFile(FileDatabase& out, boost::shared_ptr<IOStre
}
// ------------------------------------------------------------------------------------------------
void BlenderImporter::ExtractScene(Scene& out, const FileDatabase& file)
void BlenderImporter::ExtractScene(Scene& out, const FileDatabase& file)
{
const FileBlockHead* block = NULL;
std::map<std::string,size_t>::const_iterator it = file.dna.indices.find("Scene");
@ -303,7 +303,7 @@ void BlenderImporter::ExtractScene(Scene& out, const FileDatabase& file)
const Structure& ss = file.dna.structures[(*it).second];
// we need a scene somewhere to start with.
// we need a scene somewhere to start with.
for_each(const FileBlockHead& bl,file.entries) {
// Fix: using the DNA index is more reliable to locate scenes
@ -325,15 +325,15 @@ void BlenderImporter::ExtractScene(Scene& out, const FileDatabase& file)
#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
DefaultLogger::get()->info((format(),
"(Stats) Fields read: " ,file.stats().fields_read,
", pointers resolved: " ,file.stats().pointers_resolved,
", cache hits: " ,file.stats().cache_hits,
", pointers resolved: " ,file.stats().pointers_resolved,
", cache hits: " ,file.stats().cache_hits,
", cached objects: " ,file.stats().cached_objects
));
#endif
}
// ------------------------------------------------------------------------------------------------
void BlenderImporter::ConvertBlendFile(aiScene* out, const Scene& in,const FileDatabase& file)
void BlenderImporter::ConvertBlendFile(aiScene* out, const Scene& in,const FileDatabase& file)
{
ConversionData conv(file);
@ -366,7 +366,7 @@ void BlenderImporter::ConvertBlendFile(aiScene* out, const Scene& in,const FileD
root->mNumChildren = static_cast<unsigned int>(no_parents.size());
root->mChildren = new aiNode*[root->mNumChildren]();
for (unsigned int i = 0; i < root->mNumChildren; ++i) {
root->mChildren[i] = ConvertNode(in, no_parents[i], conv, aiMatrix4x4());
root->mChildren[i] = ConvertNode(in, no_parents[i], conv, aiMatrix4x4());
root->mChildren[i]->mParent = root;
}
@ -511,29 +511,29 @@ void BlenderImporter::ResolveTexture(aiMaterial* out, const Material* mat, const
if(!rtex || !rtex->type) {
return;
}
// We can't support most of the texture types because they're mostly procedural.
// These are substituted by a dummy texture.
const char* dispnam = "";
switch( rtex->type )
switch( rtex->type )
{
// these are listed in blender's UI
case Tex::Type_CLOUDS :
case Tex::Type_WOOD :
case Tex::Type_MARBLE :
case Tex::Type_MAGIC :
case Tex::Type_BLEND :
case Tex::Type_STUCCI :
case Tex::Type_NOISE :
case Tex::Type_PLUGIN :
case Tex::Type_MUSGRAVE :
case Tex::Type_VORONOI :
case Tex::Type_DISTNOISE :
case Tex::Type_ENVMAP :
case Tex::Type_CLOUDS :
case Tex::Type_WOOD :
case Tex::Type_MARBLE :
case Tex::Type_MAGIC :
case Tex::Type_BLEND :
case Tex::Type_STUCCI :
case Tex::Type_NOISE :
case Tex::Type_PLUGIN :
case Tex::Type_MUSGRAVE :
case Tex::Type_VORONOI :
case Tex::Type_DISTNOISE :
case Tex::Type_ENVMAP :
// these do no appear in the UI, why?
case Tex::Type_POINTDENSITY :
case Tex::Type_VOXELDATA :
case Tex::Type_POINTDENSITY :
case Tex::Type_VOXELDATA :
LogWarn(std::string("Encountered a texture with an unsupported type: ")+dispnam);
AddSentinelTexture(out, mat, tex, conv_data);
@ -553,7 +553,7 @@ void BlenderImporter::ResolveTexture(aiMaterial* out, const Material* mat, const
}
// ------------------------------------------------------------------------------------------------
void BlenderImporter::BuildMaterials(ConversionData& conv_data)
void BlenderImporter::BuildMaterials(ConversionData& conv_data)
{
conv_data.materials->reserve(conv_data.materials_raw.size());
@ -594,7 +594,7 @@ void BlenderImporter::BuildMaterials(ConversionData& conv_data)
for (size_t i = 0; i < sizeof(conv_data.next_texture)/sizeof(conv_data.next_texture[0]);++i) {
conv_data.next_texture[i] = 0 ;
}
aiMaterial* mout = new aiMaterial();
conv_data.materials->push_back(mout);
// For any new material field handled here, the default material above must be updated with an appropriate default value.
@ -607,7 +607,7 @@ void BlenderImporter::BuildMaterials(ConversionData& conv_data)
// basic material colors
aiColor3D col(mat->r,mat->g,mat->b);
if (mat->r || mat->g || mat->b ) {
// Usually, zero diffuse color means no diffuse color at all in the equation.
// So we omit this member to express this intent.
mout->AddProperty(&col,1,AI_MATKEY_COLOR_DIFFUSE);
@ -649,7 +649,7 @@ void BlenderImporter::CheckActualType(const ElemBase* dt, const char* check)
ai_assert(dt);
if (strcmp(dt->dna_type,check)) {
ThrowException((format(),
"Expected object at ",std::hex,dt," to be of type `",check,
"Expected object at ",std::hex,dt," to be of type `",check,
"`, but it claims to be a `",dt->dna_type,"`instead"
));
}
@ -664,7 +664,7 @@ void BlenderImporter::NotSupportedObjectType(const Object* obj, const char* type
// ------------------------------------------------------------------------------------------------
void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, const Mesh* mesh,
ConversionData& conv_data, TempArray<std::vector,aiMesh>& temp
)
)
{
// TODO: Resolve various problems with BMesh triangluation before re-enabling.
// See issues #400, #373, #318 #315 and #132.
@ -730,11 +730,11 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
// all submeshes created from this mesh are named equally. this allows
// curious users to recover the original adjacency.
out->mName = aiString(mesh->id.name+2);
out->mName = aiString(mesh->id.name+2);
// skip over the name prefix 'ME'
// resolve the material reference and add this material to the set of
// output materials. The (temporary) material index is the index
// output materials. The (temporary) material index is the index
// of the material entry within the list of resolved materials.
if (mesh->mat) {
@ -771,7 +771,7 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
aiVector3D* vn = out->mNormals + out->mNumVertices;
// XXX we can't fold this easily, because we are restricted
// to the member names from the BLEND file (v1,v2,v3,v4)
// to the member names from the BLEND file (v1,v2,v3,v4)
// which are assigned by the genblenddna.py script and
// cannot be changed without breaking the entire
// import process.
@ -846,16 +846,16 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
}
for (int i = 0; i < mesh->totpoly; ++i) {
const MPoly& mf = mesh->mpoly[i];
aiMesh* const out = temp[ mat_num_to_mesh_idx[ mf.mat_nr ] ];
aiFace& f = out->mFaces[out->mNumFaces++];
f.mIndices = new unsigned int[ f.mNumIndices = mf.totloop ];
aiVector3D* vo = out->mVertices + out->mNumVertices;
aiVector3D* vn = out->mNormals + out->mNumVertices;
// XXX we can't fold this easily, because we are restricted
// to the member names from the BLEND file (v1,v2,v3,v4)
// which are assigned by the genblenddna.py script and
@ -870,7 +870,7 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
}
const MVert& v = mesh->mvert[loop.v];
vo->x = v.co[0];
vo->y = v.co[1];
vo->z = v.co[2];
@ -878,10 +878,10 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
vn->y = v.no[1];
vn->z = v.no[2];
f.mIndices[j] = out->mNumVertices++;
++vo;
++vn;
}
if (mf.totloop == 3)
{
@ -892,7 +892,7 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
out->mPrimitiveTypes |= aiPrimitiveType_POLYGON;
}
}
// collect texture coordinates, they're stored in a separate per-face buffer
if (mesh->mtface || mesh->mloopuv) {
if (mesh->totface > static_cast<int> ( mesh->mtface.size())) {
@ -910,26 +910,26 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
aiMesh* const out = temp[ mat_num_to_mesh_idx[ mesh->mface[i].mat_nr ] ];
const aiFace& f = out->mFaces[out->mNumFaces++];
aiVector3D* vo = &out->mTextureCoords[0][out->mNumVertices];
for (unsigned int i = 0; i < f.mNumIndices; ++i,++vo,++out->mNumVertices) {
vo->x = v->uv[i][0];
vo->y = v->uv[i][1];
}
}
for (int i = 0; i < mesh->totpoly; ++i) {
const MPoly& v = mesh->mpoly[i];
aiMesh* const out = temp[ mat_num_to_mesh_idx[ v.mat_nr ] ];
const aiFace& f = out->mFaces[out->mNumFaces++];
aiVector3D* vo = &out->mTextureCoords[0][out->mNumVertices];
for (unsigned int j = 0; j < f.mNumIndices; ++j,++vo,++out->mNumVertices) {
const MLoopUV& uv = mesh->mloopuv[v.loopstart + j];
vo->x = uv.uv[0];
vo->y = uv.uv[1];
}
}
}
@ -950,7 +950,7 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
aiMesh* const out = temp[ mat_num_to_mesh_idx[ mesh->mface[i].mat_nr ] ];
const aiFace& f = out->mFaces[out->mNumFaces++];
aiVector3D* vo = &out->mTextureCoords[0][out->mNumVertices];
for (unsigned int i = 0; i < f.mNumIndices; ++i,++vo,++out->mNumVertices) {
vo->x = v->uv[i][0];
@ -975,7 +975,7 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
aiMesh* const out = temp[ mat_num_to_mesh_idx[ mesh->mface[i].mat_nr ] ];
const aiFace& f = out->mFaces[out->mNumFaces++];
aiColor4D* vo = &out->mColors[0][out->mNumVertices];
for (unsigned int n = 0; n < f.mNumIndices; ++n, ++vo,++out->mNumVertices) {
const MCol* col = &mesh->mcol[(i<<2)+n];
@ -987,12 +987,12 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
}
for (unsigned int n = f.mNumIndices; n < 4; ++n);
}
for (int i = 0; i < mesh->totpoly; ++i) {
const MPoly& v = mesh->mpoly[i];
aiMesh* const out = temp[ mat_num_to_mesh_idx[ v.mat_nr ] ];
const aiFace& f = out->mFaces[out->mNumFaces++];
aiColor4D* vo = &out->mColors[0][out->mNumVertices];
for (unsigned int j = 0; j < f.mNumIndices; ++j,++vo,++out->mNumVertices) {
const MLoopCol& col = mesh->mloopcol[v.loopstart + j];
@ -1001,7 +1001,7 @@ void BlenderImporter::ConvertMesh(const Scene& /*in*/, const Object* /*obj*/, co
vo->b = col.b;
vo->a = col.a;
}
}
}
@ -1140,7 +1140,7 @@ aiNode* BlenderImporter::ConvertNode(const Scene& in, const Object* obj, Convers
m = m.Inverse();
node->mTransformation = m*node->mTransformation;
if (children.size()) {
node->mNumChildren = static_cast<unsigned int>(children.size());
aiNode** nd = node->mChildren = new aiNode*[node->mNumChildren]();

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -55,7 +55,7 @@ struct aiCamera;
struct aiMaterial;
namespace Assimp {
// TinyFormatter.h
namespace Formatter {
template <typename T,typename TR, typename A> class basic_formatter;
@ -109,7 +109,7 @@ public:
public:
// --------------------
bool CanRead( const std::string& pFile,
bool CanRead( const std::string& pFile,
IOSystem* pIOHandler,
bool checkSig
) const;
@ -126,20 +126,20 @@ protected:
void SetupProperties(const Importer* pImp);
// --------------------
void InternReadFile( const std::string& pFile,
aiScene* pScene,
void InternReadFile( const std::string& pFile,
aiScene* pScene,
IOSystem* pIOHandler
);
// --------------------
void ParseBlendFile(Blender::FileDatabase& out,
void ParseBlendFile(Blender::FileDatabase& out,
boost::shared_ptr<IOStream> stream
);
// --------------------
void ExtractScene(Blender::Scene& out,
void ExtractScene(Blender::Scene& out,
const Blender::FileDatabase& file
);
);
// --------------------
void ConvertBlendFile(aiScene* out,
@ -150,33 +150,33 @@ protected:
private:
// --------------------
aiNode* ConvertNode(const Blender::Scene& in,
const Blender::Object* obj,
aiNode* ConvertNode(const Blender::Scene& in,
const Blender::Object* obj,
Blender::ConversionData& conv_info,
const aiMatrix4x4& parentTransform
);
);
// --------------------
void ConvertMesh(const Blender::Scene& in,
const Blender::Object* obj,
const Blender::Mesh* mesh,
void ConvertMesh(const Blender::Scene& in,
const Blender::Object* obj,
const Blender::Mesh* mesh,
Blender::ConversionData& conv_data,
Blender::TempArray<std::vector,aiMesh>& temp
);
);
// --------------------
aiLight* ConvertLight(const Blender::Scene& in,
const Blender::Object* obj,
const Blender::Lamp* mesh,
aiLight* ConvertLight(const Blender::Scene& in,
const Blender::Object* obj,
const Blender::Lamp* mesh,
Blender::ConversionData& conv_data
);
);
// --------------------
aiCamera* ConvertCamera(const Blender::Scene& in,
const Blender::Object* obj,
const Blender::Camera* mesh,
aiCamera* ConvertCamera(const Blender::Scene& in,
const Blender::Object* obj,
const Blender::Camera* mesh,
Blender::ConversionData& conv_data
);
);
// --------------------
void BuildMaterials(
@ -185,37 +185,37 @@ private:
// --------------------
void ResolveTexture(
aiMaterial* out,
const Blender::Material* mat,
aiMaterial* out,
const Blender::Material* mat,
const Blender::MTex* tex,
Blender::ConversionData& conv_data
);
// --------------------
void ResolveImage(
aiMaterial* out,
const Blender::Material* mat,
const Blender::MTex* tex,
aiMaterial* out,
const Blender::Material* mat,
const Blender::MTex* tex,
const Blender::Image* img,
Blender::ConversionData& conv_data
);
void AddSentinelTexture(
aiMaterial* out,
aiMaterial* out,
const Blender::Material* mat,
const Blender::MTex* tex,
const Blender::MTex* tex,
Blender::ConversionData& conv_data
);
private: // static stuff, mostly logging and error reporting.
// --------------------
static void CheckActualType(const Blender::ElemBase* dt,
static void CheckActualType(const Blender::ElemBase* dt,
const char* check
);
// --------------------
static void NotSupportedObjectType(const Blender::Object* obj,
static void NotSupportedObjectType(const Blender::Object* obj,
const char* type
);

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -105,7 +105,7 @@ struct SharedModifierData : ElemBase
};
// ------------------------------------------------------------------------------------------------
void BlenderModifierShowcase::ApplyModifiers(aiNode& out, ConversionData& conv_data, const Scene& in, const Object& orig_object )
void BlenderModifierShowcase::ApplyModifiers(aiNode& out, ConversionData& conv_data, const Scene& in, const Object& orig_object )
{
size_t cnt = 0u, ful = 0u;
@ -183,9 +183,9 @@ bool BlenderModifier_Mirror :: IsActive (const ModifierData& modin)
}
// ------------------------------------------------------------------------------------------------
void BlenderModifier_Mirror :: DoIt(aiNode& out, ConversionData& conv_data, const ElemBase& orig_modifier,
void BlenderModifier_Mirror :: DoIt(aiNode& out, ConversionData& conv_data, const ElemBase& orig_modifier,
const Scene& /*in*/,
const Object& orig_object )
const Object& orig_object )
{
// hijacking the ABI, see the big note in BlenderModifierShowcase::ApplyModifiers()
const MirrorModifierData& mir = static_cast<const MirrorModifierData&>(orig_modifier);
@ -208,7 +208,7 @@ void BlenderModifier_Mirror :: DoIt(aiNode& out, ConversionData& conv_data, co
const aiVector3D center( mir.mirror_ob->obmat[3][0],mir.mirror_ob->obmat[3][1],mir.mirror_ob->obmat[3][2] );
for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
aiVector3D& v = mesh->mVertices[i];
v.x = center.x + xs*(center.x - v.x);
v.y = center.y + ys*(center.y - v.y);
v.z = center.z + zs*(center.z - v.z);
@ -287,16 +287,16 @@ bool BlenderModifier_Subdivision :: IsActive (const ModifierData& modin)
}
// ------------------------------------------------------------------------------------------------
void BlenderModifier_Subdivision :: DoIt(aiNode& out, ConversionData& conv_data, const ElemBase& orig_modifier,
void BlenderModifier_Subdivision :: DoIt(aiNode& out, ConversionData& conv_data, const ElemBase& orig_modifier,
const Scene& /*in*/,
const Object& orig_object )
const Object& orig_object )
{
// hijacking the ABI, see the big note in BlenderModifierShowcase::ApplyModifiers()
const SubsurfModifierData& mir = static_cast<const SubsurfModifierData&>(orig_modifier);
ai_assert(mir.modifier.type == ModifierData::eModifierType_Subsurf);
Subdivider::Algorithm algo;
switch (mir.subdivType)
switch (mir.subdivType)
{
case SubsurfModifierData::TYPE_CatmullClarke:
algo = Subdivider::CATMULL_CLARKE;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -53,7 +53,7 @@ namespace Assimp {
/** Dummy base class for all blender modifiers. Modifiers are reused between imports, so
* they should be stateless and not try to cache model data. */
// -------------------------------------------------------------------------------------------
class BlenderModifier
class BlenderModifier
{
public:
@ -74,7 +74,7 @@ public:
* was called and gave positive response. */
virtual void DoIt(aiNode& /*out*/,
ConversionData& /*conv_data*/,
const ElemBase& orig_modifier,
const ElemBase& orig_modifier,
const Scene& /*in*/,
const Object& /*orig_object*/
) {
@ -94,9 +94,9 @@ public:
// --------------------
/** Apply all requested modifiers provided we support them. */
void ApplyModifiers(aiNode& out,
ConversionData& conv_data,
const Scene& in,
const Object& orig_object
ConversionData& conv_data,
const Scene& in,
const Object& orig_object
);
private:
@ -121,13 +121,13 @@ public:
// --------------------
virtual bool IsActive( const ModifierData& modin);
// --------------------
virtual void DoIt(aiNode& out,
ConversionData& conv_data,
const ElemBase& orig_modifier,
const Scene& in,
const Object& orig_object
virtual void DoIt(aiNode& out,
ConversionData& conv_data,
const ElemBase& orig_modifier,
const Scene& in,
const Object& orig_object
) ;
};
@ -140,13 +140,13 @@ public:
// --------------------
virtual bool IsActive( const ModifierData& modin);
// --------------------
virtual void DoIt(aiNode& out,
ConversionData& conv_data,
const ElemBase& orig_modifier,
const Scene& in,
const Object& orig_object
virtual void DoIt(aiNode& out,
ConversionData& conv_data,
const ElemBase& orig_modifier,
const Scene& in,
const Object& orig_object
) ;
};

View File

@ -5,8 +5,8 @@ Open Asset Import Library (ASSIMP)
Copyright (c) 2006-2010, 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
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
@ -23,16 +23,16 @@ following conditions are met:
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
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
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
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
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.
----------------------------------------------------------------------
@ -56,7 +56,7 @@ template <> void Structure :: Convert<Object> (
Object& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
ReadField<ErrorPolicy_Fail>((int&)dest.type,"type",db);
@ -84,7 +84,7 @@ template <> void Structure :: Convert<Group> (
Group& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
ReadField<ErrorPolicy_Igno>(dest.layer,"layer",db);
@ -98,7 +98,7 @@ template <> void Structure :: Convert<MTex> (
MTex& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Igno>((short&)dest.mapto,"mapto",db);
ReadField<ErrorPolicy_Igno>((int&)dest.blendtype,"blendtype",db);
@ -137,7 +137,7 @@ template <> void Structure :: Convert<TFace> (
TFace& dest,
const FileDatabase& db
) const
{
{
ReadFieldArray2<ErrorPolicy_Fail>(dest.uv,"uv",db);
ReadFieldArray<ErrorPolicy_Fail>(dest.col,"col",db);
@ -154,7 +154,7 @@ template <> void Structure :: Convert<SubsurfModifierData> (
SubsurfModifierData& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.modifier,"modifier",db);
ReadField<ErrorPolicy_Warn>(dest.subdivType,"subdivType",db);
@ -170,7 +170,7 @@ template <> void Structure :: Convert<MFace> (
MFace& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.v1,"v1",db);
ReadField<ErrorPolicy_Fail>(dest.v2,"v2",db);
@ -187,7 +187,7 @@ template <> void Structure :: Convert<Lamp> (
Lamp& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
ReadField<ErrorPolicy_Fail>((int&)dest.type,"type",db);
@ -215,7 +215,7 @@ template <> void Structure :: Convert<MDeformWeight> (
MDeformWeight& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.def_nr,"def_nr",db);
ReadField<ErrorPolicy_Fail>(dest.weight,"weight",db);
@ -228,7 +228,7 @@ template <> void Structure :: Convert<PackedFile> (
PackedFile& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Warn>(dest.size,"size",db);
ReadField<ErrorPolicy_Warn>(dest.seek,"seek",db);
@ -242,7 +242,7 @@ template <> void Structure :: Convert<Base> (
Base& dest,
const FileDatabase& db
) const
{
{
// note: as per https://github.com/assimp/assimp/issues/128,
// reading the Object linked list recursively is prone to stack overflow.
// This structure converter is therefore an hand-written exception that
@ -252,7 +252,7 @@ template <> void Structure :: Convert<Base> (
std::pair<Base*, int> todo = std::make_pair(&dest, initial_pos);
for ( ;; ) {
Base& cur_dest = *todo.first;
db.reader->SetCurrentPos(todo.second);
@ -262,7 +262,7 @@ template <> void Structure :: Convert<Base> (
ReadFieldPtr<ErrorPolicy_Warn>(cur_dest.object,"*object",db);
// the return value of ReadFieldPtr indicates whether the object
// the return value of ReadFieldPtr indicates whether the object
// was already cached. In this case, we don't need to resolve
// it again.
if(!ReadFieldPtr<ErrorPolicy_Warn>(cur_dest.next,"*next",db, true) && cur_dest.next) {
@ -271,7 +271,7 @@ template <> void Structure :: Convert<Base> (
}
break;
}
db.reader->SetCurrentPos(initial_pos + size);
}
@ -280,7 +280,7 @@ template <> void Structure :: Convert<MTFace> (
MTFace& dest,
const FileDatabase& db
) const
{
{
ReadFieldArray2<ErrorPolicy_Fail>(dest.uv,"uv",db);
ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
@ -296,7 +296,7 @@ template <> void Structure :: Convert<Material> (
Material& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
ReadField<ErrorPolicy_Warn>(dest.r,"r",db);
@ -332,7 +332,7 @@ template <> void Structure :: Convert<MTexPoly> (
MTexPoly& dest,
const FileDatabase& db
) const
{
{
{
boost::shared_ptr<Image> tpage;
@ -353,7 +353,7 @@ template <> void Structure :: Convert<Mesh> (
Mesh& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
ReadField<ErrorPolicy_Fail>(dest.totface,"totface",db);
@ -387,7 +387,7 @@ template <> void Structure :: Convert<MDeformVert> (
MDeformVert& dest,
const FileDatabase& db
) const
{
{
ReadFieldPtr<ErrorPolicy_Warn>(dest.dw,"*dw",db);
ReadField<ErrorPolicy_Igno>(dest.totweight,"totweight",db);
@ -400,7 +400,7 @@ template <> void Structure :: Convert<World> (
World& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
@ -412,7 +412,7 @@ template <> void Structure :: Convert<MLoopCol> (
MLoopCol& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Igno>(dest.r,"r",db);
ReadField<ErrorPolicy_Igno>(dest.g,"g",db);
@ -427,7 +427,7 @@ template <> void Structure :: Convert<MVert> (
MVert& dest,
const FileDatabase& db
) const
{
{
ReadFieldArray<ErrorPolicy_Fail>(dest.co,"co",db);
ReadFieldArray<ErrorPolicy_Fail>(dest.no,"no",db);
@ -443,7 +443,7 @@ template <> void Structure :: Convert<MEdge> (
MEdge& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.v1,"v1",db);
ReadField<ErrorPolicy_Fail>(dest.v2,"v2",db);
@ -459,7 +459,7 @@ template <> void Structure :: Convert<MLoopUV> (
MLoopUV& dest,
const FileDatabase& db
) const
{
{
ReadFieldArray<ErrorPolicy_Igno>(dest.uv,"uv",db);
ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
@ -472,7 +472,7 @@ template <> void Structure :: Convert<GroupObject> (
GroupObject& dest,
const FileDatabase& db
) const
{
{
ReadFieldPtr<ErrorPolicy_Fail>(dest.prev,"*prev",db);
ReadFieldPtr<ErrorPolicy_Fail>(dest.next,"*next",db);
@ -486,7 +486,7 @@ template <> void Structure :: Convert<ListBase> (
ListBase& dest,
const FileDatabase& db
) const
{
{
ReadFieldPtr<ErrorPolicy_Igno>(dest.first,"*first",db);
ReadFieldPtr<ErrorPolicy_Igno>(dest.last,"*last",db);
@ -499,7 +499,7 @@ template <> void Structure :: Convert<MLoop> (
MLoop& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Igno>(dest.v,"v",db);
ReadField<ErrorPolicy_Igno>(dest.e,"e",db);
@ -512,7 +512,7 @@ template <> void Structure :: Convert<ModifierData> (
ModifierData& dest,
const FileDatabase& db
) const
{
{
ReadFieldPtr<ErrorPolicy_Warn>(dest.next,"*next",db);
ReadFieldPtr<ErrorPolicy_Warn>(dest.prev,"*prev",db);
@ -528,7 +528,7 @@ template <> void Structure :: Convert<ID> (
ID& dest,
const FileDatabase& db
) const
{
{
ReadFieldArray<ErrorPolicy_Warn>(dest.name,"name",db);
ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
@ -541,7 +541,7 @@ template <> void Structure :: Convert<MCol> (
MCol& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.r,"r",db);
ReadField<ErrorPolicy_Fail>(dest.g,"g",db);
@ -556,7 +556,7 @@ template <> void Structure :: Convert<MPoly> (
MPoly& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Igno>(dest.loopstart,"loopstart",db);
ReadField<ErrorPolicy_Igno>(dest.totloop,"totloop",db);
@ -571,7 +571,7 @@ template <> void Structure :: Convert<Scene> (
Scene& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
ReadFieldPtr<ErrorPolicy_Warn>(dest.camera,"*camera",db);
@ -587,7 +587,7 @@ template <> void Structure :: Convert<Library> (
Library& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
ReadFieldArray<ErrorPolicy_Warn>(dest.name,"name",db);
@ -602,7 +602,7 @@ template <> void Structure :: Convert<Tex> (
Tex& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Igno>((short&)dest.imaflag,"imaflag",db);
ReadField<ErrorPolicy_Fail>((int&)dest.type,"type",db);
ReadFieldPtr<ErrorPolicy_Warn>(dest.ima,"*ima",db);
@ -615,7 +615,7 @@ template <> void Structure :: Convert<Camera> (
Camera& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
ReadField<ErrorPolicy_Warn>((int&)dest.type,"type",db);
@ -630,7 +630,7 @@ template <> void Structure :: Convert<MirrorModifierData> (
MirrorModifierData& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.modifier,"modifier",db);
ReadField<ErrorPolicy_Igno>(dest.axis,"axis",db);
@ -646,7 +646,7 @@ template <> void Structure :: Convert<Image> (
Image& dest,
const FileDatabase& db
) const
{
{
ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
ReadFieldArray<ErrorPolicy_Warn>(dest.name,"name",db);

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -58,13 +58,13 @@ namespace Assimp {
// this file serves as input data to the `./scripts/genblenddna.py`
// script. This script generates the actual binding code to read a
// blender file with a possibly different DNA into our structures.
// Only `struct` declarations are considered and the following
// Only `struct` declarations are considered and the following
// rules must be obeyed in order for the script to work properly:
//
// * C++ style comments only
//
// * Structures may include the primitive types char, int, short,
// float, double. Signedness specifiers are not allowed on
// float, double. Signedness specifiers are not allowed on
// integers. Enum types are allowed, but they must have been
// defined in this header.
//
@ -103,13 +103,13 @@ struct Image;
// -------------------------------------------------------------------------------
struct ID : ElemBase {
char name[24] WARN;
char name[24] WARN;
short flag;
};
// -------------------------------------------------------------------------------
struct ListBase : ElemBase {
boost::shared_ptr<ElemBase> first;
boost::shared_ptr<ElemBase> last;
};
@ -124,7 +124,7 @@ struct PackedFile : ElemBase {
// -------------------------------------------------------------------------------
struct GroupObject : ElemBase {
boost::shared_ptr<GroupObject> prev,next FAIL;
boost::shared_ptr<Object> ob;
};
@ -140,7 +140,7 @@ struct Group : ElemBase {
// -------------------------------------------------------------------------------
struct World : ElemBase {
ID id FAIL;
};
// -------------------------------------------------------------------------------
@ -297,7 +297,7 @@ struct Mesh : ElemBase {
// -------------------------------------------------------------------------------
struct Library : ElemBase {
ID id FAIL;
char name[240] WARN;
char filename[240] FAIL;
boost::shared_ptr<Library> parent WARN;
@ -312,7 +312,7 @@ struct Camera : ElemBase {
ID id FAIL;
// struct AnimData *adt;
// struct AnimData *adt;
Type type,flag WARN;
float angle WARN;
@ -348,29 +348,29 @@ struct Lamp : ElemBase {
};
ID id FAIL;
//AnimData *adt;
//AnimData *adt;
Type type FAIL;
short flags;
//int mode;
short colormodel, totex;
float r,g,b,k WARN;
//float shdwr, shdwg, shdwb;
float energy, dist, spotsize, spotblend;
//float haint;
float att1, att2;
float att1, att2;
//struct CurveMapping *curfalloff;
FalloffType falloff_type;
//float clipsta, clipend, shadspotsize;
//float bias, soft, compressthresh;
//short bufsize, samp, buffers, filtertype;
//char bufflag, buftype;
//short ray_samp, ray_sampy, ray_sampz;
//short ray_samp_type;
//short area_shape;
@ -402,11 +402,11 @@ struct Lamp : ElemBase {
// float YF_glowint, YF_glowofs;
// short YF_glowtype, YF_pad2;
//struct Ipo *ipo;
//struct MTex *mtex[18];
//struct Ipo *ipo;
//struct MTex *mtex[18];
// short pr_texture;
//struct PreviewImage *preview;
};
@ -459,7 +459,7 @@ struct ModifierData : ElemBase {
struct SubsurfModifierData : ElemBase {
enum Type {
TYPE_CatmullClarke = 0x0,
TYPE_Simple = 0x1
};
@ -519,7 +519,7 @@ struct Object : ElemBase {
float obmat[4][4] WARN;
float parentinv[4][4] WARN;
char parsubstr[32] WARN;
Object* parent WARN;
boost::shared_ptr<Object> track WARN;
@ -554,7 +554,7 @@ struct Scene : ElemBase {
struct Image : ElemBase {
ID id FAIL;
char name[240] WARN;
char name[240] WARN;
//struct anim *anim;
@ -565,8 +565,8 @@ struct Image : ElemBase {
short tpageflag, totbind;
short xrep, yrep;
short twsta, twend;
//unsigned int bindcode;
//unsigned int *repbind;
//unsigned int bindcode;
//unsigned int *repbind;
boost::shared_ptr<PackedFile> packedfile;
//struct PreviewImage * preview;
@ -575,7 +575,7 @@ struct Image : ElemBase {
int lastused;
short animspeed;
short gen_x, gen_y, gen_type;
short gen_x, gen_y, gen_type;
};
// -------------------------------------------------------------------------------
@ -613,7 +613,7 @@ struct Tex : ElemBase {
};
ID id FAIL;
// AnimData *adt;
// AnimData *adt;
//float noisesize, turbul;
//float bright, contrast, rfac, gfac, bfac;
@ -639,7 +639,7 @@ struct Tex : ElemBase {
//float cropxmin, cropymin, cropxmax, cropymax;
//int texfilter;
//int afmax;
//int afmax;
//short xrepeat, yrepeat;
//short extend;
@ -653,7 +653,7 @@ struct Tex : ElemBase {
//ImageUser iuser;
//bNodeTree *nodetree;
//Ipo *ipo;
//Ipo *ipo;
boost::shared_ptr<Image> ima WARN;
//PluginTex *plugin;
//ColorBand *coba;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (ASSIMP)
Copyright (c) 2006-2010, 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
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
@ -23,16 +23,16 @@ following conditions are met:
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
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
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
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
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.
----------------------------------------------------------------------

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2013, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -465,7 +465,7 @@ aiVector3D BlenderTessellatorP2T::GetEigenVectorFromLargestEigenValue( const aiM
lastV = v;
}
return v;
}
}
// ------------------------------------------------------------------------------------------------
// Adapted from: http://missingbytes.blogspot.co.uk/2012/06/fitting-plane-to-point-cloud.html

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2013, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Use these to toggle between GLU Tessellate or poly2tri
// Note (acg) keep GLU Tesselate disabled by default - if it is turned on,
// assimp needs to be linked against GLU, which is currently not yet
// assimp needs to be linked against GLU, which is currently not yet
// made configurable in CMake and potentially not wanted by most users
// as it requires a Gl environment.
#ifndef ASSIMP_BLEND_WITH_GLU_TESSELLATE

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -97,17 +97,17 @@ public:
// -------------------------------------------------------------------
virtual size_t Read( void *,
size_t,
size_t )
virtual size_t Read( void *,
size_t,
size_t )
{
return 0;
}
// -------------------------------------------------------------------
virtual size_t Write(const void* pvBuffer,
virtual size_t Write(const void* pvBuffer,
size_t pSize,
size_t pCount)
size_t pCount)
{
pSize *= pCount;
if (cursor + pSize > cur_size) {
@ -118,14 +118,14 @@ public:
cursor += pSize;
file_size = std::max(file_size,cursor);
return pCount;
return pCount;
}
// -------------------------------------------------------------------
virtual aiReturn Seek(size_t pOffset,
aiOrigin pOrigin)
{
switch(pOrigin)
switch(pOrigin)
{
case aiOrigin_CUR:
cursor += pOffset;
@ -164,7 +164,7 @@ public:
}
// -------------------------------------------------------------------
virtual void Flush()
virtual void Flush()
{
// ignore
}
@ -174,12 +174,12 @@ public:
private:
// -------------------------------------------------------------------
void Grow(size_t need = 0)
void Grow(size_t need = 0)
{
// 1.5 and phi are very heap-friendly growth factors (the first
// allows for frequent re-use of heap blocks, the second
// forms a fibonacci sequence with similar characteristics -
// since this heavily depends on the heap implementation
// since this heavily depends on the heap implementation
// and other factors as well, i'll just go with 1.5 since
// it is quicker to compute).
size_t new_size = std::max(initial, std::max( need, cur_size+(cur_size>>1) ));
@ -232,7 +232,7 @@ public:
public:
// -------------------------------------------------------------------
const char* GetMagicFileName() const
const char* GetMagicFileName() const
{
return AI_BLOBIO_MAGIC;
}
@ -302,7 +302,7 @@ public:
}
// -------------------------------------------------------------------
virtual void Close( IOStream* pFile)
virtual void Close( IOStream* pFile)
{
delete pFile;
}
@ -310,10 +310,10 @@ public:
private:
// -------------------------------------------------------------------
void OnDestruct(const std::string& filename, BlobIOStream* child)
{
void OnDestruct(const std::string& filename, BlobIOStream* child)
{
// we don't know in which the files are closed, so we
// can't reliably say that the first must be the master
// can't reliably say that the first must be the master
// file ...
blobs.push_back( BlobEntry(filename,child->GetBlob()) );
}
@ -325,13 +325,13 @@ private:
// --------------------------------------------------------------------------------------------
BlobIOStream :: ~BlobIOStream()
BlobIOStream :: ~BlobIOStream()
{
creator->OnDestruct(file,this);
delete[] buffer;
}
} // end Assimp
#endif

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -44,11 +44,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ASSIMP_BUILD_NO_C4D_IMPORTER
// no #ifdefing here, Cinema4D support is carried out in a branch of assimp
// where it is turned on in the CMake settings.
// where it is turned on in the CMake settings.
#ifndef _MSC_VER
# error C4D support is currently MSVC only
#endif
#endif
#include "C4DImporter.h"
#include "TinyFormatter.h"
@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# define __C4D_64BIT
#endif
#define __PC
#define __PC
#include "c4d_file.h"
#include "default_alien_overloads.h"
@ -66,7 +66,7 @@ using namespace _melange_;
// overload this function and fill in your own unique data
void GetWriterInfo(LONG &id, String &appname)
{
id = 2424226;
id = 2424226;
appname = "Open Asset Import Library";
}
@ -127,8 +127,8 @@ void C4DImporter::SetupProperties(const Importer* /*pImp*/)
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void C4DImporter::InternReadFile( const std::string& pFile,
// Imports the given file into the given scene structure.
void C4DImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
@ -141,7 +141,7 @@ void C4DImporter::InternReadFile( const std::string& pFile,
std::vector<uint8_t> mBuffer(file_size);
file->Read(&mBuffer[0], 1, file_size);
Filename f;
f.SetMemoryReadMode(&mBuffer[0], file_size);
@ -197,7 +197,7 @@ void C4DImporter::InternReadFile( const std::string& pFile,
// ------------------------------------------------------------------------------------------------
bool C4DImporter::ReadShader(aiMaterial* out, _melange_::BaseShader* shader)
bool C4DImporter::ReadShader(aiMaterial* out, _melange_::BaseShader* shader)
{
// based on Melange sample code (C4DImportExport.cpp)
while(shader) {
@ -220,13 +220,13 @@ bool C4DImporter::ReadShader(aiMaterial* out, _melange_::BaseShader* shader)
{
if (lsl->GetType() == TypeFolder)
{
BlendFolder* const folder = dynamic_cast<BlendFolder*>(lsl);
BlendFolder* const folder = dynamic_cast<BlendFolder*>(lsl);
LayerShaderLayer *subLsl = dynamic_cast<LayerShaderLayer*>(folder->m_Children.GetObject(0));
while (subLsl)
{
if (subLsl->GetType() == TypeShader) {
BlendShader* const shader = dynamic_cast<BlendShader*>(subLsl);
BlendShader* const shader = dynamic_cast<BlendShader*>(subLsl);
if(ReadShader(out, static_cast<BaseShader*>(shader->m_pLink->GetLink()))) {
return true;
}
@ -236,13 +236,13 @@ bool C4DImporter::ReadShader(aiMaterial* out, _melange_::BaseShader* shader)
}
}
else if (lsl->GetType() == TypeShader) {
BlendShader* const shader = dynamic_cast<BlendShader*>(lsl);
BlendShader* const shader = dynamic_cast<BlendShader*>(lsl);
if(ReadShader(out, static_cast<BaseShader*>(shader->m_pLink->GetLink()))) {
return true;
}
}
lsl = lsl->GetNext();
lsl = lsl->GetNext();
}
}
else if ( shader->GetType() == Xbitmap )
@ -322,8 +322,8 @@ void C4DImporter::RecurseHierarchy(BaseObject* object, aiNode* parent)
while (object)
{
const String& name = object->GetName();
const LONG type = object->GetType();
const Matrix& ml = object->GetMl();
const LONG type = object->GetType();
const Matrix& ml = object->GetMl();
aiString string;
name.GetCString(string.data, MAXLEN-1);
@ -350,8 +350,8 @@ void C4DImporter::RecurseHierarchy(BaseObject* object, aiNode* parent)
nd->mTransformation.c4 = ml.off.z;
nodes.push_back(nd);
GeData data;
GeData data;
if (type == Ocamera)
{
object->GetParameter(CAMERAOBJECT_FOV, data);
@ -374,7 +374,7 @@ void C4DImporter::RecurseHierarchy(BaseObject* object, aiNode* parent)
else {
LogWarn("ignoring object: " + std::string(GetObjectTypeName(type)));
}
RecurseHierarchy(object->GetDown(), nd);
object = object->GetNext();
}
@ -421,7 +421,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object)
for (LONG i = 0; i < polyCount; i++)
{
vcount += 3;
// TODO: do we also need to handle lines or points with similar checks?
if (polys[i].c != polys[i].d)
{
@ -538,7 +538,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object)
// copy tangents and bitangents
if (tangents_src) {
for(unsigned int k = 0; k < face->mNumIndices; ++k) {
LONG l;
switch(k) {

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -98,7 +98,7 @@ protected:
void SetupProperties(const Importer* pImp);
// --------------------
void InternReadFile( const std::string& pFile, aiScene* pScene,
void InternReadFile( const std::string& pFile, aiScene* pScene,
IOSystem* pIOHandler);
private:

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../include/assimp/IOSystem.hpp"
namespace Assimp {
// ------------------------------------------------------------------------------------------------
// Custom IOStream implementation for the C-API
class CIOStreamWrapper : public IOStream
@ -62,8 +62,8 @@ public:
{}
// ...................................................................
size_t Read(void* pvBuffer,
size_t pSize,
size_t Read(void* pvBuffer,
size_t pSize,
size_t pCount
){
// need to typecast here as C has no void*
@ -71,7 +71,7 @@ public:
}
// ...................................................................
size_t Write(const void* pvBuffer,
size_t Write(const void* pvBuffer,
size_t pSize,
size_t pCount
){
@ -116,7 +116,7 @@ public:
// ...................................................................
bool Exists( const char* pFile) const {
aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,"rb");
aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,"rb");
if (p){
mFileSystem->CloseProc(mFileSystem,p);
return true;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -76,7 +76,7 @@ static const float units[] = {
1.f/0.3048f,
1.f/0.9144f,
1.f/1609.344f
};
};
static const aiImporterDesc desc = {
"TrueSpace Object Importer",
@ -98,12 +98,12 @@ COBImporter::COBImporter()
{}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
// Destructor, private as well
COBImporter::~COBImporter()
{}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Returns whether the class can handle the format of the given file.
bool COBImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
{
const std::string& extension = GetExtension(pFile);
@ -139,8 +139,8 @@ void COBImporter::SetupProperties(const Importer* /*pImp*/)
}
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void COBImporter::InternReadFile( const std::string& pFile,
// Imports the given file into the given scene structure.
void COBImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
COB::Scene scene;
@ -157,7 +157,7 @@ void COBImporter::InternReadFile( const std::string& pFile,
if (head[16]!='L') {
ThrowException("File is big-endian, which is not supported");
}
// load data into intermediate structures
if (head[15]=='A') {
ReadAsciiFile(scene, stream.get());
@ -176,7 +176,7 @@ void COBImporter::InternReadFile( const std::string& pFile,
for_each(Face& f,mesh.faces) {
mesh.temp_map[f.material].push_back(&f);
}
}
}
}
// count meshes
@ -186,7 +186,7 @@ void COBImporter::InternReadFile( const std::string& pFile,
if (mesh.vertex_positions.size() && mesh.texture_coords.size()) {
pScene->mNumMeshes += mesh.temp_map.size();
}
}
}
}
pScene->mMeshes = new aiMesh*[pScene->mNumMeshes]();
pScene->mMaterials = new aiMaterial*[pScene->mNumMeshes]();
@ -282,8 +282,8 @@ aiNode* COBImporter::BuildNodes(const Node& root,const Scene& scin,aiScene* fill
if (v.uv_idx >= ndmesh.texture_coords.size()) {
ThrowException("UV index out of range");
}
outmesh->mVertices[outmesh->mNumVertices] = ndmesh.vertex_positions[ v.pos_idx ];
outmesh->mTextureCoords[0][outmesh->mNumVertices] = aiVector3D(
outmesh->mVertices[outmesh->mNumVertices] = ndmesh.vertex_positions[ v.pos_idx ];
outmesh->mTextureCoords[0][outmesh->mNumVertices] = aiVector3D(
ndmesh.texture_coords[ v.uv_idx ].x,
ndmesh.texture_coords[ v.uv_idx ].y,
0.f
@ -320,7 +320,7 @@ aiNode* COBImporter::BuildNodes(const Node& root,const Scene& scin,aiScene* fill
}
{ int shader;
switch(min->shader)
switch(min->shader)
{
case Material::FLAT:
shader = aiShadingMode_Gouraud;
@ -369,7 +369,7 @@ aiNode* COBImporter::BuildNodes(const Node& root,const Scene& scin,aiScene* fill
else if (Node::TYPE_LIGHT == root.type) {
const Light& ndlight = (const Light&)(root);
aiLight* outlight = fill->mLights[fill->mNumLights++] = new aiLight();
outlight->mName.Set(ndlight.name);
outlight->mColorDiffuse = outlight->mColorAmbient = outlight->mColorSpecular = ndlight.color;
@ -479,7 +479,7 @@ void COBImporter::UnsupportedChunk_Ascii(LineSplitter& splitter, const ChunkInfo
// (HACK) - our current position in the stream is the beginning of the
// head line of the next chunk. That's fine, but the caller is going
// to call ++ on `splitter`, which we need to swallow to avoid
// to call ++ on `splitter`, which we need to swallow to avoid
// missing the next line.
splitter.get_stream().IncPtr(nfo.size);
splitter.swallow_next_increment();
@ -554,14 +554,14 @@ void COBImporter::ReadBasicNodeInfo_Ascii(Node& msh, LineSplitter& splitter, con
// ------------------------------------------------------------------------------------------------
template <typename T>
void COBImporter::ReadFloat3Tuple_Ascii(T& fill, const char** in)
void COBImporter::ReadFloat3Tuple_Ascii(T& fill, const char** in)
{
const char* rgb = *in;
for(unsigned int i = 0; i < 3; ++i) {
SkipSpaces(&rgb);
if (*rgb == ',')++rgb;
SkipSpaces(&rgb);
fill[i] = fast_atof(&rgb);
}
*in = rgb;
@ -650,7 +650,7 @@ void COBImporter::ReadUnit_Ascii(Scene& out, LineSplitter& splitter, const Chunk
for_each(boost::shared_ptr< Node >& nd, out.nodes) {
if (nd->id == nfo.parent_id) {
const unsigned int t=strtoul10(splitter[1]);
nd->unit_scale = t>=sizeof(units)/sizeof(units[0])?(
LogWarn_Ascii(splitter,format()<<t<<" is not a valid value for `Units` attribute in `Unit chunk` "<<nfo.id)
,1.f):units[t];
@ -696,7 +696,7 @@ void COBImporter::ReadLght_Ascii(Scene& out, LineSplitter& splitter, const Chunk
"Unknown kind of light source in `Lght` chunk "<<nfo.id<<" : "<<*splitter);
msh.ltype = Light::SPOT;
}
++splitter;
if (!splitter.match_start("color ")) {
LogWarn_Ascii(splitter,format()<<
@ -797,7 +797,7 @@ void COBImporter::ReadPolH_Ascii(Scene& out, LineSplitter& splitter, const Chunk
for(unsigned int cur = 0;cur < cnt && ++splitter;++cur) {
const char* s = splitter->c_str();
aiVector3D& v = msh.vertex_positions[cur];
aiVector3D& v = msh.vertex_positions[cur];
SkipSpaces(&s);
v.x = fast_atof(&s);
@ -814,7 +814,7 @@ void COBImporter::ReadPolH_Ascii(Scene& out, LineSplitter& splitter, const Chunk
for(unsigned int cur = 0;cur < cnt && ++splitter;++cur) {
const char* s = splitter->c_str();
aiVector2D& v = msh.texture_coords[cur];
aiVector2D& v = msh.texture_coords[cur];
SkipSpaces(&s);
v.x = fast_atof(&s);
@ -881,8 +881,8 @@ void COBImporter::ReadBitM_Ascii(Scene& /*out*/, LineSplitter& splitter, const C
/*
"\nThumbNailHdrSize %ld"
"\nThumbHeader: %02hx 02hx %02hx "
"\nColorBufSize %ld"
"\nColorBufZipSize %ld"
"\nColorBufSize %ld"
"\nColorBufZipSize %ld"
"\nZippedThumbnail: %02hx 02hx %02hx "
*/
@ -1068,7 +1068,7 @@ void COBImporter::ReadPolH_Binary(COB::Scene& out, StreamReaderLE& reader, const
// with holes. Test data specific to COB is needed to confirm it.
if (msh.faces.empty()) {
ThrowException(format("A hole is the first entity in the `PolH` chunk with id ") << nfo.id);
}
}
}
else msh.faces.push_back(Face());
Face& f = msh.faces.back();
@ -1094,7 +1094,7 @@ void COBImporter::ReadPolH_Binary(COB::Scene& out, StreamReaderLE& reader, const
}
}
if (nfo.version>4) {
msh.draw_flags = reader.GetI4();
msh.draw_flags = reader.GetI4();
}
nfo.version>5 && nfo.version<8 ? reader.GetI4() : 0;
}

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -51,7 +51,7 @@ struct aiNode;
namespace Assimp {
class LineSplitter;
// TinyFormatter.h
namespace Formatter {
template <typename T,typename TR, typename A> class basic_formatter;
@ -66,7 +66,7 @@ namespace Assimp {
}
// -------------------------------------------------------------------------------------------
/** Importer class to load TrueSpace files (cob,scn) up to v6.
/** Importer class to load TrueSpace files (cob,scn) up to v6.
*
* Currently relatively limited, loads only ASCII files and needs more test coverage. */
// -------------------------------------------------------------------------------------------
@ -92,7 +92,7 @@ protected:
void SetupProperties(const Importer* pImp);
// --------------------
void InternReadFile( const std::string& pFile, aiScene* pScene,
void InternReadFile( const std::string& pFile, aiScene* pScene,
IOSystem* pIOHandler);
private:

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -137,9 +137,9 @@ struct Mesh : public Node
HIDE = 0x10
};
Mesh()
Mesh()
: Node(TYPE_MESH)
, draw_flags(SOLID)
, draw_flags(SOLID)
{}
// vertex elements
@ -232,7 +232,7 @@ struct Material : ChunkInfo
float alpha, exp, ior,ka,ks;
unsigned int matnum;
Shader shader;
Shader shader;
AutoFacet autofacet;
float autofacet_angle;
@ -245,7 +245,7 @@ struct Material : ChunkInfo
struct Bitmap : ChunkInfo
{
Bitmap() : orig_size() {}
struct BitmapHeader
struct BitmapHeader
{
};

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -71,7 +71,7 @@ static const aiImporterDesc desc = {
0,
0,
0,
"csm"
"csm"
};
@ -82,17 +82,17 @@ CSMImporter::CSMImporter()
{}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
// Destructor, private as well
CSMImporter::~CSMImporter()
{}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Returns whether the class can handle the format of the given file.
bool CSMImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
{
// check file extension
// check file extension
const std::string extension = GetExtension(pFile);
if( extension == "csm")
return true;
@ -118,8 +118,8 @@ void CSMImporter::SetupProperties(const Importer* pImp)
}
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void CSMImporter::InternReadFile( const std::string& pFile,
// Imports the given file into the given scene structure.
void CSMImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
@ -281,7 +281,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
pScene->mRootNode->mChildren = new aiNode* [anim->mNumChannels];
for (unsigned int i = 0; i < anim->mNumChannels;++i) {
aiNodeAnim* na = anim->mChannels[i];
aiNodeAnim* na = anim->mChannels[i];
aiNode* nd = pScene->mRootNode->mChildren[i] = new aiNode();
nd->mName = anim->mChannels[i]->mNodeName;
@ -297,7 +297,7 @@ void CSMImporter::InternReadFile( const std::string& pFile,
// mark the scene as incomplete and run SkeletonMeshBuilder on it
pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
if (!noSkeletonMesh) {
SkeletonMeshBuilder maker(pScene,pScene->mRootNode,true);
}

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -66,7 +66,7 @@ public:
public:
// -------------------------------------------------------------------
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
bool checkSig) const;
protected:
@ -78,7 +78,7 @@ protected:
void SetupProperties(const Importer* pImp);
// -------------------------------------------------------------------
void InternReadFile( const std::string& pFile, aiScene* pScene,
void InternReadFile( const std::string& pFile, aiScene* pScene,
IOSystem* pIOHandler);
private:

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,21 +25,21 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 Implementation of the post processing step to calculate
/** @file Implementation of the post processing step to calculate
* tangents and bitangents for all imported meshes
*/
@ -112,7 +112,7 @@ void CalcTangentsProcess::Execute( aiScene* pScene)
bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
{
// we assume that the mesh is still in the verbose vertex format where each face has its own set
// of vertices and no vertices are shared between faces. Sadly I don't know any quick test to
// of vertices and no vertices are shared between faces. Sadly I don't know any quick test to
// assert() it here.
// assert( must be verbose, dammit);
@ -139,7 +139,7 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
DefaultLogger::get()->error((Formatter::format("Failed to compute tangents; need UV data in channel"),configSourceUV));
return false;
}
const float angleEpsilon = 0.9999f;
std::vector<bool> vertexDone( pMesh->mNumVertices, false);
@ -154,7 +154,7 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
const aiVector3D* meshTex = pMesh->mTextureCoords[configSourceUV];
aiVector3D* meshTang = pMesh->mTangents;
aiVector3D* meshBitang = pMesh->mBitangents;
// calculate the tangent and bitangent for every face
for( unsigned int a = 0; a < pMesh->mNumFaces; a++)
{
@ -220,7 +220,7 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
localTangent = meshNorm[p] ^ localBitangent;
localTangent.Normalize();
} else {
localBitangent = localTangent ^ meshNorm[p];
localBitangent = localTangent ^ meshNorm[p];
localBitangent.Normalize();
}
}
@ -256,10 +256,10 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
}
std::vector<unsigned int> verticesFound;
const float fLimit = cosf(configMaxAngle);
const float fLimit = cosf(configMaxAngle);
std::vector<unsigned int> closeVertices;
// in the second pass we now smooth out all tangents and bitangents at the same local position
// in the second pass we now smooth out all tangents and bitangents at the same local position
// if they are not too far off.
for( unsigned int a = 0; a < pMesh->mNumVertices; a++)
{

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,23 +23,23 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 a post processing step to calculate tangents and
/** @file Defines a post processing step to calculate tangents and
bitangents on all imported meshes.*/
#ifndef AI_CALCTANGENTSPROCESS_H_INC
#define AI_CALCTANGENTSPROCESS_H_INC
@ -54,7 +54,7 @@ namespace Assimp
// ---------------------------------------------------------------------------
/** The CalcTangentsProcess calculates the tangent and bitangent for any vertex
* of all meshes. It is expected to be run before the JoinVerticesProcess runs
* because the joining of vertices also considers tangents and bitangents for
* because the joining of vertices also considers tangents and bitangents for
* uniqueness.
*/
class ASSIMP_API_WINONLY CalcTangentsProcess : public BaseProcess

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -71,7 +71,7 @@ void ExportSceneCollada(const char* pFile, IOSystem* pIOSystem, const aiScene* p
std::string path = DefaultIOSystem::absolutePath(std::string(pFile));
std::string file = DefaultIOSystem::completeBaseName(std::string(pFile));
// invoke the exporter
// invoke the exporter
ColladaExporter iDoTheExportThing( pScene, pIOSystem, path, file);
// we're still here - export successfully completed. Write result to the given IOSYstem
@ -99,7 +99,7 @@ ColladaExporter::ColladaExporter( const aiScene* pScene, IOSystem* pIOSystem, co
mSceneOwned = false;
// set up strings
endstr = "\n";
endstr = "\n";
// start writing
WriteFile();
@ -134,7 +134,7 @@ void ColladaExporter::WriteFile()
WriteSceneLibrary();
// useless Collada fu at the end, just in case we haven't had enough indirections, yet.
// useless Collada fu at the end, just in case we haven't had enough indirections, yet.
mOutput << startstr << "<scene>" << endstr;
PushTag();
mOutput << startstr << "<instance_visual_scene url=\"#" + XMLEscape(mScene->mRootNode->mName.C_Str()) + "\" />" << endstr;
@ -149,7 +149,7 @@ void ColladaExporter::WriteFile()
void ColladaExporter::WriteHeader()
{
static const float epsilon = 0.00001f;
static const aiQuaternion x_rot(aiMatrix3x3(
static const aiQuaternion x_rot(aiMatrix3x3(
0, -1, 0,
1, 0, 0,
0, 0, 1));
@ -228,19 +228,19 @@ void ColladaExporter::WriteHeader()
aiMetadata* meta = mScene->mRootNode->mMetaData;
aiString value;
if (!meta || !meta->Get("Author", value))
if (!meta || !meta->Get("Author", value))
mOutput << startstr << "<author>" << "Assimp" << "</author>" << endstr;
else
else
mOutput << startstr << "<author>" << XMLEscape(value.C_Str()) << "</author>" << endstr;
if (!meta || !meta->Get("AuthoringTool", value))
mOutput << startstr << "<authoring_tool>" << "Assimp Exporter" << "</authoring_tool>" << endstr;
else
else
mOutput << startstr << "<authoring_tool>" << XMLEscape(value.C_Str()) << "</authoring_tool>" << endstr;
//mOutput << startstr << "<author>" << mScene->author.C_Str() << "</author>" << endstr;
//mOutput << startstr << "<authoring_tool>" << mScene->authoringTool.C_Str() << "</authoring_tool>" << endstr;
PopTag();
mOutput << startstr << "</contributor>" << endstr;
mOutput << startstr << "<created>" << date_str << "</created>" << endstr;
@ -533,9 +533,9 @@ void ColladaExporter::WriteImageEntry( const Surface& pSurface, const std::strin
if( !pSurface.texture.empty() )
{
mOutput << startstr << "<image id=\"" << XMLEscape(pNameAdd) << "\">" << endstr;
PushTag();
PushTag();
mOutput << startstr << "<init_from>";
// URL encode image file name first, then XML encode on top
std::stringstream imageUrlEncoded;
for( std::string::const_iterator it = pSurface.texture.begin(); it != pSurface.texture.end(); ++it )
@ -676,10 +676,10 @@ void ColladaExporter::WriteMaterials()
// output textures if present
if( numTextures > 0 )
{
mOutput << startstr << "<library_images>" << endstr;
mOutput << startstr << "<library_images>" << endstr;
PushTag();
for( std::vector<Material>::const_iterator it = materials.begin(); it != materials.end(); ++it )
{
{
const Material& mat = *it;
WriteImageEntry( mat.ambient, mat.name + "-ambient-image");
WriteImageEntry( mat.diffuse, mat.name + "-diffuse-image");
@ -835,7 +835,7 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
if( mesh->HasVertexColors( a) )
mOutput << startstr << "<input semantic=\"COLOR\" source=\"#" << idstrEscaped << "-color" << a << "\" " /*<< set=\"" << a << "\"" */ << " />" << endstr;
}
PopTag();
mOutput << startstr << "</vertices>" << endstr;
@ -871,11 +871,11 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
// polygons
if (countPoly)
{
{
mOutput << startstr << "<polylist count=\"" << countPoly << "\" material=\"defaultMaterial\">" << endstr;
PushTag();
mOutput << startstr << "<input offset=\"0\" semantic=\"VERTEX\" source=\"#" << idstrEscaped << "-vertices\" />" << endstr;
mOutput << startstr << "<vcount>";
for( size_t a = 0; a < mesh->mNumFaces; ++a )
{
@ -883,7 +883,7 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
mOutput << mesh->mFaces[a].mNumIndices << " ";
}
mOutput << "</vcount>" << endstr;
mOutput << startstr << "<p>";
for( size_t a = 0; a < mesh->mNumFaces; ++a )
{
@ -935,7 +935,7 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy
mOutput << pData[a*3+0] << " ";
mOutput << pData[a*3+1] << " ";
}
}
}
else if( pType == FloatType_Color )
{
for( size_t a = 0; a < pElementCount; ++a )
@ -950,7 +950,7 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy
for( size_t a = 0; a < pElementCount * floatsPerElement; ++a )
mOutput << pData[a] << " ";
}
mOutput << "</float_array>" << endstr;
mOutput << "</float_array>" << endstr;
PopTag();
// the usual Collada fun. Let's bloat it even more!
@ -1020,7 +1020,7 @@ void ColladaExporter::WriteNode(aiNode* pNode)
{
// the must have a name
if (pNode->mName.length == 0)
{
{
std::stringstream ss;
ss << "Node_" << pNode;
pNode->mName.Set(ss.str());

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
struct aiScene;
struct aiNode;
namespace Assimp
namespace Assimp
{
/// Helper class to export a given scene to a Collada file. Just for my personal
@ -149,12 +149,12 @@ protected:
std::string endstr;
// pair of color and texture - texture precedences color
struct Surface
{
struct Surface
{
bool exist;
aiColor4D color;
std::string texture;
size_t channel;
aiColor4D color;
std::string texture;
size_t channel;
Surface() { exist = false; channel = 0; }
};
@ -168,7 +168,7 @@ protected:
{}
};
// summarize a material in an convinient way.
// summarize a material in an convinient way.
struct Material
{
std::string name;

View File

@ -7,8 +7,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -25,16 +25,16 @@ contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -94,7 +94,7 @@ struct Transform
{
std::string mID; ///< SID of the transform step, by which anim channels address their target node
TransformType mType;
float f[16]; ///< Interpretation of data depends on the type of the transformation
float f[16]; ///< Interpretation of data depends on the type of the transformation
};
/** A collada camera. */
@ -132,7 +132,7 @@ struct Camera
/** A collada light source. */
struct Light
{
{
Light()
: mType (aiLightSource_UNDEFINED)
, mAttConstant (1.f)
@ -245,13 +245,13 @@ struct Node
std::vector<Transform> mTransforms;
/** Meshes at this node */
std::vector<MeshInstance> mMeshes;
std::vector<MeshInstance> mMeshes;
/** Lights at this node */
std::vector<LightInstance> mLights;
std::vector<LightInstance> mLights;
/** Cameras at this node */
std::vector<CameraInstance> mCameras;
std::vector<CameraInstance> mCameras;
/** Node instances at this node */
std::vector<NodeInstance> mNodeInstances;
@ -260,14 +260,14 @@ struct Node
std::string mPrimaryCamera;
//! Constructor. Begin with a zero parent
Node() {
Node() {
mParent = NULL;
}
//! Destructor: delete all children subsequently
~Node() {
for( std::vector<Node*>::iterator it = mChildren.begin(); it != mChildren.end(); ++it)
delete *it;
~Node() {
for( std::vector<Node*>::iterator it = mChildren.begin(); it != mChildren.end(); ++it)
delete *it;
}
};
@ -286,15 +286,15 @@ struct Accessor
size_t mSize; // size of an object, in elements (floats or strings, mostly 1)
size_t mOffset; // in number of values
size_t mStride; // Stride in number of values
std::vector<std::string> mParams; // names of the data streams in the accessors. Empty string tells to ignore.
std::vector<std::string> mParams; // names of the data streams in the accessors. Empty string tells to ignore.
size_t mSubOffset[4]; // Suboffset inside the object for the common 4 elements. For a vector, thats XYZ, for a color RGBA and so on.
// For example, SubOffset[0] denotes which of the values inside the object is the vector X component.
std::string mSource; // URL of the source array
mutable const Data* mData; // Pointer to the source array, if resolved. NULL else
Accessor()
{
mCount = 0; mSize = 0; mOffset = 0; mStride = 0; mData = NULL;
Accessor()
{
mCount = 0; mSize = 0; mOffset = 0; mStride = 0; mData = NULL;
mSubOffset[0] = mSubOffset[1] = mSubOffset[2] = mSubOffset[3] = 0;
}
};
@ -332,15 +332,15 @@ struct Mesh
for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i)
mNumUVComponents[i] = 2;
}
std::string mName;
// just to check if there's some sophisticated addressing involved...
// which we don't support, and therefore should warn about.
std::string mVertexID;
std::string mVertexID;
// Vertex data addressed by vertex indices
std::vector<InputChannel> mPerVertexData;
std::vector<InputChannel> mPerVertexData;
// actual mesh data, assembled on encounter of a <p> element. Verbose format, not indexed
std::vector<aiVector3D> mPositions;
@ -355,8 +355,8 @@ struct Mesh
// Faces. Stored are only the number of vertices for each face.
// 1 == point, 2 == line, 3 == triangle, 4+ == poly
std::vector<size_t> mFaceSize;
// Position indices for all faces in the sequence given in mFaceSize -
// Position indices for all faces in the sequence given in mFaceSize -
// necessary for bone weight assignment
std::vector<size_t> mFacePosIndices;
@ -381,7 +381,7 @@ enum PrimitiveType
struct Controller
{
// the URL of the mesh deformed by the controller.
std::string mMeshId;
std::string mMeshId;
// accessor URL of the joint names
std::string mJointNameSource;
@ -392,7 +392,7 @@ struct Controller
// accessor URL of the joint inverse bind matrices
std::string mJointOffsetMatrixSource;
// input channel: joint names.
// input channel: joint names.
InputChannel mWeightInputJoints;
// input channel: joint weights
InputChannel mWeightInputWeights;
@ -422,7 +422,7 @@ enum ParamType
struct EffectParam
{
ParamType mType;
std::string mReference; // to which other thing the param is referring to.
std::string mReference; // to which other thing the param is referring to.
};
/** Shading type supported by the standard effect spec of Collada */
@ -526,7 +526,7 @@ struct Effect
// ---------------------------------------------------------
// Double-sided?
bool mDoubleSided, mWireframe, mFaceted;
Effect()
: mShadeType (Shade_Phong)
, mEmissive ( 0, 0, 0, 1)
@ -543,7 +543,7 @@ struct Effect
, mDoubleSided (false)
, mWireframe (false)
, mFaceted (false)
{
{
}
};
@ -566,8 +566,8 @@ struct Image
/** An animation channel. */
struct AnimationChannel
{
/** URL of the data to animate. Could be about anything, but we support only the
* "NodeID/TransformID.SubElement" notation
/** URL of the data to animate. Could be about anything, but we support only the
* "NodeID/TransformID.SubElement" notation
*/
std::string mTarget;

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -74,7 +74,7 @@ static const aiImporterDesc desc = {
3,
1,
5,
"dae"
"dae"
};
@ -93,12 +93,12 @@ ColladaLoader::~ColladaLoader()
{}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Returns whether the class can handle the format of the given file.
bool ColladaLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
{
// check file extension
// check file extension
std::string extension = GetExtension(pFile);
if( extension == "dae")
return true;
@ -132,7 +132,7 @@ const aiImporterDesc* ColladaLoader::GetInfo () const
}
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
// Imports the given file into the given scene structure.
void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
{
mFileName = pFile;
@ -170,21 +170,21 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I
FillMaterials(parser, pScene);
// Apply unitsize scale calculation
pScene->mRootNode->mTransformation *= aiMatrix4x4(parser.mUnitSize, 0, 0, 0,
pScene->mRootNode->mTransformation *= aiMatrix4x4(parser.mUnitSize, 0, 0, 0,
0, parser.mUnitSize, 0, 0,
0, 0, parser.mUnitSize, 0,
0, 0, 0, 1);
if( !ignoreUpDirection ) {
// Convert to Y_UP, if different orientation
if( parser.mUpDirection == ColladaParser::UP_X)
pScene->mRootNode->mTransformation *= aiMatrix4x4(
0, -1, 0, 0,
pScene->mRootNode->mTransformation *= aiMatrix4x4(
0, -1, 0, 0,
1, 0, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1);
else if( parser.mUpDirection == ColladaParser::UP_Z)
pScene->mRootNode->mTransformation *= aiMatrix4x4(
1, 0, 0, 0,
pScene->mRootNode->mTransformation *= aiMatrix4x4(
1, 0, 0, 0,
0, 0, 1, 0,
0, -1, 0, 0,
0, 0, 0, 1);
@ -207,7 +207,7 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I
// If no meshes have been loaded, it's probably just an animated skeleton.
if (!pScene->mNumMeshes) {
if (!noSkeletonMesh) {
SkeletonMeshBuilder hero(pScene);
}
@ -282,9 +282,9 @@ void ColladaLoader::ResolveNodeInstances( const ColladaParser& pParser, const Co
if (!nd) {
nd = FindNode(pParser.mRootNode,(*it).mNode);
}
if (!nd)
if (!nd)
DefaultLogger::get()->error("Collada: Unable to resolve reference to instanced node " + (*it).mNode);
else {
// attach this node to the list of children
resolved.push_back(nd);
@ -320,7 +320,7 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll
continue;
}
const Collada::Light* srcLight = &srcLightIt->second;
// now fill our ai data structure
aiLight* out = new aiLight();
out->mName = pTarget->mName;
@ -338,13 +338,13 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll
// convert falloff angle and falloff exponent in our representation, if given
if (out->mType == aiLightSource_SPOT) {
out->mAngleInnerCone = AI_DEG_TO_RAD( srcLight->mFalloffAngle );
// ... some extension magic.
// ... some extension magic.
if (srcLight->mOuterAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET*(1-1e-6f))
{
// ... some deprecation magic.
// ... some deprecation magic.
if (srcLight->mPenumbraAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET*(1-1e-6f))
{
// Need to rely on falloff_exponent. I don't know how to interpret it, so I need to guess ....
@ -397,13 +397,13 @@ void ColladaLoader::BuildCamerasForNode( const ColladaParser& pParser, const Col
out->mClipPlaneFar = srcCamera->mZFar;
out->mClipPlaneNear = srcCamera->mZNear;
// ... but for the rest some values are optional
// and we need to compute the others in any combination.
// ... but for the rest some values are optional
// and we need to compute the others in any combination.
if (srcCamera->mAspect != 10e10f)
out->mAspect = srcCamera->mAspect;
if (srcCamera->mHorFov != 10e10f) {
out->mHorizontalFOV = srcCamera->mHorFov;
out->mHorizontalFOV = srcCamera->mHorFov;
if (srcCamera->mVerFov != 10e10f && srcCamera->mAspect == 10e10f) {
out->mAspect = tan(AI_DEG_TO_RAD(srcCamera->mHorFov)) /
@ -480,7 +480,7 @@ void ColladaLoader::BuildMeshesForNode( const ColladaParser& pParser, const Coll
table = &meshMatIt->second;
meshMaterial = table->mMatName;
}
else
else
{
DefaultLogger::get()->warn( boost::str( boost::format( "Collada: No material specified for subgroup <%s> in geometry <%s>.") % submesh.mMaterial % mid.mMeshOrController));
if( !mid.mMaterials.empty() )
@ -516,7 +516,7 @@ void ColladaLoader::BuildMeshesForNode( const ColladaParser& pParser, const Coll
std::map<ColladaMeshIndex, size_t>::const_iterator dstMeshIt = mMeshIndexByID.find( index);
if( dstMeshIt != mMeshIndexByID.end()) {
newMeshRefs.push_back( dstMeshIt->second);
}
}
else
{
// else we have to add the mesh to the collection and store its newly assigned index at the node
@ -549,11 +549,11 @@ void ColladaLoader::BuildMeshesForNode( const ColladaParser& pParser, const Coll
// ------------------------------------------------------------------------------------------------
// Creates a mesh for the given ColladaMesh face subset and returns the newly created mesh
aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::Mesh* pSrcMesh, const Collada::SubMesh& pSubMesh,
aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::Mesh* pSrcMesh, const Collada::SubMesh& pSubMesh,
const Collada::Controller* pSrcController, size_t pStartVertex, size_t pStartFace)
{
aiMesh* dstMesh = new aiMesh;
dstMesh->mName = pSrcMesh->mName;
// count the vertices addressed by its faces
@ -563,11 +563,11 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::
// copy positions
dstMesh->mNumVertices = numVertices;
dstMesh->mVertices = new aiVector3D[numVertices];
std::copy( pSrcMesh->mPositions.begin() + pStartVertex, pSrcMesh->mPositions.begin() +
std::copy( pSrcMesh->mPositions.begin() + pStartVertex, pSrcMesh->mPositions.begin() +
pStartVertex + numVertices, dstMesh->mVertices);
// normals, if given. HACK: (thom) Due to the glorious Collada spec we never
// know if we have the same number of normals as there are positions. So we
// normals, if given. HACK: (thom) Due to the glorious Collada spec we never
// know if we have the same number of normals as there are positions. So we
// also ignore any vertex attribute if it has a different count
if( pSrcMesh->mNormals.size() >= pStartVertex + numVertices)
{
@ -576,19 +576,19 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::
pStartVertex + numVertices, dstMesh->mNormals);
}
// tangents, if given.
// tangents, if given.
if( pSrcMesh->mTangents.size() >= pStartVertex + numVertices)
{
dstMesh->mTangents = new aiVector3D[numVertices];
std::copy( pSrcMesh->mTangents.begin() + pStartVertex, pSrcMesh->mTangents.begin() +
std::copy( pSrcMesh->mTangents.begin() + pStartVertex, pSrcMesh->mTangents.begin() +
pStartVertex + numVertices, dstMesh->mTangents);
}
// bitangents, if given.
// bitangents, if given.
if( pSrcMesh->mBitangents.size() >= pStartVertex + numVertices)
{
dstMesh->mBitangents = new aiVector3D[numVertices];
std::copy( pSrcMesh->mBitangents.begin() + pStartVertex, pSrcMesh->mBitangents.begin() +
std::copy( pSrcMesh->mBitangents.begin() + pStartVertex, pSrcMesh->mBitangents.begin() +
pStartVertex + numVertices, dstMesh->mBitangents);
}
@ -601,7 +601,7 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::
dstMesh->mTextureCoords[real] = new aiVector3D[numVertices];
for( size_t b = 0; b < numVertices; ++b)
dstMesh->mTextureCoords[real][b] = pSrcMesh->mTexCoords[a][pStartVertex+b];
dstMesh->mNumUVComponents[real] = pSrcMesh->mNumUVComponents[a];
++real;
}
@ -848,7 +848,7 @@ void ColladaLoader::StoreSceneMaterials( aiScene* pScene)
}
// ------------------------------------------------------------------------------------------------
// Stores all animations
// Stores all animations
void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pParser)
{
// recursivly collect all animations from the collada scene
@ -918,7 +918,7 @@ void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pPars
}
// ------------------------------------------------------------------------------------------------
// Constructs the animations for the given source anim
// Constructs the animations for the given source anim
void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string &pPrefix)
{
std::string animName = pPrefix.empty() ? pSrcAnim->mName : pPrefix + "_" + pSrcAnim->mName;
@ -989,7 +989,7 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars
entry.mSubElement = 1;
else if( subElement == "Z")
entry.mSubElement = 2;
else
else
DefaultLogger::get()->warn( boost::str( boost::format( "Unknown anim subelement <%s>. Ignoring") % subElement));
} else
{
@ -1002,9 +1002,9 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars
{
entry.mTransformId = srcChannel.mTarget.substr(slashPos + 1, bracketPos - slashPos - 1);
std::string subElement = srcChannel.mTarget.substr(bracketPos);
if (subElement == "(0)(0)")
entry.mSubElement = 0;
entry.mSubElement = 0;
else if (subElement == "(1)(0)")
entry.mSubElement = 1;
else if (subElement == "(2)(0)")
@ -1259,7 +1259,7 @@ void ColladaLoader::AddTexture ( aiMaterial& mat, const ColladaParser& pParser,
mat.AddProperty((float*)&sampler.mWeighting , 1,
_AI_MATKEY_TEXBLEND_BASE, type, idx);
// UV source index ... if we didn't resolve the mapping, it is actually just
// UV source index ... if we didn't resolve the mapping, it is actually just
// a guess but it works in most cases. We search for the frst occurence of a
// number in the channel name. We assume it is the zero-based index into the
// UV channel array of all corresponding meshes. It could also be one-based
@ -1289,7 +1289,7 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce
for (std::vector<std::pair<Collada::Effect*, aiMaterial*> >::iterator it = newMats.begin(),
end = newMats.end(); it != end; ++it)
{
aiMaterial& mat = (aiMaterial&)*it->second;
aiMaterial& mat = (aiMaterial&)*it->second;
Collada::Effect& effect = *it->first;
// resolve shading mode
@ -1299,22 +1299,22 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce
else {
switch( effect.mShadeType)
{
case Collada::Shade_Constant:
shadeMode = aiShadingMode_NoShading;
case Collada::Shade_Constant:
shadeMode = aiShadingMode_NoShading;
break;
case Collada::Shade_Lambert:
shadeMode = aiShadingMode_Gouraud;
shadeMode = aiShadingMode_Gouraud;
break;
case Collada::Shade_Blinn:
case Collada::Shade_Blinn:
shadeMode = aiShadingMode_Blinn;
break;
case Collada::Shade_Phong:
shadeMode = aiShadingMode_Phong;
case Collada::Shade_Phong:
shadeMode = aiShadingMode_Phong;
break;
default:
DefaultLogger::get()->warn("Collada: Unrecognized shading mode, using gouraud shading");
shadeMode = aiShadingMode_Gouraud;
shadeMode = aiShadingMode_Gouraud;
break;
}
}
@ -1350,7 +1350,7 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce
if(effect.mRGBTransparency) {
effect.mTransparency = 1.f - effect.mTransparent.a;
}
// Global option
if(invertTransparency) {
effect.mTransparency = 1.f - effect.mTransparency;
@ -1364,7 +1364,7 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce
}
// add textures, if given
if( !effect.mTexAmbient.mName.empty())
if( !effect.mTexAmbient.mName.empty())
/* It is merely a lightmap */
AddTexture( mat, pParser, effect, effect.mTexAmbient, aiTextureType_LIGHTMAP);
@ -1455,16 +1455,16 @@ aiString ColladaLoader::FindFilenameForEffectTexture( const ColladaParser& pPars
// find the image referred by this name in the image library of the scene
ColladaParser::ImageLibrary::const_iterator imIt = pParser.mImageLibrary.find( name);
if( imIt == pParser.mImageLibrary.end())
if( imIt == pParser.mImageLibrary.end())
{
throw DeadlyImportError( boost::str( boost::format(
throw DeadlyImportError( boost::str( boost::format(
"Collada: Unable to resolve effect texture entry \"%s\", ended up at ID \"%s\".") % pName % name));
}
aiString result;
// if this is an embedded texture image setup an aiTexture for it
if (imIt->second.mFileName.empty())
if (imIt->second.mFileName.empty())
{
if (imIt->second.mImageData.empty()) {
throw DeadlyImportError("Collada: Invalid texture, no data or file reference given");
@ -1491,7 +1491,7 @@ aiString ColladaLoader::FindFilenameForEffectTexture( const ColladaParser& pPars
// and add this texture to the list
mTextures.push_back(tex);
}
else
else
{
result.Set( imIt->second.mFileName );
ConvertPath(result);
@ -1507,14 +1507,14 @@ void ColladaLoader::ConvertPath (aiString& ss)
// For the moment we're just stripping the file:// away to make it work.
// Windoes doesn't seem to be able to find stuff like
// 'file://..\LWO\LWO2\MappingModes\earthSpherical.jpg'
if (0 == strncmp(ss.data,"file://",7))
if (0 == strncmp(ss.data,"file://",7))
{
ss.length -= 7;
memmove(ss.data,ss.data+7,ss.length);
ss.data[ss.length] = '\0';
}
// Maxon Cinema Collada Export writes "file:///C:\andsoon" with three slashes...
// Maxon Cinema Collada Export writes "file:///C:\andsoon" with three slashes...
// I need to filter it without destroying linux paths starting with "/somewhere"
if( ss.data[0] == '/' && isalpha( ss.data[1]) && ss.data[2] == ':' )
{

View File

@ -7,8 +7,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -25,16 +25,16 @@ contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -60,17 +60,17 @@ struct ColladaMeshIndex
std::string mMeshID;
size_t mSubMesh;
std::string mMaterial;
ColladaMeshIndex( const std::string& pMeshID, size_t pSubMesh, const std::string& pMaterial)
ColladaMeshIndex( const std::string& pMeshID, size_t pSubMesh, const std::string& pMaterial)
: mMeshID( pMeshID), mSubMesh( pSubMesh), mMaterial( pMaterial)
{ }
bool operator < (const ColladaMeshIndex& p) const
{
if( mMeshID == p.mMeshID)
if( mMeshID == p.mMeshID)
{
if( mSubMesh == p.mSubMesh)
return mMaterial < p.mMaterial;
else
else
return mSubMesh < p.mSubMesh;
} else
{
@ -80,7 +80,7 @@ struct ColladaMeshIndex
};
/** Loader class to read Collada scenes. Collada is over-engineered to death, with every new iteration bringing
* more useless stuff, so I limited the data to what I think is useful for games.
* more useless stuff, so I limited the data to what I think is useful for games.
*/
class ColladaLoader : public BaseImporter
{
@ -90,7 +90,7 @@ public:
public:
/** Returns whether the class can handle the format of the given file.
/** Returns whether the class can handle the format of the given file.
* See BaseImporter::CanRead() for details. */
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
@ -102,7 +102,7 @@ protected:
void SetupProperties(const Importer* pImp);
/** Imports the given file into the given scene structure.
/** Imports the given file into the given scene structure.
* See BaseImporter::InternReadFile() for details
*/
void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
@ -115,19 +115,19 @@ protected:
std::vector<const Collada::Node*>& resolved);
/** Builds meshes for the given node and references them */
void BuildMeshesForNode( const ColladaParser& pParser, const Collada::Node* pNode,
void BuildMeshesForNode( const ColladaParser& pParser, const Collada::Node* pNode,
aiNode* pTarget);
/** Creates a mesh for the given ColladaMesh face subset and returns the newly created mesh */
aiMesh* CreateMesh( const ColladaParser& pParser, const Collada::Mesh* pSrcMesh, const Collada::SubMesh& pSubMesh,
aiMesh* CreateMesh( const ColladaParser& pParser, const Collada::Mesh* pSrcMesh, const Collada::SubMesh& pSubMesh,
const Collada::Controller* pSrcController, size_t pStartVertex, size_t pStartFace);
/** Builds cameras for the given node and references them */
void BuildCamerasForNode( const ColladaParser& pParser, const Collada::Node* pNode,
void BuildCamerasForNode( const ColladaParser& pParser, const Collada::Node* pNode,
aiNode* pTarget);
/** Builds lights for the given node and references them */
void BuildLightsForNode( const ColladaParser& pParser, const Collada::Node* pNode,
void BuildLightsForNode( const ColladaParser& pParser, const Collada::Node* pNode,
aiNode* pTarget);
/** Stores all meshes in the given scene */
@ -145,7 +145,7 @@ protected:
/** Stores all textures in the given scene */
void StoreSceneTextures( aiScene* pScene);
/** Stores all animations
/** Stores all animations
* @param pScene target scene to store the anims
*/
void StoreAnimations( aiScene* pScene, const ColladaParser& pParser);
@ -159,7 +159,7 @@ protected:
/** Constructs the animation for the given source anim */
void CreateAnimation( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string& pName);
/** Constructs materials from the collada material definitions */
void BuildMaterials( ColladaParser& pParser, aiScene* pScene);
@ -177,7 +177,7 @@ protected:
aiTextureType type, unsigned int idx = 0);
/** Resolves the texture name for the given effect texture entry */
aiString FindFilenameForEffectTexture( const ColladaParser& pParser,
aiString FindFilenameForEffectTexture( const ColladaParser& pParser,
const Collada::Effect& pEffect, const std::string& pName);
/** Converts a path read from a collada file to the usual representation */

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -129,7 +129,7 @@ void ColladaParser::ReadContents()
const int attrib = TestAttribute("version");
if (attrib != -1) {
const char* version = mReader->getAttributeValue(attrib);
if (!::strncmp(version,"1.5",3)) {
mFormat = FV_1_5_n;
DefaultLogger::get()->debug("Collada schema version is 1.5.n");
@ -164,7 +164,7 @@ void ColladaParser::ReadStructure()
while( mReader->read())
{
// beginning of elements
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
if( IsElement( "asset"))
ReadAssetInfo();
@ -192,8 +192,8 @@ void ColladaParser::ReadStructure()
ReadScene();
else
SkipElement();
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
break;
}
@ -225,7 +225,7 @@ void ColladaParser::ReadAssetInfo()
// consume the trailing stuff
if( !mReader->isEmptyElement())
SkipElement();
}
}
else if( IsElement( "up_axis"))
{
// read content, strip whitespace, compare
@ -243,7 +243,7 @@ void ColladaParser::ReadAssetInfo()
{
SkipElement();
}
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "asset") != 0)
@ -263,7 +263,7 @@ void ColladaParser::ReadAnimationLibrary()
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
if( IsElement( "animation"))
{
@ -275,7 +275,7 @@ void ColladaParser::ReadAnimationLibrary()
SkipElement();
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "library_animations") != 0)
ThrowException( "Expected end of <library_animations> element.");
@ -312,7 +312,7 @@ void ColladaParser::ReadAnimation( Collada::Animation* pParent)
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
// we have subanimations
if( IsElement( "animation"))
@ -327,12 +327,12 @@ void ColladaParser::ReadAnimation( Collada::Animation* pParent)
// recurse into the subelement
ReadAnimation( anim);
}
}
else if( IsElement( "source"))
{
// possible animation data - we'll never know. Better store it
ReadSource();
}
}
else if( IsElement( "sampler"))
{
// read the ID to assign the corresponding collada channel afterwards.
@ -342,7 +342,7 @@ void ColladaParser::ReadAnimation( Collada::Animation* pParent)
// have it read into a channel
ReadAnimationSampler( newChannel->second);
}
}
else if( IsElement( "channel"))
{
// the binding element whose whole purpose is to provide the target to animate
@ -359,14 +359,14 @@ void ColladaParser::ReadAnimation( Collada::Animation* pParent)
if( !mReader->isEmptyElement())
SkipElement();
}
}
else
{
// ignore the rest
SkipElement();
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "animation") != 0)
ThrowException( "Expected end of <animation> element.");
@ -403,7 +403,7 @@ void ColladaParser::ReadAnimationSampler( Collada::AnimationChannel& pChannel)
{
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
if( IsElement( "input"))
{
@ -414,7 +414,7 @@ void ColladaParser::ReadAnimationSampler( Collada::AnimationChannel& pChannel)
if( source[0] != '#')
ThrowException( "Unsupported URL format");
source++;
if( strcmp( semantic, "INPUT") == 0)
pChannel.mSourceTimes = source;
else if( strcmp( semantic, "OUTPUT") == 0)
@ -422,14 +422,14 @@ void ColladaParser::ReadAnimationSampler( Collada::AnimationChannel& pChannel)
if( !mReader->isEmptyElement())
SkipElement();
}
}
else
{
// ignore the rest
SkipElement();
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "sampler") != 0)
ThrowException( "Expected end of <sampler> element.");
@ -448,7 +448,7 @@ void ColladaParser::ReadControllerLibrary()
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
if( IsElement( "controller"))
{
@ -467,7 +467,7 @@ void ColladaParser::ReadControllerLibrary()
SkipElement();
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "library_controllers") != 0)
ThrowException( "Expected end of <library_controllers> element.");
@ -483,21 +483,21 @@ void ColladaParser::ReadController( Collada::Controller& pController)
{
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
// two types of controllers: "skin" and "morph". Only the first one is relevant, we skip the other
if( IsElement( "morph"))
{
// should skip everything inside, so there's no danger of catching elements inbetween
SkipElement();
}
}
else if( IsElement( "skin"))
{
// read the mesh it refers to. According to the spec this could also be another
// controller, but I refuse to implement every single idea they've come up with
int sourceIndex = GetAttribute( "source");
pController.mMeshId = mReader->getAttributeValue( sourceIndex) + 1;
}
}
else if( IsElement( "bind_shape_matrix"))
{
// content is 16 floats to define a matrix... it seems to be important for some models
@ -513,12 +513,12 @@ void ColladaParser::ReadController( Collada::Controller& pController)
}
TestClosing( "bind_shape_matrix");
}
}
else if( IsElement( "source"))
{
// data array - we have specialists to handle this
ReadSource();
}
}
else if( IsElement( "joints"))
{
ReadControllerJoints( pController);
@ -533,7 +533,7 @@ void ColladaParser::ReadController( Collada::Controller& pController)
SkipElement();
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "controller") == 0)
break;
@ -549,7 +549,7 @@ void ColladaParser::ReadControllerJoints( Collada::Controller& pController)
{
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
// Input channels for joint data. Two possible semantics: "JOINT" and "INV_BIND_MATRIX"
if( IsElement( "input"))
@ -582,7 +582,7 @@ void ColladaParser::ReadControllerJoints( Collada::Controller& pController)
SkipElement();
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "joints") != 0)
ThrowException( "Expected end of <joints> element.");
@ -603,7 +603,7 @@ void ColladaParser::ReadControllerWeights( Collada::Controller& pController)
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
// Input channels for weight data. Two possible semantics: "JOINT" and "WEIGHT"
if( IsElement( "input") && vertexCount > 0 )
@ -652,7 +652,7 @@ void ColladaParser::ReadControllerWeights( Collada::Controller& pController)
TestClosing( "vcount");
// reserve weight count
// reserve weight count
pController.mWeights.resize( numWeights);
}
else if( IsElement( "v") && vertexCount > 0 )
@ -680,7 +680,7 @@ void ColladaParser::ReadControllerWeights( Collada::Controller& pController)
SkipElement();
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "vertex_weights") != 0)
ThrowException( "Expected end of <vertex_weights> element.");
@ -739,7 +739,7 @@ void ColladaParser::ReadImage( Collada::Image& pImage)
}
else if( IsElement( "init_from"))
{
if (mFormat == FV_1_4_n)
if (mFormat == FV_1_4_n)
{
// FIX: C4D exporter writes empty <init_from/> tags
if (!mReader->isEmptyElement()) {
@ -752,10 +752,10 @@ void ColladaParser::ReadImage( Collada::Image& pImage)
pImage.mFileName = "unknown_texture";
}
}
else if (mFormat == FV_1_5_n)
else if (mFormat == FV_1_5_n)
{
// make sure we skip over mip and array initializations, which
// we don't support, but which could confuse the loader if
// we don't support, but which could confuse the loader if
// they're not skipped.
int attrib = TestAttribute("array_index");
if (attrib != -1 && mReader->getAttributeValueAsInt(attrib) > 0) {
@ -772,7 +772,7 @@ void ColladaParser::ReadImage( Collada::Image& pImage)
// TODO: correctly jump over cube and volume maps?
}
}
else if (mFormat == FV_1_5_n)
else if (mFormat == FV_1_5_n)
{
if( IsElement( "ref"))
{
@ -780,12 +780,12 @@ void ColladaParser::ReadImage( Collada::Image& pImage)
const char* sz = TestTextContent();
if (sz)pImage.mFileName = sz;
TestClosing( "ref");
}
}
else if( IsElement( "hex") && !pImage.mFileName.length())
{
// embedded image. get format
const int attrib = TestAttribute("format");
if (-1 == attrib)
if (-1 == attrib)
DefaultLogger::get()->warn("Collada: Unknown image file format");
else pImage.mEmbeddedFormat = mReader->getAttributeValue(attrib);
@ -798,13 +798,13 @@ void ColladaParser::ReadImage( Collada::Image& pImage)
const unsigned int size = (unsigned int)(cur-data) * 2;
pImage.mImageData.resize(size);
for (unsigned int i = 0; i < size;++i)
for (unsigned int i = 0; i < size;++i)
pImage.mImageData[i] = HexOctetToDecimal(data+(i<<1));
TestClosing( "hex");
}
}
}
else
else
{
// ignore the rest
SkipElement();
@ -827,7 +827,7 @@ void ColladaParser::ReadMaterialLibrary()
std::map<std::string, int> names;
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
if( IsElement( "material"))
{
@ -867,7 +867,7 @@ void ColladaParser::ReadMaterialLibrary()
SkipElement();
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "library_materials") != 0)
ThrowException( "Expected end of <library_materials> element.");
@ -928,9 +928,9 @@ void ColladaParser::ReadCameraLibrary()
std::string id = mReader->getAttributeValue( attrID);
// create an entry and store it in the library under its ID
Camera& cam = mCameraLibrary[id];
Camera& cam = mCameraLibrary[id];
attrID = TestAttribute( "name");
if (attrID != -1)
if (attrID != -1)
cam.mName = mReader->getAttributeValue( attrID);
ReadCamera(cam);
@ -1011,10 +1011,10 @@ void ColladaParser::ReadLight( Collada::Light& pLight)
else if (IsElement("color")) {
// text content contains 3 floats
const char* content = GetTextContent();
content = fast_atoreal_move<float>( content, (float&)pLight.mColor.r);
SkipSpacesAndLineEnd( &content);
content = fast_atoreal_move<float>( content, (float&)pLight.mColor.g);
SkipSpacesAndLineEnd( &content);
@ -1043,7 +1043,7 @@ void ColladaParser::ReadLight( Collada::Light& pLight)
pLight.mFalloffExponent = ReadFloatFromTextContent();
TestClosing("falloff_exponent");
}
// FCOLLADA extensions
// FCOLLADA extensions
// -------------------------------------------------------
else if (IsElement("outer_cone")) {
pLight.mOuterAngle = ReadFloatFromTextContent();
@ -1165,7 +1165,7 @@ void ColladaParser::ReadEffect( Collada::Effect& pEffect)
else
SkipElement();
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "effect") != 0)
ThrowException( "Expected end of <effect> element.");
@ -1181,7 +1181,7 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
{
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
if( IsElement( "newparam")) {
// save ID
@ -1189,7 +1189,7 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
std::string sid = mReader->getAttributeValue( attrSID);
pEffect.mParams[sid] = EffectParam();
ReadEffectParam( pEffect.mParams[sid]);
}
}
else if( IsElement( "technique") || IsElement( "extra"))
{
// just syntactic sugar
@ -1252,7 +1252,7 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
else if( IsElement( "index_of_refraction"))
ReadEffectFloat( pEffect.mRefractIndex);
// GOOGLEEARTH/OKINO extensions
// GOOGLEEARTH/OKINO extensions
// -------------------------------------------------------
else if( IsElement( "double_sided"))
pEffect.mDoubleSided = ReadBoolFromTextContent();
@ -1274,7 +1274,7 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
pEffect.mFaceted = ReadBoolFromTextContent();
TestClosing( "faceted");
}
else
else
{
// ignore the rest
SkipElement();
@ -1284,7 +1284,7 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
if( strcmp( mReader->getNodeName(), "profile_COMMON") == 0)
{
break;
}
}
}
}
}
@ -1340,17 +1340,17 @@ void ColladaParser::ReadSamplerProperties( Sampler& out )
TestClosing( "rotateUV");
}
else if( IsElement( "blend_mode")) {
const char* sz = GetTextContent();
// http://www.feelingsoftware.com/content/view/55/72/lang,en/
// NONE, OVER, IN, OUT, ADD, SUBTRACT, MULTIPLY, DIFFERENCE, LIGHTEN, DARKEN, SATURATE, DESATURATE and ILLUMINATE
if (0 == ASSIMP_strincmp(sz,"ADD",3))
if (0 == ASSIMP_strincmp(sz,"ADD",3))
out.mOp = aiTextureOp_Add;
else if (0 == ASSIMP_strincmp(sz,"SUBTRACT",8))
else if (0 == ASSIMP_strincmp(sz,"SUBTRACT",8))
out.mOp = aiTextureOp_Subtract;
else if (0 == ASSIMP_strincmp(sz,"MULTIPLY",8))
else if (0 == ASSIMP_strincmp(sz,"MULTIPLY",8))
out.mOp = aiTextureOp_Multiply;
else {
@ -1398,7 +1398,7 @@ void ColladaParser::ReadEffectColor( aiColor4D& pColor, Sampler& pSampler)
if( IsElement( "color"))
{
// text content contains 4 floats
const char* content = GetTextContent();
const char* content = GetTextContent();
content = fast_atoreal_move<float>( content, (float&)pColor.r);
SkipSpacesAndLineEnd( &content);
@ -1412,7 +1412,7 @@ void ColladaParser::ReadEffectColor( aiColor4D& pColor, Sampler& pSampler)
content = fast_atoreal_move<float>( content, (float&)pColor.a);
SkipSpacesAndLineEnd( &content);
TestClosing( "color");
}
}
else if( IsElement( "texture"))
{
// get name of source textur/sampler
@ -1484,7 +1484,7 @@ void ColladaParser::ReadEffectFloat( float& pFloat)
}
// ------------------------------------------------------------------------------------------------
// Reads an effect parameter specification of any kind
// Reads an effect parameter specification of any kind
void ColladaParser::ReadEffectParam( Collada::EffectParam& pParam)
{
while( mReader->read())
@ -1501,7 +1501,7 @@ void ColladaParser::ReadEffectParam( Collada::EffectParam& pParam)
// don't care for remaining stuff
SkipElement( "surface");
}
}
else if( IsElement( "sampler2D"))
{
// surface ID is given inside <source> tags
@ -1548,7 +1548,7 @@ void ColladaParser::ReadGeometryLibrary()
// create a mesh and store it in the library under its ID
Mesh* mesh = new Mesh;
mMeshLibrary[id] = mesh;
// read the mesh name if it exists
const int nameIndex = TestAttribute("name");
if(nameIndex != -1)
@ -1627,7 +1627,7 @@ void ColladaParser::ReadMesh( Mesh* pMesh)
ReadVertexData( pMesh);
}
else if( IsElement( "triangles") || IsElement( "lines") || IsElement( "linestrips")
|| IsElement( "polygons") || IsElement( "polylist") || IsElement( "trifans") || IsElement( "tristrips"))
|| IsElement( "polygons") || IsElement( "polylist") || IsElement( "trifans") || IsElement( "tristrips"))
{
// read per-index mesh data and faces setup
ReadIndexData( pMesh);
@ -1642,7 +1642,7 @@ void ColladaParser::ReadMesh( Mesh* pMesh)
if( strcmp( mReader->getNodeName(), "technique_common") == 0)
{
// end of another meaningless element - read over it
}
}
else if( strcmp( mReader->getNodeName(), "mesh") == 0)
{
// end of <mesh> element - we're done here
@ -1657,7 +1657,7 @@ void ColladaParser::ReadMesh( Mesh* pMesh)
}
// ------------------------------------------------------------------------------------------------
// Reads a source element
// Reads a source element
void ColladaParser::ReadSource()
{
int indexID = GetAttribute( "id");
@ -1673,7 +1673,7 @@ void ColladaParser::ReadSource()
}
else if( IsElement( "technique_common"))
{
// I don't care for your profiles
// I don't care for your profiles
}
else if( IsElement( "accessor"))
{
@ -1724,8 +1724,8 @@ void ColladaParser::ReadDataArray()
data.mIsStringArray = isStringArray;
// some exporters write empty data arrays, but we need to conserve them anyways because others might reference them
if (content)
{
if (content)
{
if( isStringArray)
{
data.mStrings.reserve( count);
@ -1827,7 +1827,7 @@ void ColladaParser::ReadAccessor( const std::string& pID)
else if( name == "S") acc.mSubOffset[0] = acc.mParams.size();
else if( name == "T") acc.mSubOffset[1] = acc.mParams.size();
else if( name == "P") acc.mSubOffset[2] = acc.mParams.size();
// else if( name == "Q") acc.mSubOffset[3] = acc.mParams.size();
// else if( name == "Q") acc.mSubOffset[3] = acc.mParams.size();
/* 4D uv coordinates are not supported in Assimp */
/* Generic extra data, interpreted as UV data, too*/
@ -1841,13 +1841,13 @@ void ColladaParser::ReadAccessor( const std::string& pID)
int attrType = TestAttribute( "type");
if( attrType > -1)
{
// for the moment we only distinguish between a 4x4 matrix and anything else.
// for the moment we only distinguish between a 4x4 matrix and anything else.
// TODO: (thom) I don't have a spec here at work. Check if there are other multi-value types
// which should be tested for here.
std::string type = mReader->getAttributeValue( attrType);
if( type == "float4x4")
acc.mSize += 16;
else
else
acc.mSize += 1;
}
@ -1859,7 +1859,7 @@ void ColladaParser::ReadAccessor( const std::string& pID)
{
ThrowException( boost::str( boost::format( "Unexpected sub element <%s> in tag <accessor>") % mReader->getNodeName()));
}
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "accessor") != 0)
@ -1889,7 +1889,7 @@ void ColladaParser::ReadVertexData( Mesh* pMesh)
{
ThrowException( boost::str( boost::format( "Unexpected sub element <%s> in tag <vertices>") % mReader->getNodeName()));
}
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "vertices") != 0)
@ -1948,7 +1948,7 @@ void ColladaParser::ReadIndexData( Mesh* pMesh)
if( IsElement( "input"))
{
ReadInputChannel( perIndexData);
}
}
else if( IsElement( "vcount"))
{
if( !mReader->isEmptyElement())
@ -1987,7 +1987,7 @@ void ColladaParser::ReadIndexData( Mesh* pMesh)
{
ThrowException( boost::str( boost::format( "Unexpected sub element <%s> in tag <%s>") % mReader->getNodeName() % elementName));
}
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( mReader->getNodeName() != elementName)
@ -1997,7 +1997,7 @@ void ColladaParser::ReadIndexData( Mesh* pMesh)
}
}
#ifdef ASSIMP_BUILD_DEBUG
#ifdef ASSIMP_BUILD_DEBUG
if (primType != Prim_TriFans && primType != Prim_TriStrips) {
ai_assert(actualPrimitives == numPrimitives);
}
@ -2009,11 +2009,11 @@ void ColladaParser::ReadIndexData( Mesh* pMesh)
}
// ------------------------------------------------------------------------------------------------
// Reads a single input channel element and stores it in the given array, if valid
// Reads a single input channel element and stores it in the given array, if valid
void ColladaParser::ReadInputChannel( std::vector<InputChannel>& poChannels)
{
InputChannel channel;
// read semantic
int attrSemantic = GetAttribute( "semantic");
std::string semantic = mReader->getAttributeValue( attrSemantic);
@ -2038,7 +2038,7 @@ void ColladaParser::ReadInputChannel( std::vector<InputChannel>& poChannels)
attrSet = mReader->getAttributeValueAsInt( attrSet);
if(attrSet < 0)
ThrowException( boost::str( boost::format( "Invalid index \"%i\" in set attribute of <input> element") % (attrSet)));
channel.mIndex = attrSet;
}
}
@ -2056,7 +2056,7 @@ void ColladaParser::ReadInputChannel( std::vector<InputChannel>& poChannels)
size_t ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector<InputChannel>& pPerIndexChannels,
size_t pNumPrimitives, const std::vector<size_t>& pVCount, PrimitiveType pPrimType)
{
// determine number of indices coming per vertex
// determine number of indices coming per vertex
// find the offset index for all per-vertex channels
size_t numOffsets = 1;
size_t perVertexOffset = SIZE_MAX; // invalid value
@ -2067,7 +2067,7 @@ size_t ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector<InputChannel>& pP
perVertexOffset = channel.mOffset;
}
// determine the expected number of indices
// determine the expected number of indices
size_t expectedPointCount = 0;
switch( pPrimType)
{
@ -2098,7 +2098,7 @@ size_t ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector<InputChannel>& pP
const char* content = GetTextContent();
while( *content != 0)
{
// read a value.
// read a value.
// Hack: (thom) Some exporters put negative indices sometimes. We just try to carry on anyways.
int value = std::max( 0, strtol10( content, &content));
indices.push_back( size_t( value));
@ -2185,13 +2185,13 @@ size_t ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector<InputChannel>& pP
numPoints = 3;
ReadPrimTriStrips(numOffsets, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices);
break;
case Prim_Polylist:
case Prim_Polylist:
numPoints = pVCount[currentPrimitive];
for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++)
CopyVertex(polylistStartVertex + currentVertex, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, 0, indices);
polylistStartVertex += numPoints;
break;
case Prim_TriFans:
case Prim_TriFans:
case Prim_Polygon:
numPoints = indices.size() / numOffsets;
for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++)
@ -2246,7 +2246,7 @@ void ColladaParser::ReadPrimTriStrips(size_t numOffsets, size_t perVertexOffset,
}
// ------------------------------------------------------------------------------------------------
// Extracts a single object from an input channel and stores it in the appropriate mesh data array
// Extracts a single object from an input channel and stores it in the appropriate mesh data array
void ColladaParser::ExtractDataObjectFromChannel( const InputChannel& pInput, size_t pLocalIndex, Mesh* pMesh)
{
// ignore vertex referrer - we handle them that separate
@ -2271,67 +2271,67 @@ void ColladaParser::ExtractDataObjectFromChannel( const InputChannel& pInput, si
{
case IT_Position: // ignore all position streams except 0 - there can be only one position
if( pInput.mIndex == 0)
pMesh->mPositions.push_back( aiVector3D( obj[0], obj[1], obj[2]));
else
pMesh->mPositions.push_back( aiVector3D( obj[0], obj[1], obj[2]));
else
DefaultLogger::get()->error("Collada: just one vertex position stream supported");
break;
case IT_Normal:
case IT_Normal:
// pad to current vertex count if necessary
if( pMesh->mNormals.size() < pMesh->mPositions.size()-1)
pMesh->mNormals.insert( pMesh->mNormals.end(), pMesh->mPositions.size() - pMesh->mNormals.size() - 1, aiVector3D( 0, 1, 0));
// ignore all normal streams except 0 - there can be only one normal
if( pInput.mIndex == 0)
pMesh->mNormals.push_back( aiVector3D( obj[0], obj[1], obj[2]));
else
pMesh->mNormals.push_back( aiVector3D( obj[0], obj[1], obj[2]));
else
DefaultLogger::get()->error("Collada: just one vertex normal stream supported");
break;
case IT_Tangent:
case IT_Tangent:
// pad to current vertex count if necessary
if( pMesh->mTangents.size() < pMesh->mPositions.size()-1)
pMesh->mTangents.insert( pMesh->mTangents.end(), pMesh->mPositions.size() - pMesh->mTangents.size() - 1, aiVector3D( 1, 0, 0));
// ignore all tangent streams except 0 - there can be only one tangent
if( pInput.mIndex == 0)
pMesh->mTangents.push_back( aiVector3D( obj[0], obj[1], obj[2]));
else
pMesh->mTangents.push_back( aiVector3D( obj[0], obj[1], obj[2]));
else
DefaultLogger::get()->error("Collada: just one vertex tangent stream supported");
break;
case IT_Bitangent:
case IT_Bitangent:
// pad to current vertex count if necessary
if( pMesh->mBitangents.size() < pMesh->mPositions.size()-1)
pMesh->mBitangents.insert( pMesh->mBitangents.end(), pMesh->mPositions.size() - pMesh->mBitangents.size() - 1, aiVector3D( 0, 0, 1));
// ignore all bitangent streams except 0 - there can be only one bitangent
if( pInput.mIndex == 0)
pMesh->mBitangents.push_back( aiVector3D( obj[0], obj[1], obj[2]));
else
pMesh->mBitangents.push_back( aiVector3D( obj[0], obj[1], obj[2]));
else
DefaultLogger::get()->error("Collada: just one vertex bitangent stream supported");
break;
case IT_Texcoord:
case IT_Texcoord:
// up to 4 texture coord sets are fine, ignore the others
if( pInput.mIndex < AI_MAX_NUMBER_OF_TEXTURECOORDS)
if( pInput.mIndex < AI_MAX_NUMBER_OF_TEXTURECOORDS)
{
// pad to current vertex count if necessary
if( pMesh->mTexCoords[pInput.mIndex].size() < pMesh->mPositions.size()-1)
pMesh->mTexCoords[pInput.mIndex].insert( pMesh->mTexCoords[pInput.mIndex].end(),
pMesh->mTexCoords[pInput.mIndex].insert( pMesh->mTexCoords[pInput.mIndex].end(),
pMesh->mPositions.size() - pMesh->mTexCoords[pInput.mIndex].size() - 1, aiVector3D( 0, 0, 0));
pMesh->mTexCoords[pInput.mIndex].push_back( aiVector3D( obj[0], obj[1], obj[2]));
if (0 != acc.mSubOffset[2] || 0 != acc.mSubOffset[3]) /* hack ... consider cleaner solution */
pMesh->mNumUVComponents[pInput.mIndex]=3;
} else
} else
{
DefaultLogger::get()->error("Collada: too many texture coordinate sets. Skipping.");
}
break;
case IT_Color:
case IT_Color:
// up to 4 color sets are fine, ignore the others
if( pInput.mIndex < AI_MAX_NUMBER_OF_COLOR_SETS)
{
// pad to current vertex count if necessary
if( pMesh->mColors[pInput.mIndex].size() < pMesh->mPositions.size()-1)
pMesh->mColors[pInput.mIndex].insert( pMesh->mColors[pInput.mIndex].end(),
pMesh->mColors[pInput.mIndex].insert( pMesh->mColors[pInput.mIndex].end(),
pMesh->mPositions.size() - pMesh->mColors[pInput.mIndex].size() - 1, aiColor4D( 0, 0, 0, 1));
aiColor4D result(0, 0, 0, 1);
@ -2339,15 +2339,15 @@ void ColladaParser::ExtractDataObjectFromChannel( const InputChannel& pInput, si
{
result[i] = obj[pInput.mResolved->mSubOffset[i]];
}
pMesh->mColors[pInput.mIndex].push_back(result);
} else
pMesh->mColors[pInput.mIndex].push_back(result);
} else
{
DefaultLogger::get()->error("Collada: too many vertex color sets. Skipping.");
}
break;
default:
// IT_Invalid and IT_Vertex
// IT_Invalid and IT_Vertex
ai_assert(false && "shouldn't ever get here");
}
}
@ -2370,7 +2370,7 @@ void ColladaParser::ReadSceneLibrary()
int indexID = GetAttribute( "id");
const char* attrID = mReader->getAttributeValue( indexID);
// read name if given.
// read name if given.
int indexName = TestAttribute( "name");
const char* attrName = "unnamed";
if( indexName > -1)
@ -2409,7 +2409,7 @@ void ColladaParser::ReadSceneNode( Node* pNode)
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
if( IsElement( "node"))
{
@ -2428,12 +2428,12 @@ void ColladaParser::ReadSceneNode( Node* pNode)
// TODO: (thom) support SIDs
// ai_assert( TestAttribute( "sid") == -1);
if (pNode)
if (pNode)
{
pNode->mChildren.push_back( child);
child->mParent = pNode;
}
else
else
{
// no parent node given, probably called from <library_nodes> element.
// create new node in node library
@ -2467,43 +2467,43 @@ void ColladaParser::ReadSceneNode( Node* pNode)
// render a Collada scene. The only thing that is interesting for
// us is the primary camera.
int attrId = TestAttribute("camera_node");
if (-1 != attrId)
if (-1 != attrId)
{
const char* s = mReader->getAttributeValue(attrId);
if (s[0] != '#')
DefaultLogger::get()->error("Collada: Unresolved reference format of camera");
else
else
pNode->mPrimaryCamera = s+1;
}
}
else if( IsElement( "instance_node"))
else if( IsElement( "instance_node"))
{
// find the node in the library
int attrID = TestAttribute( "url");
if( attrID != -1)
if( attrID != -1)
{
const char* s = mReader->getAttributeValue(attrID);
if (s[0] != '#')
DefaultLogger::get()->error("Collada: Unresolved reference format of node");
else
else
{
pNode->mNodeInstances.push_back(NodeInstance());
pNode->mNodeInstances.back().mNode = s+1;
}
}
}
}
else if( IsElement( "instance_geometry") || IsElement( "instance_controller"))
{
// Reference to a mesh or controller, with possible material associations
ReadNodeGeometry( pNode);
}
else if( IsElement( "instance_light"))
else if( IsElement( "instance_light"))
{
// Reference to a light, name given in 'url' attribute
int attrID = TestAttribute("url");
if (-1 == attrID)
DefaultLogger::get()->warn("Collada: Expected url attribute in <instance_light> element");
else
else
{
const char* url = mReader->getAttributeValue( attrID);
if( url[0] != '#')
@ -2513,13 +2513,13 @@ void ColladaParser::ReadSceneNode( Node* pNode)
pNode->mLights.back().mLight = url+1;
}
}
else if( IsElement( "instance_camera"))
else if( IsElement( "instance_camera"))
{
// Reference to a camera, name given in 'url' attribute
int attrID = TestAttribute("url");
if (-1 == attrID)
DefaultLogger::get()->warn("Collada: Expected url attribute in <instance_camera> element");
else
else
{
const char* url = mReader->getAttributeValue( attrID);
if( url[0] != '#')
@ -2534,7 +2534,7 @@ void ColladaParser::ReadSceneNode( Node* pNode)
// skip everything else for the moment
SkipElement();
}
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
break;
}
@ -2552,7 +2552,7 @@ void ColladaParser::ReadNodeTransformation( Node* pNode, TransformType pType)
Transform tf;
tf.mType = pType;
// read SID
int indexSID = TestAttribute( "sid");
if( indexSID >= 0)
@ -2596,22 +2596,22 @@ void ColladaParser::ReadMaterialVertexInputBinding( Collada::SemanticMappingTabl
// input semantic
n = GetAttribute("input_semantic");
vn.mType = GetTypeForSemantic( mReader->getAttributeValue(n) );
// index of input set
n = TestAttribute("input_set");
if (-1 != n)
vn.mSet = mReader->getAttributeValueAsInt(n);
tbl.mMap[s] = vn;
}
}
else if( IsElement( "bind")) {
DefaultLogger::get()->warn("Collada: Found unsupported <bind> element");
}
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
if( strcmp( mReader->getNodeName(), "instance_material") == 0)
break;
}
}
}
}
@ -2624,7 +2624,7 @@ void ColladaParser::ReadNodeGeometry( Node* pNode)
const char* url = mReader->getAttributeValue( attrUrl);
if( url[0] != '#')
ThrowException( "Unknown reference format");
Collada::MeshInstance instance;
instance.mMeshOrController = url+1; // skipping the leading #
@ -2633,7 +2633,7 @@ void ColladaParser::ReadNodeGeometry( Node* pNode)
// read material associations. Ignore additional elements inbetween
while( mReader->read())
{
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
if( mReader->getNodeType() == irr::io::EXN_ELEMENT)
{
if( IsElement( "instance_material"))
{
@ -2654,14 +2654,14 @@ void ColladaParser::ReadNodeGeometry( Node* pNode)
// store the association
instance.mMaterials[group] = s;
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{
if( strcmp( mReader->getNodeName(), "instance_geometry") == 0
if( strcmp( mReader->getNodeName(), "instance_geometry") == 0
|| strcmp( mReader->getNodeName(), "instance_controller") == 0)
break;
}
}
}
}
@ -2691,7 +2691,7 @@ void ColladaParser::ReadScene()
if( url[0] != '#')
ThrowException( "Unknown reference format in <instance_visual_scene> element");
// find the referred scene, skip the leading #
// find the referred scene, skip the leading #
NodeLibrary::const_iterator sit = mNodeLibrary.find( url+1);
if( sit == mNodeLibrary.end())
ThrowException( "Unable to resolve visual_scene reference \"" + std::string(url) + "\" in <instance_visual_scene> element.");
@ -2699,10 +2699,10 @@ void ColladaParser::ReadScene()
} else {
SkipElement();
}
}
}
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END){
break;
}
}
}
}
@ -2729,8 +2729,8 @@ void ColladaParser::SkipElement()
// Skips all data until the end node of the given element
void ColladaParser::SkipElement( const char* pElement)
{
// copy the current node's name because it'a pointer to the reader's internal buffer,
// which is going to change with the upcoming parsing
// copy the current node's name because it'a pointer to the reader's internal buffer,
// which is going to change with the upcoming parsing
std::string element = pElement;
while( mReader->read())
{
@ -2852,8 +2852,8 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vector<Transform
aiVector3D dir = aiVector3D( dstPos - pos).Normalize();
aiVector3D right = (dir ^ up).Normalize();
res *= aiMatrix4x4(
right.x, up.x, -dir.x, pos.x,
res *= aiMatrix4x4(
right.x, up.x, -dir.x, pos.x,
right.y, up.y, -dir.y, pos.y,
right.z, up.z, -dir.z, pos.z,
0, 0, 0, 1);
@ -2877,7 +2877,7 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vector<Transform
}
case TF_SCALE:
{
aiMatrix4x4 scale( tf.f[0], 0.0f, 0.0f, 0.0f, 0.0f, tf.f[1], 0.0f, 0.0f, 0.0f, 0.0f, tf.f[2], 0.0f,
aiMatrix4x4 scale( tf.f[0], 0.0f, 0.0f, 0.0f, 0.0f, tf.f[1], 0.0f, 0.0f, 0.0f, 0.0f, tf.f[2], 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
res *= scale;
break;
@ -2893,7 +2893,7 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vector<Transform
res *= mat;
break;
}
default:
default:
ai_assert( false);
break;
}

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,23 +23,23 @@ contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 ColladaParser.h
* @brief Defines the parser helper class for the collada loader
* @brief Defines the parser helper class for the collada loader
*/
#ifndef AI_COLLADAPARSER_H_INC
@ -54,9 +54,9 @@ namespace Assimp
{
// ------------------------------------------------------------------------------------------
/** Parser helper class for the Collada loader.
/** Parser helper class for the Collada loader.
*
* Does all the XML reading and builds internal data structures from it,
* Does all the XML reading and builds internal data structures from it,
* but leaves the resolving of all the references to the loader.
*/
class ColladaParser
@ -154,7 +154,7 @@ protected:
/** Reads a mesh from the geometry library */
void ReadMesh( Collada::Mesh* pMesh);
/** Reads a source element - a combination of raw data and an accessor defining
/** Reads a source element - a combination of raw data and an accessor defining
* things that should not be redefinable. Yes, that's another rant.
*/
void ReadSource();
@ -164,7 +164,7 @@ protected:
*/
void ReadDataArray();
/** Reads an accessor and stores it in the global library under the given ID -
/** Reads an accessor and stores it in the global library under the given ID -
* accessors use the ID of the parent <source> element
*/
void ReadAccessor( const std::string& pID);
@ -231,7 +231,7 @@ protected:
/** Tests for the closing tag of the given element, throws an exception if not found */
void TestClosing( const char* pName);
/** Checks the present element for the presence of the attribute, returns its index
/** Checks the present element for the presence of the attribute, returns its index
or throws an exception if not found */
int GetAttribute( const char* pAttr) const;
@ -239,7 +239,7 @@ protected:
therefore useful for optional attributes */
int TestAttribute( const char* pAttr) const;
/** Reads the text contents of an element, throws an exception if not given.
/** Reads the text contents of an element, throws an exception if not given.
Skips leading whitespace. */
const char* GetTextContent();
@ -270,7 +270,7 @@ protected:
/** XML reader, member for everyday use */
irr::io::IrrXMLReader* mReader;
/** All data arrays found in the file by ID. Might be referred to by actually
/** All data arrays found in the file by ID. Might be referred to by actually
everyone. Collada, you are a steaming pile of indirection. */
typedef std::map<std::string, Collada::Data> DataLibrary;
DataLibrary mDataLibrary;
@ -311,7 +311,7 @@ protected:
typedef std::map<std::string, Collada::Controller> ControllerLibrary;
ControllerLibrary mControllerLibrary;
/** Pointer to the root node. Don't delete, it just points to one of
/** Pointer to the root node. Don't delete, it just points to one of
the nodes in the node library. */
Collada::Node* mRootNode;
@ -332,13 +332,13 @@ protected:
// Check for element match
inline bool ColladaParser::IsElement( const char* pName) const
{
ai_assert( mReader->getNodeType() == irr::io::EXN_ELEMENT);
return ::strcmp( mReader->getNodeName(), pName) == 0;
ai_assert( mReader->getNodeType() == irr::io::EXN_ELEMENT);
return ::strcmp( mReader->getNodeName(), pName) == 0;
}
// ------------------------------------------------------------------------------------------------
// Finds the item in the given library by its reference, throws if not found
template <typename Type>
template <typename Type>
const Type& ColladaParser::ResolveLibraryReference( const std::map<std::string, Type>& pLibrary, const std::string& pURL) const
{
typename std::map<std::string, Type>::const_iterator it = pLibrary.find( pURL);

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -96,7 +96,7 @@ inline unsigned int FindEmptyUVChannel (aiMesh* mesh)
{
for (unsigned int m = 0; m < AI_MAX_NUMBER_OF_TEXTURECOORDS;++m)
if (!mesh->mTextureCoords[m])return m;
DefaultLogger::get()->error("Unable to compute UV coordinates, no free UV slot found");
return UINT_MAX;
}
@ -106,8 +106,8 @@ inline unsigned int FindEmptyUVChannel (aiMesh* mesh)
void RemoveUVSeams (aiMesh* mesh, aiVector3D* out)
{
// TODO: just a very rough algorithm. I think it could be done
// much easier, but I don't know how and am currently too tired to
// to think about a better solution.
// much easier, but I don't know how and am currently too tired to
// to think about a better solution.
const static float LOWER_LIMIT = 0.1f;
const static float UPPER_LIMIT = 0.9f;
@ -125,7 +125,7 @@ void RemoveUVSeams (aiMesh* mesh, aiVector3D* out)
// Check whether this face lies on a UV seam. We can just guess,
// but the assumption that a face with at least one very small
// on the one side and one very large U coord on the other side
// on the one side and one very large U coord on the other side
// lies on a UV seam should work for most cases.
for (unsigned int n = 0; n < face.mNumIndices;++n)
{
@ -153,12 +153,12 @@ void RemoveUVSeams (aiMesh* mesh, aiVector3D* out)
{
for (unsigned int n = 0; n < face.mNumIndices;++n)
{
// If the u value is over the upper limit and no other u
// If the u value is over the upper limit and no other u
// value of that face is 0, round it to 0
if (out[face.mIndices[n]].x > UPPER_LIMIT && !zero)
out[face.mIndices[n]].x = 0.f;
// If the u value is below the lower limit and no other u
// If the u value is below the lower limit and no other u
// value of that face is 1, round it to 1
else if (out[face.mIndices[n]].x < LOWER_LIMIT && !one)
out[face.mIndices[n]].x = 1.f;
@ -166,7 +166,7 @@ void RemoveUVSeams (aiMesh* mesh, aiVector3D* out)
// The face contains both 0 and 1 as UV coords. This can occur
// for faces which have an edge that lies directly on the seam.
// Due to numerical inaccuracies one U coord becomes 0, the
// other 1. But we do still have a third UV coord to determine
// other 1. But we do still have a third UV coord to determine
// to which side we must round to.
else if (one && zero)
{
@ -188,7 +188,7 @@ void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D
// If the axis is one of x,y,z run a faster code path. It's worth the extra effort ...
// currently the mapping axis will always be one of x,y,z, except if the
// PretransformVertices step is used (it transforms the meshes into worldspace,
// PretransformVertices step is used (it transforms the meshes into worldspace,
// thus changing the mapping axis)
if (axis * base_axis_x >= angle_epsilon) {
@ -200,7 +200,7 @@ void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D
// x = cos(lon)*cos(lat)
// y = sin(lon)*cos(lat)
// z = sin(lat)
//
//
// Thus we can derive:
// lat = arcsin (z)
// lon = arctan (y/x)
@ -238,8 +238,8 @@ void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D
(asin (diff.z) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
}
}
// Now find and remove UV seams. A seam occurs if a face has a tcoord
// close to zero on the one side, and a tcoord close to one on the
// other side.
@ -253,13 +253,13 @@ void ComputeUVMappingProcess::ComputeCylinderMapping(aiMesh* mesh,const aiVector
// If the axis is one of x,y,z run a faster code path. It's worth the extra effort ...
// currently the mapping axis will always be one of x,y,z, except if the
// PretransformVertices step is used (it transforms the meshes into worldspace,
// PretransformVertices step is used (it transforms the meshes into worldspace,
// thus changing the mapping axis)
if (axis * base_axis_x >= angle_epsilon) {
FindMeshCenter(mesh, center, min, max);
const float diff = max.x - min.x;
// If the main axis is 'z', the z coordinate of a point 'p' is mapped
// If the main axis is 'z', the z coordinate of a point 'p' is mapped
// directly to the texture V axis. The other axis is derived from
// the angle between ( p.x - c.x, p.y - c.y ) and (1,0), where
// 'c' is the center point of the mesh.
@ -328,7 +328,7 @@ void ComputeUVMappingProcess::ComputePlaneMapping(aiMesh* mesh,const aiVector3D&
// If the axis is one of x,y,z run a faster code path. It's worth the extra effort ...
// currently the mapping axis will always be one of x,y,z, except if the
// PretransformVertices step is used (it transforms the meshes into worldspace,
// PretransformVertices step is used (it transforms the meshes into worldspace,
// thus changing the mapping axis)
if (axis * base_axis_x >= angle_epsilon) {
FindMeshCenter(mesh, center, min, max);
@ -386,7 +386,7 @@ void ComputeUVMappingProcess::ComputeBoxMapping( aiMesh*, aiVector3D* )
}
// ------------------------------------------------------------------------------------------------
void ComputeUVMappingProcess::Execute( aiScene* pScene)
void ComputeUVMappingProcess::Execute( aiScene* pScene)
{
DefaultLogger::get()->debug("GenUVCoordsProcess begin");
char buffer[1024];

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -109,7 +109,7 @@ protected:
* @param axis Main axis
* @param out Receives output UV coordinates
*/
void ComputePlaneMapping(aiMesh* mesh,const aiVector3D& axis,
void ComputePlaneMapping(aiMesh* mesh,const aiVector3D& axis,
aiVector3D* out);
// -------------------------------------------------------------------

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -85,7 +85,7 @@ void MakeLeftHandedProcess::Execute( aiScene* pScene)
ai_assert(pScene->mRootNode != NULL);
DefaultLogger::get()->debug("MakeLeftHandedProcess begin");
// recursively convert all the nodes
// recursively convert all the nodes
ProcessNode( pScene->mRootNode, aiMatrix4x4());
// process the meshes accordingly
@ -133,7 +133,7 @@ void MakeLeftHandedProcess::ProcessNode( aiNode* pNode, const aiMatrix4x4& pPare
}
// ------------------------------------------------------------------------------------------------
// Converts a single mesh to left handed coordinates.
// Converts a single mesh to left handed coordinates.
void MakeLeftHandedProcess::ProcessMesh( aiMesh* pMesh)
{
// mirror positions, normals and stuff along the Z axis
@ -141,7 +141,7 @@ void MakeLeftHandedProcess::ProcessMesh( aiMesh* pMesh)
{
pMesh->mVertices[a].z *= -1.0f;
if( pMesh->HasNormals())
pMesh->mNormals[a].z *= -1.0f;
pMesh->mNormals[a].z *= -1.0f;
if( pMesh->HasTangentsAndBitangents())
{
pMesh->mTangents[a].z *= -1.0f;
@ -170,7 +170,7 @@ void MakeLeftHandedProcess::ProcessMesh( aiMesh* pMesh)
}
// ------------------------------------------------------------------------------------------------
// Converts a single material to left handed coordinates.
// Converts a single material to left handed coordinates.
void MakeLeftHandedProcess::ProcessMaterial( aiMaterial* _mat)
{
aiMaterial* mat = (aiMaterial*)_mat;
@ -179,7 +179,7 @@ void MakeLeftHandedProcess::ProcessMaterial( aiMaterial* _mat)
// Mapping axis for UV mappings?
if (!::strcmp( prop->mKey.data, "$tex.mapaxis")) {
ai_assert( prop->mDataLength >= sizeof(aiVector3D)); /* something is wrong with the validation if we end up here */
ai_assert( prop->mDataLength >= sizeof(aiVector3D)); /* something is wrong with the validation if we end up here */
aiVector3D* pff = (aiVector3D*)prop->mData;
pff->z *= -1.f;
@ -188,27 +188,27 @@ void MakeLeftHandedProcess::ProcessMaterial( aiMaterial* _mat)
}
// ------------------------------------------------------------------------------------------------
// Converts the given animation to LH coordinates.
void MakeLeftHandedProcess::ProcessAnimation( aiNodeAnim* pAnim)
{
// position keys
for( unsigned int a = 0; a < pAnim->mNumPositionKeys; a++)
pAnim->mPositionKeys[a].mValue.z *= -1.0f;
// Converts the given animation to LH coordinates.
void MakeLeftHandedProcess::ProcessAnimation( aiNodeAnim* pAnim)
{
// position keys
for( unsigned int a = 0; a < pAnim->mNumPositionKeys; a++)
pAnim->mPositionKeys[a].mValue.z *= -1.0f;
// rotation keys
for( unsigned int a = 0; a < pAnim->mNumRotationKeys; a++)
{
/* That's the safe version, but the float errors add up. So we try the short version instead
aiMatrix3x3 rotmat = pAnim->mRotationKeys[a].mValue.GetMatrix();
rotmat.a3 = -rotmat.a3; rotmat.b3 = -rotmat.b3;
rotmat.c1 = -rotmat.c1; rotmat.c2 = -rotmat.c2;
aiQuaternion rotquat( rotmat);
pAnim->mRotationKeys[a].mValue = rotquat;
*/
pAnim->mRotationKeys[a].mValue.x *= -1.0f;
pAnim->mRotationKeys[a].mValue.y *= -1.0f;
}
}
// rotation keys
for( unsigned int a = 0; a < pAnim->mNumRotationKeys; a++)
{
/* That's the safe version, but the float errors add up. So we try the short version instead
aiMatrix3x3 rotmat = pAnim->mRotationKeys[a].mValue.GetMatrix();
rotmat.a3 = -rotmat.a3; rotmat.b3 = -rotmat.b3;
rotmat.c1 = -rotmat.c1; rotmat.c2 = -rotmat.c2;
aiQuaternion rotquat( rotmat);
pAnim->mRotationKeys[a].mValue = rotquat;
*/
pAnim->mRotationKeys[a].mValue.x *= -1.0f;
pAnim->mRotationKeys[a].mValue.y *= -1.0f;
}
}
#endif // !! ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS
#ifndef ASSIMP_BUILD_NO_FLIPUVS_PROCESS
@ -245,7 +245,7 @@ void FlipUVsProcess::Execute( aiScene* pScene)
}
// ------------------------------------------------------------------------------------------------
// Converts a single material
// Converts a single material
void FlipUVsProcess::ProcessMaterial (aiMaterial* _mat)
{
aiMaterial* mat = (aiMaterial*)_mat;
@ -269,7 +269,7 @@ void FlipUVsProcess::ProcessMaterial (aiMaterial* _mat)
}
// ------------------------------------------------------------------------------------------------
// Converts a single mesh
// Converts a single mesh
void FlipUVsProcess::ProcessMesh( aiMesh* pMesh)
{
// mirror texture y coordinate
@ -316,7 +316,7 @@ void FlipWindingOrderProcess::Execute( aiScene* pScene)
}
// ------------------------------------------------------------------------------------------------
// Converts a single mesh
// Converts a single mesh
void FlipWindingOrderProcess::ProcessMesh( aiMesh* pMesh)
{
// invert the order of all faces in this mesh

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* - LH to RH
* - UV origin upper-left to lower-left
* - face order cw to ccw
* - face order cw to ccw
*/
#ifndef AI_CONVERTTOLHPROCESS_H_INC
#define AI_CONVERTTOLHPROCESS_H_INC
@ -61,9 +61,9 @@ namespace Assimp {
// -----------------------------------------------------------------------------------
/** @brief The MakeLeftHandedProcess converts all imported data to a left-handed
* coordinate system.
* coordinate system.
*
* This implies a mirroring of the Z axis of the coordinate system. But to keep
* This implies a mirroring of the Z axis of the coordinate system. But to keep
* transformation matrices free from reflections we shift the reflection to other
* places. We mirror the meshes and adapt the rotations.
*
@ -71,7 +71,7 @@ namespace Assimp {
*/
class MakeLeftHandedProcess : public BaseProcess
{
public:
MakeLeftHandedProcess();
@ -91,7 +91,7 @@ protected:
void ProcessNode( aiNode* pNode, const aiMatrix4x4& pParentGlobalRotation);
// -------------------------------------------------------------------
/** Converts a single mesh to left handed coordinates.
/** Converts a single mesh to left handed coordinates.
* This means that positions, normals and tangents are mirrored at
* the local Z axis and the order of all faces are inverted.
* @param pMesh The mesh to convert.
@ -105,7 +105,7 @@ protected:
void ProcessMaterial( aiMaterial* pMat);
// -------------------------------------------------------------------
/** Converts the given animation to LH coordinates.
/** Converts the given animation to LH coordinates.
* The rotation and translation keys are transformed, the scale keys
* work in local space and can therefore be left untouched.
* @param pAnim The bone animation to transform

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,22 +23,22 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 DXFHelper.h
/** @file DXFHelper.h
* @brief Internal utilities for the DXF loader.
*/
@ -180,7 +180,7 @@ struct PolyLine
PolyLine()
: flags()
{}
std::vector<aiVector3D> positions;
std::vector<aiColor4D> colors;
std::vector<unsigned int> indices;

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -59,14 +59,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using namespace Assimp;
// AutoCAD Binary DXF<CR><LF><SUB><NULL>
// AutoCAD Binary DXF<CR><LF><SUB><NULL>
#define AI_DXF_BINARY_IDENT ("AutoCAD Binary DXF\r\n\x1a\0")
#define AI_DXF_BINARY_IDENT_LEN (24)
// default vertex color that all uncolored vertices will receive
#define AI_DXF_DEFAULT_COLOR aiColor4D(0.6f,0.6f,0.6f,0.6f)
// color indices for DXF - 16 are supported, the table is
// color indices for DXF - 16 are supported, the table is
// taken directly from the DXF spec.
static aiColor4D g_aclrDxfIndexColors[] =
{
@ -101,7 +101,7 @@ static const aiImporterDesc desc = {
0,
0,
0,
"dxf"
"dxf"
};
// ------------------------------------------------------------------------------------------------
@ -110,12 +110,12 @@ DXFImporter::DXFImporter()
{}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
// Destructor, private as well
DXFImporter::~DXFImporter()
{}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Returns whether the class can handle the format of the given file.
bool DXFImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, bool /*checkSig*/) const
{
return SimpleExtensionCheck(pFile,"dxf");
@ -129,13 +129,13 @@ const aiImporterDesc* DXFImporter::GetInfo () const
}
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void DXFImporter::InternReadFile( const std::string& pFile,
aiScene* pScene,
// Imports the given file into the given scene structure.
void DXFImporter::InternReadFile( const std::string& pFile,
aiScene* pScene,
IOSystem* pIOHandler)
{
boost::shared_ptr<IOStream> file = boost::shared_ptr<IOStream>( pIOHandler->Open( pFile) );
// Check whether we can read the file
if( file.get() == NULL) {
throw DeadlyImportError( "Failed to open DXF file " + pFile + "");
@ -153,7 +153,7 @@ void DXFImporter::InternReadFile( const std::string& pFile,
// which will choose a suitable strategy.
file->Seek(0,aiOrigin_SET);
StreamReaderLE stream( file );
DXF::LineReader reader (stream);
DXF::FileData output;
@ -167,14 +167,14 @@ void DXFImporter::InternReadFile( const std::string& pFile,
ParseBlocks(reader,output);
continue;
}
// primary entity table
if (reader.Is(2,"ENTITIES")) {
ParseEntities(reader,output);
continue;
}
// skip unneeded sections entirely to avoid any problems with them
// skip unneeded sections entirely to avoid any problems with them
// alltogether.
else if (reader.Is(2,"CLASSES") || reader.Is(2,"TABLES")) {
SkipSection(reader);
@ -239,7 +239,7 @@ void DXFImporter::ConvertMeshes(aiScene* pScene, DXF::FileData& output)
}
DXF::Block* entities = 0;
// index blocks by name
DXF::BlockMap blocks_by_name;
BOOST_FOREACH (DXF::Block& bl, output.blocks) {
@ -296,7 +296,7 @@ void DXFImporter::ConvertMeshes(aiScene* pScene, DXF::FileData& output)
unsigned int cvert = 0,cface = 0;
BOOST_FOREACH(const DXF::PolyLine* pl, corr[elem.second]){
// sum over all faces since we need to 'verbosify' them.
cvert += std::accumulate(pl->counts.begin(),pl->counts.end(),0);
cvert += std::accumulate(pl->counts.begin(),pl->counts.end(),0);
cface += pl->counts.size();
}
@ -371,7 +371,7 @@ void DXFImporter::ExpandBlockReferences(DXF::Block& bl,const DXF::BlockMap& bloc
// XXX this would be the place to implement recursive expansion if needed.
const DXF::Block& bl_src = *(*it).second;
BOOST_FOREACH (boost::shared_ptr<const DXF::PolyLine> pl_in, bl_src.lines) {
boost::shared_ptr<DXF::PolyLine> pl_out = boost::shared_ptr<DXF::PolyLine>(new DXF::PolyLine(*pl_in));
@ -454,21 +454,21 @@ void DXFImporter::GenerateHierarchy(aiScene* pScene, DXF::FileData& /*output*/)
// ------------------------------------------------------------------------------------------------
void DXFImporter::SkipSection(DXF::LineReader& reader)
{
{
for( ;!reader.End() && !reader.Is(0,"ENDSEC"); reader++);
}
// ------------------------------------------------------------------------------------------------
void DXFImporter::ParseHeader(DXF::LineReader& reader, DXF::FileData& /*output*/)
{
{
for( ;!reader.End() && !reader.Is(0,"ENDSEC"); reader++);
}
// ------------------------------------------------------------------------------------------------
void DXFImporter::ParseBlocks(DXF::LineReader& reader, DXF::FileData& output)
{
{
while( !reader.End() && !reader.Is(0,"ENDSEC")) {
if (reader.Is(0,"BLOCK")) {
ParseBlock(++reader,output);
@ -485,7 +485,7 @@ void DXFImporter::ParseBlocks(DXF::LineReader& reader, DXF::FileData& output)
// ------------------------------------------------------------------------------------------------
void DXFImporter::ParseBlock(DXF::LineReader& reader, DXF::FileData& output)
{
{
// push a new block onto the stack.
output.blocks.push_back( DXF::Block() );
DXF::Block& block = output.blocks.back();
@ -532,7 +532,7 @@ void DXFImporter::ParseBlock(DXF::LineReader& reader, DXF::FileData& output)
// ------------------------------------------------------------------------------------------------
void DXFImporter::ParseEntities(DXF::LineReader& reader, DXF::FileData& output)
{
{
// push a new block onto the stack.
output.blocks.push_back( DXF::Block() );
DXF::Block& block = output.blocks.back();
@ -566,13 +566,13 @@ void DXFImporter::ParseEntities(DXF::LineReader& reader, DXF::FileData& output)
void DXFImporter::ParseInsertion(DXF::LineReader& reader, DXF::FileData& output)
{
{
output.blocks.back().insertions.push_back( DXF::InsertBlock() );
DXF::InsertBlock& bl = output.blocks.back().insertions.back();
while( !reader.End() && !reader.Is(0)) {
switch(reader.GroupCode())
switch(reader.GroupCode())
{
// name of referenced block
case 2:
@ -623,7 +623,7 @@ void DXFImporter::ParsePolyLine(DXF::LineReader& reader, DXF::FileData& output)
unsigned int iguess = 0, vguess = 0;
while( !reader.End() && !reader.Is(0,"ENDSEC")) {
if (reader.Is(0,"VERTEX")) {
ParsePolyLineVertex(++reader,line);
if (reader.Is(0,"SEQEND")) {
@ -632,9 +632,9 @@ void DXFImporter::ParsePolyLine(DXF::LineReader& reader, DXF::FileData& output)
continue;
}
switch(reader.GroupCode())
switch(reader.GroupCode())
{
// flags --- important that we know whether it is a
// flags --- important that we know whether it is a
// polyface mesh or 'just' a line.
case 70:
if (!line.flags) {
@ -682,7 +682,7 @@ void DXFImporter::ParsePolyLine(DXF::LineReader& reader, DXF::FileData& output)
return;
}
// if these numbers are wrong, parsing might have gone wild.
// if these numbers are wrong, parsing might have gone wild.
// however, the docs state that applications are not required
// to set the 71 and 72 fields, respectively, to valid values.
// So just fire a warning.
@ -752,10 +752,10 @@ void DXFImporter::ParsePolyLineVertex(DXF::LineReader& reader, DXF::PolyLine& li
case 30: out.z = reader.ValueAsFloat();break;
// POLYFACE vertex indices
case 71:
case 71:
case 72:
case 73:
case 74:
case 74:
if (cnti == 4) {
DefaultLogger::get()->warn("DXF: more than 4 indices per face not supported; ignoring");
break;
@ -764,14 +764,14 @@ void DXFImporter::ParsePolyLineVertex(DXF::LineReader& reader, DXF::PolyLine& li
break;
// color
case 62:
clr = g_aclrDxfIndexColors[reader.ValueAsUnsignedInt() % AI_DXF_NUM_INDEX_COLORS];
case 62:
clr = g_aclrDxfIndexColors[reader.ValueAsUnsignedInt() % AI_DXF_NUM_INDEX_COLORS];
break;
};
reader++;
}
if (line.flags & DXF_POLYLINE_FLAG_POLYFACEMESH && !(flags & DXF_VERTEX_FLAG_PART_OF_POLYFACE)) {
DefaultLogger::get()->warn("DXF: expected vertex to be part of a polyface but the 0x128 flag isn't set");
}
@ -805,7 +805,7 @@ void DXFImporter::Parse3DFace(DXF::LineReader& reader, DXF::FileData& output)
aiVector3D vip[4];
aiColor4D clr = AI_DXF_DEFAULT_COLOR;
bool b[4] = {false,false,false,false};
while( !reader.End() ) {
@ -813,11 +813,11 @@ void DXFImporter::Parse3DFace(DXF::LineReader& reader, DXF::FileData& output)
if (reader.GroupCode() == 0) {
break;
}
switch (reader.GroupCode())
switch (reader.GroupCode())
{
// 8 specifies the layer
case 8:
case 8:
line.layer = reader.Value();
break;
@ -882,8 +882,8 @@ void DXFImporter::Parse3DFace(DXF::LineReader& reader, DXF::FileData& output)
break;
// color
case 62:
clr = g_aclrDxfIndexColors[reader.ValueAsUnsignedInt() % AI_DXF_NUM_INDEX_COLORS];
case 62:
clr = g_aclrDxfIndexColors[reader.ValueAsUnsignedInt() % AI_DXF_NUM_INDEX_COLORS];
break;
};
@ -895,7 +895,7 @@ void DXFImporter::Parse3DFace(DXF::LineReader& reader, DXF::FileData& output)
if (vip[3] == vip[2]) {
b[1] = false;
}
// sanity checks to see if we got something meaningful
if ((b[1] && !b[0]) || !b[2] || !b[3]) {
DefaultLogger::get()->warn("DXF: unexpected vertex setup in 3DFACE/LINE/FACE entity; ignoring");

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,22 +23,22 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 DXFLoader.h
/** @file DXFLoader.h
* @brief Declaration of the .dxf importer class.
*/
#ifndef AI_DXFLOADER_H_INCLUDED
@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp {
namespace DXF {
class LineReader;
struct FileData;
struct PolyLine;
@ -74,9 +74,9 @@ public:
public:
// -------------------------------------------------------------------
/** Returns whether the class can handle the format of the given file.
/** Returns whether the class can handle the format of the given file.
* See BaseImporter::CanRead() for details. */
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
bool checkSig) const;
protected:
@ -87,10 +87,10 @@ protected:
const aiImporterDesc* GetInfo () const;
// -------------------------------------------------------------------
/** Imports the given file into the given scene structure.
/** Imports the given file into the given scene structure.
* See BaseImporter::InternReadFile() for details */
void InternReadFile( const std::string& pFile,
aiScene* pScene,
void InternReadFile( const std::string& pFile,
aiScene* pScene,
IOSystem* pIOHandler);
private:
@ -107,39 +107,39 @@ private:
DXF::FileData& output);
// -----------------------------------------------------
void ParseBlocks(DXF::LineReader& reader,
void ParseBlocks(DXF::LineReader& reader,
DXF::FileData& output);
// -----------------------------------------------------
void ParseBlock(DXF::LineReader& reader,
void ParseBlock(DXF::LineReader& reader,
DXF::FileData& output);
// -----------------------------------------------------
void ParseInsertion(DXF::LineReader& reader,
void ParseInsertion(DXF::LineReader& reader,
DXF::FileData& output);
// -----------------------------------------------------
void ParsePolyLine(DXF::LineReader& reader,
void ParsePolyLine(DXF::LineReader& reader,
DXF::FileData& output);
// -----------------------------------------------------
void ParsePolyLineVertex(DXF::LineReader& reader,
void ParsePolyLineVertex(DXF::LineReader& reader,
DXF::PolyLine& line);
// -----------------------------------------------------
void Parse3DFace(DXF::LineReader& reader,
void Parse3DFace(DXF::LineReader& reader,
DXF::FileData& output);
// -----------------------------------------------------
void ConvertMeshes(aiScene* pScene,
void ConvertMeshes(aiScene* pScene,
DXF::FileData& output);
// -----------------------------------------------------
void GenerateHierarchy(aiScene* pScene,
void GenerateHierarchy(aiScene* pScene,
DXF::FileData& output);
// -----------------------------------------------------
void GenerateMaterials(aiScene* pScene,
void GenerateMaterials(aiScene* pScene,
DXF::FileData& output);
// -----------------------------------------------------

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -79,7 +79,7 @@ bool DeboneProcess::IsActive( unsigned int pFlags) const
// ------------------------------------------------------------------------------------------------
// Executes the post processing step on the given imported data.
void DeboneProcess::SetupProperties(const Importer* pImp)
{
{
// get the current value of the property
mAllOrNone = pImp->GetPropertyInteger(AI_CONFIG_PP_DB_ALL_OR_NONE,0)?true:false;
mThreshold = pImp->GetPropertyFloat(AI_CONFIG_PP_DB_THRESHOLD,AI_DEBONE_THRESHOLD);
@ -95,12 +95,12 @@ void DeboneProcess::Execute( aiScene* pScene)
return;
}
std::vector<bool> splitList(pScene->mNumMeshes);
std::vector<bool> splitList(pScene->mNumMeshes);
for( unsigned int a = 0; a < pScene->mNumMeshes; a++) {
splitList[a] = ConsiderMesh( pScene->mMeshes[a] );
}
int numSplits = 0;
int numSplits = 0;
if(!!mNumBonesCanDoWithout && (!mAllOrNone||mNumBonesCanDoWithout==mNumBones)) {
for(unsigned int a = 0; a < pScene->mNumMeshes; a++) {
@ -124,16 +124,16 @@ void DeboneProcess::Execute( aiScene* pScene)
std::vector<std::pair<aiMesh*,const aiBone*> > newMeshes;
if(splitList[a]) {
if(splitList[a]) {
SplitMesh(srcMesh,newMeshes);
}
// mesh was split
if(!newMeshes.empty()) {
unsigned int out = 0, in = srcMesh->mNumBones;
if(!newMeshes.empty()) {
unsigned int out = 0, in = srcMesh->mNumBones;
// store new meshes and indices of the new meshes
for(unsigned int b=0;b<newMeshes.size();b++) {
for(unsigned int b=0;b<newMeshes.size();b++) {
const aiString *find = newMeshes[b].second?&newMeshes[b].second->mName:0;
aiNode *theNode = find?pScene->mRootNode->FindNode(*find):0;
@ -144,7 +144,7 @@ void DeboneProcess::Execute( aiScene* pScene)
out+=newMeshes[b].first->mNumBones;
}
if(!DefaultLogger::isNullLogger()) {
char buffer[1024];
::sprintf(buffer,"Removed %u bones. Input bones: %u. Output bones: %u",in-out,in,out);
@ -159,8 +159,8 @@ void DeboneProcess::Execute( aiScene* pScene)
mSubMeshIndices[a].push_back(std::pair<unsigned int,aiNode*>(meshes.size(),(aiNode*)0));
meshes.push_back(srcMesh);
}
}
}
// rebuild the scene's mesh array
pScene->mNumMeshes = meshes.size();
delete [] pScene->mMeshes;
@ -207,14 +207,14 @@ bool DeboneProcess::ConsiderMesh(const aiMesh* pMesh)
if(vertexBones[vid]!=cUnowned) {
if(vertexBones[vid]==i) //double entry
{
DefaultLogger::get()->warn("Encountered double entry in bone weights");
DefaultLogger::get()->warn("Encountered double entry in bone weights");
}
else //TODO: track attraction in order to break tie
{
vertexBones[vid] = cCoowned;
}
}
else vertexBones[vid] = i;
else vertexBones[vid] = i;
}
if(!isBoneNecessary[i]) {
@ -235,8 +235,8 @@ bool DeboneProcess::ConsiderMesh(const aiMesh* pMesh)
unsigned int w = vertexBones[pMesh->mFaces[i].mIndices[j]];
if(v!=w) {
if(v<pMesh->mNumBones) isBoneNecessary[v] = true;
if(w<pMesh->mNumBones) isBoneNecessary[w] = true;
if(v<pMesh->mNumBones) isBoneNecessary[v] = true;
if(w<pMesh->mNumBones) isBoneNecessary[w] = true;
}
}
}
@ -244,10 +244,10 @@ bool DeboneProcess::ConsiderMesh(const aiMesh* pMesh)
for(unsigned int i=0;i<pMesh->mNumBones;i++) {
if(!isBoneNecessary[i]) {
mNumBonesCanDoWithout++;
mNumBonesCanDoWithout++;
split = true;
}
mNumBones++;
}
return split;
@ -279,14 +279,14 @@ void DeboneProcess::SplitMesh( const aiMesh* pMesh, std::vector< std::pair< aiMe
if(vertexBones[vid]!=cUnowned) {
if(vertexBones[vid]==i) //double entry
{
//DefaultLogger::get()->warn("Encountered double entry in bone weights");
//DefaultLogger::get()->warn("Encountered double entry in bone weights");
}
else //TODO: track attraction in order to break tie
{
vertexBones[vid] = cCoowned;
}
}
else vertexBones[vid] = i;
else vertexBones[vid] = i;
}
if(!isBoneNecessary[i]) {
@ -309,32 +309,32 @@ void DeboneProcess::SplitMesh( const aiMesh* pMesh, std::vector< std::pair< aiMe
unsigned int w = vertexBones[pMesh->mFaces[i].mIndices[j]];
if(v!=w) {
if(v<pMesh->mNumBones) isBoneNecessary[v] = true;
if(w<pMesh->mNumBones) isBoneNecessary[w] = true;
if(v<pMesh->mNumBones) isBoneNecessary[v] = true;
if(w<pMesh->mNumBones) isBoneNecessary[w] = true;
}
else nInterstitial++;
}
if(v<pMesh->mNumBones &&nInterstitial==pMesh->mFaces[i].mNumIndices) {
if(v<pMesh->mNumBones &&nInterstitial==pMesh->mFaces[i].mNumIndices) {
faceBones[i] = v; //primitive belongs to bone #v
facesPerBone[v]++;
}
else nFacesUnowned++;
else nFacesUnowned++;
}
// invalidate any "cojoined" faces
for(unsigned int i=0;i<pMesh->mNumFaces;i++) {
if(faceBones[i]<pMesh->mNumBones&&isBoneNecessary[faceBones[i]])
if(faceBones[i]<pMesh->mNumBones&&isBoneNecessary[faceBones[i]])
{
ai_assert(facesPerBone[faceBones[i]]>0);
facesPerBone[faceBones[i]]--;
nFacesUnowned++;
faceBones[i] = cUnowned;
facesPerBone[faceBones[i]]--;
nFacesUnowned++;
faceBones[i] = cUnowned;
}
}
if(nFacesUnowned) {
if(nFacesUnowned) {
std::vector<unsigned int> subFaces;
for(unsigned int i=0;i<pMesh->mNumFaces;i++) {
@ -349,9 +349,9 @@ void DeboneProcess::SplitMesh( const aiMesh* pMesh, std::vector< std::pair< aiMe
poNewMeshes.push_back(push_pair);
}
for(unsigned int i=0;i<pMesh->mNumBones;i++) {
for(unsigned int i=0;i<pMesh->mNumBones;i++) {
if(!isBoneNecessary[i]&&facesPerBone[i]>0) {
if(!isBoneNecessary[i]&&facesPerBone[i]>0) {
std::vector<unsigned int> subFaces;
for(unsigned int j=0;j<pMesh->mNumFaces;j++) {
@ -367,7 +367,7 @@ void DeboneProcess::SplitMesh( const aiMesh* pMesh, std::vector< std::pair< aiMe
ApplyTransform(subMesh,pMesh->mBones[i]->mOffsetMatrix);
std::pair<aiMesh*,const aiBone*> push_pair(subMesh,pMesh->mBones[i]);
poNewMeshes.push_back(push_pair);
poNewMeshes.push_back(push_pair);
}
}
}
@ -377,13 +377,13 @@ void DeboneProcess::SplitMesh( const aiMesh* pMesh, std::vector< std::pair< aiMe
void DeboneProcess::UpdateNode(aiNode* pNode) const
{
// rebuild the node's mesh index list
std::vector<unsigned int> newMeshList;
// this will require two passes
unsigned int m = pNode->mNumMeshes, n = mSubMeshIndices.size();
// first pass, look for meshes which have not moved
for(unsigned int a=0;a<m;a++) {
@ -399,7 +399,7 @@ void DeboneProcess::UpdateNode(aiNode* pNode) const
}
}
// second pass, collect deboned meshes
// second pass, collect deboned meshes
for(unsigned int a=0;a<n;a++)
{
@ -436,7 +436,7 @@ void DeboneProcess::ApplyTransform(aiMesh* mesh, const aiMatrix4x4& mat)const
{
// Check whether we need to transform the coordinates at all
if (!mat.IsIdentity()) {
if (mesh->HasPositions()) {
for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
mesh->mVertices[i] = mat * mesh->mVertices[i];

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -59,9 +59,9 @@ namespace Assimp
#endif // !! AI_DEBONE_THRESHOLD
// ---------------------------------------------------------------------------
/** This post processing step removes bones nearly losslessly or according to
/** This post processing step removes bones nearly losslessly or according to
* a configured threshold. In order to remove the bone, the primitives affected by
* the bone are split from the mesh. The split off (new) mesh is boneless. At any
* the bone are split from the mesh. The split off (new) mesh is boneless. At any
* point in time, bones without affect upon a given mesh are to be removed.
*/
class DeboneProcess : public BaseProcess
@ -74,9 +74,9 @@ public:
public:
// -------------------------------------------------------------------
/** Returns whether the processing step is present in the given flag.
* @param pFlags The processing flags the importer was called with.
* @param pFlags The processing flags the importer was called with.
* A bitwise combination of #aiPostProcessSteps.
* @return true if the process is present in this flag fields,
* @return true if the process is present in this flag fields,
* false if not.
*/
bool IsActive( unsigned int pFlags) const;
@ -89,7 +89,7 @@ public:
void SetupProperties(const Importer* pImp);
protected:
// -------------------------------------------------------------------
/** Executes the post processing step on the given imported data.
* At the moment a process is not supposed to fail.
@ -112,7 +112,7 @@ protected:
void UpdateNode(aiNode* pNode) const;
// -------------------------------------------------------------------
// Apply transformation to a mesh
// Apply transformation to a mesh
void ApplyTransform(aiMesh* mesh, const aiMatrix4x4& mat)const;
public:

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,21 +25,21 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 DefaultIOStream.cpp
* @brief Default File I/O implementation for #Importer
* @brief Default File I/O implementation for #Importer
*/
@ -60,8 +60,8 @@ DefaultIOStream::~DefaultIOStream()
}
// ----------------------------------------------------------------------------------
size_t DefaultIOStream::Read(void* pvBuffer,
size_t pSize,
size_t DefaultIOStream::Read(void* pvBuffer,
size_t pSize,
size_t pCount)
{
ai_assert(NULL != pvBuffer && 0 != pSize && 0 != pCount);
@ -69,7 +69,7 @@ size_t DefaultIOStream::Read(void* pvBuffer,
}
// ----------------------------------------------------------------------------------
size_t DefaultIOStream::Write(const void* pvBuffer,
size_t DefaultIOStream::Write(const void* pvBuffer,
size_t pSize,
size_t pCount)
{
@ -86,7 +86,7 @@ aiReturn DefaultIOStream::Seek(size_t pOffset,
}
// Just to check whether our enum maps one to one with the CRT constants
BOOST_STATIC_ASSERT(aiOrigin_CUR == SEEK_CUR &&
BOOST_STATIC_ASSERT(aiOrigin_CUR == SEEK_CUR &&
aiOrigin_END == SEEK_END && aiOrigin_SET == SEEK_SET);
// do the seek
@ -108,7 +108,7 @@ size_t DefaultIOStream::FileSize() const
if (! mFile || mFilename.empty()) {
return 0;
}
if (SIZE_MAX == cachedSize) {
// Although fseek/ftell would allow us to reuse the exising file handle here,
@ -120,17 +120,17 @@ size_t DefaultIOStream::FileSize() const
// See here for details:
// https://www.securecoding.cert.org/confluence/display/seccode/FIO19-C.+Do+not+use+fseek()+and+ftell()+to+compute+the+size+of+a+regular+file
#if defined _WIN32 && !defined __GNUC__
struct __stat64 fileStat;
int err = _stat64( mFilename.c_str(), &fileStat );
if (0 != err)
return 0;
cachedSize = (size_t) (fileStat.st_size);
struct __stat64 fileStat;
int err = _stat64( mFilename.c_str(), &fileStat );
if (0 != err)
return 0;
cachedSize = (size_t) (fileStat.st_size);
#else
struct stat fileStat;
int err = stat(mFilename.c_str(), &fileStat );
if (0 != err)
return 0;
cachedSize = (size_t) (fileStat.st_size);
struct stat fileStat;
int err = stat(mFilename.c_str(), &fileStat );
if (0 != err)
return 0;
cachedSize = (size_t) (fileStat.st_size);
#endif
}
return cachedSize;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -58,13 +58,13 @@ namespace Assimp {
class DefaultIOStream : public IOStream
{
friend class DefaultIOSystem;
#if __ANDROID__
#if __ANDROID__
#if __ANDROID_API__ > 9
#if defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
friend class AndroidJNIIOSystem;
#endif // defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
#endif // __ANDROID_API__ > 9
#endif // __ANDROID__
#endif // __ANDROID__
protected:
DefaultIOStream();
@ -76,14 +76,14 @@ public:
// -------------------------------------------------------------------
/// Read from stream
size_t Read(void* pvBuffer,
size_t pSize,
size_t Read(void* pvBuffer,
size_t pSize,
size_t pCount);
// -------------------------------------------------------------------
/// Write to stream
size_t Write(const void* pvBuffer,
size_t Write(const void* pvBuffer,
size_t pSize,
size_t pCount);
@ -116,8 +116,8 @@ private:
// ----------------------------------------------------------------------------------
inline DefaultIOStream::DefaultIOStream () :
mFile (NULL),
inline DefaultIOStream::DefaultIOStream () :
mFile (NULL),
mFilename (""),
cachedSize (SIZE_MAX)
{
@ -126,9 +126,9 @@ inline DefaultIOStream::DefaultIOStream () :
// ----------------------------------------------------------------------------------
inline DefaultIOStream::DefaultIOStream (FILE* pFile,
inline DefaultIOStream::DefaultIOStream (FILE* pFile,
const std::string &strFilename) :
mFile(pFile),
mFile(pFile),
mFilename(strFilename),
cachedSize (SIZE_MAX)
{

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -57,14 +57,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using namespace Assimp;
// ------------------------------------------------------------------------------------------------
// Constructor.
// Constructor.
DefaultIOSystem::DefaultIOSystem()
{
// nothing to do here
}
// ------------------------------------------------------------------------------------------------
// Destructor.
// Destructor.
DefaultIOSystem::~DefaultIOSystem()
{
// nothing to do here
@ -90,7 +90,7 @@ IOStream* DefaultIOSystem::Open( const char* strFile, const char* strMode)
ai_assert(NULL != strMode);
FILE* file = ::fopen( strFile, strMode);
if( NULL == file)
if( NULL == file)
return NULL;
return new DefaultIOStream(file, (std::string) strFile);
@ -122,7 +122,7 @@ bool IOSystem::ComparePaths (const char* one, const char* second) const
}
// maximum path length
// XXX http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html
// XXX http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html
#ifdef PATH_MAX
# define PATHLIMIT PATH_MAX
#else
@ -140,13 +140,13 @@ inline void MakeAbsolutePath (const char* in, char* _out)
#else
// use realpath
ret = realpath(in, _out);
#endif
#endif
if(!ret) {
// preserve the input path, maybe someone else is able to fix
// the path before it is accessed (e.g. our file system filter)
DefaultLogger::get()->warn("Invalid path: "+std::string(in));
strcpy(_out,in);
}
}
}
// ------------------------------------------------------------------------------------------------
@ -160,7 +160,7 @@ bool DefaultIOSystem::ComparePaths (const char* one, const char* second) const
char temp1[PATHLIMIT];
char temp2[PATHLIMIT];
MakeAbsolutePath (one, temp1);
MakeAbsolutePath (second, temp2);

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -76,7 +76,7 @@ public:
// -------------------------------------------------------------------
/** Compare two paths */
bool ComparePaths (const char* one, const char* second) const;
/** @brief get the file name of a full filepath
* example: /tmp/archive.tar.gz -> archive.tar.gz
*/

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -84,7 +84,7 @@ struct LogStreamInfo
{
// empty
}
// Destructor
~LogStreamInfo()
{
@ -98,7 +98,7 @@ LogStream* LogStream::createDefaultStream(aiDefaultLogStream streams,
const char* name /*= "AssimpLog.txt"*/,
IOSystem* io /*= NULL*/)
{
switch (streams)
switch (streams)
{
// This is a platform-specific feature
case aiDefaultLogStream_DEBUGGER:
@ -154,7 +154,7 @@ Logger *DefaultLogger::create(const char* name /*= "AssimpLog.txt"*/,
// Stream the log to CERR?
if (defStreams & aiDefaultLogStream_STDERR)
m_pLogger->attachStream( LogStream::createDefaultStream(aiDefaultLogStream_STDERR));
// Stream the log to a file
if (defStreams & aiDefaultLogStream_FILE && name && *name)
m_pLogger->attachStream( LogStream::createDefaultStream(aiDefaultLogStream_FILE,name,io));
@ -176,17 +176,17 @@ void Logger::debug(const char* message) {
// ----------------------------------------------------------------------------------
void Logger::info(const char* message) {
// SECURITY FIX: see above
if (strlen(message)>MAX_LOG_MESSAGE_LENGTH) {
return;
}
return OnInfo(message);
}
// ----------------------------------------------------------------------------------
void Logger::warn(const char* message) {
// SECURITY FIX: see above
if (strlen(message)>MAX_LOG_MESSAGE_LENGTH) {
return;
@ -196,7 +196,7 @@ void Logger::warn(const char* message) {
// ----------------------------------------------------------------------------------
void Logger::error(const char* message) {
// SECURITY FIX: see above
if (strlen(message)>MAX_LOG_MESSAGE_LENGTH) {
return;
@ -310,7 +310,7 @@ bool DefaultLogger::attachStream( LogStream *pStream, unsigned int severity )
return true;
}
}
LogStreamInfo *pInfo = new LogStreamInfo( severity, pStream );
m_StreamArray.push_back( pInfo );
return true;
@ -326,7 +326,7 @@ bool DefaultLogger::detatchStream( LogStream *pStream, unsigned int severity )
if (0 == severity) {
severity = SeverityAll;
}
for ( StreamIt it = m_StreamArray.begin();
it != m_StreamArray.end();
++it )
@ -350,7 +350,7 @@ bool DefaultLogger::detatchStream( LogStream *pStream, unsigned int severity )
// ----------------------------------------------------------------------------------
// Constructor
DefaultLogger::DefaultLogger(LogSeverity severity)
DefaultLogger::DefaultLogger(LogSeverity severity)
: Logger ( severity )
, noRepeatMsg (false)
@ -371,7 +371,7 @@ DefaultLogger::~DefaultLogger()
// ----------------------------------------------------------------------------------
// Writes message to stream
void DefaultLogger::WriteToStreams(const char *message,
void DefaultLogger::WriteToStreams(const char *message,
ErrorSeverity ErrorSev )
{
ai_assert(NULL != message);

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -49,16 +49,16 @@ namespace Assimp {
// ------------------------------------------------------------------------------------
/** @brief Internal default implementation of the #ProgressHandler interface. */
class DefaultProgressHandler
class DefaultProgressHandler
: public ProgressHandler {
virtual bool Update(float /*percentage*/) {
return false;
}
}; // !class DefaultProgressHandler
}; // !class DefaultProgressHandler
} // Namespace Assimp
#endif

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2008, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -50,7 +50,7 @@ using std::runtime_error;
#endif
// ---------------------------------------------------------------------------
/** FOR IMPORTER PLUGINS ONLY: Simple exception class to be thrown if an
/** FOR IMPORTER PLUGINS ONLY: Simple exception class to be thrown if an
* unrecoverable error occurs while importing. Loading APIs return
* NULL instead of a valid aiScene then. */
class DeadlyImportError

View File

@ -7,8 +7,8 @@ Copyright (c) 2006-2015, assimp 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
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
@ -25,16 +25,16 @@ conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
---------------------------------------------------------------------------
*/
@ -92,7 +92,7 @@ void ExportSceneAssxml(const char*, IOSystem*, const aiScene*, const ExportPrope
// ------------------------------------------------------------------------------------------------
// global array of all export formats which Assimp supports in its current build
Exporter::ExportFormatEntry gExporters[] =
Exporter::ExportFormatEntry gExporters[] =
{
#ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER
Exporter::ExportFormatEntry( "collada", "COLLADA - Digital Asset Exchange Schema", "dae", &ExportSceneCollada),
@ -108,21 +108,21 @@ Exporter::ExportFormatEntry gExporters[] =
#endif
#ifndef ASSIMP_BUILD_NO_OBJ_EXPORTER
Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj,
Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj,
aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */),
#endif
#ifndef ASSIMP_BUILD_NO_STL_EXPORTER
Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL,
Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL,
aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices
),
Exporter::ExportFormatEntry( "stlb", "Stereolithography (binary)", "stl" , &ExportSceneSTLBinary,
Exporter::ExportFormatEntry( "stlb", "Stereolithography (binary)", "stl" , &ExportSceneSTLBinary,
aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices
),
#endif
#ifndef ASSIMP_BUILD_NO_PLY_EXPORTER
Exporter::ExportFormatEntry( "ply", "Stanford Polygon Library", "ply" , &ExportScenePly,
Exporter::ExportFormatEntry( "ply", "Stanford Polygon Library", "ply" , &ExportScenePly,
aiProcess_PreTransformVertices
),
Exporter::ExportFormatEntry( "plyb", "Stanford Polygon Library (binary)", "ply", &ExportScenePlyBinary,
@ -162,7 +162,7 @@ public:
std::copy(gExporters,gExporters+ASSIMP_NUM_EXPORTERS,mExporters.begin());
}
~ExporterPimpl()
~ExporterPimpl()
{
delete blob;
@ -173,7 +173,7 @@ public:
}
public:
aiExportDataBlob* blob;
boost::shared_ptr< Assimp::IOSystem > mIOSystem;
bool mIsDefaultIOHandler;
@ -199,7 +199,7 @@ using namespace Assimp;
// ------------------------------------------------------------------------------------------------
Exporter :: Exporter()
Exporter :: Exporter()
: pimpl(new ExporterPimpl())
{
}
@ -263,7 +263,7 @@ const aiExportDataBlob* Exporter :: ExportToBlob( const aiScene* pScene, const
// ------------------------------------------------------------------------------------------------
bool IsVerboseFormat(const aiMesh* mesh)
bool IsVerboseFormat(const aiMesh* mesh)
{
// avoid slow vector<bool> specialization
std::vector<unsigned int> seen(mesh->mNumVertices,0);
@ -281,7 +281,7 @@ bool IsVerboseFormat(const aiMesh* mesh)
// ------------------------------------------------------------------------------------------------
bool IsVerboseFormat(const aiScene* pScene)
bool IsVerboseFormat(const aiScene* pScene)
{
for(unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
if(!IsVerboseFormat(pScene->mMeshes[i])) {
@ -301,7 +301,7 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
// format. They will likely not be aware that there is a flag in the scene to indicate
// this, however. To avoid surprises and bug reports, we check for duplicates in
// meshes upfront.
const bool is_verbose_format = !(pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) || IsVerboseFormat(pScene);
const bool is_verbose_format = !(pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) || IsVerboseFormat(pScene);
pimpl->mError = "";
for (size_t i = 0; i < pimpl->mExporters.size(); ++i) {
@ -310,7 +310,7 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
try {
// Always create a full copy of the scene. We might optimize this one day,
// Always create a full copy of the scene. We might optimize this one day,
// but for now it is the most pragmatic way.
aiScene* scenecopy_tmp;
SceneCombiner::CopyScene(&scenecopy_tmp,pScene);
@ -339,7 +339,7 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
// we need to run the MakeVerboseFormat step first.
bool must_join_again = false;
if (!is_verbose_format) {
bool verbosify = false;
for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++) {
BaseProcess* const p = pimpl->mPostProcessingSteps[a];
@ -370,7 +370,7 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
step.Execute(scenecopy.get());
}
}
{
FlipUVsProcess step;
if (step.IsActive(pp)) {
@ -389,9 +389,9 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++) {
BaseProcess* const p = pimpl->mPostProcessingSteps[a];
if (p->IsActive(pp)
&& !dynamic_cast<FlipUVsProcess*>(p)
&& !dynamic_cast<FlipWindingOrderProcess*>(p)
if (p->IsActive(pp)
&& !dynamic_cast<FlipUVsProcess*>(p)
&& !dynamic_cast<FlipWindingOrderProcess*>(p)
&& !dynamic_cast<MakeLeftHandedProcess*>(p)) {
p->Execute(scenecopy.get());
@ -443,14 +443,14 @@ void Exporter :: FreeBlob( )
// ------------------------------------------------------------------------------------------------
const aiExportDataBlob* Exporter :: GetBlob() const
const aiExportDataBlob* Exporter :: GetBlob() const
{
return pimpl->blob;
}
// ------------------------------------------------------------------------------------------------
const aiExportDataBlob* Exporter :: GetOrphanedBlob() const
const aiExportDataBlob* Exporter :: GetOrphanedBlob() const
{
const aiExportDataBlob* tmp = pimpl->blob;
pimpl->blob = NULL;
@ -459,18 +459,18 @@ const aiExportDataBlob* Exporter :: GetOrphanedBlob() const
// ------------------------------------------------------------------------------------------------
size_t Exporter :: GetExportFormatCount() const
size_t Exporter :: GetExportFormatCount() const
{
return pimpl->mExporters.size();
}
// ------------------------------------------------------------------------------------------------
const aiExportFormatDesc* Exporter :: GetExportFormatDescription( size_t pIndex ) const
const aiExportFormatDesc* Exporter :: GetExportFormatDescription( size_t pIndex ) const
{
if (pIndex >= GetExportFormatCount()) {
return NULL;
}
// Return from static storage if the requested index is built-in.
if (pIndex < sizeof(gExporters) / sizeof(gExporters[0])) {
return &gExporters[pIndex].mDescription;
@ -512,7 +512,7 @@ ExportProperties::ExportProperties(const ExportProperties &other)
mStringProperties(other.mStringProperties),
mMatrixProperties(other.mMatrixProperties)
{
}
@ -546,7 +546,7 @@ bool ExportProperties :: SetPropertyMatrix(const char* szName, const aiMatrix4x4
// ------------------------------------------------------------------------------------------------
// Get a configuration property
int ExportProperties :: GetPropertyInteger(const char* szName,
int ExportProperties :: GetPropertyInteger(const char* szName,
int iErrorReturn /*= 0xffffffff*/) const
{
return GetGenericProperty<int>(mIntProperties,szName,iErrorReturn);
@ -554,7 +554,7 @@ int ExportProperties :: GetPropertyInteger(const char* szName,
// ------------------------------------------------------------------------------------------------
// Get a configuration property
float ExportProperties :: GetPropertyFloat(const char* szName,
float ExportProperties :: GetPropertyFloat(const char* szName,
float iErrorReturn /*= 10e10*/) const
{
return GetGenericProperty<float>(mFloatProperties,szName,iErrorReturn);
@ -562,7 +562,7 @@ float ExportProperties :: GetPropertyFloat(const char* szName,
// ------------------------------------------------------------------------------------------------
// Get a configuration property
const std::string ExportProperties :: GetPropertyString(const char* szName,
const std::string ExportProperties :: GetPropertyString(const char* szName,
const std::string& iErrorReturn /*= ""*/) const
{
return GetGenericProperty<std::string>(mStringProperties,szName,iErrorReturn);
@ -570,7 +570,7 @@ const std::string ExportProperties :: GetPropertyString(const char* szName,
// ------------------------------------------------------------------------------------------------
// Has a configuration property
const aiMatrix4x4 ExportProperties :: GetPropertyMatrix(const char* szName,
const aiMatrix4x4 ExportProperties :: GetPropertyMatrix(const char* szName,
const aiMatrix4x4& iErrorReturn /*= aiMatrix4x4()*/) const
{
return GetGenericProperty<aiMatrix4x4>(mMatrixProperties,szName,iErrorReturn);

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,24 +23,24 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 FBXAnimation.cpp
* @brief Assimp::FBX::AnimationCurve, Assimp::FBX::AnimationCurveNode,
* Assimp::FBX::AnimationLayer, Assimp::FBX::AnimationStack
* @brief Assimp::FBX::AnimationCurve, Assimp::FBX::AnimationCurveNode,
* Assimp::FBX::AnimationLayer, Assimp::FBX::AnimationStack
*/
#ifndef ASSIMP_BUILD_NO_FBX_IMPORTER
@ -72,7 +72,7 @@ AnimationCurve::AnimationCurve(uint64_t id, const Element& element, const std::s
if(keys.size() != values.size()) {
DOMError("the number of key times does not match the number of keyframe values",&KeyTime);
}
// check if the key times are well-ordered
if(!std::equal(keys.begin(), keys.end() - 1, keys.begin() + 1, std::less<KeyTimeList::value_type>())) {
DOMError("the keyframes are not in ascending order",&KeyTime);
@ -98,14 +98,14 @@ AnimationCurve::~AnimationCurve()
// ------------------------------------------------------------------------------------------------
AnimationCurveNode::AnimationCurveNode(uint64_t id, const Element& element, const std::string& name, const Document& doc,
AnimationCurveNode::AnimationCurveNode(uint64_t id, const Element& element, const std::string& name, const Document& doc,
const char* const * target_prop_whitelist /*= NULL*/, size_t whitelist_size /*= 0*/)
: Object(id, element, name)
, target()
, doc(doc)
{
const Scope& sc = GetRequiredScope(element);
// find target node
const char* whitelist[] = {"Model","NodeAttribute"};
const std::vector<const Connection*>& conns = doc.GetConnectionsBySourceSequenced(ID(),whitelist,2);
@ -140,7 +140,7 @@ AnimationCurveNode::AnimationCurveNode(uint64_t id, const Element& element, cons
// XXX support constraints as DOM class
//ai_assert(dynamic_cast<const Model*>(ob) || dynamic_cast<const NodeAttribute*>(ob));
target = ob;
target = ob;
if(!target) {
continue;
}
@ -218,7 +218,7 @@ AnimationLayer::~AnimationLayer()
// ------------------------------------------------------------------------------------------------
AnimationCurveNodeList AnimationLayer::Nodes(const char* const * target_prop_whitelist /*= NULL*/,
AnimationCurveNodeList AnimationLayer::Nodes(const char* const * target_prop_whitelist /*= NULL*/,
size_t whitelist_size /*= 0*/) const
{
AnimationCurveNodeList nodes;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -24,15 +24,15 @@ following conditions are met:
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
"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
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
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
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.
----------------------------------------------------------------------
@ -102,7 +102,7 @@ public:
Converter(aiScene* out, const Document& doc)
: defaultMaterialIndex()
, out(out)
, out(out)
, doc(doc)
{
// animations need to be converted first since this will
@ -155,7 +155,7 @@ private:
// ------------------------------------------------------------------------------------------------
// find scene root and trigger recursive scene conversion
void ConvertRootNode()
void ConvertRootNode()
{
out->mRootNode = new aiNode();
out->mRootNode->mName.Set("RootNode");
@ -208,7 +208,7 @@ private:
const std::string& original_name = FixNodeName(model->Name());
// check if any of the nodes in the chain has the name the fbx node
// is supposed to have. If there is none, add another node to
// is supposed to have. If there is none, add another node to
// preserve the name - people might have scripts etc. that rely
// on specific node names.
aiNode* name_carrier = NULL;
@ -258,7 +258,7 @@ private:
ConvertCameras(*model);
}
nodes.push_back(nodes_chain.front());
nodes.push_back(nodes_chain.front());
nodes_chain.clear();
}
}
@ -269,7 +269,7 @@ private:
std::swap_ranges(nodes.begin(),nodes.end(),parent.mChildren);
}
}
}
catch(std::exception&) {
Util::delete_fun<aiNode> deleter;
std::for_each(nodes.begin(),nodes.end(),deleter);
@ -478,7 +478,7 @@ private:
// ------------------------------------------------------------------------------------------------
aiVector3D TransformationCompDefaultValue(TransformationComp comp)
{
// XXX a neat way to solve the never-ending special cases for scaling
// XXX a neat way to solve the never-ending special cases for scaling
// would be to do everything in log space!
return comp == TransformationComp_Scaling ? aiVector3D(1.f,1.f,1.f) : aiVector3D();
}
@ -524,7 +524,7 @@ private:
order[2] = 0;
break;
case Model::RotOrder_EulerXZY:
case Model::RotOrder_EulerXZY:
order[0] = 1;
order[1] = 2;
order[2] = 0;
@ -536,13 +536,13 @@ private:
order[2] = 1;
break;
case Model::RotOrder_EulerYXZ:
case Model::RotOrder_EulerYXZ:
order[0] = 2;
order[1] = 0;
order[2] = 1;
break;
case Model::RotOrder_EulerZXY:
case Model::RotOrder_EulerZXY:
order[0] = 1;
order[1] = 0;
order[2] = 2;
@ -557,7 +557,7 @@ private:
default:
ai_assert(false);
}
ai_assert((order[0] >= 0) && (order[0] <= 2));
ai_assert((order[1] >= 0) && (order[1] <= 2));
ai_assert((order[2] >= 0) && (order[2] <= 2));
@ -588,7 +588,7 @@ private:
const TransformationComp comp = static_cast<TransformationComp>(i);
if( comp == TransformationComp_Rotation || comp == TransformationComp_Scaling || comp == TransformationComp_Translation ||
comp == TransformationComp_GeometricScaling || comp == TransformationComp_GeometricRotation || comp == TransformationComp_GeometricTranslation ) {
comp == TransformationComp_GeometricScaling || comp == TransformationComp_GeometricRotation || comp == TransformationComp_GeometricTranslation ) {
continue;
}
@ -612,7 +612,7 @@ private:
// ------------------------------------------------------------------------------------------------
/** note: memory for output_nodes will be managed by the caller */
void GenerateTransformationNodeChain(const Model& model,
void GenerateTransformationNodeChain(const Model& model,
std::vector<aiNode*>& output_nodes)
{
const PropertyTable& props = model.Props();
@ -622,7 +622,7 @@ private:
aiMatrix4x4 chain[TransformationComp_MAXIMUM];
std::fill_n(chain, static_cast<unsigned int>(TransformationComp_MAXIMUM), aiMatrix4x4());
// generate transformation matrices for all the different transformation components
const float zero_epsilon = 1e-6f;
bool is_complex = false;
@ -637,14 +637,14 @@ private:
const aiVector3D& PostRotation = PropertyGet<aiVector3D>(props,"PostRotation",ok);
if(ok && PostRotation.SquareLength() > zero_epsilon) {
is_complex = true;
GetRotationMatrix(rot, PostRotation, chain[TransformationComp_PostRotation]);
}
const aiVector3D& RotationPivot = PropertyGet<aiVector3D>(props,"RotationPivot",ok);
if(ok && RotationPivot.SquareLength() > zero_epsilon) {
is_complex = true;
aiMatrix4x4::Translation(RotationPivot,chain[TransformationComp_RotationPivot]);
aiMatrix4x4::Translation(-RotationPivot,chain[TransformationComp_RotationPivotInverse]);
}
@ -659,7 +659,7 @@ private:
const aiVector3D& ScalingOffset = PropertyGet<aiVector3D>(props,"ScalingOffset",ok);
if(ok && ScalingOffset.SquareLength() > zero_epsilon) {
is_complex = true;
aiMatrix4x4::Translation(ScalingOffset,chain[TransformationComp_ScalingOffset]);
}
@ -685,12 +685,12 @@ private:
if(ok && Rotation.SquareLength() > zero_epsilon) {
GetRotationMatrix(rot, Rotation, chain[TransformationComp_Rotation]);
}
const aiVector3D& GeometricScaling = PropertyGet<aiVector3D>(props, "GeometricScaling", ok);
if (ok && std::fabs(GeometricScaling.SquareLength() - 1.0f) > zero_epsilon) {
aiMatrix4x4::Scaling(GeometricScaling, chain[TransformationComp_GeometricScaling]);
}
const aiVector3D& GeometricRotation = PropertyGet<aiVector3D>(props, "GeometricRotation", ok);
if (ok && GeometricRotation.SquareLength() > zero_epsilon) {
GetRotationMatrix(rot, GeometricRotation, chain[TransformationComp_GeometricRotation]);
@ -715,7 +715,7 @@ private:
FBXImporter::LogInfo("generating full transformation chain for node: " + name);
// query the anim_chain_bits dictionary to find out which chain elements
// have associated node animation channels. These can not be dropped
// have associated node animation channels. These can not be dropped
// even if they have identity transform in bind pose.
NodeAnimBitMap::const_iterator it = node_anim_chain_bits.find(name);
const unsigned int anim_chain_bitmask = (it == node_anim_chain_bits.end() ? 0 : (*it).second);
@ -723,14 +723,14 @@ private:
unsigned int bit = 0x1;
for (size_t i = 0; i < TransformationComp_MAXIMUM; ++i, bit <<= 1) {
const TransformationComp comp = static_cast<TransformationComp>(i);
if (chain[i].IsIdentity() && (anim_chain_bitmask & bit) == 0) {
continue;
}
aiNode* nd = new aiNode();
output_nodes.push_back(nd);
nd->mName.Set(NameTransformationChainNode(name, comp));
nd->mTransformation = chain[i];
}
@ -749,7 +749,7 @@ private:
nd->mTransformation = nd->mTransformation * chain[i];
}
}
// ------------------------------------------------------------------------------------------------
void SetupNodeMetadata(const Model& model, aiNode& nd)
@ -823,10 +823,10 @@ private:
// ------------------------------------------------------------------------------------------------
// MeshGeometry -> aiMesh, return mesh index + 1 or 0 if the conversion failed
std::vector<unsigned int> ConvertMesh(const MeshGeometry& mesh,const Model& model,
std::vector<unsigned int> ConvertMesh(const MeshGeometry& mesh,const Model& model,
const aiMatrix4x4& node_global_transform)
{
std::vector<unsigned int> temp;
std::vector<unsigned int> temp;
MeshMap::const_iterator it = meshes_converted.find(&mesh);
if (it != meshes_converted.end()) {
@ -841,7 +841,7 @@ private:
return temp;
}
// one material per mesh maps easily to aiMesh. Multiple material
// one material per mesh maps easily to aiMesh. Multiple material
// meshes need to be split.
const MatIndexArray& mindices = mesh.GetMaterialIndices();
if (doc.Settings().readMaterials && !mindices.empty()) {
@ -881,11 +881,11 @@ private:
// ------------------------------------------------------------------------------------------------
unsigned int ConvertMeshSingleMaterial(const MeshGeometry& mesh, const Model& model,
const aiMatrix4x4& node_global_transform)
unsigned int ConvertMeshSingleMaterial(const MeshGeometry& mesh, const Model& model,
const aiMatrix4x4& node_global_transform)
{
const MatIndexArray& mindices = mesh.GetMaterialIndices();
aiMesh* const out_mesh = SetupEmptyMesh(mesh);
aiMesh* const out_mesh = SetupEmptyMesh(mesh);
const std::vector<aiVector3D>& vertices = mesh.GetVertices();
const std::vector<unsigned int>& faces = mesh.GetFaceIndexCounts();
@ -904,7 +904,7 @@ private:
aiFace& f = *fac++;
f.mNumIndices = pcount;
f.mIndices = new unsigned int[pcount];
switch(pcount)
switch(pcount)
{
case 1:
out_mesh->mPrimitiveTypes |= aiPrimitiveType_POINT;
@ -951,7 +951,7 @@ private:
binormals = &tempBinormals;
}
else {
binormals = NULL;
binormals = NULL;
}
}
@ -1009,12 +1009,12 @@ private:
// ------------------------------------------------------------------------------------------------
std::vector<unsigned int> ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model,
const aiMatrix4x4& node_global_transform)
std::vector<unsigned int> ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model,
const aiMatrix4x4& node_global_transform)
{
const MatIndexArray& mindices = mesh.GetMaterialIndices();
ai_assert(mindices.size());
std::set<MatIndexArray::value_type> had;
std::vector<unsigned int> indices;
@ -1031,9 +1031,9 @@ private:
// ------------------------------------------------------------------------------------------------
unsigned int ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model,
MatIndexArray::value_type index,
const aiMatrix4x4& node_global_transform)
unsigned int ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model,
MatIndexArray::value_type index,
const aiMatrix4x4& node_global_transform)
{
aiMesh* const out_mesh = SetupEmptyMesh(mesh);
@ -1048,9 +1048,9 @@ private:
// count faces
std::vector<unsigned int>::const_iterator itf = faces.begin();
for(MatIndexArray::const_iterator it = mindices.begin(),
end = mindices.end(); it != end; ++it, ++itf)
{
for(MatIndexArray::const_iterator it = mindices.begin(),
end = mindices.end(); it != end; ++it, ++itf)
{
if ((*it) != index) {
continue;
}
@ -1083,7 +1083,7 @@ private:
out_mesh->mNormals = new aiVector3D[vertices.size()];
}
// allocate tangents, binormals.
// allocate tangents, binormals.
const std::vector<aiVector3D>& tangents = mesh.GetTangents();
const std::vector<aiVector3D>* binormals = &mesh.GetBinormals();
@ -1091,7 +1091,7 @@ private:
std::vector<aiVector3D> tempBinormals;
if (!binormals->size()) {
if (normals.size()) {
// XXX this computes the binormals for the entire mesh, not only
// XXX this computes the binormals for the entire mesh, not only
// the part for which we need them.
tempBinormals.resize(normals.size());
for (unsigned int i = 0; i < tangents.size(); ++i) {
@ -1101,7 +1101,7 @@ private:
binormals = &tempBinormals;
}
else {
binormals = NULL;
binormals = NULL;
}
}
@ -1139,9 +1139,9 @@ private:
unsigned int cursor = 0, in_cursor = 0;
itf = faces.begin();
for(MatIndexArray::const_iterator it = mindices.begin(),
end = mindices.end(); it != end; ++it, ++itf)
{
for(MatIndexArray::const_iterator it = mindices.begin(),
end = mindices.end(); it != end; ++it, ++itf)
{
const unsigned int pcount = *itf;
if ((*it) != index) {
in_cursor += pcount;
@ -1152,7 +1152,7 @@ private:
f.mNumIndices = pcount;
f.mIndices = new unsigned int[pcount];
switch(pcount)
switch(pcount)
{
case 1:
out_mesh->mPrimitiveTypes |= aiPrimitiveType_POINT;
@ -1196,7 +1196,7 @@ private:
}
}
}
ConvertMaterialForMesh(out_mesh,model,mesh,index);
if(process_weights) {
@ -1206,7 +1206,7 @@ private:
return static_cast<unsigned int>(meshes.size() - 1);
}
static const unsigned int NO_MATERIAL_SEPARATION = /* std::numeric_limits<unsigned int>::max() */
static const unsigned int NO_MATERIAL_SEPARATION = /* std::numeric_limits<unsigned int>::max() */
static_cast<unsigned int>(-1);
@ -1215,9 +1215,9 @@ private:
* account when determining which weights to include.
* - outputVertStartIndices is only used when a material index is specified, it gives for
* each output vertex the DOM index it maps to. */
void ConvertWeights(aiMesh* out, const Model& model, const MeshGeometry& geo,
void ConvertWeights(aiMesh* out, const Model& model, const MeshGeometry& geo,
const aiMatrix4x4& node_global_transform = aiMatrix4x4(),
unsigned int materialIndex = NO_MATERIAL_SEPARATION,
unsigned int materialIndex = NO_MATERIAL_SEPARATION,
std::vector<unsigned int>* outputVertStartIndices = NULL)
{
ai_assert(geo.DeformerSkin());
@ -1247,7 +1247,7 @@ private:
const MatIndexArray& mats = geo.GetMaterialIndices();
bool ok = false;
bool ok = false;
const size_t no_index_sentinel = std::numeric_limits<size_t>::max();
@ -1268,12 +1268,12 @@ private:
index_out_indices.push_back(no_index_sentinel);
count_out_indices.push_back(0);
for(unsigned int i = 0; i < count; ++i) {
for(unsigned int i = 0; i < count; ++i) {
if (no_mat_check || static_cast<size_t>(mats[geo.FaceForVertexIndex(out_idx[i])]) == materialIndex) {
if (index_out_indices.back() == no_index_sentinel) {
index_out_indices.back() = out_indices.size();
}
if (no_mat_check) {
@ -1293,14 +1293,14 @@ private:
++count_out_indices.back();
ok = true;
}
}
}
}
// if we found at least one, generate the output bones
// XXX this could be heavily simplified by collecting the bone
// data in a single step.
if (ok) {
ConvertCluster(bones, model, *cluster, out_indices, index_out_indices,
ConvertCluster(bones, model, *cluster, out_indices, index_out_indices,
count_out_indices, node_global_transform);
}
}
@ -1360,13 +1360,13 @@ private:
out_weight.mVertexId = static_cast<unsigned int>(out_indices[index_index + j]);
out_weight.mWeight = weights[i];
}
}
}
}
// ------------------------------------------------------------------------------------------------
void ConvertMaterialForMesh(aiMesh* out, const Model& model, const MeshGeometry& geo,
void ConvertMaterialForMesh(aiMesh* out, const Model& model, const MeshGeometry& geo,
MatIndexArray::value_type materialIndex)
{
// locate source materials for this mesh
@ -1384,7 +1384,7 @@ private:
return;
}
out->mMaterialIndex = ConvertMaterial(*mat, &geo);
out->mMaterialIndex = ConvertMaterial(*mat, &geo);
materials_converted[mat] = out->mMaterialIndex;
}
@ -1393,7 +1393,7 @@ private:
unsigned int GetDefaultMaterial()
{
if (defaultMaterialIndex) {
return defaultMaterialIndex - 1;
return defaultMaterialIndex - 1;
}
aiMaterial* out_mat = new aiMaterial();
@ -1441,7 +1441,7 @@ private:
// shading stuff and colors
SetShadingPropertiesCommon(out_mat,props);
// texture assignments
SetTextureProperties(out_mat,material.Textures(), mesh);
SetTextureProperties(out_mat,material.LayeredTextures(), mesh);
@ -1451,8 +1451,8 @@ private:
// ------------------------------------------------------------------------------------------------
void TrySetTextureProperties(aiMaterial* out_mat, const TextureMap& textures,
const std::string& propName,
void TrySetTextureProperties(aiMaterial* out_mat, const TextureMap& textures,
const std::string& propName,
aiTextureType target, const MeshGeometry* const mesh)
{
TextureMap::const_iterator it = textures.find(propName);
@ -1494,14 +1494,14 @@ private:
// be moved, causing trouble when users read only the first
// UV channel and ignore UV channel assignments altogether.
const unsigned int matIndex = static_cast<unsigned int>(std::distance(materials.begin(),
const unsigned int matIndex = static_cast<unsigned int>(std::distance(materials.begin(),
std::find(materials.begin(),materials.end(),out_mat)
));
uvIndex = -1;
if (!mesh)
{
{
BOOST_FOREACH(const MeshMap::value_type& v,meshes_converted) {
const MeshGeometry* const mesh = dynamic_cast<const MeshGeometry*> (v.first);
if(!mesh) {
@ -1533,7 +1533,7 @@ private:
uvIndex = index;
}
else {
FBXImporter::LogWarn("the UV channel named " + uvSet +
FBXImporter::LogWarn("the UV channel named " + uvSet +
" appears at different positions in meshes, results will be wrong");
}
}
@ -1572,8 +1572,8 @@ private:
}
// ------------------------------------------------------------------------------------------------
void TrySetTextureProperties(aiMaterial* out_mat, const LayeredTextureMap& layeredTextures,
const std::string& propName,
void TrySetTextureProperties(aiMaterial* out_mat, const LayeredTextureMap& layeredTextures,
const std::string& propName,
aiTextureType target, const MeshGeometry* const mesh)
{
LayeredTextureMap::const_iterator it = layeredTextures.find(propName);
@ -1614,13 +1614,13 @@ private:
// be moved, causing trouble when users read only the first
// UV channel and ignore UV channel assignments altogether.
const unsigned int matIndex = static_cast<unsigned int>(std::distance(materials.begin(),
const unsigned int matIndex = static_cast<unsigned int>(std::distance(materials.begin(),
std::find(materials.begin(),materials.end(),out_mat)
));
uvIndex = -1;
if (!mesh)
{
{
BOOST_FOREACH(const MeshMap::value_type& v,meshes_converted) {
const MeshGeometry* const mesh = dynamic_cast<const MeshGeometry*> (v.first);
if(!mesh) {
@ -1652,7 +1652,7 @@ private:
uvIndex = index;
}
else {
FBXImporter::LogWarn("the UV channel named " + uvSet +
FBXImporter::LogWarn("the UV channel named " + uvSet +
" appears at different positions in meshes, results will be wrong");
}
}
@ -1721,7 +1721,7 @@ private:
// ------------------------------------------------------------------------------------------------
aiColor3D GetColorPropertyFromMaterial(const PropertyTable& props, const std::string& baseName,
aiColor3D GetColorPropertyFromMaterial(const PropertyTable& props, const std::string& baseName,
bool& result)
{
result = true;
@ -1752,8 +1752,8 @@ private:
{
// set shading properties. There are various, redundant ways in which FBX materials
// specify their shading settings (depending on shading models, prop
// template etc.). No idea which one is right in a particular context.
// Just try to make sense of it - there's no spec to verify this against,
// template etc.). No idea which one is right in a particular context.
// Just try to make sense of it - there's no spec to verify this against,
// so why should we.
bool ok;
const aiColor3D& Diffuse = GetColorPropertyFromMaterial(props,"Diffuse",ok);
@ -1855,7 +1855,7 @@ private:
// ------------------------------------------------------------------------------------------------
// convert animation data to aiAnimation et al
void ConvertAnimations()
void ConvertAnimations()
{
// first of all determine framerate
const FileGlobalSettings::FrameRate fps = doc.GlobalSettings().TimeMode();
@ -1870,8 +1870,8 @@ private:
// ------------------------------------------------------------------------------------------------
// rename a node already partially converted. fixed_name is a string previously returned by
// FixNodeName, new_name specifies the string FixNodeName should return on all further invocations
// rename a node already partially converted. fixed_name is a string previously returned by
// FixNodeName, new_name specifies the string FixNodeName should return on all further invocations
// which would previously have returned the old value.
//
// this also updates names in node animations, cameras and light sources and is thus slow.
@ -1920,7 +1920,7 @@ private:
// UNLESS RenameNode() is called for a particular node name.
std::string FixNodeName(const std::string& name)
{
// strip Model:: prefix, avoiding ambiguities (i.e. don't strip if
// strip Model:: prefix, avoiding ambiguities (i.e. don't strip if
// this causes ambiguities, well possible between empty identifiers,
// such as "Model::" and ""). Make sure the behaviour is consistent
// across multiple calls to FixNodeName().
@ -1960,7 +1960,7 @@ private:
// ------------------------------------------------------------------------------------------------
void ConvertAnimationStack(const AnimationStack& st)
{
{
const AnimationLayerList& layers = st.Layers();
if(layers.empty()) {
return;
@ -1979,12 +1979,12 @@ private:
}
anim->mName.Set(name);
// need to find all nodes for which we need to generate node animations -
// it may happen that we need to merge multiple layers, though.
NodeMap node_map;
// reverse mapping from curves to layers, much faster than querying
// reverse mapping from curves to layers, much faster than querying
// the FBX DOM for it.
LayerMap layer_map;
@ -1993,7 +1993,7 @@ private:
"Lcl Rotation",
"Lcl Translation"
};
BOOST_FOREACH(const AnimationLayer* layer, layers) {
ai_assert(layer);
@ -2027,12 +2027,12 @@ private:
try {
BOOST_FOREACH(const NodeMap::value_type& kv, node_map) {
GenerateNodeAnimations(node_anims,
kv.first,
kv.second,
layer_map,
GenerateNodeAnimations(node_anims,
kv.first,
kv.second,
layer_map,
start_time, stop_time,
max_time,
max_time,
min_time);
}
}
@ -2081,10 +2081,10 @@ private:
// ------------------------------------------------------------------------------------------------
void GenerateNodeAnimations(std::vector<aiNodeAnim*>& node_anims,
const std::string& fixed_name,
const std::vector<const AnimationCurveNode*>& curves,
const LayerMap& layer_map,
void GenerateNodeAnimations(std::vector<aiNodeAnim*>& node_anims,
const std::string& fixed_name,
const std::vector<const AnimationCurveNode*>& curves,
const LayerMap& layer_map,
int64_t start, int64_t stop,
double& max_time,
double& min_time)
@ -2147,7 +2147,7 @@ private:
// check if this curves contains redundant information by looking
// up the corresponding node's transformation chain.
if (doc.Settings().optimizeEmptyAnimationCurves &&
if (doc.Settings().optimizeEmptyAnimationCurves &&
IsRedundantAnimationData(target, comp, (*chain[i]).second)) {
FBXImporter::LogDebug("dropping redundant animation channel for node " + target.Name());
@ -2175,8 +2175,8 @@ private:
// we can use a single node and also a single node animation channel.
if (!has_complex && !NeedsComplexTransformationChain(target)) {
aiNodeAnim* const nd = GenerateSimpleNodeAnim(fixed_name, target, chain,
node_property_map.end(),
aiNodeAnim* const nd = GenerateSimpleNodeAnim(fixed_name, target, chain,
node_property_map.end(),
layer_map,
start, stop,
max_time,
@ -2212,14 +2212,14 @@ private:
const std::string& chain_name = NameTransformationChainNode(fixed_name, comp);
aiNodeAnim* na;
switch(comp)
switch(comp)
{
case TransformationComp_Rotation:
case TransformationComp_PreRotation:
case TransformationComp_PostRotation:
case TransformationComp_GeometricRotation:
na = GenerateRotationNodeAnim(chain_name,
target,
na = GenerateRotationNodeAnim(chain_name,
target,
(*chain[i]).second,
layer_map,
start, stop,
@ -2234,8 +2234,8 @@ private:
case TransformationComp_ScalingPivot:
case TransformationComp_Translation:
case TransformationComp_GeometricTranslation:
na = GenerateTranslationNodeAnim(chain_name,
target,
na = GenerateTranslationNodeAnim(chain_name,
target,
(*chain[i]).second,
layer_map,
start, stop,
@ -2244,11 +2244,11 @@ private:
// pivoting requires us to generate an implicit inverse channel to undo the pivot translation
if (comp == TransformationComp_RotationPivot) {
const std::string& invName = NameTransformationChainNode(fixed_name,
const std::string& invName = NameTransformationChainNode(fixed_name,
TransformationComp_RotationPivotInverse);
aiNodeAnim* const inv = GenerateTranslationNodeAnim(invName,
target,
aiNodeAnim* const inv = GenerateTranslationNodeAnim(invName,
target,
(*chain[i]).second,
layer_map,
start, stop,
@ -2268,11 +2268,11 @@ private:
flags |= bit << (TransformationComp_RotationPivotInverse - i);
}
else if (comp == TransformationComp_ScalingPivot) {
const std::string& invName = NameTransformationChainNode(fixed_name,
const std::string& invName = NameTransformationChainNode(fixed_name,
TransformationComp_ScalingPivotInverse);
aiNodeAnim* const inv = GenerateTranslationNodeAnim(invName,
target,
aiNodeAnim* const inv = GenerateTranslationNodeAnim(invName,
target,
(*chain[i]).second,
layer_map,
start, stop,
@ -2287,7 +2287,7 @@ private:
else {
node_anims.push_back(inv);
}
ai_assert(TransformationComp_RotationPivotInverse > i);
flags |= bit << (TransformationComp_RotationPivotInverse - i);
}
@ -2296,8 +2296,8 @@ private:
case TransformationComp_Scaling:
case TransformationComp_GeometricScaling:
na = GenerateScalingNodeAnim(chain_name,
target,
na = GenerateScalingNodeAnim(chain_name,
target,
(*chain[i]).second,
layer_map,
start, stop,
@ -2326,8 +2326,8 @@ private:
// ------------------------------------------------------------------------------------------------
bool IsRedundantAnimationData(const Model& target,
TransformationComp comp,
bool IsRedundantAnimationData(const Model& target,
TransformationComp comp,
const std::vector<const AnimationCurveNode*>& curves)
{
ai_assert(curves.size());
@ -2362,8 +2362,8 @@ private:
}
const aiVector3D dyn_val = aiVector3D(vx[0], vy[0], vz[0]);
const aiVector3D& static_val = PropertyGet<aiVector3D>(target.Props(),
NameTransformationCompProperty(comp),
const aiVector3D& static_val = PropertyGet<aiVector3D>(target.Props(),
NameTransformationCompProperty(comp),
TransformationCompDefaultValue(comp)
);
@ -2373,8 +2373,8 @@ private:
// ------------------------------------------------------------------------------------------------
aiNodeAnim* GenerateRotationNodeAnim(const std::string& name,
const Model& target,
aiNodeAnim* GenerateRotationNodeAnim(const std::string& name,
const Model& target,
const std::vector<const AnimationCurveNode*>& curves,
const LayerMap& layer_map,
int64_t start, int64_t stop,
@ -2405,7 +2405,7 @@ private:
// ------------------------------------------------------------------------------------------------
aiNodeAnim* GenerateScalingNodeAnim(const std::string& name,
aiNodeAnim* GenerateScalingNodeAnim(const std::string& name,
const Model& /*target*/,
const std::vector<const AnimationCurveNode*>& curves,
const LayerMap& layer_map,
@ -2437,7 +2437,7 @@ private:
// ------------------------------------------------------------------------------------------------
aiNodeAnim* GenerateTranslationNodeAnim(const std::string& name,
aiNodeAnim* GenerateTranslationNodeAnim(const std::string& name,
const Model& /*target*/,
const std::vector<const AnimationCurveNode*>& curves,
const LayerMap& layer_map,
@ -2477,9 +2477,9 @@ private:
// ------------------------------------------------------------------------------------------------
// generate node anim, extracting only Rotation, Scaling and Translation from the given chain
aiNodeAnim* GenerateSimpleNodeAnim(const std::string& name,
const Model& target,
NodeMap::const_iterator chain[TransformationComp_MAXIMUM],
aiNodeAnim* GenerateSimpleNodeAnim(const std::string& name,
const Model& target,
NodeMap::const_iterator chain[TransformationComp_MAXIMUM],
NodeMap::const_iterator iter_end,
const LayerMap& layer_map,
int64_t start, int64_t stop,
@ -2495,14 +2495,14 @@ private:
// need to convert from TRS order to SRT?
if(reverse_order) {
aiVector3D def_scale, def_translate;
aiQuaternion def_rot;
KeyFrameListList scaling;
KeyFrameListList translation;
KeyFrameListList rotation;
if(chain[TransformationComp_Scaling] != iter_end) {
scaling = GetKeyframeList((*chain[TransformationComp_Scaling]).second, start, stop);
}
@ -2516,7 +2516,7 @@ private:
else {
def_translate = PropertyGet(props,"Lcl Translation",aiVector3D(0.f,0.f,0.f));
}
if(chain[TransformationComp_Rotation] != iter_end) {
rotation = GetKeyframeList((*chain[TransformationComp_Rotation]).second, start, stop);
}
@ -2569,10 +2569,10 @@ private:
// which requires all of rotation, scaling and translation
// to be set.
if(chain[TransformationComp_Scaling] != iter_end) {
ConvertScaleKeys(na, (*chain[TransformationComp_Scaling]).second,
layer_map,
ConvertScaleKeys(na, (*chain[TransformationComp_Scaling]).second,
layer_map,
start, stop,
max_time,
max_time,
min_time);
}
else {
@ -2585,8 +2585,8 @@ private:
}
if(chain[TransformationComp_Rotation] != iter_end) {
ConvertRotationKeys(na, (*chain[TransformationComp_Rotation]).second,
layer_map,
ConvertRotationKeys(na, (*chain[TransformationComp_Rotation]).second,
layer_map,
start, stop,
max_time,
min_time,
@ -2603,10 +2603,10 @@ private:
}
if(chain[TransformationComp_Translation] != iter_end) {
ConvertTranslationKeys(na, (*chain[TransformationComp_Translation]).second,
layer_map,
ConvertTranslationKeys(na, (*chain[TransformationComp_Translation]).second,
layer_map,
start, stop,
max_time,
max_time,
min_time);
}
else {
@ -2628,7 +2628,7 @@ private:
typedef boost::tuple<boost::shared_ptr<KeyTimeList>, boost::shared_ptr<KeyValueList>, unsigned int > KeyFrameList;
typedef std::vector<KeyFrameList> KeyFrameListList;
// ------------------------------------------------------------------------------------------------
KeyFrameListList GetKeyframeList(const std::vector<const AnimationCurveNode*>& nodes, int64_t start, int64_t stop)
@ -2693,10 +2693,10 @@ private:
ai_assert(inputs.size());
// reserve some space upfront - it is likely that the keyframe lists
// have matching time values, so max(of all keyframe lists) should
// have matching time values, so max(of all keyframe lists) should
// be a good estimate.
KeyTimeList keys;
size_t estimate = 0;
BOOST_FOREACH(const KeyFrameList& kfl, inputs) {
estimate = std::max(estimate, kfl.get<0>()->size());
@ -2732,15 +2732,15 @@ private:
++next_pos[i];
}
}
}
}
return keys;
}
// ------------------------------------------------------------------------------------------------
void InterpolateKeys(aiVectorKey* valOut,const KeyTimeList& keys, const KeyFrameListList& inputs,
const bool geom,
void InterpolateKeys(aiVectorKey* valOut,const KeyTimeList& keys, const KeyFrameListList& inputs,
const bool geom,
double& max_time,
double& min_time)
@ -2764,7 +2764,7 @@ private:
const size_t ksize = kfl.get<0>()->size();
if (ksize > next_pos[i] && kfl.get<0>()->at(next_pos[i]) == time) {
++next_pos[i];
++next_pos[i];
}
const size_t id0 = next_pos[i]>0 ? next_pos[i]-1 : 0;
@ -2799,14 +2799,14 @@ private:
valOut->mValue.x = result[0];
valOut->mValue.y = result[1];
valOut->mValue.z = result[2];
++valOut;
}
}
// ------------------------------------------------------------------------------------------------
void InterpolateKeys(aiQuatKey* valOut,const KeyTimeList& keys, const KeyFrameListList& inputs,
void InterpolateKeys(aiQuatKey* valOut,const KeyTimeList& keys, const KeyFrameListList& inputs,
const bool geom,
double& maxTime,
double& minTime,
@ -2826,7 +2826,7 @@ private:
valOut[i].mTime = temp[i].mTime;
GetRotationMatrix(order, temp[i].mValue, m);
aiQuaternion quat = aiQuaternion(aiMatrix3x3(m));
@ -2838,20 +2838,20 @@ private:
quat.y = -quat.y;
quat.z = -quat.z;
quat.w = -quat.w;
}
}
lastq = quat;
valOut[i].mValue = quat;
valOut[i].mValue = quat;
}
}
// ------------------------------------------------------------------------------------------------
void ConvertTransformOrder_TRStoSRT(aiQuatKey* out_quat, aiVectorKey* out_scale,
aiVectorKey* out_translation,
const KeyFrameListList& scaling,
const KeyFrameListList& translation,
const KeyFrameListList& rotation,
aiVectorKey* out_translation,
const KeyFrameListList& scaling,
const KeyFrameListList& translation,
const KeyFrameListList& rotation,
const KeyTimeList& times,
double& maxTime,
double& minTime,
@ -2908,7 +2908,7 @@ private:
// ------------------------------------------------------------------------------------------------
// euler xyz -> quat
aiQuaternion EulerToQuaternion(const aiVector3D& rot, Model::RotOrder order)
aiQuaternion EulerToQuaternion(const aiVector3D& rot, Model::RotOrder order)
{
aiMatrix4x4 m;
GetRotationMatrix(order, rot, m);
@ -2926,7 +2926,7 @@ private:
ai_assert(nodes.size());
// XXX for now, assume scale should be blended geometrically (i.e. two
// layers should be multiplied with each other). There is a FBX
// layers should be multiplied with each other). There is a FBX
// property in the layer to specify the behaviour, though.
const KeyFrameListList& inputs = GetKeyframeList(nodes, start, stop);
@ -2940,7 +2940,7 @@ private:
// ------------------------------------------------------------------------------------------------
void ConvertTranslationKeys(aiNodeAnim* na, const std::vector<const AnimationCurveNode*>& nodes,
void ConvertTranslationKeys(aiNodeAnim* na, const std::vector<const AnimationCurveNode*>& nodes,
const LayerMap& /*layers*/,
int64_t start, int64_t stop,
double& maxTime,
@ -2960,7 +2960,7 @@ private:
// ------------------------------------------------------------------------------------------------
void ConvertRotationKeys(aiNodeAnim* na, const std::vector<const AnimationCurveNode*>& nodes,
void ConvertRotationKeys(aiNodeAnim* na, const std::vector<const AnimationCurveNode*>& nodes,
const LayerMap& /*layers*/,
int64_t start, int64_t stop,
double& maxTime,

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -139,7 +139,7 @@ Skin::Skin(uint64_t id, const Element& element, const Document& doc, const std::
accuracy = ParseTokenAsFloat(GetRequiredToken(*Link_DeformAcuracy,0));
}
// resolve assigned clusters
// resolve assigned clusters
const std::vector<const Connection*>& conns = doc.GetConnectionsByDestinationSequenced(ID(),"Deformer");
clusters.reserve(conns.size());

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -107,7 +107,7 @@ const Object* LazyObject::Get(bool dieOnError)
std::string name = ParseTokenAsString(*tokens[1],err);
if (err) {
DOMError(err,&element);
}
}
// small fix for binary reading: binary fbx files don't use
// prefixes such as Model:: in front of their names. The
@ -125,7 +125,7 @@ const Object* LazyObject::Get(bool dieOnError)
const std::string classtag = ParseTokenAsString(*tokens[2],err);
if (err) {
DOMError(err,&element);
}
}
// prevent recursive calls
flags |= BEING_CONSTRUCTED;
@ -192,7 +192,7 @@ const Object* LazyObject::Get(bool dieOnError)
}
else if (!strncmp(obtype,"AnimationCurveNode",length)) {
object.reset(new AnimationCurveNode(id,element,name,doc));
}
}
}
catch(std::exception& ex) {
flags &= ~BEING_CONSTRUCTED;
@ -236,7 +236,7 @@ Object::~Object()
// ------------------------------------------------------------------------------------------------
FileGlobalSettings::FileGlobalSettings(const Document& doc, boost::shared_ptr<const PropertyTable> props)
: props(props)
, doc(doc)
, doc(doc)
{
}
@ -314,7 +314,7 @@ void Document::ReadHeader()
" trying to read it nevertheless");
}
}
const Element* const ecreator = shead["Creator"];
if(ecreator) {
@ -372,10 +372,10 @@ void Document::ReadObjects()
const Scope& sobjects = *eobjects->Compound();
BOOST_FOREACH(const ElementMap::value_type& el, sobjects.Elements()) {
// extract ID
// extract ID
const TokenList& tok = el.second->Tokens();
if (tok.empty()) {
DOMError("expected ID after object key",el.second);
}
@ -503,8 +503,8 @@ void Document::ReadConnections()
// add new connection
const Connection* const c = new Connection(insertionOrder++,src,dest,prop,*this);
src_connections.insert(ConnectionMap::value_type(src,c));
dest_connections.insert(ConnectionMap::value_type(dest,c));
src_connections.insert(ConnectionMap::value_type(src,c));
dest_connections.insert(ConnectionMap::value_type(dest,c));
}
}
@ -541,12 +541,12 @@ LazyObject* Document::GetObject(uint64_t id) const
#define MAX_CLASSNAMES 6
// ------------------------------------------------------------------------------------------------
std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id,
std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id,
const ConnectionMap& conns) const
{
std::vector<const Connection*> temp;
const std::pair<ConnectionMap::const_iterator,ConnectionMap::const_iterator> range =
const std::pair<ConnectionMap::const_iterator,ConnectionMap::const_iterator> range =
conns.equal_range(id);
temp.reserve(std::distance(range.first,range.second));
@ -561,9 +561,9 @@ std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id,
// ------------------------------------------------------------------------------------------------
std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, bool is_src,
const ConnectionMap& conns,
const char* const* classnames,
std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, bool is_src,
const ConnectionMap& conns,
const char* const* classnames,
size_t count) const
{
@ -579,12 +579,12 @@ std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, bo
std::vector<const Connection*> temp;
const std::pair<ConnectionMap::const_iterator,ConnectionMap::const_iterator> range =
const std::pair<ConnectionMap::const_iterator,ConnectionMap::const_iterator> range =
conns.equal_range(id);
temp.reserve(std::distance(range.first,range.second));
for (ConnectionMap::const_iterator it = range.first; it != range.second; ++it) {
const Token& key = (is_src
const Token& key = (is_src
? (*it).second->LazyDestinationObject()
: (*it).second->LazySourceObject()
).GetElement().KeyToken();
@ -620,7 +620,7 @@ std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_
// ------------------------------------------------------------------------------------------------
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t dest,
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t dest,
const char* classname) const
{
const char* arr[] = {classname};
@ -630,7 +630,7 @@ std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_
// ------------------------------------------------------------------------------------------------
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t source,
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t source,
const char* const* classnames, size_t count) const
{
return GetConnectionsSequenced(source, true, ConnectionsBySource(),classnames, count);
@ -638,7 +638,7 @@ std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_
// ------------------------------------------------------------------------------------------------
std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(uint64_t dest,
std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(uint64_t dest,
const char* classname) const
{
const char* arr[] = {classname};
@ -654,7 +654,7 @@ std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(ui
// ------------------------------------------------------------------------------------------------
std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(uint64_t dest,
std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(uint64_t dest,
const char* const* classnames, size_t count) const
{
@ -663,7 +663,7 @@ std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(ui
// ------------------------------------------------------------------------------------------------
Connection::Connection(uint64_t insertionOrder, uint64_t src, uint64_t dest, const std::string& prop,
Connection::Connection(uint64_t insertionOrder, uint64_t src, uint64_t dest, const std::string& prop,
const Document& doc)
: insertionOrder(insertionOrder)

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -96,7 +96,7 @@ public:
const Object* Get(bool dieOnError = false);
template <typename T>
template <typename T>
const T* Get(bool dieOnError = false) {
const Object* const ob = Get(dieOnError);
return ob ? dynamic_cast<const T*>(ob) : NULL;
@ -373,12 +373,12 @@ public:
public:
enum RotOrder
{
RotOrder_EulerXYZ = 0,
RotOrder_EulerXZY,
RotOrder_EulerYZX,
RotOrder_EulerYXZ,
RotOrder_EulerZXY,
{
RotOrder_EulerXYZ = 0,
RotOrder_EulerXZY,
RotOrder_EulerYZX,
RotOrder_EulerYXZ,
RotOrder_EulerZXY,
RotOrder_EulerZYX,
RotOrder_SphericXYZ,
@ -566,7 +566,7 @@ public:
return *props.get();
}
// return a 4-tuple
// return a 4-tuple
const unsigned int* Crop() const {
return crop;
}
@ -753,9 +753,9 @@ public:
const std::vector<aiVector3D>& GetBinormals() const {
return binormals;
}
/** Return list of faces - each entry denotes a face and specifies
* how many vertices it has. Vertices are taken from the
* how many vertices it has. Vertices are taken from the
* vertex data arrays in sequential order. */
const std::vector<unsigned int>& GetFaceIndexCounts() const {
return faces;
@ -781,8 +781,8 @@ public:
static const std::vector<aiColor4D> empty;
return index >= AI_MAX_NUMBER_OF_COLOR_SETS ? empty : colors[index];
}
/** Get per-face-vertex material assignments */
const MatIndexArray& GetMaterialIndices() const {
return materials;
@ -810,7 +810,7 @@ public:
* This mapping is always unique. */
unsigned int FaceForVertexIndex(unsigned int in_index) const {
ai_assert(in_index < vertices.size());
// in the current conversion pattern this will only be needed if
// weights are present, so no need to always pre-compute this table
if (facesVertexStartIndices.empty()) {
@ -827,7 +827,7 @@ public:
in_index
);
return static_cast<unsigned int>(std::distance(facesVertexStartIndices.begin(), it - 1));
return static_cast<unsigned int>(std::distance(facesVertexStartIndices.begin(), it - 1));
}
public:
@ -838,27 +838,27 @@ private:
void ReadLayerElement(const Scope& layerElement);
void ReadVertexData(const std::string& type, int index, const Scope& source);
void ReadVertexDataUV(std::vector<aiVector2D>& uv_out, const Scope& source,
void ReadVertexDataUV(std::vector<aiVector2D>& uv_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType);
void ReadVertexDataNormals(std::vector<aiVector3D>& normals_out, const Scope& source,
void ReadVertexDataNormals(std::vector<aiVector3D>& normals_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType);
void ReadVertexDataColors(std::vector<aiColor4D>& colors_out, const Scope& source,
void ReadVertexDataColors(std::vector<aiColor4D>& colors_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType);
void ReadVertexDataTangents(std::vector<aiVector3D>& tangents_out, const Scope& source,
void ReadVertexDataTangents(std::vector<aiVector3D>& tangents_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType);
void ReadVertexDataBinormals(std::vector<aiVector3D>& binormals_out, const Scope& source,
void ReadVertexDataBinormals(std::vector<aiVector3D>& binormals_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType);
void ReadVertexDataMaterials(MatIndexArray& materials_out, const Scope& source,
void ReadVertexDataMaterials(MatIndexArray& materials_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType);
@ -902,7 +902,7 @@ public:
}
/** get list of keyframe values.
/** get list of keyframe values.
* Invariant: |GetKeys()| == |GetValues()| && |GetKeys()| > 0*/
const KeyValueList& GetValues() const {
return values;
@ -990,7 +990,7 @@ class AnimationLayer : public Object
{
public:
AnimationLayer(uint64_t id, const Element& element, const std::string& name, const Document& doc);
~AnimationLayer();
@ -1210,7 +1210,7 @@ public:
// during their entire lifetime (Document). FBX files have
// up to many thousands of objects (most of which we never use),
// so the memory overhead for them should be kept at a minimum.
typedef std::map<uint64_t, LazyObject*> ObjectMap;
typedef std::map<uint64_t, LazyObject*> ObjectMap;
typedef std::fbx_unordered_map<std::string, boost::shared_ptr<const PropertyTable> > PropertyTemplateMap;
@ -1288,7 +1288,7 @@ private:
/** DOM root for a FBX file */
class Document
class Document
{
public:
@ -1353,10 +1353,10 @@ public:
std::vector<const Connection*> GetConnectionsBySourceSequenced(uint64_t source, const char* classname) const;
std::vector<const Connection*> GetConnectionsByDestinationSequenced(uint64_t dest, const char* classname) const;
std::vector<const Connection*> GetConnectionsBySourceSequenced(uint64_t source,
std::vector<const Connection*> GetConnectionsBySourceSequenced(uint64_t source,
const char* const* classnames, size_t count) const;
std::vector<const Connection*> GetConnectionsByDestinationSequenced(uint64_t dest,
const char* const* classnames,
std::vector<const Connection*> GetConnectionsByDestinationSequenced(uint64_t dest,
const char* const* classnames,
size_t count) const;
const std::vector<const AnimationStack*>& AnimationStacks() const;
@ -1364,9 +1364,9 @@ public:
private:
std::vector<const Connection*> GetConnectionsSequenced(uint64_t id, const ConnectionMap&) const;
std::vector<const Connection*> GetConnectionsSequenced(uint64_t id, bool is_src,
const ConnectionMap&,
const char* const* classnames,
std::vector<const Connection*> GetConnectionsSequenced(uint64_t id, bool is_src,
const ConnectionMap&,
const char* const* classnames,
size_t count) const;
private:

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -95,10 +95,10 @@ void DOMWarning(const std::string& message, const Element* element /*= NULL*/)
// ------------------------------------------------------------------------------------------------
// fetch a property table and the corresponding property template
boost::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
const std::string& templateName,
const Element &element,
// fetch a property table and the corresponding property template
boost::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
const std::string& templateName,
const Element &element,
const Scope& sc,
bool no_warn /*= false*/)
{
@ -107,7 +107,7 @@ boost::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
static_cast<const PropertyTable*>(NULL));
if(templateName.length()) {
PropertyTemplateMap::const_iterator it = doc.Templates().find(templateName);
PropertyTemplateMap::const_iterator it = doc.Templates().find(templateName);
if(it != doc.Templates().end()) {
templateProps = (*it).second;
}

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -66,20 +66,20 @@ void DOMWarning(const std::string& message, const Token& token);
void DOMWarning(const std::string& message, const Element* element = NULL);
// fetch a property table and the corresponding property template
boost::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
const std::string& templateName,
const Element &element,
// fetch a property table and the corresponding property template
boost::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
const std::string& templateName,
const Element &element,
const Scope& sc,
bool no_warn = false);
// ------------------------------------------------------------------------------------------------
template <typename T>
inline const T* ProcessSimpleConnection(const Connection& con,
bool is_object_property_conn,
const char* name,
const Element& element,
inline const T* ProcessSimpleConnection(const Connection& con,
bool is_object_property_conn,
const char* name,
const Element& element,
const char** propNameOut = NULL)
{
if (is_object_property_conn && !con.PropertyName().length()) {
@ -98,7 +98,7 @@ inline const T* ProcessSimpleConnection(const Connection& con,
}
if(is_object_property_conn && propNameOut) {
// note: this is ok, the return value of PropertyValue() is guaranteed to
// note: this is ok, the return value of PropertyValue() is guaranteed to
// remain valid and unchanged as long as the document exists.
*propNameOut = con.PropertyName().c_str();
}

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -48,7 +48,7 @@ namespace Assimp {
namespace FBX {
/** FBX import settings, parts of which are publicly accessible via their corresponding AI_CONFIG constants */
struct ImportSettings
struct ImportSettings
{
ImportSettings()
: strictMode(true)
@ -62,7 +62,7 @@ struct ImportSettings
, preservePivots(true)
, optimizeEmptyAnimationCurves(true)
{}
/** enable strict mode:
* - only accept fbx 2012, 2013 files
@ -75,7 +75,7 @@ struct ImportSettings
/** specifies whether all geometry layers are read and scanned for
* usable data channels. The FBX spec indicates that many readers
* will only read the first channel and that this is in some way
* the recommended way- in reality, however, it happens a lot that
* the recommended way- in reality, however, it happens a lot that
* vertex data is spread among multiple layers. The default
* value for this option is true.*/
bool readAllLayers;
@ -88,7 +88,7 @@ struct ImportSettings
bool readAllMaterials;
/** import materials (true) or skip them and assign a default
/** import materials (true) or skip them and assign a default
* material. The default value is true.*/
bool readMaterials;
@ -114,7 +114,7 @@ struct ImportSettings
*
* The naming scheme for the generated nodes is:
* <OriginalName>_$AssimpFbx$_<TransformName>
*
*
* where <TransformName> is one of
* RotationPivot
* RotationOffset

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -79,7 +79,7 @@ static const aiImporterDesc desc = {
0,
0,
0,
"fbx"
"fbx"
};
}
@ -89,13 +89,13 @@ FBXImporter::FBXImporter()
{}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
// Destructor, private as well
FBXImporter::~FBXImporter()
{
}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
// Returns whether the class can handle the format of the given file.
bool FBXImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
{
const std::string& extension = GetExtension(pFile);
@ -136,8 +136,8 @@ void FBXImporter::SetupProperties(const Importer* pImp)
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void FBXImporter::InternReadFile( const std::string& pFile,
// Imports the given file into the given scene structure.
void FBXImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb"));
@ -170,7 +170,7 @@ void FBXImporter::InternReadFile( const std::string& pFile,
Tokenize(tokens,begin);
}
// use this information to construct a very rudimentary
// use this information to construct a very rudimentary
// parse-tree representing the FBX scope structure
Parser parser(tokens, is_binary);

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "FBXImportSettings.h"
namespace Assimp {
// TinyFormatter.h
namespace Formatter {
template <typename T,typename TR, typename A> class basic_formatter;
@ -74,7 +74,7 @@ public:
public:
// --------------------
bool CanRead( const std::string& pFile,
bool CanRead( const std::string& pFile,
IOSystem* pIOHandler,
bool checkSig
) const;
@ -88,14 +88,14 @@ protected:
void SetupProperties(const Importer* pImp);
// --------------------
void InternReadFile( const std::string& pFile,
aiScene* pScene,
void InternReadFile( const std::string& pFile,
aiScene* pScene,
IOSystem* pIOHandler
);
private:
private:
FBX::ImportSettings settings;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -62,7 +62,7 @@ Material::Material(uint64_t id, const Element& element, const Document& doc, con
: Object(id,element,name)
{
const Scope& sc = GetRequiredScope(element);
const Element* const ShadingModel = sc["ShadingModel"];
const Element* const MultiLayer = sc["MultiLayer"];
@ -218,7 +218,7 @@ LayeredTexture::LayeredTexture(uint64_t id, const Element& element, const Docume
const Element* const BlendModes = sc["BlendModes"];
const Element* const Alphas = sc["Alphas"];
if(BlendModes!=0)
{
blendMode = (BlendMode)ParseTokenAsInt(GetRequiredToken(*BlendModes,0));

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -158,11 +158,11 @@ MeshGeometry::MeshGeometry(uint64_t id, const Element& element, const std::strin
const int absi = index < 0 ? (-index - 1) : index;
mappings[mapping_offsets[absi] + mapping_counts[absi]++] = cursor++;
}
// if settings.readAllLayers is true:
// * read all layers, try to load as many vertex channels as possible
// if settings.readAllLayers is false:
// * read only the layer with index 0, but warn about any further layers
// * read only the layer with index 0, but warn about any further layers
for (ElementMap::const_iterator it = Layer.first; it != Layer.second; ++it) {
const TokenList& tokens = (*it).second->Tokens();
@ -223,7 +223,7 @@ void MeshGeometry::ReadLayerElement(const Scope& layerElement)
}
}
FBXImporter::LogError(Formatter::format("failed to resolve vertex layer element: ")
FBXImporter::LogError(Formatter::format("failed to resolve vertex layer element: ")
<< type << ", index: " << typedIndex);
}
@ -238,10 +238,10 @@ void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scop
const std::string& ReferenceInformationType = ParseTokenAsString(GetRequiredToken(
GetRequiredElement(source,"ReferenceInformationType"),0)
);
if (type == "LayerElementUV") {
if(index >= AI_MAX_NUMBER_OF_TEXTURECOORDS) {
FBXImporter::LogError(Formatter::format("ignoring UV layer, maximum number of UV channels exceeded: ")
FBXImporter::LogError(Formatter::format("ignoring UV layer, maximum number of UV channels exceeded: ")
<< index << " (limit is " << AI_MAX_NUMBER_OF_TEXTURECOORDS << ")" );
return;
}
@ -319,7 +319,7 @@ void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scop
}
else if (type == "LayerElementColor") {
if(index >= AI_MAX_NUMBER_OF_COLOR_SETS) {
FBXImporter::LogError(Formatter::format("ignoring vertex color layer, maximum number of color sets exceeded: ")
FBXImporter::LogError(Formatter::format("ignoring vertex color layer, maximum number of color sets exceeded: ")
<< index << " (limit is " << AI_MAX_NUMBER_OF_COLOR_SETS << ")" );
return;
}
@ -337,7 +337,7 @@ void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scop
// output is in polygon vertex order. This logic is used for reading normals, UVs, colors,
// tangents ..
template <typename T>
void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType,
const char* dataElementName,
@ -353,7 +353,7 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
// handle permutations of Mapping and Reference type - it would be nice to
// deal with this more elegantly and with less redundancy, but right
// now it seems unavoidable.
if (MappingInformationType == "ByVertice" && ReferenceInformationType == "Direct") {
if (MappingInformationType == "ByVertice" && ReferenceInformationType == "Direct") {
data_out.resize(vertex_count);
for (size_t i = 0, e = tempUV.size(); i < e; ++i) {
@ -363,7 +363,7 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
}
}
}
else if (MappingInformationType == "ByVertice" && ReferenceInformationType == "IndexToDirect") {
else if (MappingInformationType == "ByVertice" && ReferenceInformationType == "IndexToDirect") {
data_out.resize(vertex_count);
std::vector<int> uvIndices;
@ -380,9 +380,9 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
}
}
}
else if (MappingInformationType == "ByPolygonVertex" && ReferenceInformationType == "Direct") {
else if (MappingInformationType == "ByPolygonVertex" && ReferenceInformationType == "Direct") {
if (tempUV.size() != vertex_count) {
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygon mapping: ")
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygon mapping: ")
<< tempUV.size() << ", expected " << vertex_count
);
return;
@ -390,7 +390,7 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
data_out.swap(tempUV);
}
else if (MappingInformationType == "ByPolygonVertex" && ReferenceInformationType == "IndexToDirect") {
else if (MappingInformationType == "ByPolygonVertex" && ReferenceInformationType == "IndexToDirect") {
data_out.resize(vertex_count);
std::vector<int> uvIndices;
@ -411,13 +411,13 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
}
}
else {
FBXImporter::LogError(Formatter::format("ignoring vertex data channel, access type not implemented: ")
FBXImporter::LogError(Formatter::format("ignoring vertex data channel, access type not implemented: ")
<< MappingInformationType << "," << ReferenceInformationType);
}
}
// ------------------------------------------------------------------------------------------------
void MeshGeometry::ReadVertexDataNormals(std::vector<aiVector3D>& normals_out, const Scope& source,
void MeshGeometry::ReadVertexDataNormals(std::vector<aiVector3D>& normals_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType)
{
@ -432,7 +432,7 @@ void MeshGeometry::ReadVertexDataNormals(std::vector<aiVector3D>& normals_out, c
// ------------------------------------------------------------------------------------------------
void MeshGeometry::ReadVertexDataUV(std::vector<aiVector2D>& uv_out, const Scope& source,
void MeshGeometry::ReadVertexDataUV(std::vector<aiVector2D>& uv_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType)
{
@ -447,7 +447,7 @@ void MeshGeometry::ReadVertexDataUV(std::vector<aiVector2D>& uv_out, const Scope
// ------------------------------------------------------------------------------------------------
void MeshGeometry::ReadVertexDataColors(std::vector<aiColor4D>& colors_out, const Scope& source,
void MeshGeometry::ReadVertexDataColors(std::vector<aiColor4D>& colors_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType)
{
@ -462,7 +462,7 @@ void MeshGeometry::ReadVertexDataColors(std::vector<aiColor4D>& colors_out, cons
// ------------------------------------------------------------------------------------------------
void MeshGeometry::ReadVertexDataTangents(std::vector<aiVector3D>& tangents_out, const Scope& source,
void MeshGeometry::ReadVertexDataTangents(std::vector<aiVector3D>& tangents_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType)
{
@ -478,7 +478,7 @@ void MeshGeometry::ReadVertexDataTangents(std::vector<aiVector3D>& tangents_out,
// ------------------------------------------------------------------------------------------------
void MeshGeometry::ReadVertexDataBinormals(std::vector<aiVector3D>& binormals_out, const Scope& source,
void MeshGeometry::ReadVertexDataBinormals(std::vector<aiVector3D>& binormals_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType)
{
@ -494,7 +494,7 @@ void MeshGeometry::ReadVertexDataBinormals(std::vector<aiVector3D>& binormals_ou
// ------------------------------------------------------------------------------------------------
void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, const Scope& source,
void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, const Scope& source,
const std::string& MappingInformationType,
const std::string& ReferenceInformationType)
{
@ -516,21 +516,21 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, cons
FBXImporter::LogWarn(Formatter::format("expected only a single material index, ignoring all except the first one"));
materials_out.clear();
}
materials.assign(vertices.size(),materials_out[0]);
}
else if (MappingInformationType == "ByPolygon" && ReferenceInformationType == "IndexToDirect") {
materials.resize(face_count);
if(materials_out.size() != face_count) {
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygon mapping: ")
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygon mapping: ")
<< materials_out.size() << ", expected " << face_count
);
return;
}
}
else {
FBXImporter::LogError(Formatter::format("ignoring material assignments, access type not implemented: ")
FBXImporter::LogError(Formatter::format("ignoring material assignments, access type not implemented: ")
<< MappingInformationType << "," << ReferenceInformationType);
}
}

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -139,7 +139,7 @@ bool Model::IsNull() const
{
const std::vector<const NodeAttribute*>& attrs = GetAttributes();
BOOST_FOREACH(const NodeAttribute* att, attrs) {
const Null* null_tag = dynamic_cast<const Null*>(att);
if(null_tag) {
return true;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -122,7 +122,7 @@ private:
* @verbatim
* GlobalSettings: {
* Version: 1000
* Properties70:
* Properties70:
* [...]
* }
* @endverbatim */
@ -157,10 +157,10 @@ private:
/** FBX parsing class, takes a list of input tokens and generates a hierarchy
* of nested #Scope instances, representing the fbx DOM.*/
class Parser
class Parser
{
public:
/** Parse given a token list. Does not take ownership of the tokens -
* the objects must persist during the entire parser lifetime */
Parser (const TokenList& tokens,bool is_binary);
@ -187,12 +187,12 @@ private:
TokenPtr LastToken() const;
TokenPtr CurrentToken() const;
private:
const TokenList& tokens;
TokenPtr last, current;
TokenList::const_iterator cursor;
boost::scoped_ptr<Scope> root;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -94,12 +94,12 @@ Property* ReadTypedProperty(const Element& element)
else if (!strcmp(cs, "KTime")) {
return new TypedProperty<int64_t>(ParseTokenAsInt64(*tok[4]));
}
else if (!strcmp(cs,"Vector3D") ||
!strcmp(cs,"ColorRGB") ||
!strcmp(cs,"Vector") ||
!strcmp(cs,"Color") ||
!strcmp(cs,"Lcl Translation") ||
!strcmp(cs,"Lcl Rotation") ||
else if (!strcmp(cs,"Vector3D") ||
!strcmp(cs,"ColorRGB") ||
!strcmp(cs,"Vector") ||
!strcmp(cs,"Color") ||
!strcmp(cs,"Lcl Translation") ||
!strcmp(cs,"Lcl Rotation") ||
!strcmp(cs,"Lcl Scaling")
) {
return new TypedProperty<aiVector3D>(aiVector3D(
@ -200,7 +200,7 @@ const Property* PropertyTable::Get(const std::string& name) const
return NULL;
}
}
return (*it).second;
}
@ -218,7 +218,7 @@ DirectPropertyMap PropertyTable::GetUnparsedProperties() const
// Wrap the naked pointer (since the call site is required to acquire ownership)
// std::unique_ptr from C++11 would be preferred both as a wrapper and a return value.
boost::shared_ptr<Property> prop = boost::shared_ptr<Property>(ReadTypedProperty(*element.second));
// Element could not be read. Skip it.
if (!prop) continue;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,23 +23,23 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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 FBXProperties.h
* @brief FBX dynamic properties
* @brief FBX dynamic properties
*/
#ifndef INCLUDED_AI_FBX_PROPERTIES_H
#define INCLUDED_AI_FBX_PROPERTIES_H
@ -87,7 +87,7 @@ class TypedProperty : public Property
{
public:
TypedProperty(const T& value)
TypedProperty(const T& value)
: value(value)
{
}
@ -114,7 +114,7 @@ public:
// in-memory property table with no source element
PropertyTable();
PropertyTable(const Element& element, boost::shared_ptr<const PropertyTable> templateProps);
~PropertyTable();
@ -144,7 +144,7 @@ private:
// ------------------------------------------------------------------------------------------------
template <typename T>
inline T PropertyGet(const PropertyTable& in, const std::string& name,
inline T PropertyGet(const PropertyTable& in, const std::string& name,
const T& defaultValue)
{
const Property* const prop = in.Get(name);
@ -152,7 +152,7 @@ inline T PropertyGet(const PropertyTable& in, const std::string& name,
return defaultValue;
}
// strong typing, no need to be lenient
// strong typing, no need to be lenient
const TypedProperty<T>* const tprop = prop->As< TypedProperty<T> >();
if(!tprop) {
return defaultValue;
@ -164,7 +164,7 @@ inline T PropertyGet(const PropertyTable& in, const std::string& name,
// ------------------------------------------------------------------------------------------------
template <typename T>
inline T PropertyGet(const PropertyTable& in, const std::string& name,
inline T PropertyGet(const PropertyTable& in, const std::string& name,
bool& result)
{
const Property* const prop = in.Get(name);
@ -173,7 +173,7 @@ inline T PropertyGet(const PropertyTable& in, const std::string& name,
return T();
}
// strong typing, no need to be lenient
// strong typing, no need to be lenient
const TypedProperty<T>* const tprop = prop->As< TypedProperty<T> >();
if(!tprop) {
result = false;

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -93,11 +93,11 @@ AI_WONT_RETURN void TokenizeError(const std::string& message, unsigned int line,
}
// process a potential data token up to 'cur', adding it to 'output_tokens'.
// process a potential data token up to 'cur', adding it to 'output_tokens'.
// ------------------------------------------------------------------------------------------------
void ProcessDataToken( TokenList& output_tokens, const char*& start, const char*& end,
unsigned int line,
unsigned int column,
unsigned int line,
unsigned int column,
TokenType type = TokenType_DATA,
bool must_have_token = false)
{
@ -143,7 +143,7 @@ void Tokenize(TokenList& output_tokens, const char* input)
bool comment = false;
bool in_double_quotes = false;
bool pending_data_token = false;
const char* token_begin = NULL, *token_end = NULL;
for (const char* cur = input;*cur;column += (*cur == '\t' ? ASSIMP_FBX_TAB_WIDTH : 1), ++cur) {
const char c = *cur;
@ -194,7 +194,7 @@ void Tokenize(TokenList& output_tokens, const char* input)
ProcessDataToken(output_tokens,token_begin,token_end,line,column);
output_tokens.push_back(new_Token(cur,cur+1,TokenType_CLOSE_BRACKET,line,column));
continue;
case ',':
if (pending_data_token) {
ProcessDataToken(output_tokens,token_begin,token_end,line,column,TokenType_DATA,true);
@ -211,7 +211,7 @@ void Tokenize(TokenList& output_tokens, const char* input)
}
continue;
}
if (IsSpaceOrNewLine(c)) {
if (token_begin) {

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -59,7 +59,7 @@ enum TokenType
{
// {
TokenType_OPEN_BRACKET = 0,
// }
TokenType_CLOSE_BRACKET,
@ -82,7 +82,7 @@ enum TokenType
* classified by the #TokenType enumerated types.
*
* Offers iterator protocol. Tokens are immutable. */
class Token
class Token
{
private:

View File

@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2015, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
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
@ -23,16 +23,16 @@ following conditions are met:
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
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
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
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
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.
----------------------------------------------------------------------
@ -59,7 +59,7 @@ const char* TokenTypeString(TokenType t)
switch(t) {
case TokenType_OPEN_BRACKET:
return "TOK_OPEN_BRACKET";
case TokenType_CLOSE_BRACKET:
return "TOK_CLOSE_BRACKET";
@ -79,7 +79,7 @@ const char* TokenTypeString(TokenType t)
ai_assert(false);
return "";
}
// ------------------------------------------------------------------------------------------------
std::string AddOffset(const std::string& prefix, const std::string& text, unsigned int offset)
@ -102,7 +102,7 @@ std::string AddTokenText(const std::string& prefix, const std::string& text, con
", offset 0x", std::hex, tok->Offset(),") ",
text) );
}
return static_cast<std::string>( (Formatter::format(),prefix,
" (",TokenTypeString(tok->Type()),
", line ",tok->Line(),

Some files were not shown because too many files have changed in this diff Show More