accelerated-raytracer/src/KDLeaf.h

32 lines
850 B
C++

#ifndef RAYTRYCPP_KDLEAF_H
#define RAYTRYCPP_KDLEAF_H
#include "KDAxis.h"
#include "Triangle.h"
namespace raytry::KD {
using namespace std::string_literals;
struct Leaf {
std::vector<const Triangle *> triangles{};
AABB boundaries{};
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg) const {
dbg << "KD::Leaf(" << triangles.size() << ", [";
for (unsigned int a = Axis::X; a <= Axis::Z; ++a) {
dbg << ("("s + std::to_string(boundaries[a].first) + ", "s + std::to_string(boundaries[a].second) + ")"s).c_str() << ", ";
}
return dbg << "])";
}
friend QDebug operator<<(QDebug dbg, const Leaf &leaf) {
return leaf.operator<<(std::move(dbg));
}
#endif
};
}// namespace raytry::KD
#endif//RAYTRYCPP_KDLEAF_H