Main MRPT website > C++ reference for MRPT 1.9.9
CEllipsoidRangeBearing2D.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-2017, 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 
13 #include <mrpt/utils/CStream.h>
14 
15 using namespace mrpt;
16 using namespace mrpt::opengl;
17 using namespace mrpt::utils;
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  // (range,bearing) --> (x,y)
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 range = in_pts[i][0];
39  const double bearing = in_pts[i][1];
40  out_pts[i][0] = range * cos(bearing);
41  out_pts[i][1] = range * sin(bearing);
42  }
43 
44  MRPT_END
45 }
46 
47 /*---------------------------------------------------------------
48  Implements the writing to a CStream capability of
49  CSerializable objects
50  ---------------------------------------------------------------*/
52  mrpt::utils::CStream& out, int* version) const
53 {
54  if (version)
55  *version = 0;
56  else
57  {
58  writeToStreamRender(out);
59  BASE::thisclass_writeToStream(out);
60  }
61 }
62 
63 /*---------------------------------------------------------------
64  Implements the reading from a CStream capability of
65  CSerializable objects
66  ---------------------------------------------------------------*/
68  mrpt::utils::CStream& in, int version)
69 {
70  switch (version)
71  {
72  case 0:
73  {
74  readFromStreamRender(in);
75  BASE::thisclass_readFromStream(in);
76  }
77  break;
78  default:
80  };
82 }
GLsizei range
Definition: glext.h:5907
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
STL namespace.
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
A renderizable object suitable for rendering with OpenGL&#39;s display lists.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
This base provides a set of functions for maths stuff.
Definition: CArrayNumeric.h:19
#define MRPT_END
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define MRPT_START
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLuint in
Definition: glext.h:7274
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
IMPLEMENTS_SERIALIZABLE(CEllipsoidRangeBearing2D, CRenderizableDisplayList, mrpt::opengl) void CEllipsoidRangeBearing2D
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, a list of points defining an ellipsoid in parameter space into their corresponding points in 2D/3D space.
An especial "ellipsoid" in 2D computed as the uncertainty iso-surfaces of a (range,bearing) variable.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019