OGS
ColorLookupTable.cpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2
// SPDX-License-Identifier: BSD-3-Clause
3
4
#include "
ColorLookupTable.h
"
5
6
#include <limits>
7
8
namespace
DataHolderLib
9
{
10
ColorLookupTable::ColorLookupTable
()
11
:
_range
(
12
std::make_pair<double, double>(std::numeric_limits<double>::lowest(),
13
std::numeric_limits<double>::max()))
14
15
{
16
}
17
18
void
ColorLookupTable::setTableRange
(
double
min,
double
max)
19
{
20
if
(min < max)
21
{
22
_range
= std::make_pair(min, max);
23
}
24
}
25
26
void
ColorLookupTable::setColor
(
double
id
,
DataHolderLib::Color
const
& color)
27
{
28
if
((
id
>
_range
.first) && (
id
<
_range
.second))
29
{
30
_lut
.emplace_back(
id
, color,
""
);
31
}
32
}
33
34
void
ColorLookupTable::setColor
(std::string
const
& name,
35
DataHolderLib::Color
const
& color)
36
{
37
_lut
.emplace_back(0, color, name);
38
}
39
40
}
// namespace DataHolderLib
ColorLookupTable.h
DataHolderLib::ColorLookupTable::setColor
void setColor(double id, DataHolderLib::Color const &color)
Definition
ColorLookupTable.cpp:26
DataHolderLib::ColorLookupTable::ColorLookupTable
ColorLookupTable()
Definition
ColorLookupTable.cpp:10
DataHolderLib::ColorLookupTable::setTableRange
void setTableRange(double min, double max)
Definition
ColorLookupTable.cpp:18
DataHolderLib::ColorLookupTable::_lut
std::vector< std::tuple< double, Color, std::string > > _lut
Definition
ColorLookupTable.h:57
DataHolderLib::ColorLookupTable::_range
std::pair< double, double > _range
Definition
ColorLookupTable.h:59
DataHolderLib
Definition
MeshElementRemovalDialog.h:15
DataHolderLib::Color
std::array< unsigned char, 4 > Color
Definition
Color.h:12
Applications
DataHolderLib
ColorLookupTable.cpp
Generated by
1.14.0