2014-08-09 15:23:41 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-24 00:14:52 -05:00
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2014-08-09 15:23:41 -05:00
|
|
|
// ResInsight 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2014-08-09 15:23:41 -05:00
|
|
|
// ResInsight 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2014-08-09 15:23:41 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "cvfColor3.h"
|
2014-08-09 15:23:41 -05:00
|
|
|
#include "cvfObject.h"
|
|
|
|
#include "cvfVector2.h"
|
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
class TextureImage;
|
2014-08-09 15:23:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RivTernaryScalarMapper : public cvf::Object
|
|
|
|
{
|
|
|
|
public:
|
2019-09-06 03:40:57 -05:00
|
|
|
explicit RivTernaryScalarMapper( const cvf::Color3f& undefScalarColor );
|
2014-08-09 15:23:41 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void setTernaryRanges( double soilLower, double soilUpper, double sgasLower, double sgasUpper );
|
2014-08-11 00:42:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::Vec2f mapToTextureCoord( double soil, double sgas, bool isTransparent ) const;
|
|
|
|
bool updateTexture( cvf::TextureImage* image, float opacityLevel ) const;
|
2014-08-09 15:23:41 -05:00
|
|
|
|
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::Color3f m_undefScalarColor;
|
|
|
|
cvf::Vec2ui m_textureSize;
|
2014-08-10 02:50:50 -05:00
|
|
|
|
2015-10-23 08:46:25 -05:00
|
|
|
double m_rangeMaxSoil;
|
|
|
|
double m_rangeMinSoil;
|
|
|
|
double m_soilFactor;
|
2014-08-10 02:50:50 -05:00
|
|
|
|
2015-10-23 08:46:25 -05:00
|
|
|
double m_rangeMaxSgas;
|
|
|
|
double m_rangeMinSgas;
|
|
|
|
double m_sgasFactor;
|
2014-08-09 15:23:41 -05:00
|
|
|
};
|