69 if (std::abs(d) < 1e-20 || d != d)
82 std::vector<array_parameter_t> params_pts;
92 std::numeric_limits<double>::max(),
93 std::numeric_limits<double>::max(), 0);
95 -std::numeric_limits<double>::max(),
96 -std::numeric_limits<double>::max(), 0);
98 for (
int k = 0; k < DIM; k++)
135 template <
typename MATRIX,
typename VECTOR>
153 template <
typename MATRIX>
223 [[maybe_unused]]
double& dist)
const override 234 const std::vector<array_point_t>& params_pts,
235 std::vector<array_point_t>& out_pts)
const = 0;
259 const uint8_t version = 0;
288 std::vector<array_parameter_t>& out_params_pts)
const;
void generatePoints(const cov_matrix_t &U, std::vector< array_parameter_t > &out_params_pts) const
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...
mrpt::math::TPoint3D m_bb_max
bool m_needToRecomputeEigenVals
#define THROW_EXCEPTION(msg)
void thisclass_writeToStream(mrpt::serialization::CArchive &out) const
void freeOpenGLResources() override
Free opengl buffers.
bool chol(Derived &U) const
Cholesky M=UT * U decomposition for symmetric matrix (upper-half of the matrix is actually ignored...
void setNumberOfSegments(const uint32_t numSegments)
Set the number of segments of the surface/curve (higher means with greater resolution) ...
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
float m_quantiles
The number of "sigmas" for drawing the ellipse/ellipsoid (default=3)
mrpt::opengl::shader_id_t shader_id
A structure that holds runtime class type information.
void implUpdate_Wireframe()
Renderizable generic renderer for objects using the triangles shader.
float getQuantiles() const
Refer to documentation of setQuantiles()
uint32_t m_numSegments
Number of segments in 2D/3D ellipsoids (default=20)
void freeOpenGLResources() override
Free opengl buffers.
void implUpdate_Triangles()
mrpt::poses::CPose3D m_pose
6D pose wrt the parent coordinate reference.
std::vector< shader_id_t > shader_list_t
A list of shader IDs.
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.
void setCovMatrixAndMean(const MATRIX &new_cov, const VECTOR &new_mean)
Set the NxN covariance matrix that will determine the aspect of the ellipsoid - Notice that the covar...
Context for calls to render()
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
mrpt::math::TPoint3D m_bb_min
This base provides a set of functions for maths stuff.
virtual ~CGeneralizedEllipsoidTemplate() override=default
#define ASSERT_EQUAL_(__A, __B)
Assert comparing two values, reporting their actual values upon failure.
static constexpr shader_id_t WIREFRAME
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
Scalar det() const
Determinant of matrix.
TPoint3D_< double > TPoint3D
Lightweight 3D point.
std::vector< array_point_t > m_render_pts
uint32_t getNumberOfSegments()
void setCovMatrix(const MATRIX &new_cov)
Like setCovMatrixAndMean(), for mean=zero.
void onUpdateBuffers_Triangles() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
virtual const mrpt::rtti::TRuntimeClassId * GetRuntimeClass() const override
Returns information about the class of an object in runtime.
static constexpr shader_id_t TRIANGLES
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...
virtual const mrpt::rtti::TRuntimeClassId * GetRuntimeClass() const override
Returns information about the class of an object in runtime.
A class that generalizes the concept of an ellipsoid to arbitrary parameterizations of uncertainty sh...
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
virtual void transformFromParameterSpace(const std::vector< array_point_t > ¶ms_pts, std::vector< array_point_t > &out_pts) const =0
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.
Virtual base class for "archives": classes abstracting I/O streams.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
void thisclass_readFromStream(mrpt::serialization::CArchive &in)
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
mrpt::vision::TStereoCalibResults out
This file implements matrix/vector text and binary serialization.
const cov_matrix_t & getCovMatrix() const
Gets the current uncertainty covariance of parameter space.
Renderizable generic renderer for objects using the wireframe shader.
The namespace for 3D scene representation and rendering.
void setQuantiles(float q)
Changes the scale of the "sigmas" for drawing the ellipse/ellipsoid (default=3, ~97 or ~98% CI); the ...
void enableDrawSolid3D(bool v)
If set to "true", a whole ellipsoid surface will be drawn, or if set to "false" (default) it will be ...
void composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::optional_ref< mrpt::math::CMatrixDouble33 > out_jacobian_df_dpoint=std::nullopt, mrpt::optional_ref< mrpt::math::CMatrixDouble36 > out_jacobian_df_dpose=std::nullopt, mrpt::optional_ref< mrpt::math::CMatrixDouble36 > out_jacobian_df_dse3=std::nullopt, bool use_small_rot_approx=false) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
cov_matrix_t m_U
Cholesky U triangular matrix cache.
virtual bool traceRay([[maybe_unused]] const mrpt::poses::CPose3D &o, [[maybe_unused]] double &dist) const override
Ray tracing.
void freeOpenGLResources() override
Free opengl buffers.
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
bool m_drawSolid3D
If set to "true", a whole ellipsoid surface will be drawn, or if set to "false" (default)it will be d...
CGeneralizedEllipsoidTemplate()=default
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.
mrpt::math::CMatrixFixed< double, DIM, DIM > cov_matrix_t
The type of fixed-size covariance matrices for this representation.
virtual shader_list_t requiredShaders() const override
Returns the ID of the OpenGL shader program required to render this class.
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.