MRPT  2.0.0
CEllipsoid2D.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/math/CMatrixD.h>
12 #include <mrpt/math/CMatrixFixed.h>
14 
15 namespace mrpt::opengl
16 {
17 /** A 2D ellipse on the XY plane, centered at the origin of this object pose.
18  *
19  * The color is determined by the RGBA fields in the class "CRenderizable".
20  * Note that a transparent ellipse can be drawn for "0<alpha<1" values.
21  * If any of the eigen value of the covariance matrix of the ellipsoid is
22  * zero, it will not be rendered.
23  * \sa opengl::COpenGLScene
24  *
25  * Please read the documentation of
26  * CGeneralizedEllipsoidTemplate::setQuantiles() for learning
27  * the mathematical details about setting the desired confidence interval.
28  *
29  * <div align="center">
30  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px;
31  *border-style: solid;">
32  * <tr> <td> mrpt::opengl::CEllipsoid2D </td> <td> \image html
33  *preview_CEllipsoid.png </td> </tr>
34  * </table>
35  * </div>
36  *
37  * \ingroup mrpt_opengl_grp
38  */
40 {
42 
44 
45  public:
46  CEllipsoid2D() = default;
47  virtual ~CEllipsoid2D() override = default;
48 
49  /** The number of segments of a 2D ellipse (default=20) */
50  void set2DsegmentsCount(unsigned int N) { BASE::setNumberOfSegments(N); }
51 
52  /** Ray tracing */
53  bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const override;
54 
55  protected:
56  /** To be implemented by derived classes: maps, using some arbitrary space
57  * transformation, a list of points
58  * defining an ellipsoid in parameter space into their corresponding
59  * points in 2D/3D space.
60  */
62  const std::vector<BASE::array_parameter_t>& in_pts,
63  std::vector<BASE::array_point_t>& out_pts) const override;
64 };
65 
66 } // namespace mrpt::opengl
void setNumberOfSegments(const uint32_t numSegments)
Set the number of segments of the surface/curve (higher means with greater resolution) ...
virtual ~CEllipsoid2D() override=default
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.
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Ray tracing.
A class that generalizes the concept of an ellipsoid to arbitrary parameterizations of uncertainty sh...
A 2D ellipse on the XY plane, centered at the origin of this object pose.
Definition: CEllipsoid2D.h:39
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
void set2DsegmentsCount(unsigned int N)
The number of segments of a 2D ellipse (default=20)
Definition: CEllipsoid2D.h:50
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020