MRPT  1.9.9
CCamera.cpp
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 
10 #include "opengl-precomp.h" // Precompiled header
11 
12 #include <mrpt/opengl/CCamera.h>
14 
15 #include <mrpt/opengl/opengl_api.h>
16 
17 using namespace mrpt;
18 using namespace mrpt::opengl;
19 using namespace mrpt::math;
20 using namespace std;
21 
23 
24 uint8_t CCamera::serializeGetVersion() const { return 1; }
26 {
27  // Save data:
28  out << m_pointingX << m_pointingY << m_pointingZ << m_eyeDistance
29  << m_azimuthDeg << m_elevationDeg << m_projectiveModel
30  << m_projectiveFOVdeg;
31 }
32 
34 {
35  switch (version)
36  {
37  case 1:
38  {
39  // Load data:
40  in >> m_pointingX >> m_pointingY >> m_pointingZ >> m_eyeDistance >>
41  m_azimuthDeg >> m_elevationDeg >> m_projectiveModel >>
42  m_projectiveFOVdeg;
43  }
44  break;
45  case 0:
46  {
47  in >> m_pointingX >> m_pointingY >> m_pointingZ >> m_eyeDistance >>
48  m_azimuthDeg >> m_elevationDeg;
49  }
50  break;
51  default:
53  };
54 }
55 
56 /** In this class, returns a fixed box (max,max,max), (-max,-max,-max). */
59 {
61  std::numeric_limits<double>::max(), std::numeric_limits<double>::max(),
62  std::numeric_limits<double>::max());
64  -std::numeric_limits<double>::max(),
65  -std::numeric_limits<double>::max(),
66  -std::numeric_limits<double>::max());
67 }
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
The base class of 3D objects that can be directly rendered through OpenGL.
Definition: CRenderizable.h:48
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
Definition: CCamera.cpp:33
STL namespace.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
In this class, returns a fixed box (max,max,max), (-max,-max,-max).
Definition: CCamera.cpp:57
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Definition: exceptions.h:97
This base provides a set of functions for maths stuff.
TPoint3D_< double > TPoint3D
Lightweight 3D point.
Definition: TPoint3D.h:268
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:54
mrpt::vision::TStereoCalibResults out
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
Definition: CCamera.cpp:25
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
const auto bb_max
const auto bb_min
A camera: if added to a scene, the viewpoint defined by this camera will be used instead of the camer...
Definition: CCamera.h:33



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020