mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 05:52:33 +00:00
Refactor ColladaSerializer.cpp, encode material names only once, decode them before passing to OpenCollada functions that take URI parameters
This commit is contained in:
committed by
Thomas Krijnen
parent
1c83b2db53
commit
06589ca1c6
@@ -69,11 +69,7 @@ private:
|
||||
{}
|
||||
void addFloatSource(const std::string& mesh_id, const std::string& suffix,
|
||||
const std::vector<real_t>& floats, const char* coords = "XYZ");
|
||||
void write(const std::string &mesh_id, const std::string& default_material_name,
|
||||
const std::vector<real_t>& positions, 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<real_t>& uvs);
|
||||
void write(std::string mesh_id, std::string default_material_name, std::vector<real_t> positions, std::vector<real_t> normals, std::vector<int> faces, std::vector<int> edges, std::vector<int> material_ids, std::vector<IfcGeom::Material> materials, std::vector<real_t> uvs, std::vector<std::string> material_references);
|
||||
void close();
|
||||
ColladaSerializer *serializer;
|
||||
};
|
||||
@@ -115,11 +111,12 @@ private:
|
||||
explicit ColladaEffects(COLLADASW::StreamWriter& stream)
|
||||
: COLLADASW::LibraryEffects(&stream)
|
||||
{}
|
||||
void write(const IfcGeom::Material& material);
|
||||
void write(const IfcGeom::Material &material, const std::string &material_uri);
|
||||
void close();
|
||||
ColladaSerializer *serializer;
|
||||
};
|
||||
std::vector<IfcGeom::Material> materials;
|
||||
std::vector<std::string> material_uris;
|
||||
public:
|
||||
explicit ColladaMaterials(COLLADASW::StreamWriter& stream, ColladaSerializer *_serializer)
|
||||
: COLLADASW::LibraryMaterials(&stream)
|
||||
@@ -127,6 +124,7 @@ private:
|
||||
, effects(stream)
|
||||
{}
|
||||
void add(const IfcGeom::Material& material);
|
||||
std::string getMaterialUri(const IfcGeom::Material& material);
|
||||
bool contains(const IfcGeom::Material& material);
|
||||
void write();
|
||||
ColladaSerializer *serializer;
|
||||
|
||||
Reference in New Issue
Block a user