1 #ifndef GRIDVALUESCSV_H
3 #define GRIDVALUESCSV_H
5 #include "gridvalues.h"
11 class GridValuesCSV :
public GridValues
17 bool_t init(
const std::string &fileName,
bool noNegativeValues =
true,
bool flipY =
false);
19 int getWidth()
const {
return m_width; }
20 int getHeight()
const {
return m_height; }
22 double getValue(
int x,
int y)
const;
23 void setValue(
int x,
int y,
double v);
25 bool isYFlipped()
const {
return m_flipped; }
27 std::string getFileName()
const {
return m_fileName; }
29 std::vector<double> m_values;
30 int m_width, m_height;
32 std::string m_fileName;
35 inline double GridValuesCSV::getValue(
int x,
int y)
const
37 assert(x >= 0 && x < m_width && y >= 0 && y < m_height);
38 return m_values[x+y*m_width];
41 inline void GridValuesCSV::setValue(
int x,
int y,
double v)
43 assert(x >= 0 && x < m_width && y >= 0 && y < m_height);
44 m_values[x+y*m_width] = v;
47 #endif // GRIDVALUESCSV_H
Type to return true/false with error description.
Definition: booltype.h:25