mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2537 Mohr circle: avoid clearing plot on selection = nullptr
This commit is contained in:
@@ -95,7 +95,7 @@ RiuMohrsCirclePlot::~RiuMohrsCirclePlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMohrsCirclePlot::updateOnSelectionChanged(const RiuSelectionItem* selectionItem)
|
||||
void RiuMohrsCirclePlot::appendSelection(const RiuSelectionItem* selectionItem)
|
||||
{
|
||||
const RiuGeoMechSelectionItem* geoMechSelectionItem = dynamic_cast<const RiuGeoMechSelectionItem*>(selectionItem);
|
||||
|
||||
@@ -103,7 +103,6 @@ void RiuMohrsCirclePlot::updateOnSelectionChanged(const RiuSelectionItem* select
|
||||
|
||||
if (!geoMechSelectionItem)
|
||||
{
|
||||
this->clearPlot();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -264,7 +263,7 @@ void RiuMohrsCirclePlot::deleteCircles()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMohrsCirclePlot::addEnvelope(const cvf::Vec3f& principals, RimGeoMechView* view)
|
||||
void RiuMohrsCirclePlot::addEnvelopeCurve(const cvf::Vec3f& principals, RimGeoMechView* view)
|
||||
{
|
||||
if (!view) return;
|
||||
|
||||
@@ -376,8 +375,7 @@ void RiuMohrsCirclePlot::queryDataAndUpdatePlot(RimGeoMechView* geoMechView
|
||||
}
|
||||
caf::Ten3f elmTensor = tensorSumOfElmNodes * (1.0 / 8.0);
|
||||
|
||||
cvf::Vec3f dirs[3];
|
||||
cvf::Vec3f principals = elmTensor.calculatePrincipals(dirs);
|
||||
cvf::Vec3f principals = elmTensor.calculatePrincipals(nullptr);
|
||||
|
||||
if (!isValidPrincipals(principals))
|
||||
{
|
||||
@@ -406,7 +404,7 @@ void RiuMohrsCirclePlot::addMohrsCirclesInfo(const MohrsCirclesInfo& mohrsCircle
|
||||
{
|
||||
m_mohrsCiclesInfos.push_back(mohrsCircleInfo);
|
||||
|
||||
addEnvelope(mohrsCircleInfo.principals, view);
|
||||
addEnvelopeCurve(mohrsCircleInfo.principals, view);
|
||||
addMohrCircles(mohrsCircleInfo);
|
||||
updateTransparentCurvesOnPrincipals();
|
||||
}
|
||||
|
||||
@@ -47,12 +47,12 @@ public:
|
||||
RiuMohrsCirclePlot(QWidget* parent);
|
||||
~RiuMohrsCirclePlot();
|
||||
|
||||
void updateOnSelectionChanged(const RiuSelectionItem* selectionItem);
|
||||
void appendSelection(const RiuSelectionItem* selectionItem);
|
||||
void clearPlot();
|
||||
|
||||
void updateOnTimeStepChanged(Rim3dView* changedView);
|
||||
|
||||
public:
|
||||
private:
|
||||
struct MohrsCirclesInfo
|
||||
{
|
||||
MohrsCirclesInfo(cvf::Vec3f principals,
|
||||
@@ -87,7 +87,7 @@ private:
|
||||
void addMohrCircles(const MohrsCirclesInfo& mohrsCirclesInfo);
|
||||
void deleteCircles();
|
||||
|
||||
void addEnvelope(const cvf::Vec3f& principals, RimGeoMechView* view);
|
||||
void addEnvelopeCurve(const cvf::Vec3f& principals, RimGeoMechView* view);
|
||||
void deleteEnvelopes();
|
||||
|
||||
void queryDataAndUpdatePlot(RimGeoMechView* geoMechView, size_t gridIndex, size_t elmIndex, const cvf::Color3ub& color);
|
||||
|
||||
@@ -90,7 +90,7 @@ void RiuSelectionChangedHandler::handleSelectionDeleted() const
|
||||
RiuPvtPlotUpdater* pvtPlotUpdater = RiuMainWindow::instance()->pvtPlotPanel()->plotUpdater();
|
||||
pvtPlotUpdater->updateOnSelectionChanged(nullptr);
|
||||
|
||||
RiuMainWindow::instance()->mohrsCirclePlot()->updateOnSelectionChanged(nullptr);
|
||||
RiuMainWindow::instance()->mohrsCirclePlot()->clearPlot();
|
||||
|
||||
updateResultInfo(nullptr);
|
||||
|
||||
@@ -110,7 +110,7 @@ void RiuSelectionChangedHandler::handleItemAppended(const RiuSelectionItem* item
|
||||
RiuPvtPlotUpdater* pvtPlotUpdater = RiuMainWindow::instance()->pvtPlotPanel()->plotUpdater();
|
||||
pvtPlotUpdater->updateOnSelectionChanged(item);
|
||||
|
||||
RiuMainWindow::instance()->mohrsCirclePlot()->updateOnSelectionChanged(item);
|
||||
RiuMainWindow::instance()->mohrsCirclePlot()->appendSelection(item);
|
||||
|
||||
updateResultInfo(item);
|
||||
|
||||
@@ -124,7 +124,7 @@ void RiuSelectionChangedHandler::handleSetSelectedItem(const RiuSelectionItem* i
|
||||
{
|
||||
RiuMainWindow::instance()->resultPlot()->deleteAllCurves();
|
||||
|
||||
RiuMainWindow::instance()->mohrsCirclePlot()->updateOnSelectionChanged(nullptr);
|
||||
RiuMainWindow::instance()->mohrsCirclePlot()->clearPlot();
|
||||
|
||||
handleItemAppended(item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user