Main MRPT website > C++ reference for MRPT 1.9.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(
32 {
33  MRPT_LOAD_CONFIG_VAR(enableSaveAs3DObject, bool, source, sct);
34  MRPT_LOAD_CONFIG_VAR(enableObservationLikelihood, bool, source, sct);
35  MRPT_LOAD_CONFIG_VAR(enableObservationInsertion, bool, source, sct);
36 }
37 void TMapGenericParams::dumpToTextStream(mrpt::utils::CStream& out) const
38 {
39  // Common:
40  LOADABLEOPTS_DUMP_VAR(enableSaveAs3DObject, bool);
41  LOADABLEOPTS_DUMP_VAR(enableObservationLikelihood, bool);
42  LOADABLEOPTS_DUMP_VAR(enableObservationInsertion, bool);
43 }
44 
45 void TMapGenericParams::writeToStream(
46  mrpt::utils::CStream& out, int* version) const
47 {
48  if (version)
49  *version = 0;
50  else
51  {
52  out << enableSaveAs3DObject << enableObservationLikelihood
53  << enableObservationInsertion;
54  }
55 }
56 
57 void TMapGenericParams::readFromStream(mrpt::utils::CStream& in, int version)
58 {
59  switch (version)
60  {
61  case 0:
62  {
63  in >> enableSaveAs3DObject >> enableObservationLikelihood >>
64  enableObservationInsertion;
65  }
66  break;
67  default:
69  };
70 }
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:44
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
#define LOADABLEOPTS_DUMP_VAR(variableName, variableType)
Macro for dumping a variable to a stream, within the method "dumpToTextStream(out)" (Variable types a...
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:41
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This namespace contains representation of robot actions and observations.
GLsizei const GLchar ** string
Definition: glext.h:4101
Common params to all maps derived from mrpt::maps::CMetricMap.
GLuint in
Definition: glext.h:7274
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
#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...



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019