mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
2d Maps: Fix crash when generating new map without a result variable set
This commit is contained in:
parent
32eb83712f
commit
5bdba24148
@ -121,6 +121,18 @@ QString RimContourMapView::createAutoName() const
|
|||||||
return autoName.join(": ");
|
return autoName.join(": ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimContourMapView::isTimeStepDependentDataVisible() const
|
||||||
|
{
|
||||||
|
if (RimEclipseView::isTimeStepDependentDataVisible())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return m_contourMapProjection->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -141,13 +153,6 @@ void RimContourMapView::createDisplayModel()
|
|||||||
{
|
{
|
||||||
RimEclipseView::createDisplayModel();
|
RimEclipseView::createDisplayModel();
|
||||||
|
|
||||||
if (!isTimeStepDependentDataVisible())
|
|
||||||
{
|
|
||||||
// RimEclipseView::createDisplayModel() will not draw anything in this case. Draw something anyway.
|
|
||||||
m_viewer->setCurrentFrame(m_currentTimeStep);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix)
|
if (this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix)
|
||||||
{
|
{
|
||||||
this->zoomAll();
|
this->zoomAll();
|
||||||
@ -221,7 +226,8 @@ void RimContourMapView::appendContourMapProjectionToModel()
|
|||||||
if (m_viewer && m_contourMapProjection->isChecked())
|
if (m_viewer && m_contourMapProjection->isChecked())
|
||||||
{
|
{
|
||||||
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
|
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
|
||||||
|
if (frameScene)
|
||||||
|
{
|
||||||
cvf::String name = "ContourMapProjection";
|
cvf::String name = "ContourMapProjection";
|
||||||
this->removeModelByName(frameScene, name);
|
this->removeModelByName(frameScene, name);
|
||||||
|
|
||||||
@ -233,7 +239,7 @@ void RimContourMapView::appendContourMapProjectionToModel()
|
|||||||
m_contourMapProjectionPartMgr->appendProjectionToModel(contourMapProjectionModelBasicList.p(), transForm.p());
|
m_contourMapProjectionPartMgr->appendProjectionToModel(contourMapProjectionModelBasicList.p(), transForm.p());
|
||||||
contourMapProjectionModelBasicList->updateBoundingBoxesRecursive();
|
contourMapProjectionModelBasicList->updateBoundingBoxesRecursive();
|
||||||
frameScene->addModel(contourMapProjectionModelBasicList.p());
|
frameScene->addModel(contourMapProjectionModelBasicList.p());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ 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;
|
||||||
|
Loading…
Reference in New Issue
Block a user