ug4
|
#include <heightfield_util.h>
Public Member Functions | |
void | blur (number alpha, size_t numIterations) |
Smoothens the field by adjusting the value of each pixel towards the average of its neighbours. More... | |
const vector2 & | cell_size () const |
std::pair< int, int > | coordinate_to_index (number x, number y) const |
returns the index-tuple of the closest field-entry More... | |
bool | eliminate_invalid_cells () |
eliminates invalid cells by repeatedly filling those cells with averages of neighboring cells More... | |
vector2 | extent () const |
returns the x- and y-extent of the heightfield More... | |
Field< number > & | field () |
const Field< number > & | field () const |
Heightfield () | |
vector2 | index_to_coordinate (int ix, int iy) const |
returns the coordinate of the given cell (specified through an index-tuple) More... | |
void | move (const vector2 &v) |
number | no_data_value () const |
const vector2 & | offset () const |
void | set_cell_size (const vector2 &s) |
void | set_no_data_value (number val) |
void | set_offset (const vector2 &o) |
number | interpolate (number x, number y, int interpOrder) const |
returns the interpolated value at the given location. More... | |
number | interpolate (const vector2 &c, int interpOrder) const |
returns the interpolated value at the given location. More... | |
number | interpolate (number x, number y) const |
returns the interpolated value at the given location. More... | |
number | interpolate (const vector2 &c) const |
returns the interpolated value at the given location. More... | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
vector2 | m_cellSize |
Field< number > | m_field |
number | m_noDataValue |
vector2 | m_offset |
Friends | |
class | boost::serialization::access |
A heightfield represents a grid of number-values together with descriptors for the cell dimensions and the total offset. You can manually create heightfields or load them from a file. Given a heightfield you may create a quad/tri grid or extract the heightfields boundary into a grid. Have a look at field_util.h, too, which declares some useful functions (e.g. blurring).
ug::Heightfield::Heightfield | ( | ) |
void ug::Heightfield::blur | ( | number | alpha, |
size_t | numIterations | ||
) |
Smoothens the field by adjusting the value of each pixel towards the average of its neighbours.
References alpha, ug::BlurField(), field(), and no_data_value().
|
inline |
References m_cellSize.
Referenced by ug::CreateGridFromField(), ug::CreateGridFromFieldBoundary(), ug::RasterLayers::invalidate_small_lenses(), and ug::RasterLayers::remove_small_holes().
returns the index-tuple of the closest field-entry
References m_cellSize, and m_offset.
Referenced by interpolate(), ug::RasterLayers::remove_small_holes(), and ug::SnapToHorizontalRaster().
bool ug::Heightfield::eliminate_invalid_cells | ( | ) |
eliminates invalid cells by repeatedly filling those cells with averages of neighboring cells
The field has to contain at least one valid cell. If it doesn't, false is returned.
References ug::EliminateInvalidCells(), field(), and no_data_value().
vector2 ug::Heightfield::extent | ( | ) | const |
returns the x- and y-extent of the heightfield
References ug::Field< T >::height(), m_cellSize, m_field, and ug::Field< T >::width().
References m_field.
Referenced by blur(), ug::RasterLayers::construct_relative_to_global_height_table(), ug::CreateGridFromField(), ug::CreateGridFromFieldBoundary(), eliminate_invalid_cells(), ug::RasterLayers::eliminate_invalid_cells(), ug::RasterLayers::invalidate_flat_cells(), ug::RasterLayers::invalidate_small_lenses(), ug::LoadHeightfieldFromASC(), ug::RasterLayers::remove_small_holes(), and ug::RasterLayers::snap_cells_to_higher_layers().
vector2 ug::Heightfield::index_to_coordinate | ( | int | ix, |
int | iy | ||
) | const |
returns the coordinate of the given cell (specified through an index-tuple)
References m_cellSize, and m_offset.
Referenced by ug::RasterLayers::construct_relative_to_global_height_table(), ug::RasterLayers::invalidate_flat_cells(), ug::RasterLayers::remove_small_holes(), ug::RasterLayers::snap_cells_to_higher_layers(), and ug::SnapToHorizontalRaster().
returns the interpolated value at the given location.
returns the interpolated value at the given location. Through 'interpOrder' one may specify the order of interpolation:
References interpolate().
returns the interpolated value at the given location.
returns the interpolated value at the given location. Through 'interpOrder' one may specify the order of interpolation:
References interpolate().
returns the interpolated value at the given location.
returns the interpolated value at the given location. Through 'interpOrder' one may specify the order of interpolation:
References interpolate().
returns the interpolated value at the given location.
returns the interpolated value at the given location. Through 'interpOrder' one may specify the order of interpolation:
References ug::Field< T >::at(), coordinate_to_index(), ug::Field< T >::height(), m_cellSize, m_field, m_noDataValue, m_offset, UG_THROW, and ug::Field< T >::width().
Referenced by ug::ExtrudeLayersMixed(), interpolate(), ug::RasterLayers::invalidate_flat_cells(), and ug::RasterLayers::snap_cells_to_higher_layers().
|
inline |
References m_noDataValue.
Referenced by blur(), ug::RasterLayers::construct_relative_to_global_height_table(), ug::CreateGridFromField(), ug::CreateGridFromFieldBoundary(), eliminate_invalid_cells(), ug::RasterLayers::eliminate_invalid_cells(), ug::ExtrudeLayers(), ug::ExtrudeLayersMixed(), ug::RasterLayers::invalidate_flat_cells(), ug::ProjectToLayer(), ug::RasterLayers::remove_small_holes(), and ug::RasterLayers::snap_cells_to_higher_layers().
|
inline |
References m_offset.
Referenced by ug::CreateGridFromField(), and ug::CreateGridFromFieldBoundary().
|
inlineprivate |
References m_cellSize, m_field, m_noDataValue, and m_offset.
|
inline |
References m_cellSize, and s.
Referenced by ug::LoadHeightfieldFromASC().
|
inline |
References m_noDataValue.
Referenced by ug::LoadHeightfieldFromASC().
|
inline |
References m_offset.
Referenced by ug::LoadHeightfieldFromASC().
|
friend |
|
private |
Referenced by cell_size(), coordinate_to_index(), extent(), index_to_coordinate(), interpolate(), serialize(), and set_cell_size().
Referenced by extent(), field(), interpolate(), and serialize().
|
private |
Referenced by interpolate(), no_data_value(), serialize(), and set_no_data_value().
|
private |
Referenced by coordinate_to_index(), index_to_coordinate(), interpolate(), move(), offset(), serialize(), and set_offset().