Main MRPT website > C++ reference for MRPT 1.5.9
metric_map_types.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 "obs-precomp.h" // Precompiled headers
11 
12 #include <mrpt/utils/CStream.h>
16 
17 using namespace mrpt::obs;
18 using namespace mrpt::maps;
19 using namespace mrpt::utils;
20 
22 
24  enableSaveAs3DObject(true),
25  enableObservationLikelihood(true),
26  enableObservationInsertion(true)
27 {
28 }
29 
30 void TMapGenericParams::loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string &sct)
31 {
32  MRPT_LOAD_CONFIG_VAR(enableSaveAs3DObject , bool, source,sct);
33  MRPT_LOAD_CONFIG_VAR(enableObservationLikelihood , bool, source,sct);
34  MRPT_LOAD_CONFIG_VAR(enableObservationInsertion , bool, source,sct);
35 }
36 void TMapGenericParams::dumpToTextStream(mrpt::utils::CStream &out) const
37 {
38  // Common:
39  LOADABLEOPTS_DUMP_VAR(enableSaveAs3DObject , bool);
40  LOADABLEOPTS_DUMP_VAR(enableObservationLikelihood , bool);
41  LOADABLEOPTS_DUMP_VAR(enableObservationInsertion , bool);
42 }
43 
44 void TMapGenericParams::writeToStream(mrpt::utils::CStream &out, int *version) const
45 {
46  if (version)
47  *version = 0;
48  else
49  {
50  out << enableSaveAs3DObject << enableObservationLikelihood << enableObservationInsertion;
51  }
52 }
53 
54 void TMapGenericParams::readFromStream(mrpt::utils::CStream &in, int version)
55 {
56  switch(version)
57  {
58  case 0:
59  {
60  in >> enableSaveAs3DObject >> enableObservationLikelihood >> enableObservationInsertion;
61  } break;
62  default:
64  };
65 }
66 
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
#define LOADABLEOPTS_DUMP_VAR(variableName, variableType)
Macro for dumping a variable to a stream, within the method "dumpToTextStream(out)" (Variable types a...
IMPLEMENTS_SERIALIZABLE(CLogFileRecord_FullEval, CHolonomicLogFileRecord, mrpt::nav) IMPLEMENTS_SERIALIZABLE(CHolonomicFullEval
This class allows loading and storing values and vectors of different types from a configuration text...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This namespace contains representation of robot actions and observations.
int version
Definition: mrpt_jpeglib.h:898
GLsizei const GLchar ** string
Definition: glext.h:3919
#define MRPT_LOAD_CONFIG_VAR(variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
Common params to all maps derived from mrpt::maps::CMetricMap.
GLuint in
Definition: glext.h:6301
GLsizei GLsizei GLchar * source
Definition: glext.h:3908



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020