#3716 Ensure static results can be shown if there are no dynamic results.

This commit is contained in:
Gaute Lindkvist 2018-11-20 14:54:30 +01:00
parent 9145e6011d
commit 66d5cedb2e
3 changed files with 40 additions and 34 deletions

View File

@ -188,14 +188,19 @@ RimContourMapProjection::ContourPolygons RimContourMapProjection::generateContou
std::fabs(maxValue() - minValue()) > 1.0e-8)
{
std::vector<double> contourLevels;
if (legendConfig()->mappingMode() != RimRegularLegendConfig::CATEGORY_INTEGER)
{
legendConfig()->scalarMapper()->majorTickValues(&contourLevels);
int nContourLevels = static_cast<int>(contourLevels.size());
if (nContourLevels > 2)
{
if (legendConfig()->mappingMode() == RimRegularLegendConfig::LINEAR_CONTINUOUS || legendConfig()->mappingMode() == RimRegularLegendConfig::LINEAR_DISCRETE)
{
// Slight fudge to avoid very jagged contour lines at the very edge
// Shift the contour levels inwards.
contourLevels[0] += (contourLevels[1] - contourLevels[0]) * 0.1;
contourLevels[nContourLevels - 1] -= (contourLevels[nContourLevels - 1] - contourLevels[nContourLevels - 2]) * 0.1;
}
std::vector<std::vector<cvf::Vec2d>> contourLines;
caf::ContourLines::create(m_aggregatedVertexResults, xVertexPositions(), yVertexPositions(), contourLevels, &contourLines);
@ -216,6 +221,7 @@ RimContourMapProjection::ContourPolygons RimContourMapProjection::generateContou
}
}
}
}
return contourPolygons;
}

View File

@ -120,18 +120,6 @@ QString RimContourMapView::createAutoName() const
return autoName.join(": ");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimContourMapView::isTimeStepDependentDataVisible() const
{
if (RimEclipseView::isTimeStepDependentDataVisible())
{
return true;
}
return m_contourMapProjection->isChecked();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -153,6 +141,12 @@ void RimContourMapView::createDisplayModel()
{
RimEclipseView::createDisplayModel();
if (!this->isTimeStepDependentDataVisible())
{
// Need to add geometry even if it hasn't happened during dynamic time step update.
updateGeometry();
}
if (this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix)
{
this->zoomAll();
@ -198,7 +192,14 @@ void RimContourMapView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
void RimContourMapView::updateCurrentTimeStep()
{
static_cast<RimEclipsePropertyFilterCollection*>(nativePropertyFilterCollection())->updateFromCurrentTimeStep();
updateGeometry();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimContourMapView::updateGeometry()
{
this->updateVisibleGeometriesAndCellColors();
if (m_contourMapProjection->isChecked())

View File

@ -32,7 +32,6 @@ public:
RimContourMapProjection* contourMapProjection() const;
QString createAutoName() const override;
bool isTimeStepDependentDataVisible() const override;
protected:
void initAfterRead() override;
@ -40,7 +39,7 @@ protected:
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
void updateCurrentTimeStep() override;
void updateGeometry();
void setFaultVisParameters();
void appendContourMapProjectionToModel();
void appendPickPointVisToModel();