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
22
namespace
ug
{
23
namespace
d3f {
24
28
class
RasterID
29
{
30
typedef
Raster<int, 2>
id_raster_type
;
31
32
public
:
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
52
private
:
53
54
id_raster_type
m_id_raster
;
55
};
56
57
}
// namespace d3f
58
}
// end namespace ug
59
60
#endif
// __H__UG__PLUGINS__D3F__RASTERID__
61
62
/* End of File */
ug::Raster
ug::Raster::load_from_asc
void load_from_asc(const char *filename)
ug::Raster::no_data_value
T no_data_value() const
ug::Raster::interpolate
T interpolate(const Coordinate &coord, int order) const
ug::d3f::RasterID
Definition
rasterid.h:29
ug::d3f::RasterID::get_id_by_pnt
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
ug::d3f::RasterID::id_raster_type
Raster< int, 2 > id_raster_type
Definition
rasterid.h:30
ug::d3f::RasterID::RasterID
RasterID()
class constructor
Definition
rasterid.h:35
ug::d3f::RasterID::load_id_raster_from
void load_id_raster_from(const char *file_name)
loads the id raster
Definition
rasterid.h:38
ug::d3f::RasterID::m_id_raster
id_raster_type m_id_raster
Definition
rasterid.h:54
common.h
number
double number
ug
raster.h
plugins
d3f
rasterid.h
Generated on Mon Aug 24 2026 01:06:21 for Plugins by
1.9.8