33 #ifndef __H__UG_heightfield_util
34 #define __H__UG_heightfield_util
119 template <
class Archive>
120 void serialize( Archive& ar,
const unsigned int version)
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
Definition: heightfield_util.h:50
number interpolate(const vector2 &c, int interpOrder) const
returns the interpolated value at the given location.
Definition: heightfield_util.h:66
const vector2 & cell_size() const
Definition: heightfield_util.h:96
std::pair< int, int > coordinate_to_index(number x, number y) const
returns the index-tuple of the closest field-entry
Definition: heightfield_util.cpp:106
Field< number > & field()
Definition: heightfield_util.h:93
bool eliminate_invalid_cells()
eliminates invalid cells by repeatedly filling those cells with averages of neighboring cells
Definition: heightfield_util.cpp:143
vector2 m_cellSize
Definition: heightfield_util.h:131
void set_offset(const vector2 &o)
Definition: heightfield_util.h:100
const vector2 & offset() const
Definition: heightfield_util.h:99
vector2 m_offset
Definition: heightfield_util.h:132
number m_noDataValue
Definition: heightfield_util.h:133
const Field< number > & field() const
Definition: heightfield_util.h:94
void move(const vector2 &v)
Definition: heightfield_util.h:106
void set_no_data_value(number val)
Definition: heightfield_util.h:103
number interpolate(const vector2 &c) const
returns the interpolated value at the given location.
Definition: heightfield_util.h:76
Field< number > m_field
Definition: heightfield_util.h:130
number interpolate(number x, number y) const
returns the interpolated value at the given location.
Definition: heightfield_util.h:71
Heightfield()
Definition: heightfield_util.cpp:43
number interpolate(number x, number y, int interpOrder) const
returns the interpolated value at the given location.
Definition: heightfield_util.cpp:51
vector2 index_to_coordinate(int ix, int iy) const
returns the coordinate of the given cell (specified through an index-tuple)
Definition: heightfield_util.cpp:125
void serialize(Archive &ar, const unsigned int version)
Definition: heightfield_util.h:120
number no_data_value() const
Definition: heightfield_util.h:102
friend class boost::serialization::access
Definition: heightfield_util.h:117
void blur(number alpha, size_t numIterations)
Smoothens the field by adjusting the value of each pixel towards the average of its neighbours.
Definition: heightfield_util.cpp:137
void set_cell_size(const vector2 &s)
Definition: heightfield_util.h:97
vector2 extent() const
returns the x- and y-extent of the heightfield
Definition: heightfield_util.cpp:131
#define UG_API
Definition: ug_config.h:65
double number
Definition: types.h:124
void LoadHeightfieldFromASC(Heightfield &hfield, const char *filename)
Definition: heightfield_util.cpp:170
void CreateGridFromField(Grid &grid, const Field< number > &field, const vector2 &cellSize, const vector2 &offset, number noDataValue, Grid::VertexAttachmentAccessor< APosition > aaPos)
Definition: field_util.cpp:41
void CreateGridFromFieldBoundary(Grid &grid, const Field< number > &field, const vector2 &cellSize, const vector2 &offset, number noDataValue, Grid::VertexAttachmentAccessor< APosition > aaPos)
Definition: field_util.cpp:117