mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#829 Update display and pick information when reloading / selecting a formation names file
This commit is contained in:
parent
e360c55e16
commit
88af194702
@ -50,6 +50,11 @@ void RicReloadFormationNamesFeature::onActionTriggered(bool isChecked)
|
||||
if (selectedFormationNamesCollObjs.size())
|
||||
{
|
||||
selectedFormationNamesCollObjs[0]->readAllFormationNames();
|
||||
for(RimFormationNames* fnames: selectedFormationNamesCollObjs[0]->formationNamesList())
|
||||
{
|
||||
fnames->updateConnectedViews();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -58,6 +63,7 @@ void RicReloadFormationNamesFeature::onActionTriggered(bool isChecked)
|
||||
for (RimFormationNames* fnames: selectedFormationNamesObjs)
|
||||
{
|
||||
fnames->readFormationNamesFile(nullptr);
|
||||
fnames->updateConnectedViews();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -307,6 +307,14 @@ void RimEclipseCase::updateFormationNamesData()
|
||||
{
|
||||
rigEclipseCase->setActiveFormationNames(nullptr);
|
||||
}
|
||||
std::vector<RimView*> views = this->views();
|
||||
for(RimView* view : views)
|
||||
{
|
||||
if(view && view->isUsingFormationNames())
|
||||
{
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1695,6 +1695,14 @@ void RimEclipseView::axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::S
|
||||
*zLabel = "Z";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseView::isUsingFormationNames() const
|
||||
{
|
||||
return (cellResult()->resultType() == RimDefines::FORMATION_NAMES) ;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -136,6 +136,8 @@ public:
|
||||
|
||||
virtual void axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel);
|
||||
|
||||
virtual bool isUsingFormationNames() const override;
|
||||
|
||||
protected:
|
||||
virtual void initAfterRead();
|
||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||
|
@ -20,7 +20,9 @@
|
||||
|
||||
#include "RigFormationNames.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "cafPdmUiFilePathEditor.h"
|
||||
#include "QFile"
|
||||
@ -95,6 +97,23 @@ const QString& RimFormationNames::fileName()
|
||||
return m_formationNamesFileName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFormationNames::updateConnectedViews()
|
||||
{
|
||||
std::vector<caf::PdmObjectHandle*> usingObjs;
|
||||
this->objectsWithReferringPtrFields(usingObjs);
|
||||
for (caf::PdmObjectHandle* obj: usingObjs)
|
||||
{
|
||||
RimCase* caseObj = dynamic_cast<RimCase*>(obj);
|
||||
if (caseObj)
|
||||
{
|
||||
caseObj->updateFormationNamesData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
const QString& fileName();
|
||||
|
||||
RigFormationNames* formationNamesData() { return m_formationNamesData.p();}
|
||||
void updateConnectedViews();
|
||||
|
||||
void readFormationNamesFile(QString * errorMessage);
|
||||
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
|
||||
|
@ -272,6 +272,15 @@ void RimGeoMechCase::updateFormationNamesData()
|
||||
{
|
||||
rigCaseData->femPartResults()->setActiveFormationNames(nullptr);
|
||||
}
|
||||
|
||||
std::vector<RimView*> views = this->views();
|
||||
for(RimView* view : views)
|
||||
{
|
||||
if(view && view->isUsingFormationNames())
|
||||
{
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -655,6 +655,14 @@ void RimGeoMechView::axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::S
|
||||
*zLabel = "Z(3)";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGeoMechView::isUsingFormationNames() const
|
||||
{
|
||||
return cellResult()->hasCategoryResult(); // Correct for now
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -80,6 +80,8 @@ public:
|
||||
|
||||
virtual void axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel);
|
||||
|
||||
virtual bool isUsingFormationNames() const override;
|
||||
|
||||
protected:
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
|
||||
|
||||
|
@ -147,6 +147,7 @@ public:
|
||||
bool isMasterView() const;
|
||||
RimViewLinker* assosiatedViewLinker() const;
|
||||
|
||||
virtual bool isUsingFormationNames() const = 0;
|
||||
cvf::ref<cvf::UByteArray> currentTotalCellVisibility();
|
||||
|
||||
virtual bool showActiveCellsOnly();
|
||||
|
Loading…
Reference in New Issue
Block a user