Files
ResInsight/VisualizationModules/LibRender/cvfScalarMapperDiscreteLinear.h
T

49 lines
1.7 KiB
C++
Raw Normal View History

2012-05-18 09:45:23 +02:00
//##################################################################################################
//
// Custom Visualization Core library
// Copyright (C) 2011-2012 Ceetron AS
//
// This library is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <<http://www.gnu.org/licenses/gpl.html>>
// for more details.
//
//##################################################################################################
#pragma once
2012-10-02 10:17:52 +02:00
#include "cvfScalarMapperRangeBased.h"
2012-05-18 09:45:23 +02:00
namespace cvf {
//==================================================================================================
//
// Maps scalar values to texture coordinates/colors
//
//==================================================================================================
2012-10-02 10:17:52 +02:00
class ScalarMapperDiscreteLinear : public ScalarMapperRangeBased
2012-05-18 09:45:23 +02:00
{
public:
ScalarMapperDiscreteLinear();
2012-10-02 10:17:52 +02:00
// Scalarmapper interface implementation
2012-05-18 09:45:23 +02:00
virtual Vec2f mapToTextureCoord(double scalarValue) const;
virtual Color3ub mapToColor(double scalarValue) const;
2012-10-02 10:17:52 +02:00
virtual double normalizedValue( double domainValue ) const;
2012-05-18 09:45:23 +02:00
virtual double domainValue( double normalizedPosition ) const;
private:
double discretize(double scalarValue) const;
};
}