Plugins
Loading...
Searching...
No Matches
rasterid.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Gesellschaft fuer Anlagen- und Reaktorsicherheit gGmbH
3 * SPDX-License-Identifier: EUPL-1.2
4 * SPDX-FileContributor: Dmitry Logashenko
5 * SPDX-FileContributor: Goethe Universität Frankfurt
6 * SPDX-FileType: SOURCE
7 *
8 * This file is part of d3f++.
9 * d3f++ is an extension for UG4. Licensing information and citation requirements of UG4 are provided in LICENSES/UG4-LGPL_2.1
10 */
11
12/*
13 * Definition of surface functions by rasters of identifiers.
14 */
15#ifndef __H__UG__PLUGINS__D3F__RASTERID__
16#define __H__UG__PLUGINS__D3F__RASTERID__
17
18// ug4 headers
19#include "common/common.h"
20#include "common/util/raster.h"
21
22namespace ug {
23namespace d3f {
24
29{
31
32public:
33
35 RasterID () {};
36
38 void load_id_raster_from (const char * file_name)
39 {
40 m_id_raster.load_from_asc (file_name);
41 }
42
44 bool get_id_by_pnt (number x, number y, int & ident) const
45 {
46 id_raster_type::Coordinate coord;
47 coord[0] = x; coord[1] = y;
48 ident = m_id_raster.interpolate (coord, 0);
49 return ident != m_id_raster.no_data_value ();
50 }
51
52private:
53
55};
56
57} // namespace d3f
58} // end namespace ug
59
60#endif // __H__UG__PLUGINS__D3F__RASTERID__
61
62/* End of File */
void load_from_asc(const char *filename)
T no_data_value() const
T interpolate(const Coordinate &coord, int order) const
Definition rasterid.h:29
bool get_id_by_pnt(number x, number y, int &ident) const
checks, in which union (x, y) is (if in any)
Definition rasterid.h:44
Raster< int, 2 > id_raster_type
Definition rasterid.h:30
RasterID()
class constructor
Definition rasterid.h:35
void load_id_raster_from(const char *file_name)
loads the id raster
Definition rasterid.h:38
id_raster_type m_id_raster
Definition rasterid.h:54
double number