add parent property to deffered objects

This commit is contained in:
Balleux Benjamin
2017-04-12 15:49:05 +02:00
parent be326e13ed
commit 8312853b99
2 changed files with 7 additions and 5 deletions
+4 -4
View File
@@ -224,7 +224,7 @@ void ColladaSerializer::ColladaExporter::ColladaScene::write() {
if (scene_opened) { if (scene_opened) {
closeVisualScene(); closeVisualScene();
closeLibrary(); closeLibrary();
COLLADASW::Scene scene (mSW, COLLADASW::URI ("#" + scene_id)); COLLADASW::Scene scene (mSW, COLLADASW::URI ("#" + scene_id));
scene.add(); scene.add();
} }
@@ -319,8 +319,8 @@ void ColladaSerializer::ColladaExporter::write(const IfcGeom::TriangulationEleme
} }
deferreds.push_back( deferreds.push_back(
DeferredObject(name, representation_id, o->type(), o->transformation().matrix().data(), mesh.verts(), mesh.normals(), DeferredObject(name, representation_id, o->type(), o->transformation().matrix().data(), mesh.verts(), mesh.normals(),
mesh.faces(), mesh.edges(), mesh.material_ids(), mesh.materials(), material_references, mesh.uvs()) mesh.faces(), mesh.edges(), mesh.material_ids(), mesh.materials(), material_references, mesh.uvs(), "")
); );
} }
@@ -343,7 +343,7 @@ void ColladaSerializer::ColladaExporter::write(const IfcGeom::TriangulationEleme
deferreds.push_back( deferreds.push_back(
DeferredObject(name, representation_id, o->type(), o->transformation().matrix().data(), mesh.verts(), mesh.normals(), DeferredObject(name, representation_id, o->type(), o->transformation().matrix().data(), mesh.verts(), mesh.normals(),
mesh.faces(), mesh.edges(), mesh.material_ids(), mesh.materials(), material_references, mesh.uvs()) mesh.faces(), mesh.edges(), mesh.material_ids(), mesh.materials(), material_references, mesh.uvs(), parent->name())
); );
} }
+3 -1
View File
@@ -132,10 +132,11 @@ private:
std::vector<IfcGeom::Material> materials; std::vector<IfcGeom::Material> materials;
std::vector<std::string> material_references; std::vector<std::string> material_references;
std::vector<real_t> uvs; std::vector<real_t> uvs;
std::string parent;
DeferredObject(const std::string& unique_id, const std::string& representation_id, const std::string& type, const std::vector<real_t>& matrix, DeferredObject(const std::string& unique_id, const std::string& representation_id, const std::string& type, const std::vector<real_t>& matrix,
const std::vector<real_t>& vertices, const std::vector<real_t>& normals, const std::vector<int>& faces, const std::vector<real_t>& vertices, const std::vector<real_t>& normals, const std::vector<int>& faces,
const std::vector<int>& edges, const std::vector<int>& material_ids, const std::vector<IfcGeom::Material>& materials, const std::vector<int>& edges, const std::vector<int>& material_ids, const std::vector<IfcGeom::Material>& materials,
const std::vector<std::string>& material_references, const std::vector<real_t>& uvs) const std::vector<std::string>& material_references, const std::vector<real_t>& uvs, const std::string& parent)
: unique_id(unique_id) : unique_id(unique_id)
, representation_id(representation_id) , representation_id(representation_id)
, type(type) , type(type)
@@ -148,6 +149,7 @@ private:
, materials(materials) , materials(materials)
, material_references(material_references) , material_references(material_references)
, uvs(uvs) , uvs(uvs)
, parent(parent)
{} {}
}; };
COLLADABU::NativeString filename; COLLADABU::NativeString filename;