Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
caddies
caddies-api
Commits
02099f50
Commit
02099f50
authored
Jul 20, 2016
by
mjg226
Browse files
added a couple more functions to the hex grid class, which I used in caFloodPro and DLL
parent
0ee465c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
impls/hexagonal-cell/1-levels/simple/HexAsciiGrid.hpp
impls/hexagonal-cell/1-levels/simple/HexAsciiGrid.hpp
+43
-0
No files found.
impls/hexagonal-cell/1-levels/simple/HexAsciiGrid.hpp
View file @
02099f50
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment