3MF-Importer: remove unused variable.

pull/1038/head
Kim Kulling 2016-10-16 17:14:22 +02:00
parent 5cb4df80ad
commit 09ad67f469
1 changed files with 12 additions and 13 deletions

View File

@ -113,7 +113,7 @@ public:
std::vector<aiNode*> children; std::vector<aiNode*> children;
while(ReadToEndElement(D3MF::XmlTag::model)) while(ReadToEndElement(D3MF::XmlTag::model))
{ {
if(xmlReader->getNodeName() == D3MF::XmlTag::object) if(xmlReader->getNodeName() == D3MF::XmlTag::object)
{ {
@ -123,7 +123,7 @@ public:
{ {
} }
} }
if(scene->mRootNode->mName.length == 0) if(scene->mRootNode->mName.length == 0)
scene->mRootNode->mName.Set("3MF"); scene->mRootNode->mName.Set("3MF");
@ -143,24 +143,23 @@ public:
private: private:
aiNode* ReadObject(aiScene* scene) aiNode* ReadObject(aiScene* scene)
{ {
ScopeGuard<aiNode> node(new aiNode()); ScopeGuard<aiNode> node(new aiNode());
std::vector<unsigned long> meshIds; std::vector<unsigned long> meshIds;
int id = std::atoi(xmlReader->getAttributeValue(D3MF::XmlTag::id.c_str()));
std::string name(xmlReader->getAttributeValue(D3MF::XmlTag::name.c_str())); std::string name(xmlReader->getAttributeValue(D3MF::XmlTag::name.c_str()));
std::string type(xmlReader->getAttributeValue(D3MF::XmlTag::type.c_str())); std::string type(xmlReader->getAttributeValue(D3MF::XmlTag::type.c_str()));
node->mParent = scene->mRootNode; node->mParent = scene->mRootNode;
node->mName.Set(name); node->mName.Set(name);
unsigned long meshIdx = meshes.size(); unsigned long meshIdx = meshes.size();
while(ReadToEndElement(D3MF::XmlTag::object)) while(ReadToEndElement(D3MF::XmlTag::object))
{ {
if(xmlReader->getNodeName() == D3MF::XmlTag::mesh) if(xmlReader->getNodeName() == D3MF::XmlTag::mesh)
{ {
auto mesh = ReadMesh(); auto mesh = ReadMesh();
mesh->mName.Set(name); mesh->mName.Set(name);
@ -186,7 +185,7 @@ private:
aiMesh* mesh = new aiMesh(); aiMesh* mesh = new aiMesh();
while(ReadToEndElement(D3MF::XmlTag::mesh)) while(ReadToEndElement(D3MF::XmlTag::mesh))
{ {
if(xmlReader->getNodeName() == D3MF::XmlTag::vertices) if(xmlReader->getNodeName() == D3MF::XmlTag::vertices)
{ {
ImportVertices(mesh); ImportVertices(mesh);
@ -204,12 +203,12 @@ private:
void ImportVertices(aiMesh* mesh) void ImportVertices(aiMesh* mesh)
{ {
std::vector<aiVector3D> vertices; std::vector<aiVector3D> vertices;
while(ReadToEndElement(D3MF::XmlTag::vertices)) while(ReadToEndElement(D3MF::XmlTag::vertices))
{ {
if(xmlReader->getNodeName() == D3MF::XmlTag::vertex) if(xmlReader->getNodeName() == D3MF::XmlTag::vertex)
{ {
vertices.push_back(ReadVertex()); vertices.push_back(ReadVertex());
} }
} }
@ -220,7 +219,7 @@ private:
} }
aiVector3D ReadVertex() aiVector3D ReadVertex()
{ {
aiVector3D vertex; aiVector3D vertex;
vertex.x = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::x.c_str()), nullptr); vertex.x = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::x.c_str()), nullptr);
vertex.y = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::y.c_str()), nullptr); vertex.y = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::y.c_str()), nullptr);
@ -231,7 +230,7 @@ private:
void ImportTriangles(aiMesh* mesh) void ImportTriangles(aiMesh* mesh)
{ {
std::vector<aiFace> faces; std::vector<aiFace> faces;
while(ReadToEndElement(D3MF::XmlTag::triangles)) while(ReadToEndElement(D3MF::XmlTag::triangles))
@ -337,7 +336,7 @@ D3MFImporter::~D3MFImporter()
} }
bool D3MFImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const bool D3MFImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const
{ {
const std::string extension = GetExtension(pFile); const std::string extension = GetExtension(pFile);
if(extension == "3mf") { if(extension == "3mf") {
return true; return true;