27 const std::vector<BASE::array_parameter_t>& in_pts,
28 std::vector<BASE::array_point_t>& out_pts)
const 37 writeToStreamRender(
out);
38 out << m_cov << m_drawSolid3D << m_quantiles << (uint32_t)m_numSegments
49 readFromStreamRender(in);
51 in >> m_drawSolid3D >> m_quantiles;
52 m_numSegments = in.
ReadAs<uint32_t>();
66 static bool quickSolveEqn(
double a,
double b_2,
double c,
double& t)
68 double delta =
square(b_2) - a * c;
70 return (t = -b_2 / a) >= 0;
74 if ((t = (-b_2 - delta) / a) >= 0)
77 return (t = (-b_2 + delta) / a) >= 0;
86 #if 0 // Update, someday... 87 if (m_cov.rows() != 3)
return false;
92 for (
size_t i = 0; i < 3; i++)
96 for (
size_t j = 0; j < 3; j++)
98 double vji = m_eigVec(j, i);
103 double a = 0, b_2 = 0, c = -
square(m_quantiles);
104 for (
size_t i = 0; i < 3; i++)
106 double ev = m_eigVal(i, i);
111 return quickSolveEqn(a, b_2, c, dist);
IMPLEMENTS_SERIALIZABLE(CEllipsoid3D, CRenderizableShaderWireFrame, mrpt::opengl) void CEllipsoid3D
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Ray tracing.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
TPoint3D pBase
Base point.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void transformFromParameterSpace(const std::vector< BASE::array_parameter_t > &in_pts, std::vector< BASE::array_point_t > &out_pts) const override
To be implemented by derived classes: maps, using some arbitrary space transformation, a list of points defining an ellipsoid in parameter space into their corresponding points in 2D/3D space.
This base provides a set of functions for maths stuff.
STORED_TYPE ReadAs()
De-serialize a variable and returns it by value.
TVector3D director
Director vector.
return_t square(const num_t x)
Inline function for the square of a number.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
A 3D ellipsoid, centered at zero with respect to this object pose.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
void createFromPoseX(const mrpt::math::TPose3D &p, TLine3D &r)
Gets a 3D line corresponding to the X axis in a given pose.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
mrpt::vision::TStereoCalibResults out
void unitarize()
Unitarize director vector.
This file implements matrix/vector text and binary serialization.
Renderizable generic renderer for objects using the wireframe shader.
The namespace for 3D scene representation and rendering.
3D line, represented by a base point and a director vector.