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-2019, 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 "opengl_internals.h"
16 
17 using namespace mrpt;
18 using namespace mrpt::opengl;
19 
20 using namespace mrpt::math;
21 using namespace std;
22 
24 
25 /*--------------------------------------------------------------
26  CCamera
27  ---------------------------------------------------------------*/
29 
30  = default;
31 
32 uint8_t CCamera::serializeGetVersion() const { return 1; }
34 {
35  // Save data:
36  out << m_pointingX << m_pointingY << m_pointingZ << m_distanceZoom
37  << m_azimuthDeg << m_elevationDeg << m_projectiveModel
38  << m_projectiveFOVdeg;
39 }
40 
42 {
43  switch (version)
44  {
45  case 1:
46  {
47  // Load data:
48  in >> m_pointingX >> m_pointingY >> m_pointingZ >> m_distanceZoom >>
49  m_azimuthDeg >> m_elevationDeg >> m_projectiveModel >>
50  m_projectiveFOVdeg;
51  }
52  break;
53  case 0:
54  {
55  in >> m_pointingX >> m_pointingY >> m_pointingZ >> m_distanceZoom >>
56  m_azimuthDeg >> m_elevationDeg;
57  }
58  break;
59  default:
61  };
62 }
63 
64 /** In this class, returns a fixed box (max,max,max), (-max,-max,-max). */
67 {
69  std::numeric_limits<double>::max(), std::numeric_limits<double>::max(),
70  std::numeric_limits<double>::max());
72  -std::numeric_limits<double>::max(),
73  -std::numeric_limits<double>::max(),
74  -std::numeric_limits<double>::max());
75 }
#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:40
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
Definition: CCamera.cpp:41
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:65
CCamera()
Constructor.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Definition: exceptions.h:97
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
Definition: CCamera.cpp:32
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: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:33
GLuint in
Definition: glext.h:7391
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
const auto bb_max
const auto bb_min
Lightweight 3D point.
Definition: TPoint3D.h:90
A camera: if added to a scene, the viewpoint defined by this camera will be used instead of the camer...
Definition: CCamera.h:27



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 9b18308f3 Mon Nov 18 23:39:25 2019 +0100 at lun nov 18 23:45:12 CET 2019