MRPT  2.0.3
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 }
opengl_api.h
mrpt::math::TPoint3D
TPoint3D_< double > TPoint3D
Lightweight 3D point.
Definition: TPoint3D.h:268
mrpt::math::TPoint3D_< double >
CCamera.h
mrpt::opengl::CRenderizable
The base class of 3D objects that can be directly rendered through OpenGL.
Definition: CRenderizable.h:48
out
mrpt::vision::TStereoCalibResults out
Definition: chessboard_stereo_camera_calib_unittest.cpp:25
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: BaseAppDataSource.h:15
mrpt::serialization::CArchive
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:54
mrpt::opengl::CCamera::serializeTo
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
Definition: CCamera.cpp:25
bb_max
const auto bb_max
Definition: CPose3DPDFGrid_unittest.cpp:25
bb_min
const auto bb_min
Definition: CPose3DPDFGrid_unittest.cpp:23
mrpt::opengl::CCamera
A camera: if added to a scene, the viewpoint defined by this camera will be used instead of the camer...
Definition: CCamera.h:33
IMPLEMENTS_SERIALIZABLE
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
Definition: CSerializable.h:166
opengl-precomp.h
mrpt::math
This base provides a set of functions for maths stuff.
Definition: math/include/mrpt/math/bits_math.h:11
mrpt::opengl::CCamera::serializeFrom
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
CArchive.h
MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Definition: exceptions.h:97
mrpt::opengl
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
mrpt::opengl::CCamera::getBoundingBox
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



Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020