std::vector<aiNode*> children;
while(ReadToEndElement(D3MF::XmlTag::model))
- {
+ {
if(xmlReader->getNodeName() == D3MF::XmlTag::object)
{
{
}
- }
+ }
if(scene->mRootNode->mName.length == 0)
scene->mRootNode->mName.Set("3MF");
private:
aiNode* ReadObject(aiScene* scene)
- {
+ {
ScopeGuard<aiNode> node(new aiNode());
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 type(xmlReader->getAttributeValue(D3MF::XmlTag::type.c_str()));
node->mParent = scene->mRootNode;
- node->mName.Set(name);
+ node->mName.Set(name);
unsigned long meshIdx = meshes.size();
while(ReadToEndElement(D3MF::XmlTag::object))
{
if(xmlReader->getNodeName() == D3MF::XmlTag::mesh)
- {
+ {
auto mesh = ReadMesh();
mesh->mName.Set(name);
aiMesh* mesh = new aiMesh();
while(ReadToEndElement(D3MF::XmlTag::mesh))
- {
+ {
if(xmlReader->getNodeName() == D3MF::XmlTag::vertices)
{
ImportVertices(mesh);
void ImportVertices(aiMesh* mesh)
{
- std::vector<aiVector3D> vertices;
+ std::vector<aiVector3D> vertices;
while(ReadToEndElement(D3MF::XmlTag::vertices))
- {
+ {
if(xmlReader->getNodeName() == D3MF::XmlTag::vertex)
- {
+ {
vertices.push_back(ReadVertex());
}
}
}
aiVector3D ReadVertex()
- {
+ {
aiVector3D vertex;
vertex.x = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::x.c_str()), nullptr);
vertex.y = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::y.c_str()), nullptr);
void ImportTriangles(aiMesh* mesh)
{
- std::vector<aiFace> faces;
+ std::vector<aiFace> faces;
while(ReadToEndElement(D3MF::XmlTag::triangles))
}
bool D3MFImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const
-{
+{
const std::string extension = GetExtension(pFile);
if(extension == "3mf") {
return true;