mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-23 23:13:39 -06:00
Remove the unused, unnecessary "position" from several methods and the overlay layout struct
This commit is contained in:
parent
b102b3025a
commit
1f8d4437bf
@ -43,7 +43,7 @@
|
||||
RivTernarySaturationOverlayItem::RivTernarySaturationOverlayItem(cvf::Font* font)
|
||||
: TitledOverlayFrame(font, 120, 150)
|
||||
{
|
||||
this->computeLayoutAndExtents(cvf::Vec2i(0, 0), this->sizeHint());
|
||||
this->computeLayoutAndExtents( this->sizeHint());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -57,7 +57,7 @@ RivTernarySaturationOverlayItem::~RivTernarySaturationOverlayItem()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivTernarySaturationOverlayItem::computeLayoutAndExtents(const cvf::Vec2i& position, const cvf::Vec2ui& size)
|
||||
void RivTernarySaturationOverlayItem::computeLayoutAndExtents(const cvf::Vec2ui& size)
|
||||
{
|
||||
this->setMinimumWidth(size.x());
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class RivTernarySaturationOverlayItem : public caf::TitledOverlayFrame
|
||||
public:
|
||||
explicit RivTernarySaturationOverlayItem(cvf::Font* font);
|
||||
~RivTernarySaturationOverlayItem();
|
||||
virtual void computeLayoutAndExtents(const cvf::Vec2i& position, const cvf::Vec2ui& size) override;
|
||||
virtual void computeLayoutAndExtents(const cvf::Vec2ui& size) override;
|
||||
|
||||
void setRangeText(const cvf::String& soilRange, const cvf::String& sgasRange, const cvf::String& swatRange);
|
||||
|
||||
|
@ -371,7 +371,7 @@ void RimRegularLegendConfig::updateLegend()
|
||||
numDecimalDigits -= static_cast<int>(decadesInRange);
|
||||
}
|
||||
m_scalarMapperLegend->setTickPrecision(cvf::Math::clamp(numDecimalDigits, 0, 20));
|
||||
m_scalarMapperLegend->computeLayoutAndExtents(cvf::Vec2i(0, 0), m_scalarMapperLegend->sizeHint());
|
||||
m_scalarMapperLegend->computeLayoutAndExtents( m_scalarMapperLegend->sizeHint());
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RiaPreferences* preferences = app->preferences();
|
||||
|
@ -622,7 +622,7 @@ void RiuViewer::addColorLegendToBottomLeftCorner(caf::TitledOverlayFrame* legend
|
||||
unsigned int requiredLegendWidth = 0u;
|
||||
for (auto legend : overlayItems)
|
||||
{
|
||||
legend->computeLayoutAndExtents(cvf::Vec2i(0, 0), legend->sizeHint());
|
||||
legend->computeLayoutAndExtents(legend->sizeHint());
|
||||
requiredLegendWidth = std::max(requiredLegendWidth, legend->minimumWidth());
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace caf {
|
||||
CategoryLegend::CategoryLegend(Font* font, const CategoryMapper* categoryMapper)
|
||||
: TitledOverlayFrame(font, 200, 200)
|
||||
, m_categoryMapper(categoryMapper)
|
||||
, m_Layout(Vec2i(0, 0), Vec2ui(200u, 200u))
|
||||
, m_Layout(Vec2ui(200u, 200u))
|
||||
{
|
||||
CVF_ASSERT(font);
|
||||
CVF_ASSERT(!font->isEmpty());
|
||||
@ -91,7 +91,7 @@ bool CategoryLegend::pick(int oglXCoord, int oglYCoord, const Vec2i& position, c
|
||||
{
|
||||
Recti oglRect(position, size.x(), size.y());
|
||||
|
||||
OverlayColorLegendLayoutInfo layoutInViewPortCoords(oglRect.min(), Vec2ui(oglRect.width(), oglRect.height()));
|
||||
OverlayColorLegendLayoutInfo layoutInViewPortCoords( Vec2ui(oglRect.width(), oglRect.height()));
|
||||
layoutInfo(&layoutInViewPortCoords);
|
||||
|
||||
Vec2i legendBarOrigin = oglRect.min();
|
||||
@ -129,7 +129,7 @@ void CategoryLegend::renderGeneric(OpenGLContext* oglContext,
|
||||
camera.applyOpenGL();
|
||||
camera.viewport()->applyOpenGL(oglContext, Viewport::CLEAR_DEPTH);
|
||||
|
||||
this->computeLayoutAndExtents(position, size);
|
||||
this->computeLayoutAndExtents(size);
|
||||
|
||||
Vec2f backgroundSize(CVF_MIN((float)this->minimumWidth(), (float)size.x()), (float)size.y());
|
||||
|
||||
@ -500,10 +500,10 @@ void CategoryLegend::layoutInfo(OverlayColorLegendLayoutInfo* layout)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void CategoryLegend::computeLayoutAndExtents(const Vec2i& position, const Vec2ui& size)
|
||||
void CategoryLegend::computeLayoutAndExtents(const Vec2ui& size)
|
||||
{
|
||||
// Todo: Cache this between renderings. Update only when needed.
|
||||
m_Layout = OverlayColorLegendLayoutInfo(position, size);
|
||||
m_Layout = OverlayColorLegendLayoutInfo(size);
|
||||
layoutInfo(&m_Layout);
|
||||
m_textDrawer = new TextDrawer(this->font());
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
virtual ~CategoryLegend();
|
||||
|
||||
size_t categoryCount() const;
|
||||
void computeLayoutAndExtents(const cvf::Vec2i& position, const cvf::Vec2ui& size) override;
|
||||
void computeLayoutAndExtents(const cvf::Vec2ui& size) override;
|
||||
|
||||
protected:
|
||||
void render(cvf::OpenGLContext* oglContext, const cvf::Vec2i& position, const cvf::Vec2ui& size) override;
|
||||
@ -40,7 +40,7 @@ protected:
|
||||
|
||||
struct OverlayColorLegendLayoutInfo
|
||||
{
|
||||
OverlayColorLegendLayoutInfo(const cvf::Vec2i& pos, const cvf::Vec2ui& setSize)
|
||||
OverlayColorLegendLayoutInfo(const cvf::Vec2ui& setSize)
|
||||
{
|
||||
charHeight = 0.0f;
|
||||
lineSpacing = 0.0f;
|
||||
@ -49,7 +49,6 @@ protected:
|
||||
tickStartX = 0.0f;
|
||||
tickMidX = 0.0f;
|
||||
|
||||
position = pos;
|
||||
size = setSize;
|
||||
}
|
||||
|
||||
@ -60,7 +59,6 @@ protected:
|
||||
|
||||
cvf::Rectf colorBarRect;
|
||||
|
||||
cvf::Vec2i position;
|
||||
cvf::Vec2ui size;
|
||||
};
|
||||
|
||||
|
@ -86,7 +86,7 @@ OverlayScalarMapperLegend::OverlayScalarMapperLegend(Font* font)
|
||||
: TitledOverlayFrame(font, 200, 200)
|
||||
, m_tickNumberPrecision(4)
|
||||
, m_numberFormat(AUTO)
|
||||
, m_Layout(Vec2i(0, 0), Vec2ui(200u, 200u))
|
||||
, m_Layout(Vec2ui(200u, 200u))
|
||||
{
|
||||
CVF_ASSERT(font);
|
||||
CVF_ASSERT(!font->isEmpty());
|
||||
@ -147,7 +147,7 @@ bool OverlayScalarMapperLegend::pick(int oglXCoord, int oglYCoord, const Vec2i&
|
||||
{
|
||||
Recti oglRect(position, size.x(), size.y());
|
||||
|
||||
OverlayColorLegendLayoutInfo layoutInViewPortCoords(oglRect.min(), Vec2ui(oglRect.width(), oglRect.height()));
|
||||
OverlayColorLegendLayoutInfo layoutInViewPortCoords(Vec2ui(oglRect.width(), oglRect.height()));
|
||||
layoutInfo(&layoutInViewPortCoords);
|
||||
|
||||
Vec2i legendBarOrigin = oglRect.min();
|
||||
@ -183,7 +183,7 @@ void OverlayScalarMapperLegend::renderGeneric(OpenGLContext* oglContext, const V
|
||||
camera.applyOpenGL();
|
||||
camera.viewport()->applyOpenGL(oglContext, Viewport::CLEAR_DEPTH);
|
||||
|
||||
this->computeLayoutAndExtents(position, size);
|
||||
this->computeLayoutAndExtents( size);
|
||||
|
||||
Vec2f backgroundSize((float)this->matchedWidth(), (float)size.y());
|
||||
|
||||
@ -668,10 +668,10 @@ void OverlayScalarMapperLegend::setTickFormat(NumberFormat format)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void OverlayScalarMapperLegend::computeLayoutAndExtents(const Vec2i& position, const Vec2ui& size)
|
||||
void OverlayScalarMapperLegend::computeLayoutAndExtents( const Vec2ui& size)
|
||||
{
|
||||
// Todo: Cache this between renderings. Update only when needed.
|
||||
//m_Layout = OverlayColorLegendLayoutInfo(position, size);
|
||||
//m_Layout = OverlayColorLegendLayoutInfo( size );
|
||||
layoutInfo(&m_Layout);
|
||||
|
||||
m_textDrawer = new TextDrawer(this->font());
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
void setTickPrecision(int precision);
|
||||
enum NumberFormat { AUTO, SCIENTIFIC, FIXED};
|
||||
void setTickFormat(NumberFormat format);
|
||||
void computeLayoutAndExtents(const cvf::Vec2i& position, const cvf::Vec2ui& size) override;
|
||||
void computeLayoutAndExtents(const cvf::Vec2ui& size) override;
|
||||
protected:
|
||||
void render(OpenGLContext* oglContext, const Vec2i& position, const Vec2ui& size) override;
|
||||
void renderSoftware(OpenGLContext* oglContext, const Vec2i& position, const Vec2ui& size) override;
|
||||
@ -93,9 +93,8 @@ protected:
|
||||
|
||||
struct OverlayColorLegendLayoutInfo
|
||||
{
|
||||
OverlayColorLegendLayoutInfo(const Vec2i& pos, const Vec2ui& setSize)
|
||||
OverlayColorLegendLayoutInfo(const Vec2ui& setSize)
|
||||
{
|
||||
position = pos;
|
||||
size = setSize;
|
||||
}
|
||||
|
||||
@ -108,7 +107,6 @@ protected:
|
||||
|
||||
cvf::ref<DoubleArray> tickYPixelPos;
|
||||
|
||||
Vec2i position;
|
||||
Vec2ui size;
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,7 @@ namespace caf {
|
||||
void setBackgroundColor(const cvf::Color4f& backgroundColor);
|
||||
void setBackgroundFrameColor(const cvf::Color4f& backgroundFrameColor);
|
||||
|
||||
virtual void computeLayoutAndExtents(const cvf::Vec2i& position, const cvf::Vec2ui& size) = 0;
|
||||
virtual void computeLayoutAndExtents(const cvf::Vec2ui& size) = 0;
|
||||
|
||||
virtual cvf::Vec2ui sizeHint() override;
|
||||
unsigned int minimumWidth();
|
||||
|
Loading…
Reference in New Issue
Block a user