Commit 02099f50 authored by mjg226's avatar mjg226
Browse files

added a couple more functions to the hex grid class, which I used in caFloodPro and DLL

parent 0ee465c1
......@@ -312,6 +312,49 @@ namespace CA {
}// end of compareAsciiGridHeader
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//std::ostream & operator<<(std::ostream & Str, ESRI_ASCIIGrid<CA::Real> const & value) {
inline std::string getString() {
// print something from v to str, e.g: Str << v.getX();
std::ostringstream Str;
std::string output;
Str << "n cols: " << ncols << std::endl;
Str << "n rows: " << nrows << std::endl;
Str << "xllcorner: " << xllcorner << std::endl;
Str << "yllcorner: " << yllcorner << std::endl;
Str << "no_data: " << nodata << std::endl;
output = Str.str();
//return Str;
return output;
}
//--------------------------------------------------------------------------------------------------------------
inline void copyData(HexAsciiGrid inGrid)
{
AsciiGridGeneral<T>::ncols = inGrid.ncols;
AsciiGridGeneral<T>::nrows = inGrid.nrows;
AsciiGridGeneral<T>::xllcorner = inGrid.xllcorner;
AsciiGridGeneral<T>::yllcorner = inGrid.yllcorner;
AsciiGridGeneral<T>::cellsize = inGrid.cellsize;
AsciiGridGeneral<T>::nodata = inGrid.nodata;
AsciiGridGeneral<T>::data.resize(inGrid.data.size());
for (int counter = 0; counter < inGrid.data.size(); ++counter) {
AsciiGridGeneral<T>::data[counter] = inGrid.data[counter];
}
}
};// end of class
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment