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

Method Serialize

src/ifcgeom/kernels/cgal/CgalConversionResult.cpp:405–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405void ifcopenshell::geometry::CgalShape::Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string& r) const {
406 cgal_shape_t s = *this;
407
408 if (!place.is_identity()) {
409 const auto& m = place.ccomponents();
410
411 // @todo check
412 const cgal_placement_t trsf(
413 m(0, 0), m(0, 1), m(0, 2), m(0, 3),
414 m(1, 0), m(1, 1), m(1, 2), m(1, 3),
415 m(2, 0), m(2, 1), m(2, 2), m(2, 3));
416
417 // Apply transformation
418 for (auto &vertex : s.vertex_handles()) {
419 vertex->point() = vertex->point().transform(trsf);
420 }
421 }
422
423 std::stringstream sstream;
424 sstream << s;
425 r = sstream.str();
426}
427
428#include <CGAL/Polygon_mesh_processing/bbox.h>
429

Callers 1

SerializationMethod · 0.45

Calls 2

is_identityMethod · 0.80
strMethod · 0.45

Tested by

no test coverage detected