19namespace RasterDataToMesh
25 ERR(
"This functionality is currently only available for 2D meshes.");
32 double const replacement)
34 if (std::abs(value - no_data) < std::numeric_limits<double>::epsilon())
42 double const default_replacement,
43 std::string
const& array_name)
52 std::string
const name =
54 auto vec = props.createNewPropertyVector<
double>(
57 std::transform(nodes.cbegin(), nodes.cend(), std::back_inserter(*vec),
60 return evaluatePixel(raster.getValueAtPoint(*node),
61 no_data, default_replacement);
67 double const default_replacement,
68 std::string
const& array_name)
77 std::string
const name =
79 auto vec = props.createNewPropertyVector<
double>(
82 std::transform(elems.cbegin(), elems.cend(), std::back_inserter(*vec),
85 auto node = getCenterOfGravity(*elem);
86 return evaluatePixel(raster.getValueAtPoint(node),
87 no_data, default_replacement);
Definition of the Element class.
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the Node class.
Class Raster is used for managing raster data.
RasterHeader const & getHeader() const
Returns the complete header information.
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Properties & getProperties()
std::string getUniqueName(std::vector< std::string > const &existing_names, std::string const &input_name)
Append '-' and a number such that the name is unique.