mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1670 Use PtrField instead of PdmPointer
This commit is contained in:
parent
5a7755fe0c
commit
f8f57d3184
@ -43,6 +43,9 @@ RicCellRangeUi::RicCellRangeUi()
|
||||
{
|
||||
CAF_PDM_InitObject("Cell Range", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_case, "Case", "Case", "", "", "");
|
||||
m_case.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&m_gridIndex, "GridIndex", 0, "Grid", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_startIndexI, "StartIndexI", 1, "Start index I", "", "", "");
|
||||
@ -66,9 +69,12 @@ RicCellRangeUi::RicCellRangeUi()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCellRangeUi::setCase(RimCase* rimCase)
|
||||
{
|
||||
m_case = rimCase;
|
||||
if (m_case != rimCase)
|
||||
{
|
||||
m_case = rimCase;
|
||||
|
||||
setDefaultValues();
|
||||
setDefaultValues();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -251,7 +257,7 @@ void RicCellRangeUi::setDefaultValues()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigActiveCellInfo* RicCellRangeUi::activeCellInfo() const
|
||||
{
|
||||
RimEclipseCase* rimEclipeCase = dynamic_cast<RimEclipseCase*>(m_case.p());
|
||||
RimEclipseCase* rimEclipeCase = dynamic_cast<RimEclipseCase*>(m_case());
|
||||
if (rimEclipeCase && rimEclipeCase->eclipseCaseData())
|
||||
{
|
||||
return rimEclipeCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS);
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "cafVecIjk.h"
|
||||
|
||||
class RimCase;
|
||||
@ -40,11 +41,9 @@ public:
|
||||
|
||||
caf::VecIjk start() const;
|
||||
caf::VecIjk count() const;
|
||||
|
||||
QString gridName() const;
|
||||
QString gridName() const;
|
||||
|
||||
private:
|
||||
// PDM overrides
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
@ -56,7 +55,7 @@ private:
|
||||
void updateLegendText();
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimCase> m_case;
|
||||
caf::PdmPtrField<RimCase*> m_case;
|
||||
|
||||
caf::PdmField<int> m_gridIndex;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user