OGS
ColorLookupTable.cpp
Go to the documentation of this file.
1
11
#include "
ColorLookupTable.h
"
12
13
#include <limits>
14
15
namespace
DataHolderLib
16
{
17
ColorLookupTable::ColorLookupTable
()
18
: _range(
19
std::make_pair<double, double>(std::numeric_limits<double>::lowest(),
20
std::numeric_limits<double>::max()))
21
22
{
23
}
24
25
void
ColorLookupTable::setTableRange
(
double
min,
double
max)
26
{
27
if
(min < max)
28
{
29
_range
= std::make_pair(min, max);
30
}
31
}
32
33
void
ColorLookupTable::setColor
(
double
id
,
DataHolderLib::Color
const
& color)
34
{
35
if
((
id
>
_range
.first) && (
id
<
_range
.second))
36
{
37
_lut
.emplace_back(
id
, color,
""
);
38
}
39
}
40
41
void
ColorLookupTable::setColor
(std::string
const
& name,
42
DataHolderLib::Color
const
& color)
43
{
44
_lut
.emplace_back(0, color, name);
45
}
46
47
}
// namespace DataHolderLib
ColorLookupTable.h
DataHolderLib::ColorLookupTable::setColor
void setColor(double id, DataHolderLib::Color const &color)
Definition
ColorLookupTable.cpp:33
DataHolderLib::ColorLookupTable::ColorLookupTable
ColorLookupTable()
Definition
ColorLookupTable.cpp:17
DataHolderLib::ColorLookupTable::setTableRange
void setTableRange(double min, double max)
Definition
ColorLookupTable.cpp:25
DataHolderLib::ColorLookupTable::_lut
std::vector< std::tuple< double, Color, std::string > > _lut
Definition
ColorLookupTable.h:64
DataHolderLib::ColorLookupTable::_range
std::pair< double, double > _range
Definition
ColorLookupTable.h:66
DataHolderLib
Definition
MeshElementRemovalDialog.h:26
DataHolderLib::Color
std::array< unsigned char, 4 > Color
Definition
Color.h:24
Applications
DataHolderLib
ColorLookupTable.cpp
Generated by
1.11.0