https://gitlab.opengeosys.org/ogs/ogs.git
Revision 26db1ed92ecf2e5f816115e366ec9c6b22e8adc5 authored by Lars Bilke on 18 May 2021, 10:47:07 UTC, committed by Lars Bilke on 18 May 2021, 10:47:07 UTC
Bump LibXml2 to 2.9.12 and build statically, install xsltproc in container

See merge request ogs/ogs!3625
2 parent s 906dcad + 7395bbe
Raw File
Tip revision: 26db1ed92ecf2e5f816115e366ec9c6b22e8adc5 authored by Lars Bilke on 18 May 2021, 10:47:07 UTC
Merge branch 'ci-fix' into 'master'
Tip revision: 26db1ed
ColorLookupTable.cpp
/**
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#include "ColorLookupTable.h"

#include <limits>

namespace DataHolderLib
{
ColorLookupTable::ColorLookupTable()
    : _range(
          std::make_pair<double, double>(std::numeric_limits<double>::lowest(),
                                         std::numeric_limits<double>::max()))

{
}

void ColorLookupTable::setTableRange(double min, double max)
{
    if (min < max)
    {
        _range = std::make_pair(min, max);
    }
}

void ColorLookupTable::setColor(double id, DataHolderLib::Color const& color)
{
    if ((id > _range.first) && (id < _range.second))
    {
        _lut.emplace_back(id, color, "");
    }
}

void ColorLookupTable::setColor(std::string const& name,
                                DataHolderLib::Color const& color)
{
    _lut.emplace_back(0, color, name);
}

}  // namespace DataHolderLib
back to top