MRPT  1.9.9
CDynamicGrid.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 "containers-precomp.h" // Precompiled headers
11 
13 #include <mrpt/core/format.h>
14 #include <fstream>
15 
17  const std::string& fileName) const
18 {
19  std::ofstream f;
20  f.open(fileName.c_str(), std::ofstream::out);
21  if (!f.is_open()) return false;
22  const unsigned int sy = getSizeY(), sx = getSizeX();
23  for (unsigned int cy = 0; cy < sy; cy++)
24  {
25  for (unsigned int cx = 0; cx < sx; cx++)
26  f << mrpt::format("%f ", getCellAsFloat(cx, cy));
27  f << "\n";
28  }
29  return true;
30 }
std::string std::string format(std::string_view fmt, ARGS &&... args)
Definition: format.h:26
bool saveToTextFile(const std::string &fileName) const
mrpt::vision::TStereoCalibResults out
virtual float getCellAsFloat(unsigned int cx, unsigned int cy) const =0
virtual unsigned int getSizeX() const =0
virtual unsigned int getSizeY() const =0



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020