[3393728] [PATCH 1/2] ommit->omit and splitted->split

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1064 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2011-08-20 22:00:33 +00:00
parent 56098cd33c
commit 2ffac898d6
16 changed files with 54 additions and 54 deletions

View File

@@ -422,7 +422,7 @@ struct SubsurfModifierData : ElemBase {
};
enum Flags {
// some ommitted
// some omitted
FLAGS_SubsurfUV =1<<3
};

View File

@@ -387,7 +387,7 @@ void COBImporter::ReadAsciiFile(Scene& out, StreamReaderLE* stream)
ChunkInfo ci;
for(LineSplitter splitter(*stream);splitter;++splitter) {
// add all chunks to be recognized here. /else ../ ommitted intentionally.
// add all chunks to be recognized here. /else ../ omitted intentionally.
if (splitter.match_start("PolH ")) {
ReadChunkInfo_Ascii(ci,splitter);
ReadPolH_Ascii(out,splitter,ci);

View File

@@ -1193,32 +1193,32 @@ bool MDLImporter::ProcessFrames_3DGS_MDL7(const MDL::IntGroupInfo_MDL7& groupInf
void MDLImporter::SortByMaterials_3DGS_MDL7(
const MDL::IntGroupInfo_MDL7& groupInfo,
MDL::IntGroupData_MDL7& groupData,
MDL::IntSplittedGroupData_MDL7& splittedGroupData)
MDL::IntSplittedGroupData_MDL7& splitGroupData)
{
const unsigned int iNumMaterials = (unsigned int)splittedGroupData.shared.pcMats.size();
const unsigned int iNumMaterials = (unsigned int)splitGroupData.shared.pcMats.size();
if (!groupData.bNeed2UV) {
// if we don't need a second set of texture coordinates there is no reason to keep it in memory ...
groupData.vTextureCoords2.clear();
// allocate the array
splittedGroupData.aiSplit = new std::vector<unsigned int>*[iNumMaterials];
splitGroupData.aiSplit = new std::vector<unsigned int>*[iNumMaterials];
for (unsigned int m = 0; m < iNumMaterials;++m)
splittedGroupData.aiSplit[m] = new std::vector<unsigned int>();
splitGroupData.aiSplit[m] = new std::vector<unsigned int>();
// iterate through all faces and sort by material
for (unsigned int iFace = 0; iFace < (unsigned int)groupInfo.pcGroup->numtris;++iFace) {
// check range
if (groupData.pcFaces[iFace].iMatIndex[0] >= iNumMaterials) {
// use the last material instead
splittedGroupData.aiSplit[iNumMaterials-1]->push_back(iFace);
splitGroupData.aiSplit[iNumMaterials-1]->push_back(iFace);
// sometimes MED writes -1, but normally only if there is only
// one skin assigned. No warning in this case
if(0xFFFFFFFF != groupData.pcFaces[iFace].iMatIndex[0])
DefaultLogger::get()->warn("Index overflow in MDL7 material list [#0]");
}
else splittedGroupData.aiSplit[groupData.pcFaces[iFace].
else splitGroupData.aiSplit[groupData.pcFaces[iFace].
iMatIndex[0]]->push_back(iFace);
}
}
@@ -1271,8 +1271,8 @@ void MDLImporter::SortByMaterials_3DGS_MDL7(
sHelper.pcMat = new MaterialHelper();
sHelper.iOldMatIndices[0] = iMatIndex;
sHelper.iOldMatIndices[1] = iMatIndex2;
JoinSkins_3DGS_MDL7(splittedGroupData.shared.pcMats[iMatIndex],
splittedGroupData.shared.pcMats[iMatIndex2],sHelper.pcMat);
JoinSkins_3DGS_MDL7(splitGroupData.shared.pcMats[iMatIndex],
splitGroupData.shared.pcMats[iMatIndex2],sHelper.pcMat);
// and add it to the list
avMats.push_back(sHelper);
@@ -1288,21 +1288,21 @@ void MDLImporter::SortByMaterials_3DGS_MDL7(
// now add the newly created materials to the old list
if (0 == groupInfo.iIndex) {
splittedGroupData.shared.pcMats.resize(avMats.size());
splitGroupData.shared.pcMats.resize(avMats.size());
for (unsigned int o = 0; o < avMats.size();++o)
splittedGroupData.shared.pcMats[o] = avMats[o].pcMat;
splitGroupData.shared.pcMats[o] = avMats[o].pcMat;
}
else {
// This might result in redundant materials ...
splittedGroupData.shared.pcMats.resize(iNumMaterials + avMats.size());
splitGroupData.shared.pcMats.resize(iNumMaterials + avMats.size());
for (unsigned int o = iNumMaterials; o < avMats.size();++o)
splittedGroupData.shared.pcMats[o] = avMats[o].pcMat;
splitGroupData.shared.pcMats[o] = avMats[o].pcMat;
}
// and build the final face-to-material array
splittedGroupData.aiSplit = new std::vector<unsigned int>*[aiTempSplit.size()];
splitGroupData.aiSplit = new std::vector<unsigned int>*[aiTempSplit.size()];
for (unsigned int m = 0; m < iNumMaterials;++m)
splittedGroupData.aiSplit[m] = aiTempSplit[m];
splitGroupData.aiSplit[m] = aiTempSplit[m];
}
}
@@ -1438,7 +1438,7 @@ void MDLImporter::InternReadFile_3DGS_MDL7( )
szCurrent += pcHeader->mainvertex_stc_size * groupInfo.pcGroup->numverts;
VALIDATE_FILE_SIZE(szCurrent);
MDL::IntSplittedGroupData_MDL7 splittedGroupData(sharedData,avOutList[iGroup]);
MDL::IntSplittedGroupData_MDL7 splitGroupData(sharedData,avOutList[iGroup]);
MDL::IntGroupData_MDL7 groupData;
if (groupInfo.pcGroup->numtris && groupInfo.pcGroup->numverts)
{
@@ -1467,10 +1467,10 @@ void MDLImporter::InternReadFile_3DGS_MDL7( )
// sort by materials
SortByMaterials_3DGS_MDL7(groupInfo, groupData,
splittedGroupData);
splitGroupData);
for (unsigned int qq = 0; qq < sharedData.pcMats.size();++qq) {
if (!splittedGroupData.aiSplit[qq]->empty())
if (!splitGroupData.aiSplit[qq]->empty())
sharedData.abNeedMaterials[qq] = true;
}
}
@@ -1479,7 +1479,7 @@ void MDLImporter::InternReadFile_3DGS_MDL7( )
// process all frames and generate output meshes
ProcessFrames_3DGS_MDL7(groupInfo,groupData, sharedData,szCurrent,&szCurrent);
GenerateOutputMeshes_3DGS_MDL7(groupData,splittedGroupData);
GenerateOutputMeshes_3DGS_MDL7(groupData,splitGroupData);
}
// generate a nodegraph and subnodes for each group
@@ -1773,16 +1773,16 @@ void MDLImporter::AddAnimationBoneTrafoKey_3DGS_MDL7(unsigned int iTrafo,
// Construct output meshes
void MDLImporter::GenerateOutputMeshes_3DGS_MDL7(
MDL::IntGroupData_MDL7& groupData,
MDL::IntSplittedGroupData_MDL7& splittedGroupData)
MDL::IntSplittedGroupData_MDL7& splitGroupData)
{
const MDL::IntSharedData_MDL7& shared = splittedGroupData.shared;
const MDL::IntSharedData_MDL7& shared = splitGroupData.shared;
// get a pointer to the header ...
const MDL::Header_MDL7* const pcHeader = (const MDL::Header_MDL7*)this->mBuffer;
const unsigned int iNumOutBones = pcHeader->bones_num;
for (std::vector<MaterialHelper*>::size_type i = 0; i < shared.pcMats.size();++i) {
if (!splittedGroupData.aiSplit[i]->empty()) {
if (!splitGroupData.aiSplit[i]->empty()) {
// allocate the output mesh
aiMesh* pcMesh = new aiMesh();
@@ -1791,7 +1791,7 @@ void MDLImporter::GenerateOutputMeshes_3DGS_MDL7(
pcMesh->mMaterialIndex = (unsigned int)i;
// allocate output storage
pcMesh->mNumFaces = (unsigned int)splittedGroupData.aiSplit[i]->size();
pcMesh->mNumFaces = (unsigned int)splitGroupData.aiSplit[i]->size();
pcMesh->mFaces = new aiFace[pcMesh->mNumFaces];
pcMesh->mNumVertices = pcMesh->mNumFaces*3;
@@ -1813,7 +1813,7 @@ void MDLImporter::GenerateOutputMeshes_3DGS_MDL7(
pcMesh->mFaces[iFace].mNumIndices = 3;
pcMesh->mFaces[iFace].mIndices = new unsigned int[3];
unsigned int iSrcFace = splittedGroupData.aiSplit[i]->operator[](iFace);
unsigned int iSrcFace = splitGroupData.aiSplit[i]->operator[](iFace);
const MDL::IntFace_MDL7& oldFace = groupData.pcFaces[iSrcFace];
// iterate through all face indices
@@ -1841,7 +1841,7 @@ void MDLImporter::GenerateOutputMeshes_3DGS_MDL7(
int iCurrent = 0;
for (unsigned int iFace = 0; iFace < pcMesh->mNumFaces;++iFace) {
unsigned int iSrcFace = splittedGroupData.aiSplit[i]->operator[](iFace);
unsigned int iSrcFace = splitGroupData.aiSplit[i]->operator[](iFace);
const MDL::IntFace_MDL7& oldFace = groupData.pcFaces[iSrcFace];
// iterate through all face indices
@@ -1887,7 +1887,7 @@ void MDLImporter::GenerateOutputMeshes_3DGS_MDL7(
}
}
// add the mesh to the list of output meshes
splittedGroupData.avOutList.push_back(pcMesh);
splitGroupData.avOutList.push_back(pcMesh);
}
}
}

View File

@@ -78,7 +78,7 @@ using namespace MDL;
* </ul>
* These formats are partially identical and it would be possible to load
* them all with a single 1000-line function-beast. However, it has been
* splitted to several code paths to make the code easier to read and maintain.
* split into several code paths to make the code easier to read and maintain.
*/
class MDLImporter : public BaseImporter
{
@@ -401,12 +401,12 @@ protected:
* might create new materials.
* \param groupInfo -> doc of data structure
* \param groupData -> doc of data structure
* \param splittedGroupData -> doc of data structure
* \param splitGroupData -> doc of data structure
*/
void SortByMaterials_3DGS_MDL7(
const MDL::IntGroupInfo_MDL7& groupInfo,
MDL::IntGroupData_MDL7& groupData,
MDL::IntSplittedGroupData_MDL7& splittedGroupData);
MDL::IntSplittedGroupData_MDL7& splitGroupData);
// -------------------------------------------------------------------
/** Read all faces and vertices from a MDL7 group. The function fills
@@ -420,11 +420,11 @@ protected:
// -------------------------------------------------------------------
/** Generate the final output meshes for a7 models
* \param groupData -> doc of data structure
* \param splittedGroupData -> doc of data structure
* \param splitGroupData -> doc of data structure
*/
void GenerateOutputMeshes_3DGS_MDL7(
MDL::IntGroupData_MDL7& groupData,
MDL::IntSplittedGroupData_MDL7& splittedGroupData);
MDL::IntSplittedGroupData_MDL7& splitGroupData);
protected:

View File

@@ -119,7 +119,7 @@ public:
/** @brief Specify a maximum size of a single output mesh.
*
* If a single input mesh already exceeds this limit, it won't
* be splitted.
* be split.
* @param verts Maximum number of vertices per mesh
* @param faces Maximum number of faces per mesh
*/

View File

@@ -84,7 +84,7 @@ void SplitLargeMeshesProcess_Triangle::Execute( aiScene* pScene)
if (avList.size() != pScene->mNumMeshes)
{
// it seems something has been splitted. rebuild the mesh list
// it seems something has been split. rebuild the mesh list
delete[] pScene->mMeshes;
pScene->mNumMeshes = (unsigned int)avList.size();
pScene->mMeshes = new aiMesh*[avList.size()];
@@ -94,7 +94,7 @@ void SplitLargeMeshesProcess_Triangle::Execute( aiScene* pScene)
// now we need to update all nodes
this->UpdateNode(pScene->mRootNode,avList);
DefaultLogger::get()->info("SplitLargeMeshesProcess_Triangle finished. Meshes have been splitted");
DefaultLogger::get()->info("SplitLargeMeshesProcess_Triangle finished. Meshes have been split");
}
else DefaultLogger::get()->debug("SplitLargeMeshesProcess_Triangle finished. There was nothing to do");
return;
@@ -227,7 +227,7 @@ void SplitLargeMeshesProcess_Triangle::SplitMesh(
pcMesh->mBones = new aiBone*[pMesh->mNumBones];
// iterate through all bones of the mesh and find those which
// need to be copied to the splitted mesh
// need to be copied to the split mesh
std::vector<aiVertexWeight> avTempWeights;
for (unsigned int p = 0; p < pcMesh->mNumBones;++p)
{
@@ -382,7 +382,7 @@ void SplitLargeMeshesProcess_Vertex::Execute( aiScene* pScene)
if (avList.size() != pScene->mNumMeshes)
{
// it seems something has been splitted. rebuild the mesh list
// it seems something has been split. rebuild the mesh list
delete[] pScene->mMeshes;
pScene->mNumMeshes = (unsigned int)avList.size();
pScene->mMeshes = new aiMesh*[avList.size()];
@@ -392,7 +392,7 @@ void SplitLargeMeshesProcess_Vertex::Execute( aiScene* pScene)
// now we need to update all nodes
SplitLargeMeshesProcess_Triangle::UpdateNode(pScene->mRootNode,avList);
DefaultLogger::get()->info("SplitLargeMeshesProcess_Vertex finished. Meshes have been splitted");
DefaultLogger::get()->info("SplitLargeMeshesProcess_Vertex finished. Meshes have been split");
}
else DefaultLogger::get()->debug("SplitLargeMeshesProcess_Vertex finished. There was nothing to do");
return;

View File

@@ -114,7 +114,7 @@ protected:
const XFile::Node* pNode);
// -------------------------------------------------------------------
/** Converts all meshes in the given mesh array. Each mesh is splitted
/** Converts all meshes in the given mesh array. Each mesh is split
* up per material, the indices of the generated meshes are stored in
* the node structure.
* @param pScene The scene to construct the return data in.

View File

@@ -153,7 +153,7 @@ The general 'rule' to get from Assimp headers to the serialized layout is:
[[aiNode]]
- mParent is ommitted
- mParent is omitted
[[aiLight]]
@@ -162,7 +162,7 @@ The general 'rule' to get from Assimp headers to the serialized layout is:
[[aiMaterial]]
- mNumAllocated is ommitted, for obvious reasons :-)
- mNumAllocated is omitted, for obvious reasons :-)
@endverbatim*/