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)
|
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())
|
if (this->isVisible())
|
||||||
{
|
{
|
||||||
const size_t gridIndex = geoMechSelectionItem->m_gridIndex;
|
m_sourceGeoMechViewOfLastPlot = nullptr;
|
||||||
const size_t cellIndex = geoMechSelectionItem->m_cellIndex;
|
|
||||||
const cvf::Color3f color = geoMechSelectionItem->m_color;
|
|
||||||
|
|
||||||
queryData(geoMechView, gridIndex, cellIndex, cvf::Color3ub(color));
|
const RiuGeoMechSelectionItem* geoMechSelectionItem = dynamic_cast<const RiuGeoMechSelectionItem*>(selectionItem);
|
||||||
updatePlot();
|
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
|
else
|
||||||
{
|
{
|
||||||
@ -133,6 +130,8 @@ void RiuMohrsCirclePlot::clearPlot()
|
|||||||
{
|
{
|
||||||
deletePlotItems();
|
deletePlotItems();
|
||||||
|
|
||||||
|
m_sourceGeoMechViewOfLastPlot = nullptr;
|
||||||
|
|
||||||
this->replot();
|
this->replot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user