MRPT  2.0.3
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 }
mrpt::containers::internal::dynamic_grid_txt_saver::getSizeX
virtual unsigned int getSizeX() const =0
mrpt::containers::internal::dynamic_grid_txt_saver::getCellAsFloat
virtual float getCellAsFloat(unsigned int cx, unsigned int cy) const =0
format.h
mrpt::containers::internal::dynamic_grid_txt_saver::getSizeY
virtual unsigned int getSizeY() const =0
out
mrpt::vision::TStereoCalibResults out
Definition: chessboard_stereo_camera_calib_unittest.cpp:25
CDynamicGrid.h
mrpt::containers::internal::dynamic_grid_txt_saver::saveToTextFile
bool saveToTextFile(const std::string &fileName) const
Definition: CDynamicGrid.cpp:16
containers-precomp.h
mrpt::format
std::string std::string format(std::string_view fmt, ARGS &&... args)
Definition: format.h:26



Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 15:49:54 UTC 2020