Main MRPT website > C++ reference for MRPT 1.5.6
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 {
22  FILE *f=os::fopen(fileName.c_str(),"wt");
23  if(!f) return false;
24  const unsigned int sy = getSizeY(), sx = getSizeX();
25  for (unsigned int cy=0;cy<sy;cy++)
26  {
27  for (unsigned int cx=0;cx<sx;cx++)
28  os::fprintf(f,"%f ", getCellAsFloat(cx,cy) );
29  os::fprintf(f,"\n");
30  }
31  os::fclose(f);
32  return true;
33 }
FILE BASE_IMPEXP * fopen(const char *fileName, const char *mode) MRPT_NO_THROWS
An OS-independent version of fopen.
Definition: os.cpp:255
int BASE_IMPEXP void BASE_IMPEXP fclose(FILE *f)
An OS-independent version of fclose.
Definition: os.cpp:272
int BASE_IMPEXP fprintf(FILE *fil, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(2
An OS-independent version of fprintf.
Definition: os.cpp:412
bool saveToTextFile(const std::string &fileName) const
GLsizei const GLcharARB ** string
Definition: glew.h:3293
GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble f
Definition: glew.h:5092



Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018