Main MRPT website > C++ reference for MRPT 1.9.9
CDynamicGrid.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 "base-precomp.h" // Precompiled headers
11 
13 #include <mrpt/system/os.h>
14 
15 using namespace mrpt;
16 using namespace mrpt::utils;
17 using namespace mrpt::system;
18 using namespace std;
19 
21  const std::string& fileName) const
22 {
23  FILE* f = os::fopen(fileName.c_str(), "wt");
24  if (!f) return false;
25  const unsigned int sy = getSizeY(), sx = getSizeX();
26  for (unsigned int cy = 0; cy < sy; cy++)
27  {
28  for (unsigned int cx = 0; cx < sx; cx++)
29  os::fprintf(f, "%f ", getCellAsFloat(cx, cy));
30  os::fprintf(f, "\n");
31  }
32  os::fclose(f);
33  return true;
34 }
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
Definition: math_frwds.h:30
int void fclose(FILE *f)
An OS-independent version of fclose.
Definition: os.cpp:272
STL namespace.
bool saveToTextFile(const std::string &fileName) const
GLsizei const GLchar ** string
Definition: glext.h:4101
int fprintf(FILE *fil, const char *format,...) noexcept MRPT_printf_format_check(2
An OS-independent version of fprintf.
Definition: os.cpp:405
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
FILE * fopen(const char *fileName, const char *mode) noexcept
An OS-independent version of fopen.
Definition: os.cpp:254



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