Main MRPT website > C++ reference for MRPT 1.9.9
CEllipsoidInverseDepth3D.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "opengl-precomp.h" // Precompiled header
11 
14 
15 using namespace mrpt;
16 using namespace mrpt::opengl;
17 
18 using namespace mrpt::math;
19 using namespace std;
20 
23 
24 /*---------------------------------------------------------------
25  transformFromParameterSpace
26  ---------------------------------------------------------------*/
28  const std::vector<BASE::array_parameter_t>& in_pts,
29  std::vector<BASE::array_point_t>& out_pts) const
30 {
32 
33  // (inv_range,yaw,pitch) --> (x,y,z)
34  const size_t N = in_pts.size();
35  out_pts.resize(N);
36  for (size_t i = 0; i < N; i++)
37  {
38  const double inv_range = in_pts[i][0];
39  const double yaw = in_pts[i][1];
40  const double pitch = in_pts[i][2];
41 
42  const double range = inv_range < 0
43  ? m_underflowMaxRange
44  : (inv_range != 0 ? 1. / inv_range : 0);
45 
46  out_pts[i][0] = range * cos(yaw) * cos(pitch);
47  out_pts[i][1] = range * sin(yaw) * cos(pitch);
48  out_pts[i][2] = -range * sin(pitch);
49  }
50 
51  MRPT_END
52 }
53 
57 {
58  writeToStreamRender(out);
59  BASE::thisclass_writeToStream(out);
60 
61  out << m_underflowMaxRange;
62 }
63 
66 {
67  switch (version)
68  {
69  case 0:
70  {
71  readFromStreamRender(in);
72  BASE::thisclass_readFromStream(in);
73 
74  in >> m_underflowMaxRange;
75  }
76  break;
77  default:
79  };
81 }
IMPLEMENTS_SERIALIZABLE
IMPLEMENTS_SERIALIZABLE(CEllipsoidInverseDepth3D, CRenderizableDisplayList, mrpt::opengl) void CEllipsoidInverseDepth3D
Definition: CEllipsoidInverseDepth3D.cpp:21
mrpt::opengl::CEllipsoidInverseDepth3D::transformFromParameterSpace
virtual 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,...
mrpt::opengl::CRenderizableDisplayList
A renderizable object suitable for rendering with OpenGL's display lists.
Definition: CRenderizableDisplayList.h:39
mrpt::opengl::CRenderizableDisplayList::notifyChange
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
Definition: CRenderizableDisplayList.h:57
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
uint8_t
unsigned char uint8_t
Definition: rptypes.h:41
mrpt::serialization::CArchive
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:48
mrpt::opengl::CEllipsoidInverseDepth3D::serializeGetVersion
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
MRPT_START
#define MRPT_START
Definition: exceptions.h:262
mrpt::opengl::CEllipsoidInverseDepth3D::serializeFrom
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
CEllipsoidInverseDepth3D.h
mrpt::obs::gnss::pitch
double pitch
Definition: gnss_messages_novatel.h:264
mrpt::opengl::CEllipsoidInverseDepth3D
An especial "ellipsoid" in 3D computed as the uncertainty iso-surfaces of a (inv_range,...
Definition: CEllipsoidInverseDepth3D.h:49
mrpt::opengl::CEllipsoidInverseDepth3D::serializeTo
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
opengl-precomp.h
MRPT_END
#define MRPT_END
Definition: exceptions.h:266
mrpt::math
This base provides a set of functions for maths stuff.
Definition: math/include/mrpt/math/bits_math.h:13
in
GLuint in
Definition: glext.h:7274
CArchive.h
MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Definition: exceptions.h:90
range
GLsizei range
Definition: glext.h:5907
mrpt::opengl
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST