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

Function getBounds

src/cpp/test/io_helpers.cpp:539–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537 }
538
539 Bounds getBounds(std::vector<std::vector<glm::dvec2>> input, glm::dvec2 size, glm::dvec2 offset)
540 {
541 std::vector<glm::dvec2> retval;
542
543 glm::dvec2 min(
544 DBL_MAX,
545 DBL_MAX);
546
547 glm::dvec2 max(
548 -DBL_MAX,
549 -DBL_MAX);
550
551 for (auto &loop : input)
552 {
553 for (auto &point : loop)
554 {
555 min = glm::min(min, point);
556 max = glm::max(max, point);
557 }
558 }
559
560 double width = max.x - min.x;
561 double height = max.y - min.y;
562
563 if (width == 0 && height == 0)
564 {
565 printf("asdf");
566 }
567
568 return {min, max};
569 }
570
571}

Callers 1

makeSVGLinesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected