mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added init after read for GeoMechView/Case
And finalized moving the caseUserDescription field All in order to get project load to work. Nearly there. Animation frame is not restored though.
This commit is contained in:
parent
5e44826206
commit
9596f6c0a4
@ -39,6 +39,7 @@ public:
|
|||||||
|
|
||||||
virtual void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath) = 0;
|
virtual void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath) = 0;
|
||||||
|
|
||||||
|
virtual caf::PdmFieldHandle* userDescriptionField() { return &caseUserDescription; }
|
||||||
protected:
|
protected:
|
||||||
static QString relocateFile(const QString& fileName, const QString& newProjectPath, const QString& oldProjectPath,
|
static QString relocateFile(const QString& fileName, const QString& newProjectPath, const QString& oldProjectPath,
|
||||||
bool* foundFile, std::vector<QString>* searchedPaths);
|
bool* foundFile, std::vector<QString>* searchedPaths);
|
||||||
|
@ -83,7 +83,7 @@ public:
|
|||||||
|
|
||||||
// Overridden methods from PdmObject
|
// Overridden methods from PdmObject
|
||||||
public:
|
public:
|
||||||
virtual caf::PdmFieldHandle* userDescriptionField() { return &caseUserDescription; }
|
|
||||||
protected:
|
protected:
|
||||||
virtual void initAfterRead();
|
virtual void initAfterRead();
|
||||||
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
|
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
|
||||||
|
@ -33,7 +33,6 @@ RimGeoMechCase::RimGeoMechCase(void)
|
|||||||
{
|
{
|
||||||
CAF_PDM_InitObject("Geomechanical Case", ":/GeoMechCase48x48.png", "", "");
|
CAF_PDM_InitObject("Geomechanical Case", ":/GeoMechCase48x48.png", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitField(&caseUserDescription, "CaseUserDescription", QString(), "Case name", "", "" ,"");
|
|
||||||
CAF_PDM_InitField(&m_caseFileName, "CaseFileName", QString(), "Case file name", "", "", "");
|
CAF_PDM_InitField(&m_caseFileName, "CaseFileName", QString(), "Case file name", "", "", "");
|
||||||
m_caseFileName.setUiReadOnly(true);
|
m_caseFileName.setUiReadOnly(true);
|
||||||
CAF_PDM_InitFieldNoDefault(&geoMechViews, "GeoMechViews", "", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&geoMechViews, "GeoMechViews", "", "", "", "");
|
||||||
@ -63,14 +62,6 @@ RimGeoMechView* RimGeoMechCase::createAndAddReservoirView()
|
|||||||
return gmv;
|
return gmv;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
caf::PdmFieldHandle* RimGeoMechCase::userDescriptionField()
|
|
||||||
{
|
|
||||||
return &caseUserDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -123,3 +114,18 @@ std::vector<RimView*> RimGeoMechCase::views()
|
|||||||
return views;
|
return views;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGeoMechCase::initAfterRead()
|
||||||
|
{
|
||||||
|
size_t j;
|
||||||
|
for (j = 0; j < geoMechViews().size(); j++)
|
||||||
|
{
|
||||||
|
RimGeoMechView* riv = geoMechViews()[j];
|
||||||
|
CVF_ASSERT(riv);
|
||||||
|
|
||||||
|
riv->setGeoMechCase(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -53,12 +53,10 @@ public:
|
|||||||
virtual std::vector<RimView*> views();
|
virtual std::vector<RimView*> views();
|
||||||
|
|
||||||
// Fields:
|
// Fields:
|
||||||
caf::PdmField<QString> caseUserDescription;
|
|
||||||
caf::PdmPointersField<RimGeoMechView*> geoMechViews;
|
caf::PdmPointersField<RimGeoMechView*> geoMechViews;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
virtual void initAfterRead();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cvf::ref<RigGeoMechCaseData> m_geoMechCaseData;
|
cvf::ref<RigGeoMechCaseData> m_geoMechCaseData;
|
||||||
caf::PdmField<QString> m_caseFileName;
|
caf::PdmField<QString> m_caseFileName;
|
||||||
|
@ -450,6 +450,16 @@ void RimGeoMechView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimGeoMechView::initAfterRead()
|
||||||
|
{
|
||||||
|
this->cellResult()->setReservoirView(this);
|
||||||
|
|
||||||
|
this->updateUiIconFromToggleField();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
@ -81,6 +81,7 @@ private:
|
|||||||
void updateLegends();
|
void updateLegends();
|
||||||
|
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||||
|
virtual void initAfterRead();
|
||||||
|
|
||||||
caf::PdmPointer<RimGeoMechCase> m_geomechCase;
|
caf::PdmPointer<RimGeoMechCase> m_geomechCase;
|
||||||
cvf::ref<RivGeoMechPartMgr> m_geoMechFullModel;
|
cvf::ref<RivGeoMechPartMgr> m_geoMechFullModel;
|
||||||
|
Loading…
Reference in New Issue
Block a user