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(": ");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimContourMapView::isTimeStepDependentDataVisible() const
|
||||
{
|
||||
if (RimEclipseView::isTimeStepDependentDataVisible())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return m_contourMapProjection->isChecked();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -141,13 +153,6 @@ void RimContourMapView::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)
|
||||
{
|
||||
this->zoomAll();
|
||||
@ -221,19 +226,20 @@ void RimContourMapView::appendContourMapProjectionToModel()
|
||||
if (m_viewer && m_contourMapProjection->isChecked())
|
||||
{
|
||||
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
|
||||
if (frameScene)
|
||||
{
|
||||
cvf::String name = "ContourMapProjection";
|
||||
this->removeModelByName(frameScene, name);
|
||||
|
||||
cvf::String name = "ContourMapProjection";
|
||||
this->removeModelByName(frameScene, name);
|
||||
cvf::ref<cvf::ModelBasicList> contourMapProjectionModelBasicList = new cvf::ModelBasicList;
|
||||
contourMapProjectionModelBasicList->setName(name);
|
||||
|
||||
cvf::ref<cvf::ModelBasicList> contourMapProjectionModelBasicList = new cvf::ModelBasicList;
|
||||
contourMapProjectionModelBasicList->setName(name);
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = this->displayCoordTransform();
|
||||
|
||||
m_contourMapProjectionPartMgr->appendProjectionToModel(contourMapProjectionModelBasicList.p(), transForm.p());
|
||||
contourMapProjectionModelBasicList->updateBoundingBoxesRecursive();
|
||||
frameScene->addModel(contourMapProjectionModelBasicList.p());
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = this->displayCoordTransform();
|
||||
|
||||
m_contourMapProjectionPartMgr->appendProjectionToModel(contourMapProjectionModelBasicList.p(), transForm.p());
|
||||
contourMapProjectionModelBasicList->updateBoundingBoxesRecursive();
|
||||
frameScene->addModel(contourMapProjectionModelBasicList.p());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
RimContourMapProjection* contourMapProjection() const;
|
||||
|
||||
QString createAutoName() const override;
|
||||
bool isTimeStepDependentDataVisible() const override;
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
|
Loading…
Reference in New Issue
Block a user