mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2715 Mohr Circle plot : Do as little as possible if not visible
This commit is contained in:
parent
fdcf9f3ba4
commit
bc26fa697c
@ -97,28 +97,25 @@ RiuMohrsCirclePlot::~RiuMohrsCirclePlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMohrsCirclePlot::appendSelection(const RiuSelectionItem* selectionItem)
|
||||
{
|
||||
const RiuGeoMechSelectionItem* geoMechSelectionItem = dynamic_cast<const RiuGeoMechSelectionItem*>(selectionItem);
|
||||
|
||||
m_sourceGeoMechViewOfLastPlot = nullptr;
|
||||
|
||||
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;
|
||||
m_sourceGeoMechViewOfLastPlot = nullptr;
|
||||
|
||||
queryData(geoMechView, gridIndex, cellIndex, cvf::Color3ub(color));
|
||||
updatePlot();
|
||||
const RiuGeoMechSelectionItem* geoMechSelectionItem = dynamic_cast<const RiuGeoMechSelectionItem*>(selectionItem);
|
||||
if (geoMechSelectionItem)
|
||||
{
|
||||
RimGeoMechView* geoMechView = geoMechSelectionItem->m_view;
|
||||
CVF_ASSERT(geoMechView);
|
||||
|
||||
m_sourceGeoMechViewOfLastPlot = geoMechView;
|
||||
const size_t gridIndex = geoMechSelectionItem->m_gridIndex;
|
||||
const size_t cellIndex = geoMechSelectionItem->m_cellIndex;
|
||||
const cvf::Color3f color = geoMechSelectionItem->m_color;
|
||||
|
||||
queryData(geoMechView, gridIndex, cellIndex, cvf::Color3ub(color));
|
||||
updatePlot();
|
||||
|
||||
m_sourceGeoMechViewOfLastPlot = geoMechView;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -133,6 +130,8 @@ void RiuMohrsCirclePlot::clearPlot()
|
||||
{
|
||||
deletePlotItems();
|
||||
|
||||
m_sourceGeoMechViewOfLastPlot = nullptr;
|
||||
|
||||
this->replot();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user