mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3716 Ensure static results can be shown if there are no dynamic results.
This commit is contained in:
parent
9145e6011d
commit
66d5cedb2e
@ -188,14 +188,19 @@ RimContourMapProjection::ContourPolygons RimContourMapProjection::generateContou
|
|||||||
std::fabs(maxValue() - minValue()) > 1.0e-8)
|
std::fabs(maxValue() - minValue()) > 1.0e-8)
|
||||||
{
|
{
|
||||||
std::vector<double> contourLevels;
|
std::vector<double> contourLevels;
|
||||||
|
if (legendConfig()->mappingMode() != RimRegularLegendConfig::CATEGORY_INTEGER)
|
||||||
|
{
|
||||||
legendConfig()->scalarMapper()->majorTickValues(&contourLevels);
|
legendConfig()->scalarMapper()->majorTickValues(&contourLevels);
|
||||||
int nContourLevels = static_cast<int>(contourLevels.size());
|
int nContourLevels = static_cast<int>(contourLevels.size());
|
||||||
if (nContourLevels > 2)
|
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
|
// Slight fudge to avoid very jagged contour lines at the very edge
|
||||||
// Shift the contour levels inwards.
|
// Shift the contour levels inwards.
|
||||||
contourLevels[0] += (contourLevels[1] - contourLevels[0]) * 0.1;
|
contourLevels[0] += (contourLevels[1] - contourLevels[0]) * 0.1;
|
||||||
contourLevels[nContourLevels - 1] -= (contourLevels[nContourLevels - 1] - contourLevels[nContourLevels - 2]) * 0.1;
|
contourLevels[nContourLevels - 1] -= (contourLevels[nContourLevels - 1] - contourLevels[nContourLevels - 2]) * 0.1;
|
||||||
|
}
|
||||||
std::vector<std::vector<cvf::Vec2d>> contourLines;
|
std::vector<std::vector<cvf::Vec2d>> contourLines;
|
||||||
caf::ContourLines::create(m_aggregatedVertexResults, xVertexPositions(), yVertexPositions(), contourLevels, &contourLines);
|
caf::ContourLines::create(m_aggregatedVertexResults, xVertexPositions(), yVertexPositions(), contourLevels, &contourLines);
|
||||||
|
|
||||||
@ -216,6 +221,7 @@ RimContourMapProjection::ContourPolygons RimContourMapProjection::generateContou
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return contourPolygons;
|
return contourPolygons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,18 +120,6 @@ QString RimContourMapView::createAutoName() const
|
|||||||
return autoName.join(": ");
|
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();
|
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)
|
if (this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix)
|
||||||
{
|
{
|
||||||
this->zoomAll();
|
this->zoomAll();
|
||||||
@ -198,7 +192,14 @@ void RimContourMapView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
|
|||||||
void RimContourMapView::updateCurrentTimeStep()
|
void RimContourMapView::updateCurrentTimeStep()
|
||||||
{
|
{
|
||||||
static_cast<RimEclipsePropertyFilterCollection*>(nativePropertyFilterCollection())->updateFromCurrentTimeStep();
|
static_cast<RimEclipsePropertyFilterCollection*>(nativePropertyFilterCollection())->updateFromCurrentTimeStep();
|
||||||
|
updateGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimContourMapView::updateGeometry()
|
||||||
|
{
|
||||||
this->updateVisibleGeometriesAndCellColors();
|
this->updateVisibleGeometriesAndCellColors();
|
||||||
|
|
||||||
if (m_contourMapProjection->isChecked())
|
if (m_contourMapProjection->isChecked())
|
||||||
|
@ -32,7 +32,6 @@ public:
|
|||||||
RimContourMapProjection* contourMapProjection() const;
|
RimContourMapProjection* contourMapProjection() const;
|
||||||
|
|
||||||
QString createAutoName() const override;
|
QString createAutoName() const override;
|
||||||
bool isTimeStepDependentDataVisible() const override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initAfterRead() override;
|
void initAfterRead() override;
|
||||||
@ -40,7 +39,7 @@ protected:
|
|||||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||||
void updateCurrentTimeStep() override;
|
void updateCurrentTimeStep() override;
|
||||||
|
void updateGeometry();
|
||||||
void setFaultVisParameters();
|
void setFaultVisParameters();
|
||||||
void appendContourMapProjectionToModel();
|
void appendContourMapProjectionToModel();
|
||||||
void appendPickPointVisToModel();
|
void appendPickPointVisToModel();
|
||||||
|
Loading…
Reference in New Issue
Block a user