WSL/SLF GitLab Repository

Commit c4a67b91 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Next round of fixes for issue 68 (variable names starting with "_" under...

Next round of fixes for issue 68 (variable names starting with "_" under Visual C++). Hopefully, this issue should now be fully addressed.
parent f3402ce6
......@@ -107,7 +107,7 @@ void FilterAlgorithms::parseWindowFilterArguments(const std::string& filtername,
bool FilterAlgorithms::getWindowData(const std::string& filtername, const std::vector<MeteoData>& vecM,
const unsigned int& pos,
const Date& date, const std::vector<std::string>& _vecArgs,
const Date& date, const std::vector<std::string>& i_vecArgs,
const unsigned int& paramindex, std::vector<double>& vecWindow,
std::vector<Date> *vecDate)
{
......@@ -115,7 +115,7 @@ bool FilterAlgorithms::getWindowData(const std::string& filtername, const std::v
bool isSoft = false;
std::string windowposition = "center"; //the default is a centered window
std::vector<double> vecArgs;
parseWindowFilterArguments(filtername, _vecArgs, 2, 2, isSoft, windowposition, vecArgs);
parseWindowFilterArguments(filtername, i_vecArgs, 2, 2, isSoft, windowposition, vecArgs);
if (vecArgs[0] < 1) //the window size has to be at least 1
throw InvalidArgumentException("Number of data points in window of " +filtername+ " filter cannot be < 1", AT);
......@@ -346,14 +346,14 @@ bool FilterAlgorithms::compareMeteoData (const MeteoData& m1, const MeteoData& m
unsigned int FilterAlgorithms::getWindowData(const std::string& filtername, const std::vector<MeteoData>& vecM,
const unsigned int& pos,
const std::vector<std::string>& _vecArgs, std::vector<MeteoData>& vecResult)
const std::vector<std::string>& i_vecArgs, std::vector<MeteoData>& vecResult)
{
Date date(vecM.at(pos).date);
vecResult.clear();
bool isSoft = false;
std::string windowposition = "center"; //the default is a centered window
std::vector<double> vecArgs;
parseWindowFilterArguments(filtername, _vecArgs, 2, 2, isSoft, windowposition, vecArgs);
parseWindowFilterArguments(filtername, i_vecArgs, 2, 2, isSoft, windowposition, vecArgs);
if (vecArgs[0] < 1) //the window size has to be at least 1
throw InvalidArgumentException("Number of data points in window of " +filtername+ " filter cannot be < 1", AT);
......
......@@ -82,10 +82,10 @@ class FilterAlgorithms {
bool& isSoft, std::string& windowposition, std::vector<double>& vecArgs_out);
static unsigned int getWindowData(const std::string& filtername, const std::vector<MeteoData>& vecM,
const unsigned int& pos,
const std::vector<std::string>& _vecArgs, std::vector<MeteoData>& vecResult);
const std::vector<std::string>& i_vecArgs, std::vector<MeteoData>& vecResult);
static bool getWindowData(const std::string& filtername, const std::vector<MeteoData>& vecM,
const unsigned int& pos,
const Date& date, const std::vector<std::string>& _vecArgs,
const Date& date, const std::vector<std::string>& i_vecArgs,
const unsigned int& paramindex, std::vector<double>& vecWindow,
std::vector<Date> *vecDate = NULL);
......
......@@ -36,7 +36,7 @@ class FilterProperties {
funcptr filterfunc;
FilterProperties() : checkonly(false), filterfunc(NULL){}
FilterProperties(const bool& _co, const funcptr& _ptr ) : checkonly(_co), filterfunc(_ptr){}
FilterProperties(const bool& i_co, const funcptr& i_ptr ) : checkonly(i_co), filterfunc(i_ptr){}
};
} //end namespace mio
......
......@@ -44,31 +44,31 @@ Grid2DObject::Grid2DObject() : grid2D()
cellsize = 0.0;
}
Grid2DObject::Grid2DObject(const unsigned int& _ncols, const unsigned int& _nrows,
const double& _cellsize, const Coords& _llcorner) : grid2D(_ncols, _nrows, IOUtils::nodata)
Grid2DObject::Grid2DObject(const unsigned int& i_ncols, const unsigned int& i_nrows,
const double& i_cellsize, const Coords& i_llcorner) : grid2D(i_ncols, i_nrows, IOUtils::nodata)
{
//set metadata, grid2D already successfully created
setValues(_ncols, _nrows, _cellsize, _llcorner);
setValues(i_ncols, i_nrows, i_cellsize, i_llcorner);
}
Grid2DObject::Grid2DObject(const unsigned int& _ncols, const unsigned int& _nrows,
const double& _cellsize, const Coords& _llcorner, const Array2D<double>& _grid2D) : grid2D()
Grid2DObject::Grid2DObject(const unsigned int& i_ncols, const unsigned int& i_nrows,
const double& i_cellsize, const Coords& i_llcorner, const Array2D<double>& i_grid2D) : grid2D()
{
set(_ncols, _nrows, _cellsize, _llcorner, _grid2D);
set(i_ncols, i_nrows, i_cellsize, i_llcorner, i_grid2D);
}
Grid2DObject::Grid2DObject(const Grid2DObject& _grid2Dobj, const unsigned int& _nx, const unsigned int& _ny,
const unsigned int& _ncols, const unsigned int& _nrows)
: grid2D(_grid2Dobj.grid2D, _nx,_ny, _ncols,_nrows)
Grid2DObject::Grid2DObject(const Grid2DObject& i_grid2Dobj, const unsigned int& i_nx, const unsigned int& i_ny,
const unsigned int& i_ncols, const unsigned int& i_nrows)
: grid2D(i_grid2Dobj.grid2D, i_nx,i_ny, i_ncols,i_nrows)
{
setValues(_ncols, _nrows, _grid2Dobj.cellsize);
setValues(i_ncols, i_nrows, i_grid2Dobj.cellsize);
//we take the previous corner (so we use the same projection parameters)
//and we shift it by the correct X and Y distance
llcorner = _grid2Dobj.llcorner;
llcorner = i_grid2Dobj.llcorner;
if( (llcorner.getEasting()!=IOUtils::nodata) && (llcorner.getNorthing()!=IOUtils::nodata) ) {
llcorner.setXY( llcorner.getEasting()+_nx*_grid2Dobj.cellsize,
llcorner.getNorthing()+_ny*_grid2Dobj.cellsize, IOUtils::nodata);
llcorner.setXY( llcorner.getEasting()+i_nx*i_grid2Dobj.cellsize,
llcorner.getNorthing()+i_ny*i_grid2Dobj.cellsize, IOUtils::nodata);
}
}
......@@ -189,27 +189,27 @@ bool Grid2DObject::WGS84_to_grid(Coords& point) const {
return error_code;
}
void Grid2DObject::set(const unsigned int& _ncols, const unsigned int& _nrows,
const double& _cellsize, const Coords& _llcorner)
void Grid2DObject::set(const unsigned int& i_ncols, const unsigned int& i_nrows,
const double& i_cellsize, const Coords& i_llcorner)
{
setValues(_ncols, _nrows, _cellsize, _llcorner);
setValues(i_ncols, i_nrows, i_cellsize, i_llcorner);
grid2D.resize(ncols, nrows, IOUtils::nodata);
}
void Grid2DObject::set(const unsigned int& _ncols, const unsigned int& _nrows,
const double& _cellsize, const Coords& _llcorner, const Array2D<double>& _grid2D)
void Grid2DObject::set(const unsigned int& i_ncols, const unsigned int& i_nrows,
const double& i_cellsize, const Coords& i_llcorner, const Array2D<double>& i_grid2D)
{
//Test for equality in size: Only compatible Array2D<double> grids are permitted
unsigned int nx,ny;
_grid2D.size(nx,ny);
if ((_ncols != nx) || (_nrows != ny)) {
i_grid2D.size(nx,ny);
if ((i_ncols != nx) || (i_nrows != ny)) {
throw IOException("Mismatch in size of Array2D<double> parameter _grid2D and size of Grid2DObject", AT);
}
setValues(_ncols, _nrows, _cellsize, _llcorner);
setValues(i_ncols, i_nrows, i_cellsize, i_llcorner);
//Copy by value, after destroying the old grid
grid2D = _grid2D;
grid2D = i_grid2D;
}
void Grid2DObject::size(unsigned int& o_ncols, unsigned int& o_nrows) const {
......@@ -217,19 +217,19 @@ void Grid2DObject::size(unsigned int& o_ncols, unsigned int& o_nrows) const {
o_nrows = nrows;
}
void Grid2DObject::setValues(const unsigned int& _ncols, const unsigned int& _nrows,
const double& _cellsize)
void Grid2DObject::setValues(const unsigned int& i_ncols, const unsigned int& i_nrows,
const double& i_cellsize)
{
ncols = _ncols;
nrows = _nrows;
cellsize = _cellsize;
ncols = i_ncols;
nrows = i_nrows;
cellsize = i_cellsize;
}
void Grid2DObject::setValues(const unsigned int& _ncols, const unsigned int& _nrows,
const double& _cellsize, const Coords& _llcorner)
void Grid2DObject::setValues(const unsigned int& i_ncols, const unsigned int& i_nrows,
const double& i_cellsize, const Coords& i_llcorner)
{
setValues(_ncols, _nrows, _cellsize);
llcorner = _llcorner;
setValues(i_ncols, i_nrows, i_cellsize);
llcorner = i_llcorner;
}
bool Grid2DObject::isSameGeolocalization(const Grid2DObject& target) const
......
......@@ -67,22 +67,22 @@ class Grid2DObject {
*/
Grid2DObject();
Grid2DObject(const unsigned int& ncols, const unsigned int& nrows,
const double& cellsize, const Coords& _llcorner);
const double& cellsize, const Coords& i_llcorner);
Grid2DObject(const unsigned int& ncols, const unsigned int& nrows,
const double& cellsize, const Coords& _llcorner, const Array2D<double>& grid2D_in);
const double& cellsize, const Coords& i_llcorner, const Array2D<double>& grid2D_in);
/**
* @brief constructs an object as a subset of another grid object
* @param _grid2Dobj (const Grid2DObject&) initial grid object
* @param _nx (const unsigned int) starting column of the subset
* @param _ny (const unsigned int) starting row of the subset
* @param _ncols (const unsigned int) number of columns of the subset
* @param _nrows (const unsigned int) number of rows of the subset
* @param i_grid2Dobj (const Grid2DObject&) initial grid object
* @param i_nx (const unsigned int) starting column of the subset
* @param i_ny (const unsigned int) starting row of the subset
* @param i_ncols (const unsigned int) number of columns of the subset
* @param i_nrows (const unsigned int) number of rows of the subset
*/
Grid2DObject(const Grid2DObject& _grid2Dobj,
const unsigned int& _nx, const unsigned int& _ny, //Point in the plane
const unsigned int& _ncols, const unsigned int& _nrows); //dimensions of the sub-plane
Grid2DObject(const Grid2DObject& i_grid2Dobj,
const unsigned int& i_nx, const unsigned int& i_ny, //Point in the plane
const unsigned int& i_ncols, const unsigned int& i_nrows); //dimensions of the sub-plane
/**
* @brief Compute the positional parameters that are not already known
......@@ -110,21 +110,21 @@ class Grid2DObject {
* @param ncols (unsigned int) number of colums in the grid2D
* @param nrows (unsigned int) number of rows in the grid2D
* @param cellsize (double) value for cellsize in grid2D
* @param _llcorner lower left corner point
* @param i_llcorner lower left corner point
*/
void set(const unsigned int& ncols, const unsigned int& nrows,
const double& cellsize, const Coords& _llcorner);
const double& cellsize, const Coords& i_llcorner);
/**
* @brief Set all variables in one go. Notably the member grid2D of type
* Array2D\<double\> will be destroyed and recreated to size ncols x nrows.
* @param ncols (unsigned int) number of colums in the grid2D
* @param nrows (unsigned int) number of rows in the grid2D
* @param cellsize (double) value for cellsize in grid2D
* @param _llcorner lower left corner point
* @param i_llcorner lower left corner point
* @param grid2D_in (CArray\<double\>&) grid to be copied by value
*/
void set(const unsigned int& ncols, const unsigned int& nrows,
const double& cellsize, const Coords& _llcorner, const Array2D<double>& grid2D_in); //TODO: const CArray would be better...
const double& cellsize, const Coords& i_llcorner, const Array2D<double>& grid2D_in); //TODO: const CArray would be better...
void size(unsigned int& o_ncols, unsigned int& o_nrows) const;
......@@ -157,9 +157,9 @@ class Grid2DObject {
protected:
void setValues(const unsigned int& ncols, const unsigned int& nrows,
const double& cellsize, const Coords& _llcorner);
void setValues(const unsigned int& _ncols, const unsigned int& _nrows,
const double& _cellsize);
const double& cellsize, const Coords& i_llcorner);
void setValues(const unsigned int& i_ncols, const unsigned int& i_nrows,
const double& i_cellsize);
/**
* @brief Converts WGS84 coordinates into grid coordinates (i,j)
......
......@@ -40,36 +40,37 @@ Grid3DObject::Grid3DObject() : grid3D() //using Array3D default constructor
cellsize = 0.0;
}
Grid3DObject::Grid3DObject(const Grid3DObject& _grid3Dobj,
const unsigned int& _nx, const unsigned int& _ny, const unsigned int& _nz,
const unsigned int& _nwidths, const unsigned int& _nheights, const unsigned int& _ndepths)
: grid3D(_grid3Dobj.grid3D, _nx,_ny,_nz, _nwidths,_nheights,_ndepths)
Grid3DObject::Grid3DObject(const Grid3DObject& i_grid3Dobj,
const unsigned int& i_nx, const unsigned int& i_ny, const unsigned int& i_nz,
const unsigned int& i_nwidths, const unsigned int& i_nheights, const unsigned int& i_ndepths)
: grid3D(i_grid3Dobj.grid3D, i_nx,i_ny,i_nz, i_nwidths,i_nheights,i_ndepths)
{
setValues(_nwidths, _nheights, _ndepths, _grid3Dobj.cellsize);
setValues(i_nwidths, i_nheights, i_ndepths, i_grid3Dobj.cellsize);
//we take the previous corner (so we use the same projection parameters)
//and we shift it by the correct X and Y distance
llcorner = _grid3Dobj.llcorner;
llcorner = i_grid3Dobj.llcorner;
if( (llcorner.getEasting()!=IOUtils::nodata) && (llcorner.getNorthing()!=IOUtils::nodata) ) {
llcorner.setXY( llcorner.getEasting()+_nx*_grid3Dobj.cellsize,
llcorner.getNorthing()+_ny*_grid3Dobj.cellsize,
llcorner.getAltitude()+_nz*_grid3Dobj.cellsize );
llcorner.setXY( llcorner.getEasting()+i_nx*i_grid3Dobj.cellsize,
llcorner.getNorthing()+i_ny*i_grid3Dobj.cellsize,
llcorner.getAltitude()+i_nz*i_grid3Dobj.cellsize );
}
}
Grid3DObject::Grid3DObject(const unsigned int& _ncols, const unsigned int& _nrows, const unsigned int& _ndepths,
const double& _cellsize, const Coords& _llcorner) : grid3D(_ncols, _nrows, _ndepths, IOUtils::nodata)
Grid3DObject::Grid3DObject(const unsigned int& i_ncols, const unsigned int& i_nrows, const unsigned int& i_ndepths,
const double& i_cellsize, const Coords& i_llcorner) : grid3D(i_ncols, i_nrows, i_ndepths, IOUtils::nodata)
{
setValues(_ncols, _nrows, _ndepths, _cellsize, _llcorner);
setValues(i_ncols, i_nrows, i_ndepths, i_cellsize, i_llcorner);
}
Grid3DObject::Grid3DObject(const unsigned int& _ncols, const unsigned int& _nrows, const unsigned int& _ndepths,
const double& _cellsize, const Coords& _llcorner, const Array3D<double>& _grid3D) : grid3D()
Grid3DObject::Grid3DObject(const unsigned int& i_ncols, const unsigned int& i_nrows, const unsigned int& i_ndepths,
const double& i_cellsize, const Coords& i_llcorner, const Array3D<double>& i_grid3D) : grid3D()
{
set(_ncols, _nrows, _ndepths, _cellsize, _llcorner, _grid3D);
set(i_ncols, i_nrows, i_ndepths, i_cellsize, i_llcorner, i_grid3D);
}
bool Grid3DObject::gridify(std::vector<Coords>& vec_points) const {
bool Grid3DObject::gridify(std::vector<Coords>& vec_points) const
{
bool status=true;
std::vector<Coords>::iterator v_Itr = vec_points.begin();
......@@ -85,7 +86,8 @@ bool Grid3DObject::gridify(std::vector<Coords>& vec_points) const {
return status;
}
bool Grid3DObject::gridify(Coords& point) const {
bool Grid3DObject::gridify(Coords& point) const
{
std::string proj_type, proj_args;
point.getProj(proj_type, proj_args);
if(proj_type=="NULL") {
......@@ -102,7 +104,8 @@ bool Grid3DObject::gridify(Coords& point) const {
}
}
bool Grid3DObject::grid_to_WGS84(Coords& point) const {
bool Grid3DObject::grid_to_WGS84(Coords& point) const
{
int i=point.getGridI(), j=point.getGridJ(), k=point.getGridK();
if(i==IOUtils::inodata || j==IOUtils::inodata || k==IOUtils::inodata) {
......@@ -142,10 +145,11 @@ bool Grid3DObject::grid_to_WGS84(Coords& point) const {
return true;
}
bool Grid3DObject::WGS84_to_grid(Coords point) const {
bool Grid3DObject::WGS84_to_grid(Coords point) const
{
if(point.getLat()==IOUtils::nodata || point.getLon()==IOUtils::nodata || point.getAltitude()==IOUtils::nodata) {
//if the point is invalid, there is nothing we can do
return false;
//if the point is invalid, there is nothing we can do
return false;
}
bool error_code=true;
......@@ -196,47 +200,48 @@ bool Grid3DObject::WGS84_to_grid(Coords point) const {
return error_code;
}
void Grid3DObject::set(const unsigned int& _ncols, const unsigned int& _nrows, const unsigned int& _ndepths,
const double& _cellsize, const Coords& _llcorner)
void Grid3DObject::set(const unsigned int& i_ncols, const unsigned int& i_nrows, const unsigned int& i_ndepths,
const double& i_cellsize, const Coords& i_llcorner)
{
setValues(_ncols, _nrows, _ndepths, _cellsize, _llcorner);
grid3D.resize(ncols, nrows, ndepths, IOUtils::nodata);
setValues(i_ncols, i_nrows, i_ndepths, i_cellsize, i_llcorner);
grid3D.resize(ncols, nrows, ndepths, IOUtils::nodata);
}
void Grid3DObject::set(const unsigned int& _ncols, const unsigned int& _nrows, const unsigned int& _ndepths,
const double& _cellsize, const Coords& _llcorner, const Array3D<double>& _grid3D)
void Grid3DObject::set(const unsigned int& i_ncols, const unsigned int& i_nrows, const unsigned int& i_ndepths,
const double& i_cellsize, const Coords& i_llcorner, const Array3D<double>& i_grid3D)
{
//Test for equality in size: Only compatible Array3D<double> grids are permitted
unsigned int nx, ny, nz;
_grid3D.size(nx, ny, nz);
if ((_ncols != nx) || (_nrows != ny) || (_ndepths != nz)) {
i_grid3D.size(nx, ny, nz);
if ((i_ncols != nx) || (i_nrows != ny) || (i_ndepths != nz)) {
throw IOException("Mismatch in size of Array3D<double> parameter grid3D and size of Grid3DObject", AT);
}
setValues(_ncols, _nrows, _ndepths, _cellsize, _llcorner);
grid3D = _grid3D; //copy by value
setValues(i_ncols, i_nrows, i_ndepths, i_cellsize, i_llcorner);
grid3D = i_grid3D; //copy by value
}
void Grid3DObject::size(unsigned int& o_ncols, unsigned int& o_nrows, unsigned int& o_ndepths) const {
void Grid3DObject::size(unsigned int& o_ncols, unsigned int& o_nrows, unsigned int& o_ndepths) const
{
o_ncols = ncols;
o_nrows = nrows;
o_ndepths = ndepths;
}
void Grid3DObject::setValues(const unsigned int& _ncols, const unsigned int& _nrows, const unsigned int& _ndepths,
const double& _cellsize)
void Grid3DObject::setValues(const unsigned int& i_ncols, const unsigned int& i_nrows, const unsigned int& i_ndepths,
const double& i_cellsize)
{
ncols = _ncols;
nrows = _nrows;
ndepths = _ndepths;
cellsize = _cellsize;
ncols = i_ncols;
nrows = i_nrows;
ndepths = i_ndepths;
cellsize = i_cellsize;
}
void Grid3DObject::setValues(const unsigned int& _ncols, const unsigned int& _nrows, const unsigned int& _ndepths,
const double& _cellsize, const Coords& _llcorner)
void Grid3DObject::setValues(const unsigned int& i_ncols, const unsigned int& i_nrows, const unsigned int& i_ndepths,
const double& i_cellsize, const Coords& i_llcorner)
{
setValues(_ncols, _nrows, _ndepths, _cellsize);
llcorner = _llcorner;
setValues(i_ncols, i_nrows, i_ndepths, i_cellsize);
llcorner = i_llcorner;
}
bool Grid3DObject::isSameGeolocalization(const Grid3DObject& target)
......
......@@ -63,18 +63,18 @@ class Grid3DObject{
/**
* A constructor that can be used to create a Grid3DObject that is contained in the
* one passed as _grid3Dobj argument. The resulting Grid3DObject is a by value copy of
* a subspace of the space spanned by the _grid3Dobj
* one passed as i_grid3Dobj argument. The resulting Grid3DObject is a by value copy of
* a subspace of the space spanned by the i_grid3Dobj
*/
Grid3DObject(const Grid3DObject& _grid3Dobj,
const unsigned int& _nx, const unsigned int& _ny, const unsigned int& _nz,
const unsigned int& _nwidths, const unsigned int& _nheights, const unsigned int& _ndepths);
Grid3DObject(const Grid3DObject& i_grid3Dobj,
const unsigned int& i_nx, const unsigned int& i_ny, const unsigned int& i_nz,
const unsigned int& i_nwidths, const unsigned int& i_nheights, const unsigned int& i_ndepths);
Grid3DObject(const unsigned int& ncols, const unsigned int& nrows, const unsigned int& ndepths,
const double& cellsize, const Coords& _llcorner);
const double& cellsize, const Coords& i_llcorner);
Grid3DObject(const unsigned int& ncols, const unsigned int& nrows, const unsigned int& ndepths,
const double& cellsize, const Coords& _llcorner, const Array3D<double>& grid3D);
const double& cellsize, const Coords& i_llcorner, const Array3D<double>& grid3D);
/**
* @brief Set all variables in one go.
......@@ -82,10 +82,10 @@ class Grid3DObject{
* @param nrows (unsigned int&) number of rows in the grid3D (2nd dimension)
* @param depths (unsigned int&) number of depth in the grid3D (3rd dimension)
* @param cellsize (double&) value for cellsize in grid3D
* @param _llcorner lower left corner coordinates
* @param i_llcorner lower left corner coordinates
*/
void set(const unsigned int& ncols, const unsigned int& nrows, const unsigned int& depths,
const double& cellsize, const Coords& _llcorner);
const double& cellsize, const Coords& i_llcorner);
/**
* @brief Set all variables in one go. Notably the member grid3D of type Array3D<double>
* will be destroyed and recreated to size ncols x nrows.
......@@ -94,11 +94,11 @@ class Grid3DObject{
* @param nrows (unsigned int&) number of rows in the grid3D
* @param ndepths (unsigned int&) number of depth in the grid3D (3rd dimension)
* @param cellsize (double&) value for cellsize in grid3D
* @param _llcorner lower left corner coordinates
* @param i_llcorner lower left corner coordinates
* @param grid3D_in (Array\<double\>&) grid to be copied by value
*/
void set(const unsigned int& ncols, const unsigned int& nrows, const unsigned int& ndepths,
const double& cellsize, const Coords& _llcorner, const Array3D<double>& grid3D_in);
const double& cellsize, const Coords& i_llcorner, const Array3D<double>& grid3D_in);
void size(unsigned int& o_ncols, unsigned int& o_nrows, unsigned int& o_ndepths) const;
......@@ -150,7 +150,7 @@ class Grid3DObject{
void setValues(const unsigned int& ncols, const unsigned int& nrows, const unsigned int& ndepths,
const double& cellsize);
void setValues(const unsigned int& ncols, const unsigned int& nrows, const unsigned int& ndepths,
const double& cellsize, const Coords& _llcorner);
const double& cellsize, const Coords& i_llcorner);
/**
* @brief Converts WGS84 coordinates into grid coordinates (i,j)
......
......@@ -198,10 +198,10 @@ IOInterface* IOHandler::getPlugin(const std::string& cfgkey, const std::string&
return (mapit->second).io;
}
void IOHandler::read2DGrid(Grid2DObject& out_grid, const std::string& _filename)
void IOHandler::read2DGrid(Grid2DObject& out_grid, const std::string& i_filename)
{
IOInterface *plugin = getPlugin("GRID2D", "Input");
plugin->read2DGrid(out_grid, _filename);
plugin->read2DGrid(out_grid, i_filename);
}
void IOHandler::readDEM(DEMObject& dem_out)
......
......@@ -44,12 +44,12 @@ class IOPlugin {
/**
* @brief The main constructor for the IOPlugin class
*
* @param _s1 A std::string representing the file to be opened (or "" if plugin is statically linked)
* @param _s2 A std::string that is the classname of the object to be loaded (e.g. "A3DIO", "GSNIO")
* @param i_s1 A std::string representing the file to be opened (or "" if plugin is statically linked)
* @param i_s2 A std::string that is the classname of the object to be loaded (e.g. "A3DIO", "GSNIO")
* @param p1 A pointer to the loaded object of type IOInterface (or NULL)
* @param p2 A pointer to the loaded dynamic library (or NULL)
*/
IOPlugin(std::string _s1, std::string _s2, IOInterface *p1, DynamicLibrary *p2) : libname(_s1), classname(_s2), io(p1), dynLibrary(p2){}
IOPlugin(std::string i_s1, std::string i_s2, IOInterface *p1, DynamicLibrary *p2) : libname(i_s1), classname(i_s2), io(p1), dynLibrary(p2){}
IOPlugin() : libname(""), classname(""), io(NULL), dynLibrary(NULL){}
friend std::ostream& operator<<(std::ostream& os, const IOPlugin& data);
......
......@@ -23,7 +23,7 @@ using namespace std;
namespace mio {
std::set<std::string> AlgorithmFactory::setAlgorithms;
const bool AlgorithmFactory::__init = AlgorithmFactory::initStaticData();
const bool AlgorithmFactory::flag_init = AlgorithmFactory::initStaticData();
bool AlgorithmFactory::initStaticData()
{
......@@ -51,14 +51,12 @@ bool AlgorithmFactory::initStaticData()
}
//HACK: do not build a new object at every time step!!
InterpolationAlgorithm* AlgorithmFactory::getAlgorithm(const std::string& _algoname,
Meteo2DInterpolator& _mi,
const Date& date,
const DEMObject& _dem,
const std::vector<std::string>& _vecArgs,
IOManager& iom)
InterpolationAlgorithm* AlgorithmFactory::getAlgorithm(const std::string& i_algoname,
Meteo2DInterpolator& i_mi, const Date& date,
const DEMObject& i_dem,
const std::vector<std::string>& i_vecArgs, IOManager& iom)
{
std::string algoname(_algoname);
std::string algoname(i_algoname);
IOUtils::toUpper(algoname);
//Check whether algorithm theoretically exists
......@@ -66,27 +64,27 @@ InterpolationAlgorithm* AlgorithmFactory::getAlgorithm(const std::string& _algon
throw UnknownValueException("The interpolation algorithm '"+algoname+"' does not exist" , AT);
if (algoname == "CST"){
return new ConstAlgorithm(_mi, date, _dem, _vecArgs, _algoname, iom);
return new ConstAlgorithm(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else if (algoname == "STD_PRESS"){
return new StandardPressureAlgorithm(_mi, date, _dem, _vecArgs, _algoname, iom);
return new StandardPressureAlgorithm(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else if (algoname == "CST_LAPSE"){
return new ConstLapseRateAlgorithm(_mi, date, _dem, _vecArgs, _algoname, iom);
return new ConstLapseRateAlgorithm(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else if (algoname == "IDW"){
return new IDWAlgorithm(_mi, date, _dem, _vecArgs, _algoname, iom);
return new IDWAlgorithm(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else if (algoname == "IDW_LAPSE"){
return new IDWLapseAlgorithm(_mi, date, _dem, _vecArgs, _algoname, iom);
return new IDWLapseAlgorithm(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else if (algoname == "LIDW_LAPSE"){
return new LocalIDWLapseAlgorithm(_mi, date, _dem, _vecArgs, _algoname, iom);
return new LocalIDWLapseAlgorithm(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else if (algoname == "RH"){
return new RHAlgorithm(_mi, date, _dem, _vecArgs, _algoname, iom);
return new RHAlgorithm(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else if (algoname == "WIND_CURV"){
return new SimpleWindInterpolationAlgorithm(_mi, date, _dem, _vecArgs, _algoname, iom);
return new SimpleWindInterpolationAlgorithm(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else if (algoname == "ODKRIG"){
return new OrdinaryKrigingAlgorithm(_mi, date, _dem, _vecArgs, _algoname, iom);
return new OrdinaryKrigingAlgorithm(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else if (algoname == "USER"){
return new USERInterpolation(_mi, date, _dem, _vecArgs, _algoname, iom);
return new USERInterpolation(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else if (algoname == "HNW_SNOW"){
return new SnowHNWInterpolation(_mi, date, _dem, _vecArgs, _algoname, iom);
return new SnowHNWInterpolation(i_mi, date, i_dem, i_vecArgs, i_algoname, iom);
} else {
throw IOException("The interpolation algorithm '"+algoname+"' is not implemented" , AT);
}
......@@ -95,10 +93,10 @@ InterpolationAlgorithm* AlgorithmFactory::getAlgorithm(const std::string& _algon
}
InterpolationAlgorithm::InterpolationAlgorithm(Meteo2DInterpolator& i_mi,
const Date& i_date,
const DEMObject& i_dem,
const std::vector<std::string>& i_vecArgs,
const std::string& i_algo, IOManager& iom)
const Date& i_date,
const DEMObject& i_dem,
const std::vector<std::string>& i_vecArgs,
const std::string& i_algo, IOManager& iom)
: mi(i_mi), date(i_date), dem(i_dem), vecArgs(i_vecArgs), algo(i_algo), iomanager(iom)
{
nrOfMeasurments = 0;
......
......@@ -130,11 +130,11 @@ class Meteo2DInterpolator; // forward declaration, cyclic header include
class InterpolationAlgorithm {