29 uint8_t CSetOfTexturedTriangles::serializeGetVersion()
const {
return 2; }
30 void CSetOfTexturedTriangles::serializeTo(
35 writeToStreamRender(
out);
36 writeToStreamTexturedObject(
out);
38 n = (uint32_t)m_triangles.size();
42 for (uint32_t i = 0; i < n; i++) m_triangles[i].writeTo(
out);
45 void CSetOfTexturedTriangles::serializeFrom(
54 readFromStreamRender(in);
57 readFromStreamTexturedObject(in);
66 m_triangles.resize(n);
68 for (uint32_t i = 0; i < n; i++) m_triangles[i].readFrom(in);
74 CRenderizable::notifyChange();
79 [[maybe_unused]]
double& dist)
const 81 throw std::runtime_error(
82 "TODO: TraceRay not implemented in CSetOfTexturedTriangles");
85 void CSetOfTexturedTriangles::getBoundingBox(
89 std::numeric_limits<double>::max(), std::numeric_limits<double>::max(),
90 std::numeric_limits<double>::max());
92 -std::numeric_limits<double>::max(),
93 -std::numeric_limits<double>::max(),
94 -std::numeric_limits<double>::max());
96 for (
const auto& t : m_triangles)
98 for (
size_t i = 0; i < 3; i++)
void keep_min(T &var, const K test_val)
If the second argument is below the first one, set the first argument to this lower value...
#define THROW_EXCEPTION(msg)
bool traceRay(const std::vector< TPolygonWithPlane > &vec, const mrpt::math::TPose3D &pose, double &dist)
Fast ray tracing method using polygons' properties.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
The base class of 3D objects that can be directly rendered through OpenGL.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This base provides a set of functions for maths stuff.
TPoint3D_< double > TPoint3D
Lightweight 3D point.
void keep_max(T &var, const K test_val)
If the second argument is above the first one, set the first argument to this higher value...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
mrpt::vision::TStereoCalibResults out
The namespace for 3D scene representation and rendering.
A set of textured triangles.