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-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  // (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 
50 {
51  writeToStreamRender(out);
52  BASE::thisclass_writeToStream(out);
53 }
54 
57 {
58  switch (version)
59  {
60  case 0:
61  {
62  readFromStreamRender(in);
63  BASE::thisclass_readFromStream(in);
64  }
65  break;
66  default:
68  };
70 }
GLsizei range
Definition: glext.h:5907
#define MRPT_START
Definition: exceptions.h:262
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 serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
unsigned char uint8_t
Definition: rptypes.h:41
A renderizable object suitable for rendering with OpenGL&#39;s display lists.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Definition: exceptions.h:90
This base provides a set of functions for maths stuff.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:52
#define MRPT_END
Definition: exceptions.h:266
GLuint in
Definition: glext.h:7274
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
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.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
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: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020