#2715 Mohr Circle plot : Do as little as possible if not visible

This commit is contained in:
Magne Sjaastad 2018-04-24 14:32:46 +02:00
parent fdcf9f3ba4
commit bc26fa697c

View File

@ -97,20 +97,16 @@ RiuMohrsCirclePlot::~RiuMohrsCirclePlot()
//--------------------------------------------------------------------------------------------------
void RiuMohrsCirclePlot::appendSelection(const RiuSelectionItem* selectionItem)
{
const RiuGeoMechSelectionItem* geoMechSelectionItem = dynamic_cast<const RiuGeoMechSelectionItem*>(selectionItem);
if (this->isVisible())
{
m_sourceGeoMechViewOfLastPlot = nullptr;
if (!geoMechSelectionItem)
const RiuGeoMechSelectionItem* geoMechSelectionItem = dynamic_cast<const RiuGeoMechSelectionItem*>(selectionItem);
if (geoMechSelectionItem)
{
return;
}
RimGeoMechView* geoMechView = geoMechSelectionItem->m_view;
CVF_ASSERT(geoMechView);
if (this->isVisible())
{
const size_t gridIndex = geoMechSelectionItem->m_gridIndex;
const size_t cellIndex = geoMechSelectionItem->m_cellIndex;
const cvf::Color3f color = geoMechSelectionItem->m_color;
@ -120,6 +116,7 @@ void RiuMohrsCirclePlot::appendSelection(const RiuSelectionItem* selectionItem)
m_sourceGeoMechViewOfLastPlot = geoMechView;
}
}
else
{
this->clearPlot();
@ -133,6 +130,8 @@ void RiuMohrsCirclePlot::clearPlot()
{
deletePlotItems();
m_sourceGeoMechViewOfLastPlot = nullptr;
this->replot();
}