OGS
anonymous_namespace{CoordinateSystem.cpp} Namespace Reference

Functions

unsigned char getCoordinateSystem (GeoLib::AABB const &bbox)

Function Documentation

◆ getCoordinateSystem()

unsigned char anonymous_namespace{CoordinateSystem.cpp}::getCoordinateSystem ( GeoLib::AABB const & bbox)

Definition at line 14 of file MeshLib/CoordinateSystem.cpp.

15{
16 unsigned char coords = 0;
17
18 auto const [bbox_min, bbox_max] = bbox.getMinMaxPoints();
19 Eigen::Vector3d const pt_diff = bbox_max - bbox_min;
20
21 // The axis aligned bounding box is a from the right half-open interval.
22 // Therefore, the difference between the particular coordinates of the
23 // points is modified by the unit in the last place towards zero.
24 if (std::nexttoward(std::abs(pt_diff[0]), 0.0) > .0)
25 {
27 }
28 if (std::nexttoward(std::abs(pt_diff[1]), 0.0) > .0)
29 {
31 }
32 if (std::nexttoward(std::abs(pt_diff[2]), 0.0) > .0)
33 {
35 }
36
37 return coords;
38}
constexpr ranges::views::view_closure coords
Definition Mesh.h:223

References GeoLib::AABB::getMinMaxPoints(), MeshLib::CoordinateSystemType::X, MeshLib::CoordinateSystemType::Y, and MeshLib::CoordinateSystemType::Z.