Merge branch 'dev' into measurement

This commit is contained in:
Magne Sjaastad
2019-01-02 14:32:17 +01:00
31 changed files with 263 additions and 269 deletions

View File

@@ -18,8 +18,11 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RiaColorTools.h"
#include "cvfMath.h"
#include <algorithm>
#include <cmath>
//--------------------------------------------------------------------------------------------------
/// Uses W3.org relative luminance calculation taking into account the different luminance of the different colors
@@ -98,7 +101,7 @@ cvf::Color3f RiaColorTools::brightContrastColorSofter()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiaColorTools::constrastColor(cvf::Color3f backgroundColor, bool softerContrast)
cvf::Color3f RiaColorTools::contrastColor(cvf::Color3f backgroundColor, bool softerContrast)
{
if (isBrightnessAboveThreshold(backgroundColor))
{

View File

@@ -38,7 +38,7 @@ public:
static cvf::Color3f brightContrastColor();
static cvf::Color3f darkContrastColorSofter();
static cvf::Color3f brightContrastColorSofter();
static cvf::Color3f constrastColor(cvf::Color3f backgroundColor, bool softerContrast = false);
static cvf::Color3f contrastColor(cvf::Color3f backgroundColor, bool softerContrast = false);
static QColor toQColor(cvf::Color3f color, float alpha = 1.0f);
static QColor toQColor(cvf::Color4f color);
static float contrastRatio(cvf::Color3f color1, cvf::Color3f color2);

View File

@@ -446,6 +446,7 @@ if (MSVC)
add_custom_command(TARGET ResInsight POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${qtlib}> $<TARGET_FILE_DIR:ResInsight>
)
list(APPEND RI_DLL_FILENAMES $<TARGET_FILE:${qtlib}>)
endforeach(qtlib)
else()
set (QTLIBLIST QtCore4 QtCored4 QtGui4 QtGuid4 QtOpenGl4 QtOpenGld4 QtNetwork4 QtNetworkd4 QtScript4 QtScriptd4 QtScriptTools4 QtScriptToolsd4)

View File

@@ -246,9 +246,11 @@ RigCompletionData::CompletionType RicMswPerforationICV::completionType() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswPerforationAICD::RicMswPerforationAICD(const QString& label,
const RimWellPathValve* wellPathValve)
RicMswPerforationAICD::RicMswPerforationAICD(const QString& label, const RimWellPathValve* wellPathValve)
: RicMswValve(label, wellPathValve)
, m_valid(false)
, m_deviceOpen(false)
, m_length(0.0)
{
}

View File

@@ -178,4 +178,4 @@ private:
bool m_deviceOpen;
std::array<double, AICD_NUM_PARAMS> m_parameters;
double m_length;
};
};

View File

@@ -79,7 +79,6 @@ private:
double m_endTVD;
double m_effectiveDiameter;
double m_holeDiameter;
double m_linerDiameter;
double m_openHoleRoughnessFactor;
double m_skinFactor;

View File

@@ -97,7 +97,6 @@ public:
CompletionInfo(RigCompletionData::CompletionType type, const QString& name)
: type(type)
, name(name)
, wellPathName(wellPathName)
{
}
RigCompletionData::CompletionType type;

View File

@@ -45,11 +45,9 @@ void RicImportGeoMechCaseFeature::onActionTriggered(bool isChecked)
if (fileNames.size()) defaultDir = QFileInfo(fileNames.last()).absolutePath();
app->setLastUsedDialogDirectory("GEOMECH_MODEL", defaultDir);
for (int i = 0; i < fileNames.size(); i++)
for (const auto& fileName : fileNames)
{
QString fileName = fileNames[i];
if (!fileNames.isEmpty())
if (!fileName.isEmpty())
{
if (app->openOdbCaseFromFile(fileName))
{

View File

@@ -38,7 +38,12 @@
class AsciiDataParseOptions
{
public:
AsciiDataParseOptions() : useCustomDateTimeFormat(false), assumeNumericDataColumns(false) { }
AsciiDataParseOptions()
: useCustomDateTimeFormat(false)
, assumeNumericDataColumns(false)
, curveSymbolSkipDistance(0.0f)
{
}
QString plotTitle;
QString curvePrefix;

View File

@@ -741,7 +741,7 @@ cvf::Vec3f RivGridBoxGenerator::cornerDirection(FaceType face1, FaceType face2)
void RivGridBoxGenerator::updateFromBackgroundColor(const cvf::Color3f& backgroundColor)
{
m_gridColor = RiaColorTools::computeOffsetColor(backgroundColor, 0.3f);
m_gridLegendColor = RiaColorTools::constrastColor(backgroundColor);
m_gridLegendColor = RiaColorTools::contrastColor(backgroundColor);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -62,7 +62,7 @@ void RivContourMapProjectionPartMgr::appendProjectionToModel(cvf::ModelBasicList
std::vector<cvf::ref<cvf::Drawable>> contourDrawables = contourDrawablesForAllLevels[i];
cvf::Color3f backgroundColor(mapper->mapToColor(tickValues[i]));
cvf::Color3f lineColor = RiaColorTools::constrastColor(backgroundColor, true);
cvf::Color3f lineColor = RiaColorTools::contrastColor(backgroundColor, true);
for (cvf::ref<cvf::Drawable> contourDrawable : contourDrawables)
{
@@ -234,7 +234,7 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>> RivContourMapProjectionPartMgr
std::vector<cvf::ref<cvf::Drawable>> contourDrawables;
cvf::Color3f backgroundColor(mapper->mapToColor(tickValues[i]));
cvf::Color3f textColor = RiaColorTools::constrastColor(backgroundColor);
cvf::Color3f textColor = RiaColorTools::contrastColor(backgroundColor);
for (size_t j = 0; j < contourPolygons[i].size(); ++j)
{

View File

@@ -201,14 +201,6 @@ cvf::Color3f RimPolylineAppearance::sphereColor() const
return m_sphereColor();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPolylineAppearance::setSphereRadiusFactor(double factor)
{
m_sphereRadiusFactor = factor;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -93,7 +93,6 @@ public:
void setSphereColor(const cvf::Color3f& color);
cvf::Color3f sphereColor() const;
void setSphereRadiusFactor(double factor);
double sphereRadiusFactor() const;
protected:

View File

@@ -281,8 +281,11 @@ void RimWellAllocationPlot::updateFromWell()
wfCalculator->tracerFlowPrPseudoLength(tracerName, brIdx));
}
addStackedCurve(tracerName, depthValues, *accFlow, plotTrack);
//TODO: THIs is the data to be plotted...
if (accFlow)
{
addStackedCurve(tracerName, depthValues, *accFlow, plotTrack);
// TODO: THIs is the data to be plotted...
}
}
}

View File

@@ -152,11 +152,11 @@ void RimWellRftPlot::applyCurveAppearance(RimWellLogCurve* newCurve)
static size_t defaultColorTableIndex = 0;
static size_t defaultSymbolTableIndex = 0;
cvf::Color3f currentColor;
RiuQwtSymbol::PointSymbolEnum currentSymbol = symbolTable.front();
RiuQwtPlotCurve::LineStyleEnum currentLineStyle = RiuQwtPlotCurve::STYLE_SOLID;
bool isCurrentColorSet = false;
bool isCurrentSymbolSet = false;
cvf::Color3f currentColor;
RiuQwtSymbol::PointSymbolEnum currentSymbol = symbolTable.front();
RiuQwtPlotCurve::LineStyleEnum currentLineStyle = RiuQwtPlotCurve::STYLE_SOLID;
bool isCurrentColorSet = false;
bool isCurrentSymbolSet = false;
std::set<cvf::Color3f> assignedColors;
std::set<RiuQwtSymbol::PointSymbolEnum> assignedSymbols;
@@ -686,13 +686,13 @@ void RimWellRftPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
if (changedField == &m_wellPathNameOrSimWellName)
{
if (changedField == &m_wellPathNameOrSimWellName)
{
m_branchIndex = 0;
}
m_branchIndex = 0;
RimWellLogTrack* const plotTrack = m_wellLogPlot->trackByIndex(0);
plotTrack->deleteAllCurves();
if (plotTrack)
{
plotTrack->deleteAllCurves();
}
updateEditorsFromCurves();
updateFormationsOnPlot();

View File

@@ -193,7 +193,7 @@ QWidget* Rim3dView::createViewWidget(QWidget* mainWindowParent)
QGLFormat glFormat;
glFormat.setDirectRendering(RiaApplication::instance()->useShaders());
m_viewer = new RiuViewer(glFormat, nullptr);
m_viewer = new RiuViewer(glFormat, mainWindowParent);
m_viewer->setOwnerReservoirView(this);
cvf::String xLabel;

View File

@@ -584,15 +584,15 @@ bool RimContourMapProjection::checkForMapIntersection(const cvf::Vec3d& localPoi
{
CVF_TIGHT_ASSERT(contourMapPoint);
CVF_TIGHT_ASSERT(valueAtPoint);
cvf::Vec3d localPos3d(localPoint3d.x(), localPoint3d.y(), 0.0);
cvf::Vec3d localPos3d(localPoint3d.x() + m_sampleSpacing, localPoint3d.y() + m_sampleSpacing, 0.0);
cvf::Vec2d localPos2d(localPos3d.x(), localPos3d.y());
cvf::Vec2ui pickedCell = ijFromLocalPos(localPos2d);
*contourMapCell = pickedCell;
if (true || hasResultInCell(pickedCell.x(), pickedCell.y()))
{
cvf::Vec2d gridorigin(m_fullBoundingBox.min().x(), m_fullBoundingBox.min().y());
cvf::Vec2d cellCenter = globalCellCenterPosition(pickedCell.x(), pickedCell.y()) - gridorigin;
cvf::Vec2d globalCellCenter = globalCellCenterPosition(pickedCell.x(), pickedCell.y());
cvf::Vec2d cellCenter = globalCellCenter - gridorigin;
std::array <cvf::Vec3d, 4> x;
x[0] = cvf::Vec3d(cellCenter + cvf::Vec2d(-m_sampleSpacing * 0.5, -m_sampleSpacing * 0.5), 0.0);
x[1] = cvf::Vec3d(cellCenter + cvf::Vec2d(m_sampleSpacing*0.5, -m_sampleSpacing * 0.5), 0.0);

View File

@@ -19,18 +19,20 @@
#include "RimViewNameConfig.h"
//==================================================================================================
///
///
///
///
//==================================================================================================
CAF_PDM_SOURCE_INIT(RimViewNameConfig, "RimViewNameConfig");
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimViewNameConfig::RimViewNameConfig(const RimNameConfigHolderInterface* configHolder)
: RimNameConfig(configHolder)
, m_hideCaseNameField(false)
, m_hideAggregationTypeField(false)
, m_hidePropertyField(false)
, m_hideSampleSpacingField(false)
{
CAF_PDM_InitObject("View Name Generator", "", "", "");
@@ -156,8 +158,8 @@ void RimViewNameConfig::hideSampleSpacingField(bool hide)
void RimViewNameConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
RimNameConfig::defineUiOrdering(uiConfigName, uiOrdering);
if(!m_hideCaseNameField) uiOrdering.add(&m_addCaseName);
if(!m_hideAggregationTypeField) uiOrdering.add(&m_addAggregationType);
if(!m_hidePropertyField) uiOrdering.add(&m_addProperty);
if(!m_hideSampleSpacingField) uiOrdering.add(&m_addSampleSpacing);
if (!m_hideCaseNameField) uiOrdering.add(&m_addCaseName);
if (!m_hideAggregationTypeField) uiOrdering.add(&m_addAggregationType);
if (!m_hidePropertyField) uiOrdering.add(&m_addProperty);
if (!m_hideSampleSpacingField) uiOrdering.add(&m_addSampleSpacing);
}

View File

@@ -29,7 +29,7 @@ class RimViewNameConfig : public RimNameConfig
CAF_PDM_HEADER_INIT;
public:
RimViewNameConfig(const RimNameConfigHolderInterface* configHolder = nullptr);
explicit RimViewNameConfig(const RimNameConfigHolderInterface* configHolder = nullptr);
void setAddCaseName(bool add);
bool addCaseName() const;

View File

@@ -102,22 +102,6 @@ void RimSummaryPlotSourceStepping::applyPrevCase()
modifyCurrentIndex(&m_summaryCase, -1);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotSourceStepping::applyNextEnsemble()
{
modifyCurrentIndex(&m_ensemble, 1);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlotSourceStepping::applyPrevEnsemble()
{
modifyCurrentIndex(&m_ensemble, -1);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -389,9 +373,6 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi(const caf::PdmFieldHandle* c
bool triggerLoadDataAndUpdate = false;
std::string oldValueString = oldValue.toString().toStdString();
std::string newValueString = newValue.toString().toStdString();
if (changedField == &m_summaryCase)
{
if (m_summaryCase())

View File

@@ -58,9 +58,6 @@ public:
void applyNextCase();
void applyPrevCase();
void applyNextEnsemble();
void applyPrevEnsemble();
void applyNextQuantity();
void applyPrevQuantity();

View File

@@ -110,7 +110,7 @@ namespace RigFlowDiagInterfaceTools {
{
auto satfunc = Opm::ECLSaturationFunc(G, init);
Opm::ECLFluxCalc calc(G, init, 9.80665, true);
Opm::ECLFluxCalc calc(G, init, 9.80665);
auto getFlux = [&calc, &rstrt]
(const Opm::ECLPhaseIndex p)

View File

@@ -104,7 +104,7 @@ double GeometryTools::getAngle(const cvf::Vec3d& positiveNormalAxis, const cvf::
bool isOk = false;
cvf::Vec3d v1N = v1.getNormalized(&isOk);
if (!isOk) return 0;
cvf::Vec3d v2N = v2.getNormalized();
cvf::Vec3d v2N = v2.getNormalized(&isOk);
if (!isOk) return 0;
double cosAng = v1N * v2N;

View File

@@ -41,7 +41,11 @@ class RiuCalculationsContextMenuManager : public QObject
static const std::map<QString, std::set<QString>> MENU_MAP;
public:
RiuCalculationsContextMenuManager() { }
RiuCalculationsContextMenuManager()
: m_curveCalc(nullptr)
, m_textPosition(0)
{
}
void attachWidget(QWidget* widget, RicSummaryCurveCalculator* curveCalc);

View File

@@ -39,7 +39,10 @@ class RiuExpressionContextMenuManager : public QObject
static const std::map<QString, std::set<QString>> MENU_MAP;
public:
RiuExpressionContextMenuManager() { }
RiuExpressionContextMenuManager()
: m_textPosition(0)
{
}
void attachTextEdit(QTextEdit* textEdit);

View File

@@ -3,17 +3,17 @@
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
//
// 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -27,13 +27,14 @@
#include "RiaRegressionTestRunner.h"
#include "RimCase.h"
#include "RimProject.h"
#include "RimGridView.h"
#include "RimProject.h"
#include "RimViewController.h"
#include "RimViewLinker.h"
#include "RivGridBoxGenerator.h"
#include "RivTernarySaturationOverlayItem.h"
#include "WindowEdgeAxesOverlayItem/RivWindowEdgeAxesOverlayItem.h"
#include "RiuCadNavigation.h"
#include "RiuGeoQuestNavigation.h"
@@ -43,14 +44,14 @@
#include "cafPdmUiSelection3dEditorVisualizer.h"
#include "cafTitledOverlayFrame.h"
#include "cafCategoryLegend.h"
#include "cafOverlayScalarMapperLegend.h"
#include "cafCeetronPlusNavigation.h"
#include "cafDisplayCoordTransform.h"
#include "cafEffectGenerator.h"
#include "cafFrameAnimationControl.h"
#include "cafOverlayScalarMapperLegend.h"
#include "cafOverlayScaleLegend.h"
#include "cafTitledOverlayFrame.h"
#include "cvfCamera.h"
#include "cvfFont.h"
@@ -69,13 +70,11 @@
#include <QLabel>
#include <QMouseEvent>
#include <QProgressBar>
#include "WindowEdgeAxesOverlayItem/RivWindowEdgeAxesOverlayItem.h"
#include <algorithm>
using cvf::ManipulatorTrackball;
const double RI_MIN_NEARPLANE_DISTANCE = 0.1;
//==================================================================================================
@@ -83,19 +82,19 @@ const double RI_MIN_NEARPLANE_DISTANCE = 0.1;
/// \class RiuViewer
/// \ingroup ResInsight
///
///
///
///
//==================================================================================================
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
: caf::Viewer(format, parent), m_isNavigationRotationEnabled(true)
: caf::Viewer(format, parent)
, m_isNavigationRotationEnabled(true)
{
cvf::Font* standardFont = RiaApplication::instance()->standardFont();
m_axisCross = new cvf::OverlayAxisCross(m_mainCamera.p(), standardFont);
m_axisCross = new cvf::OverlayAxisCross(m_mainCamera.p(), standardFont);
m_axisCross->setAxisLabels("X", "Y", "Z");
m_axisCross->setLayout(cvf::OverlayItem::VERTICAL, cvf::OverlayItem::BOTTOM_RIGHT);
m_mainRendering->addOverlayItem(m_axisCross.p());
@@ -104,33 +103,32 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
this->enableOverlyPainting(true);
this->setReleaseOGLResourcesEachFrame(true);
QColor c;
QColor c;
QPalette p = QApplication::palette();
//QColor frameAndTextColor(255, 255, 255, 255);
// QColor frameAndTextColor(255, 255, 255, 255);
QColor frameAndTextColor(0, 0, 0, 255);
QColor progressAndHistogramColor(0,0,90,70); // Also Progressbar dark text color
QColor progressAndHistogramColor(0, 0, 90, 70); // Also Progress bar dark text color
//p.setColor(QPalette::Window, QColor(144, 173, 208, 180));
// p.setColor(QPalette::Window, QColor(144, 173, 208, 180));
p.setColor(QPalette::Window, QColor(255, 255, 255, 50));
p.setColor(QPalette::WindowText, frameAndTextColor);
c = p.color(QPalette::Base );
c = p.color(QPalette::Base);
c.setAlpha(100);
p.setColor(QPalette::Base, c);
//c = p.color(QPalette::AlternateBase );
//c.setAlpha(0);
//p.setColor(QPalette::AlternateBase, c);
// c = p.color(QPalette::AlternateBase );
// c.setAlpha(0);
// p.setColor(QPalette::AlternateBase, c);
//p.setColor(QPalette::Highlight, QColor(20, 20, 130, 40));
// p.setColor(QPalette::Highlight, QColor(20, 20, 130, 40));
p.setColor(QPalette::Highlight, progressAndHistogramColor);
//p.setColor(QPalette::HighlightedText, frameAndTextColor);
p.setColor(QPalette::HighlightedText, QColor(255, 255, 255, 255)); //Progressbar light text color
// p.setColor(QPalette::HighlightedText, frameAndTextColor);
p.setColor(QPalette::HighlightedText, QColor(255, 255, 255, 255)); // Progress bar light text color
//p.setColor(QPalette::Dark, QColor(230, 250, 255, 100));
// p.setColor(QPalette::Dark, QColor(230, 250, 255, 100));
p.setColor(QPalette::Dark, progressAndHistogramColor);
// Info Text
@@ -145,17 +143,17 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
m_versionInfoLabel->setFrameShape(QFrame::NoFrame);
m_versionInfoLabel->setAlignment(Qt::AlignRight);
m_versionInfoLabel->setText(QString("%1 v%2").arg(RI_APPLICATION_NAME, RiaApplication::getVersionStringApp(false)));
// Z scale label
m_zScaleLabel = new QLabel();
m_zScaleLabel->setFrameShape(QFrame::NoFrame);
m_zScaleLabel->setAlignment(Qt::AlignLeft);
m_zScaleLabel->setText(QString("Z: "));
m_showZScaleLabel = true;
m_showZScaleLabel = true;
m_hideZScaleCheckbox = false;
QPalette versionInfoPalette = p;
QColor versionInfoLabelColor = p.color(QPalette::Window);
QPalette versionInfoPalette = p;
QColor versionInfoLabelColor = p.color(QPalette::Window);
versionInfoLabelColor.setAlpha(0);
versionInfoPalette.setColor(QPalette::Window, versionInfoLabelColor);
m_versionInfoLabel->setPalette(versionInfoPalette);
@@ -202,8 +200,8 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
m_gridBoxGenerator = new RivGridBoxGenerator;
m_cursorPositionDomainCoords = cvf::Vec3d::UNDEFINED;
m_windowEdgeAxisOverlay = new RivWindowEdgeAxesOverlayItem(standardFont);
m_showWindowEdgeAxes = false;
m_windowEdgeAxisOverlay = new RivWindowEdgeAxesOverlayItem(standardFont);
m_showWindowEdgeAxes = false;
m_selectionVisualizerManager = new caf::PdmUiSelection3dEditorVisualizer(this);
@@ -212,7 +210,7 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RiuViewer::~RiuViewer()
{
@@ -221,7 +219,7 @@ RiuViewer::~RiuViewer()
m_rimView->handleMdiWindowClosed();
m_rimView->setCameraPosition(m_mainCamera->viewMatrix());
m_rimView->setCameraPointOfInterest( pointOfInterest());
m_rimView->setCameraPointOfInterest(pointOfInterest());
}
delete m_infoLabel;
@@ -233,7 +231,6 @@ RiuViewer::~RiuViewer()
delete m_gridBoxGenerator;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -243,7 +240,7 @@ void RiuViewer::clearRimView()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setDefaultView()
{
@@ -251,7 +248,7 @@ void RiuViewer::setDefaultView()
if (!bb.isValid())
{
bb.add(cvf::Vec3d(-1, -1, -1));
bb.add(cvf::Vec3d( 1, 1, 1));
bb.add(cvf::Vec3d(1, 1, 1));
}
if (m_mainCamera->projection() == cvf::Camera::PERSPECTIVE)
@@ -269,9 +266,8 @@ void RiuViewer::setDefaultView()
m_mainCamera->fitView(bb, -cvf::Vec3d::Z_AXIS, cvf::Vec3d::Y_AXIS);
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::mouseReleaseEvent(QMouseEvent* event)
{
@@ -299,7 +295,6 @@ void RiuViewer::mouseReleaseEvent(QMouseEvent* event)
m_viewerCommands->handlePickAction(event->x(), event->y(), event->modifiers());
return;
}
else if (event->button() == Qt::RightButton)
{
@@ -316,7 +311,7 @@ void RiuViewer::mouseReleaseEvent(QMouseEvent* event)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::slotEndAnimation()
{
@@ -324,14 +319,14 @@ void RiuViewer::slotEndAnimation()
CVF_ASSERT(firstRendering);
if (m_rimView) m_rimView->endAnimation();
caf::Viewer::slotEndAnimation();
caf::EffectGenerator::releaseUnreferencedEffects();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::slotSetCurrentFrame(int frameIndex)
{
@@ -348,7 +343,7 @@ void RiuViewer::slotSetCurrentFrame(int frameIndex)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3d RiuViewer::pointOfInterest()
{
@@ -356,7 +351,7 @@ cvf::Vec3d RiuViewer::pointOfInterest()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setPointOfInterest(cvf::Vec3d poi)
{
@@ -364,9 +359,9 @@ void RiuViewer::setPointOfInterest(cvf::Vec3d poi)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setOwnerReservoirView(RiuViewerToViewInterface * owner)
void RiuViewer::setOwnerReservoirView(RiuViewerToViewInterface* owner)
{
m_rimView = owner;
@@ -374,7 +369,7 @@ void RiuViewer::setOwnerReservoirView(RiuViewerToViewInterface * owner)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setEnableMask(unsigned int mask)
{
@@ -382,17 +377,17 @@ void RiuViewer::setEnableMask(unsigned int mask)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::paintOverlayItems(QPainter* painter)
{
int columnWidth = 200;
int edgeAxisFrameBorderWidth = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderWidth(): 0;
int edgeAxisFrameBorderHeight = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderHeight(): 0;
int edgeAxisFrameBorderWidth = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderWidth() : 0;
int edgeAxisFrameBorderHeight = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderHeight() : 0;
int margin = 5;
int yPos = margin + edgeAxisFrameBorderHeight;
int yPos = margin + edgeAxisFrameBorderHeight;
bool showAnimBar = false;
if (isAnimationActive() && frameCount() > 1) showAnimBar = true;
@@ -410,9 +405,8 @@ void RiuViewer::paintOverlayItems(QPainter* painter)
m_animationProgress->setValue(currentFrameIndex());
m_animationProgress->resize(columnWidth, m_animationProgress->sizeHint().height());
m_animationProgress->render(painter,QPoint(columnPos, yPos));
yPos += m_animationProgress->height() + margin;
m_animationProgress->render(painter, QPoint(columnPos, yPos));
yPos += m_animationProgress->height() + margin;
}
if (m_showInfoText)
@@ -425,7 +419,7 @@ void RiuViewer::paintOverlayItems(QPainter* painter)
m_infoLabelOverlayArea.setBottom(yPos + m_infoLabel->height());
m_infoLabelOverlayArea.setRight(columnPos + columnWidth);
yPos += m_infoLabel->height() + margin;
yPos += m_infoLabel->height() + margin;
}
else
{
@@ -435,14 +429,15 @@ void RiuViewer::paintOverlayItems(QPainter* painter)
if (m_showHistogram)
{
m_histogramWidget->resize(columnWidth, 40);
m_histogramWidget->render(painter,QPoint(columnPos, yPos));
//yPos += m_histogramWidget->height() + margin;
m_histogramWidget->render(painter, QPoint(columnPos, yPos));
// yPos += m_histogramWidget->height() + margin;
}
if (m_showInfoText) // Version Label
{
QSize size(m_versionInfoLabel->sizeHint().width(), m_versionInfoLabel->sizeHint().height());
QPoint pos(this->width() - size.width() - margin - edgeAxisFrameBorderWidth, this->height() - size.height() - margin - edgeAxisFrameBorderHeight);
QSize size(m_versionInfoLabel->sizeHint().width(), m_versionInfoLabel->sizeHint().height());
QPoint pos(this->width() - size.width() - margin - edgeAxisFrameBorderWidth,
this->height() - size.height() - margin - edgeAxisFrameBorderHeight);
m_versionInfoLabel->resize(size.width(), size.height());
m_versionInfoLabel->render(painter, pos);
}
@@ -450,8 +445,7 @@ void RiuViewer::paintOverlayItems(QPainter* painter)
if (m_showZScaleLabel) // Z scale Label
{
QSize size(m_zScaleLabel->sizeHint().width(), m_zScaleLabel->sizeHint().height());
QPoint pos(margin + edgeAxisFrameBorderWidth,
margin + edgeAxisFrameBorderHeight);
QPoint pos(margin + edgeAxisFrameBorderWidth, margin + edgeAxisFrameBorderHeight);
m_zScaleLabel->resize(size.width(), size.height());
m_zScaleLabel->render(painter, pos);
}
@@ -467,21 +461,23 @@ void RiuViewer::paintOverlayItems(QPainter* painter)
cvf::Vec3d screenCoords;
if (mainCamera()->project(displayCoord, &screenCoords))
{
int translatedMousePosY = height() - screenCoords.y();
int translatedMousePosY = height() - screenCoords.y();
QPoint centerPos(screenCoords.x(), translatedMousePosY);
// Draw a cross hair marker
int markerHalfLength = 6;
painter->drawLine(centerPos.x(), centerPos.y() - markerHalfLength, centerPos.x(), centerPos.y() + markerHalfLength);
painter->drawLine(centerPos.x() - markerHalfLength, centerPos.y(), centerPos.x() + markerHalfLength, centerPos.y());
painter->drawLine(
centerPos.x(), centerPos.y() - markerHalfLength, centerPos.x(), centerPos.y() + markerHalfLength);
painter->drawLine(
centerPos.x() - markerHalfLength, centerPos.y(), centerPos.x() + markerHalfLength, centerPos.y());
}
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setInfoText(QString text)
{
@@ -513,7 +509,7 @@ void RiuViewer::setZScale(int scale)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::showInfoText(bool enable)
{
@@ -521,7 +517,7 @@ void RiuViewer::showInfoText(bool enable)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setHistogram(double min, double max, const std::vector<size_t>& histogram)
{
@@ -529,7 +525,7 @@ void RiuViewer::setHistogram(double min, double max, const std::vector<size_t>&
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setHistogramPercentiles(double pmin, double pmax, double mean)
{
@@ -538,7 +534,7 @@ void RiuViewer::setHistogramPercentiles(double pmin, double pmax, double mean)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::showGridBox(bool enable)
{
@@ -551,7 +547,7 @@ void RiuViewer::showGridBox(bool enable)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::showAnimationProgress(bool enable)
{
@@ -559,7 +555,7 @@ void RiuViewer::showAnimationProgress(bool enable)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::showHistogram(bool enable)
{
@@ -567,7 +563,7 @@ void RiuViewer::showHistogram(bool enable)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::mousePressEvent(QMouseEvent* event)
{
@@ -575,7 +571,7 @@ void RiuViewer::mousePressEvent(QMouseEvent* event)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::removeAllColorLegends()
{
@@ -588,13 +584,13 @@ void RiuViewer::removeAllColorLegends()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::addColorLegendToBottomLeftCorner(caf::TitledOverlayFrame* addedLegend)
{
RiaApplication* app = RiaApplication::instance();
CVF_ASSERT(app);
RiaPreferences* preferences = app->preferences();
RiaPreferences* preferences = app->preferences();
cvf::Rendering* firstRendering = m_mainRendering.p();
CVF_ASSERT(preferences);
CVF_ASSERT(firstRendering);
@@ -602,10 +598,10 @@ void RiuViewer::addColorLegendToBottomLeftCorner(caf::TitledOverlayFrame* addedL
if (addedLegend)
{
cvf::Color4f backgroundColor = mainCamera()->viewport()->clearColor();
backgroundColor.a() = 0.8f;
backgroundColor.a() = 0.8f;
cvf::Color3f frameColor(backgroundColor.r(), backgroundColor.g(), backgroundColor.b());
updateLegendTextAndTickMarkColor(addedLegend);
firstRendering->addOverlayItem(addedLegend);
addedLegend->enableBackground(preferences->showLegendBackground());
addedLegend->setBackgroundColor(backgroundColor);
@@ -615,103 +611,109 @@ void RiuViewer::addColorLegendToBottomLeftCorner(caf::TitledOverlayFrame* addedL
}
updateLegendLayout();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::updateLegendLayout()
{
int viewPortHeight = static_cast<int>(m_mainCamera->viewport()->height());
const float maxFreeLegendHeight = 0.7f*viewPortHeight;
const int border = 3;
int edgeAxisBorderWidth = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderWidth(): 0;
int edgeAxisBorderHeight = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderHeight(): 0;
const float maxFreeLegendHeight = 0.7f * viewPortHeight;
const int border = 3;
int edgeAxisBorderWidth = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderWidth() : 0;
int edgeAxisBorderHeight = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderHeight() : 0;
int xPos = border + edgeAxisBorderWidth;
int yPos = border + edgeAxisBorderHeight;
std::vector<caf::TitledOverlayFrame*> standardHeightLegends;
// Place the legends needing the full height, and sort out the standard height legends
for ( cvf::ref<caf::TitledOverlayFrame> legend : m_visibleLegends )
{
cvf::Vec2ui prefSize = legend->preferredSize();
if (prefSize.y() > maxFreeLegendHeight)
int xPos = border + edgeAxisBorderWidth;
int yPos = border + edgeAxisBorderHeight;
std::vector<caf::TitledOverlayFrame*> standardHeightLegends;
// Place the legends needing the full height, and sort out the standard height legends
for (cvf::ref<caf::TitledOverlayFrame> legend : m_visibleLegends)
{
int legendWidth = prefSize.x();
legend->setLayoutFixedPosition(cvf::Vec2i(xPos, yPos));
legend->setRenderSize(cvf::Vec2ui(legendWidth, viewPortHeight - 2 * border - 2 * edgeAxisBorderHeight));
xPos += legendWidth + border;
}
else
{
standardHeightLegends.push_back(legend.p());
}
}
// Place the rest of the legends in columns that fits within the screen height
int maxColumnWidht = 0;
std::vector<caf::TitledOverlayFrame*> columnLegends;
for ( caf::TitledOverlayFrame* legend : standardHeightLegends )
{
cvf::Vec2ui prefSize = legend->preferredSize();
// Check if we need a new column
if ((yPos + (int)prefSize.y() + border) > viewPortHeight)
{
xPos += border + maxColumnWidht;
yPos = border + edgeAxisBorderHeight;
// Set same width to all legends in the column
for (caf::TitledOverlayFrame* columnLegend : columnLegends )
cvf::Vec2ui prefSize = legend->preferredSize();
if (prefSize.y() > maxFreeLegendHeight)
{
columnLegend->setRenderSize(cvf::Vec2ui(maxColumnWidht, columnLegend->renderSize().y()));
int legendWidth = prefSize.x();
legend->setLayoutFixedPosition(cvf::Vec2i(xPos, yPos));
legend->setRenderSize(cvf::Vec2ui(legendWidth, viewPortHeight - 2 * border - 2 * edgeAxisBorderHeight));
xPos += legendWidth + border;
}
else
{
standardHeightLegends.push_back(legend.p());
}
maxColumnWidht = 0;
columnLegends.clear();
}
legend->setLayoutFixedPosition(cvf::Vec2i(xPos, yPos));
legend->setRenderSize(cvf::Vec2ui(prefSize.x(), prefSize.y()));
columnLegends.push_back(legend);
// Place the rest of the legends in columns that fits within the screen height
yPos += legend->renderSize().y() + border;
maxColumnWidht = std::max(maxColumnWidht, (int)prefSize.x());
int maxColumnWidht = 0;
std::vector<caf::TitledOverlayFrame*> columnLegends;
for (caf::TitledOverlayFrame* legend : standardHeightLegends)
{
cvf::Vec2ui prefSize = legend->preferredSize();
// Check if we need a new column
if ((yPos + (int)prefSize.y() + border) > viewPortHeight)
{
xPos += border + maxColumnWidht;
yPos = border + edgeAxisBorderHeight;
// Set same width to all legends in the column
for (caf::TitledOverlayFrame* columnLegend : columnLegends)
{
columnLegend->setRenderSize(cvf::Vec2ui(maxColumnWidht, columnLegend->renderSize().y()));
}
maxColumnWidht = 0;
columnLegends.clear();
}
legend->setLayoutFixedPosition(cvf::Vec2i(xPos, yPos));
legend->setRenderSize(cvf::Vec2ui(prefSize.x(), prefSize.y()));
columnLegends.push_back(legend);
yPos += legend->renderSize().y() + border;
maxColumnWidht = std::max(maxColumnWidht, (int)prefSize.x());
}
// Set same width to all legends in the last column
for (caf::TitledOverlayFrame* legend : columnLegends)
{
legend->setRenderSize(cvf::Vec2ui(maxColumnWidht, legend->renderSize().y()));
}
}
// Set same width to all legends in the last column
for (caf::TitledOverlayFrame* legend : columnLegends )
{
legend->setRenderSize(cvf::Vec2ui(maxColumnWidht, legend->renderSize().y()));
}
int margin = 5;
auto scaleLegendSize = m_scaleLegend->renderSize();
auto otherItemsHeight = m_versionInfoLabel->sizeHint().height();
int margin = 5;
auto scaleLegendSize = m_scaleLegend->renderSize();
auto otherItemsHeight = m_versionInfoLabel->size().height();
m_scaleLegend->setLayoutFixedPosition({ width() - (int)scaleLegendSize.x() - margin - edgeAxisBorderWidth,
margin + edgeAxisBorderHeight + margin + otherItemsHeight});
const int xPos = width() - (int)scaleLegendSize.x() - margin - edgeAxisBorderWidth;
const int yPos = margin + edgeAxisBorderHeight + margin + otherItemsHeight;
m_scaleLegend->setLayoutFixedPosition({xPos, yPos});
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::enableNavigationRotation(bool enable)
{
auto tbNavPol = dynamic_cast<caf::TrackBallBasedNavigation*>(m_navigationPolicy.p());
auto tbNavPol = dynamic_cast<caf::TrackBallBasedNavigation*>(m_navigationPolicy.p());
m_isNavigationRotationEnabled = enable;
if (tbNavPol) tbNavPol->enableRotation(m_isNavigationRotationEnabled);
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::updateNavigationPolicy()
{
@@ -742,7 +744,7 @@ void RiuViewer::updateNavigationPolicy()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::navigationPolicyUpdate()
{
@@ -759,7 +761,7 @@ void RiuViewer::navigationPolicyUpdate()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setCurrentFrame(int frameIndex)
{
@@ -767,14 +769,14 @@ void RiuViewer::setCurrentFrame(int frameIndex)
CVF_ASSERT(firstRendering);
if (m_rimView) m_rimView->setCurrentTimeStepAndUpdate(frameIndex);
animationControl()->setCurrentFrameOnly(frameIndex);
caf::Viewer::slotSetCurrentFrame(frameIndex);
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::showAxisCross(bool enable)
{
@@ -788,7 +790,7 @@ void RiuViewer::showAxisCross(bool enable)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RiuViewerToViewInterface* RiuViewer::ownerReservoirView()
{
@@ -796,15 +798,15 @@ RiuViewerToViewInterface* RiuViewer::ownerReservoirView()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimViewWindow* RiuViewer::ownerViewWindow() const
{
return dynamic_cast<RimViewWindow*>( m_rimView.p());
return dynamic_cast<RimViewWindow*>(m_rimView.p());
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::optimizeClippingPlanes()
{
@@ -823,7 +825,7 @@ void RiuViewer::optimizeClippingPlanes()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::resizeGL(int width, int height)
{
@@ -832,7 +834,7 @@ void RiuViewer::resizeGL(int width, int height)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::mouseMoveEvent(QMouseEvent* mouseEvent)
{
@@ -845,7 +847,9 @@ void RiuViewer::mouseMoveEvent(QMouseEvent* mouseEvent)
int translatedMousePosY = height() - mouseEvent->pos().y();
cvf::Vec3d displayCoord(0, 0, 0);
if (mainCamera()->unproject(cvf::Vec3d(static_cast<double>(translatedMousePosX), static_cast<double>(translatedMousePosY), 0), &displayCoord))
if (mainCamera()->unproject(
cvf::Vec3d(static_cast<double>(translatedMousePosX), static_cast<double>(translatedMousePosY), 0),
&displayCoord))
{
if (m_cursorPositionDomainCoords != cvf::Vec3d::UNDEFINED)
{
@@ -856,10 +860,10 @@ void RiuViewer::mouseMoveEvent(QMouseEvent* mouseEvent)
update();
}
cvf::ref<caf::DisplayCoordTransform> trans = m_rimView->displayCoordTransform();
cvf::Vec3d domainCoord = trans->transformToDomainCoord(displayCoord);
cvf::ref<caf::DisplayCoordTransform> trans = m_rimView->displayCoordTransform();
cvf::Vec3d domainCoord = trans->transformToDomainCoord(displayCoord);
viewLinker->updateCursorPosition(dynamic_cast<RimGridView*>(m_rimView.p()) , domainCoord);
viewLinker->updateCursorPosition(dynamic_cast<RimGridView*>(m_rimView.p()), domainCoord);
}
}
}
@@ -868,9 +872,9 @@ void RiuViewer::mouseMoveEvent(QMouseEvent* mouseEvent)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::leaveEvent(QEvent *)
void RiuViewer::leaveEvent(QEvent*)
{
if (m_rimView && m_rimView->assosiatedViewLinker())
{
@@ -880,11 +884,11 @@ void RiuViewer::leaveEvent(QEvent *)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::updateGridBoxData(double scaleZ,
const cvf::Vec3d& displayModelOffset,
const cvf::Color3f& backgroundColor,
void RiuViewer::updateGridBoxData(double scaleZ,
const cvf::Vec3d& displayModelOffset,
const cvf::Color3f& backgroundColor,
const cvf::BoundingBox& domainCoordBoundingBox)
{
m_gridBoxGenerator->setScaleZ(scaleZ);
@@ -911,11 +915,14 @@ void RiuViewer::showEdgeTickMarksXY(bool enable, bool showAxisLines)
m_windowEdgeAxisOverlay->setShowAxisLines(showAxisLines);
m_mainRendering->addOverlayItem(m_windowEdgeAxisOverlay.p());
}
m_showWindowEdgeAxes = enable;
updateLegendLayout();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::showEdgeTickMarksXZ(bool enable, bool showAxisLines)
{
@@ -928,11 +935,14 @@ void RiuViewer::showEdgeTickMarksXZ(bool enable, bool showAxisLines)
m_windowEdgeAxisOverlay->setShowAxisLines(showAxisLines);
m_mainRendering->addOverlayItem(m_windowEdgeAxisOverlay.p());
}
m_showWindowEdgeAxes = enable;
updateLegendLayout();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::updateAnnotationItems()
{
@@ -940,7 +950,7 @@ void RiuViewer::updateAnnotationItems()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setAxisLabels(const cvf::String& xLabel, const cvf::String& yLabel, const cvf::String& zLabel)
{
@@ -948,7 +958,7 @@ void RiuViewer::setAxisLabels(const cvf::String& xLabel, const cvf::String& yLab
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3d RiuViewer::lastPickPositionInDomainCoords() const
{
@@ -958,7 +968,7 @@ cvf::Vec3d RiuViewer::lastPickPositionInDomainCoords() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
cvf::OverlayItem* RiuViewer::pickFixedPositionedLegend(int winPosX, int winPosY)
{
@@ -978,7 +988,7 @@ cvf::OverlayItem* RiuViewer::pickFixedPositionedLegend(int winPosX, int winPosY)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setCursorPosition(const cvf::Vec3d& domainCoord)
{
@@ -991,7 +1001,7 @@ void RiuViewer::setCursorPosition(const cvf::Vec3d& domainCoord)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::vector<cvf::ref<cvf::Part>> RiuViewer::visibleParts()
{
@@ -999,8 +1009,8 @@ std::vector<cvf::ref<cvf::Part>> RiuViewer::visibleParts()
if (m_mainRendering.notNull())
{
auto enableMask = m_mainRendering->enableMask();
cvf::Scene* scene = currentScene();
auto enableMask = m_mainRendering->enableMask();
cvf::Scene* scene = currentScene();
for (cvf::uint i = 0; i < scene->modelCount(); i++)
{
@@ -1031,7 +1041,7 @@ void RiuViewer::showScaleLegend(bool show)
{
if (show)
{
if(m_scaleLegend->orientation() == caf::OverlayScaleLegend::HORIZONTAL)
if (m_scaleLegend->orientation() == caf::OverlayScaleLegend::HORIZONTAL)
m_scaleLegend->setRenderSize({280, 45});
else
m_scaleLegend->setRenderSize({50, 280});
@@ -1042,10 +1052,12 @@ void RiuViewer::showScaleLegend(bool show)
{
m_mainRendering->removeOverlayItem(m_scaleLegend.p());
}
updateLegendLayout();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::updateLegendTextAndTickMarkColor(cvf::OverlayItem* legend)
{
@@ -1075,7 +1087,7 @@ void RiuViewer::updateLegendTextAndTickMarkColor(cvf::OverlayItem* legend)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::updateTextAndTickMarkColorForOverlayItems()
{
@@ -1088,7 +1100,7 @@ void RiuViewer::updateTextAndTickMarkColorForOverlayItems()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::updateAxisCrossTextColor()
{
@@ -1098,7 +1110,7 @@ void RiuViewer::updateAxisCrossTextColor()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RiuViewer::computeContrastColor() const
{
@@ -1106,8 +1118,8 @@ cvf::Color3f RiuViewer::computeContrastColor() const
if (m_rimView.notNull())
{
contrastColor = RiaColorTools::constrastColor(m_rimView->backgroundColor());
contrastColor = RiaColorTools::contrastColor(m_rimView->backgroundColor());
}
return contrastColor;
}

View File

@@ -178,12 +178,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
if (pickItemInfos.size())
{
cvf::Vec3d globalIntersectionPoint(cvf::Vec3d::ZERO);
if ( pickItemInfos.size() )
{
globalIntersectionPoint = pickItemInfos[0].globalPickedPoint();
}
cvf::Vec3d globalIntersectionPoint = pickItemInfos[0].globalPickedPoint();
for (const auto& pickItem : pickItemInfos)
{

View File

@@ -50,6 +50,7 @@ RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem(const RimWellPath* we
, m_componentType(RiaDefines::WELL_PATH)
, m_columnOffset(0.0)
, m_depthType(RimWellLogPlot::MEASURED_DEPTH)
, m_maxColumnOffset(0.0)
, m_showLabel(false)
{
CVF_ASSERT(wellPath);
@@ -68,6 +69,7 @@ RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem(const RimWellPath* we
: m_wellPath(wellPath)
, m_columnOffset(0.0)
, m_depthType(RimWellLogPlot::MEASURED_DEPTH)
, m_maxColumnOffset(0.0)
, m_showLabel(false)
{
CVF_ASSERT(wellPath && component);
@@ -306,7 +308,7 @@ QwtPlotItem* RiuWellPathComponentPlotItem::createMarker(double posX, double dept
QColor textColor = RiaColorTools::toQColor(baseColor.toColor3f(), 1.0);
if (contrastTextColor)
{
textColor = RiaColorTools::toQColor(RiaColorTools::constrastColor(baseColor.toColor3f()));
textColor = RiaColorTools::toQColor(RiaColorTools::contrastColor(baseColor.toColor3f()));
}
QwtPlotMarker* marker = new QwtPlotMarker(label);
RiuQwtSymbol* symbol = new RiuQwtSymbol(symbolType, "", RiuQwtSymbol::LabelRightOfSymbol);

View File

@@ -23,7 +23,6 @@ option(USE_COMMAND_FRAMEWORK "Use Caf Command Framework" ON)
set (MOC_HEADER_FILES
MainWindow.h
WidgetLayoutTest.h
ManyGroups.h
CustomObjectEditor.h
MenuItemProducer.h
)

View File

@@ -185,8 +185,7 @@ namespace Opm
ECLFluxCalc::ECLFluxCalc(const ECLGraph& graph,
const ECLInitFileData& init,
const double grav,
const bool /* useEPS */)
const double grav)
: graph_(graph)
, satfunc_(graph, init)
, rmap_(pvtnumVector(graph, init))

View File

@@ -56,8 +56,7 @@ namespace Opm
/// result set.
ECLFluxCalc(const ECLGraph& graph,
const ECLInitFileData& init,
const double grav,
const bool useEPS);
const double grav);
/// Retrive phase flux on all connections defined by \code
/// graph.neighbours() \endcode.