MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / addFloatSource

Method addFloatSource

src/serializers/ColladaSerializer.cpp:46–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void ColladaSerializer::ColladaExporter::ColladaGeometries::addFloatSource(const std::string& mesh_id,
47 const std::string& suffix, const std::vector<double>& floats, const char* coords /* = "XYZ" */)
48{
49 COLLADASW::FloatSource source(mSW);
50 source.setId(mesh_id + suffix);
51 source.setArrayId(mesh_id + suffix + COLLADASW::LibraryGeometries::ARRAY_ID_SUFFIX);
52 const size_t num_elems = strlen(coords);
53 source.setAccessorStride(static_cast<unsigned long>(num_elems));
54 source.setAccessorCount(static_cast<unsigned long>(floats.size() / num_elems));
55 for (size_t i = 0; i < num_elems; ++i) {
56 source.getParameterNameList().push_back(std::string(1, coords[i]));
57 }
58 source.prepareToAppendValues();
59 for (std::vector<double>::const_iterator it = floats.begin(); it != floats.end(); ++it) {
60 source.appendValues(*it);
61 }
62 source.finish();
63}
64
65void ColladaSerializer::ColladaExporter::ColladaGeometries::write(
66 const std::string &mesh_id, const std::string &/**<@todo 'default_material_name' unused, remove? */,

Callers

nothing calls this directly

Calls 4

push_backMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected