MCPcopy Create free account
hub / github.com/ThatOpen/engine_web-ifc / VAlignmentToObj

Function VAlignmentToObj

src/cpp/test/io_helpers.cpp:426–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424 }
425
426 std::string VAlignmentToObj(const std::vector<webifc::geometry::IfcAlignment> &geom)
427 {
428 std::stringstream obj;
429
430 for (uint32_t ia = 0; ia < geom.size(); ia++)
431 {
432 for (uint32_t ic = 0; ic < geom[ia].Vertical.curves.size(); ic++)
433 {
434 for (uint32_t ip = 0; ip < geom[ia].Vertical.curves[ic].points.size(); ip++)
435 {
436 glm::dvec3 t = glm::dvec4(geom[ia].Vertical.curves[ic].points[ip].x, geom[ia].Vertical.curves[ic].points[ip].y, 0, 1);
437 obj << "v " << t.x << " " << t.y << " " << t.z << "\n";
438 }
439 }
440 }
441
442 uint32_t idx = 0;
443
444 for (uint32_t ia = 0; ia < geom.size(); ia++)
445 {
446 if(geom[ia].Vertical.curves.size() > 0)
447 {
448 for (uint32_t ic = 0; ic < geom[ia].Vertical.curves.size(); ic++)
449 {
450 if(geom[ia].Vertical.curves[ic].points.size() > 0)
451 {
452 for (uint32_t ip = 0; ip < geom[ia].Vertical.curves[ic].points.size() - 1; ip++)
453 {
454 obj << "l " << (idx) << " " << (idx + 1) << "\n";
455 ;
456 idx++;
457 }
458 }
459 }
460 }
461 }
462
463 return obj.str();
464 }
465
466 std::string HAlignmentToObj(const std::vector<webifc::geometry::IfcAlignment> &geom)
467 {

Callers 1

DumpAlignmentFunction · 0.85

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected