ResInsight/ApplicationCode/ModelVisualization/RivTernarySaturationOverlayItem.h

87 lines
3.1 KiB
C
Raw Normal View History

2014-04-07 06:18:39 -05:00
/////////////////////////////////////////////////////////////////////////////////
//
2014-09-24 00:14:52 -05:00
// Copyright (C) Statoil ASA
// Copyright (C) Ceetron Solutions AS
2014-04-07 06:18:39 -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.
//
// 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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfOverlayItem.h"
#include "cvfMatrix4.h"
#include "cvfColor3.h"
2018-03-08 09:14:13 -06:00
#include "cvfColor4.h"
2014-04-07 06:18:39 -05:00
#include "cvfString.h"
namespace cvf {
class Font;
}
//==================================================================================================
//
//
//
//==================================================================================================
class RivTernarySaturationOverlayItem : public cvf::OverlayItem
{
public:
explicit RivTernarySaturationOverlayItem(cvf::Font* font);
2014-04-07 06:18:39 -05:00
~RivTernarySaturationOverlayItem();
2014-05-06 16:29:41 -05:00
void setRangeText(const cvf::String& soilRange, const cvf::String& sgasRange, const cvf::String& swatRange);
2014-04-07 06:18:39 -05:00
void setSize(const cvf::Vec2ui& size);
void setAxisLabelsColor(const cvf::Color3f& color);
2014-08-01 01:46:46 -05:00
void setTitle(const cvf::String& title);
2018-03-08 09:14:13 -06:00
void enableBackground(bool enable);
void setBackgroundColor(const cvf::Color4f& backgroundColor);
void setBackgroundFrameColor(const cvf::Color4f& backgroundFrameColor);
2014-04-07 06:18:39 -05:00
private:
2018-03-08 09:14:13 -06:00
cvf::Vec2ui sizeHint() override;
void render(cvf::OpenGLContext* oglContext,
const cvf::Vec2i& position,
const cvf::Vec2ui& size) override;
void renderSoftware(cvf::OpenGLContext* oglContext,
const cvf::Vec2i& position,
const cvf::Vec2ui& size) override;
void renderGeneric(cvf::OpenGLContext* oglContext,
const cvf::Vec2i& position,
const cvf::Vec2ui& size,
bool software);
void renderAxisImmediateMode(float upperY, float lowerBoundY, float border, cvf::OpenGLContext* oglContext);
2014-04-07 06:18:39 -05:00
private:
cvf::Color3f m_textColor; // Text color
cvf::ref<cvf::Font> m_font;
2014-05-06 16:29:41 -05:00
2018-03-08 09:14:13 -06:00
bool m_isBackgroundEnabled;
cvf::Color4f m_backgroundColor;
cvf::Color4f m_backgroundFrameColor;
2014-05-06 16:29:41 -05:00
cvf::String m_soilRange;
cvf::String m_sgasRange;
cvf::String m_swatRange;
2014-04-07 06:18:39 -05:00
cvf::Vec2ui m_size; // Pixel size of draw area
2014-08-01 01:46:46 -05:00
std::vector<cvf::String> m_titleStrings;
2014-04-07 06:18:39 -05:00
};