mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 20:22:09 +00:00
Merge branch 'feature/hierarchy' of https://github.com/mitmadness/IfcOpenShell into feature/hierarchy
# Conflicts: # src/ifcconvert/ColladaSerializer.cpp
This commit is contained in:
@@ -89,7 +89,7 @@ private:
|
||||
{}
|
||||
void add(const std::string& node_id, const std::string& node_name, const std::string& geom_name,
|
||||
const std::vector<std::string>& material_ids, const std::vector<real_t>& matrix);
|
||||
void addParent(const std::string& node_name);
|
||||
void addParent(const IfcGeom::Element<real_t>& parent);
|
||||
void closeParent();
|
||||
void write();
|
||||
ColladaSerializer *serializer;
|
||||
@@ -127,7 +127,14 @@ private:
|
||||
class DeferredObject {
|
||||
friend bool operator < (const DeferredObject & def_obj1, const DeferredObject & def_obj2)
|
||||
{
|
||||
return (def_obj1.parent < def_obj2.parent ? true : false);
|
||||
const IfcGeom::Element<real_t>* parent1 = def_obj1.parent;
|
||||
const IfcGeom::Element<real_t>* parent2 = def_obj2.parent;
|
||||
|
||||
if (parent1 == NULL || parent2 == NULL)
|
||||
{
|
||||
return (def_obj1.unique_id < def_obj2.unique_id ? true : false);
|
||||
}
|
||||
else return parent1->name() < parent2->name() ? true : false;
|
||||
}
|
||||
public:
|
||||
std::string unique_id, representation_id, type;
|
||||
@@ -140,11 +147,11 @@ private:
|
||||
std::vector<IfcGeom::Material> materials;
|
||||
std::vector<std::string> material_references;
|
||||
std::vector<real_t> uvs;
|
||||
std::string parent;
|
||||
const IfcGeom::Element<real_t>* parent;
|
||||
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<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::string& parent)
|
||||
const std::vector<std::string>& material_references, const std::vector<real_t>& uvs, const IfcGeom::Element<real_t>& _parent)
|
||||
: unique_id(unique_id)
|
||||
, representation_id(representation_id)
|
||||
, type(type)
|
||||
@@ -157,8 +164,29 @@ private:
|
||||
, materials(materials)
|
||||
, material_references(material_references)
|
||||
, uvs(uvs)
|
||||
, parent(parent)
|
||||
{}
|
||||
{
|
||||
parent = &_parent;
|
||||
}
|
||||
|
||||
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<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)
|
||||
: unique_id(unique_id)
|
||||
, representation_id(representation_id)
|
||||
, type(type)
|
||||
, matrix(matrix)
|
||||
, vertices(vertices)
|
||||
, normals(normals)
|
||||
, faces(faces)
|
||||
, edges(edges)
|
||||
, material_ids(material_ids)
|
||||
, materials(materials)
|
||||
, material_references(material_references)
|
||||
, uvs(uvs)
|
||||
{
|
||||
parent = NULL;
|
||||
}
|
||||
};
|
||||
COLLADABU::NativeString filename;
|
||||
COLLADASW::StreamWriter stream;
|
||||
|
||||
Reference in New Issue
Block a user