mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 23:46:00 -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,30 +188,36 @@ 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;
|
||||||
legendConfig()->scalarMapper()->majorTickValues(&contourLevels);
|
if (legendConfig()->mappingMode() != RimRegularLegendConfig::CATEGORY_INTEGER)
|
||||||
int nContourLevels = static_cast<int>(contourLevels.size());
|
|
||||||
if (nContourLevels > 2)
|
|
||||||
{
|
{
|
||||||
// Slight fudge to avoid very jagged contour lines at the very edge
|
legendConfig()->scalarMapper()->majorTickValues(&contourLevels);
|
||||||
// Shift the contour levels inwards.
|
int nContourLevels = static_cast<int>(contourLevels.size());
|
||||||
contourLevels[0] += (contourLevels[1] - contourLevels[0]) * 0.1;
|
if (nContourLevels > 2)
|
||||||
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);
|
|
||||||
|
|
||||||
contourPolygons.reserve(contourLines.size());
|
|
||||||
for (size_t i = 0; i < contourLines.size(); ++i)
|
|
||||||
{
|
{
|
||||||
if (!contourLines[i].empty())
|
if (legendConfig()->mappingMode() == RimRegularLegendConfig::LINEAR_CONTINUOUS || legendConfig()->mappingMode() == RimRegularLegendConfig::LINEAR_DISCRETE)
|
||||||
{
|
{
|
||||||
cvf::ref<cvf::Vec3fArray> contourPolygon = new cvf::Vec3fArray(contourLines[i].size());
|
// Slight fudge to avoid very jagged contour lines at the very edge
|
||||||
for (size_t j = 0; j < contourLines[i].size(); ++j)
|
// 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);
|
||||||
|
|
||||||
|
contourPolygons.reserve(contourLines.size());
|
||||||
|
for (size_t i = 0; i < contourLines.size(); ++i)
|
||||||
|
{
|
||||||
|
if (!contourLines[i].empty())
|
||||||
{
|
{
|
||||||
cvf::Vec3d contourPoint3d = cvf::Vec3d(contourLines[i][j], m_fullBoundingBox.min().z());
|
cvf::ref<cvf::Vec3fArray> contourPolygon = new cvf::Vec3fArray(contourLines[i].size());
|
||||||
cvf::Vec3d displayPoint3d = displayCoordTransform->transformToDisplayCoord(contourPoint3d);
|
for (size_t j = 0; j < contourLines[i].size(); ++j)
|
||||||
(*contourPolygon)[j] = cvf::Vec3f(displayPoint3d);
|
{
|
||||||
|
cvf::Vec3d contourPoint3d = cvf::Vec3d(contourLines[i][j], m_fullBoundingBox.min().z());
|
||||||
|
cvf::Vec3d displayPoint3d = displayCoordTransform->transformToDisplayCoord(contourPoint3d);
|
||||||
|
(*contourPolygon)[j] = cvf::Vec3f(displayPoint3d);
|
||||||
|
}
|
||||||
|
contourPolygons.push_back(contourPolygon);
|
||||||
}
|
}
|
||||||
contourPolygons.push_back(contourPolygon);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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,9 +192,16 @@ 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())
|
||||||
{
|
{
|
||||||
m_contourMapProjection->generateResults();
|
m_contourMapProjection->generateResults();
|
||||||
|
@ -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