33 #ifndef __H__UG_raster_layer_util
34 #define __H__UG_raster_layer_util
69 template <
class Archive>
70 void serialize( Archive& ar,
const unsigned int version)
107 void resize(
size_t newSize);
217 template <
class Archive>
218 void save( Archive& ar,
const unsigned int version)
const
222 for(
size_t i = 0; i <
m_layers.size(); ++i){
233 template <
class Archive>
234 void load( Archive& ar,
const unsigned int version)
236 size_t numLayers = 0;
239 for(
size_t i = 0; i < numLayers; ++i){
244 size_t numRelToGlob = 0;
247 for(
size_t i = 0; i < numRelToGlob; ++i){
253 BOOST_SERIALIZATION_SPLIT_MEMBER()
Definition: smart_pointer.h:108
Definition: heightfield_util.h:50
Definition: raster_layer_util.h:59
void load(Archive &ar, const unsigned int version)
Definition: raster_layer_util.h:234
void eliminate_invalid_cells()
eliminates invalid cells by filling those cells with averages of neighboring valid cells
Definition: raster_layer_util.cpp:283
const layer_t & layer(size_t i) const
Definition: raster_layer_util.h:117
std::pair< int, number > trace_line_down(const vector2 &c, size_t firstLayer) const
finds the first valid value at the given x-y-coordinate starting at the specified layer moving downwa...
Definition: raster_layer_util.cpp:301
number upper_lower_dist_relation(Field< number > &lower, Field< number > &middle, Field< number > &upper, size_t ix, size_t iy)
returns dist(middle, upper, ix, iy) / dist(lower, upper, ix, iy)
Definition: raster_layer_util.cpp:527
std::pair< int, number > trace_line_up(const vector2 &c, size_t firstLayer) const
finds the first valid value at the given x-y-coordinate starting at the specified layer moving downwa...
Definition: raster_layer_util.cpp:314
RasterLayerDesc LayerDesc
Definition: raster_layer_util.h:78
void invalidate_relative_to_global_height_table()
invalidates the table construced by 'construct_relative_to_global_height_table'
Definition: raster_layer_util.cpp:521
void construct_relative_to_global_height_table(size_t iterations, number alpha)
Prepares a table for better 'relative_to_global_height' values in invalid inner regions.
Definition: raster_layer_util.cpp:398
void save(Archive &ar, const unsigned int version) const
Definition: raster_layer_util.h:218
const Heightfield & heightfield(size_t i) const
Definition: raster_layer_util.h:122
size_t size() const
Definition: raster_layer_util.h:109
Heightfield & heightfield(size_t i)
Definition: raster_layer_util.h:121
number relative_to_global_height_simple(const vector2 &c, number relHeight) const
transforms a relative height to an absolute height for a given x-y-coordinate.
Definition: raster_layer_util.cpp:375
void remove_small_holes(number maxArea)
removes small holes by expanding the layer in those regions to the specified height
Definition: raster_layer_util.cpp:151
bool empty() const
Definition: raster_layer_util.h:111
void set_min_height(size_t i, number h)
Definition: raster_layer_util.h:124
void resize(size_t newSize)
Definition: raster_layer_util.cpp:83
void invalidate_flat_cells()
invalidates cells in lower levels which are too close to valid cells in higher levels
Definition: raster_layer_util.cpp:93
number relative_to_global_height(const vector2 &c, number relHeight) const
transforms a relative height to an absolute height for a given x-y-coordinate.
Definition: raster_layer_util.cpp:349
SPRasterLayerDesc SPLayerDesc
Definition: raster_layer_util.h:79
layer_t & layer(size_t i)
Definition: raster_layer_util.h:116
void load_from_files(const std::vector< LayerDesc > &layerDescs)
loads raster data from a list of .asc files.
Definition: raster_layer_util.cpp:51
void blur_layers(number alpha, size_t numIterations)
smoothens the values in each layer by averaging with neighboured values
Definition: raster_layer_util.cpp:293
void snap_cells_to_higher_layers()
sets invalid or flat cells to the value of the corresponding cell in the level above
Definition: raster_layer_util.cpp:252
std::vector< SmartPtr< layer_t > > m_layers
Definition: raster_layer_util.h:256
friend class boost::serialization::access
Definition: raster_layer_util.h:215
std::vector< SmartPtr< Heightfield > > m_relativeToGlobalHeights
Definition: raster_layer_util.h:263
void invalidate_small_lenses(number minArea)
invalidates cells that belong to a small lense regarding its horizontal area
Definition: raster_layer_util.cpp:138
size_t num_layers() const
Definition: raster_layer_util.h:110
const layer_t & top() const
Definition: raster_layer_util.h:119
number min_height(size_t i) const
Definition: raster_layer_util.h:125
layer_t & operator[](size_t i)
Definition: raster_layer_util.h:113
std::pair< int, int > get_layer_indices(const vector3 &c) const
returns an index-pair of the layers above and below the specified point
Definition: raster_layer_util.cpp:327
double number
Definition: types.h:124
Definition: smart_pointer.h:814
const number SMALL
Definition: math_constants.h:41
SmartPtr< RasterLayerDesc > SPRasterLayerDesc
Definition: raster_layer_util.h:56
SmartPtr< T, FreePolicy > make_sp(T *inst)
returns a SmartPtr for the passed raw pointer
Definition: smart_pointer.h:836
Definition: raster_layer_util.h:44
RasterLayerDesc(const std::string &filename, number minHeight)
Definition: raster_layer_util.h:45
const std::string & filename() const
Definition: raster_layer_util.h:48
number min_height() const
Definition: raster_layer_util.h:49
std::string m_filename
Definition: raster_layer_util.h:52
number m_minHeight
Definition: raster_layer_util.h:53
Definition: raster_layer_util.h:61
layer_t()
Definition: raster_layer_util.h:62
void serialize(Archive &ar, const unsigned int version)
Definition: raster_layer_util.h:70
number minHeight
Definition: raster_layer_util.h:65
friend class boost::serialization::access
Definition: raster_layer_util.h:68
Heightfield heightfield
Definition: raster_layer_util.h:64