mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3766 Hide blank grid children in GeoMech cases
This commit is contained in:
parent
70eca210bf
commit
5498c2f466
@ -851,7 +851,7 @@ bool RimEclipseCase::openReserviorCase()
|
||||
descendantsIncludingThisOfType(gridColls);
|
||||
for (RimGridCollection* gridCollection : gridColls)
|
||||
{
|
||||
gridCollection->syncFromMainGrid();
|
||||
gridCollection->syncFromMainEclipseGrid();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,9 +361,9 @@ caf::PdmFieldHandle* RimGridCollection::objectToggleField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCollection::syncFromMainGrid()
|
||||
void RimGridCollection::syncFromMainEclipseGrid()
|
||||
{
|
||||
auto mainGrid = this->mainGrid();
|
||||
auto mainGrid = this->mainEclipseGrid();
|
||||
if (mainGrid)
|
||||
{
|
||||
m_mainGrid->setName("Main Grid");
|
||||
@ -471,14 +471,17 @@ void RimGridCollection::initAfterRead()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCollection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
uiTreeOrdering.add(m_mainGrid());
|
||||
if (hasPersistentLgrs())
|
||||
if (mainEclipseGrid())
|
||||
{
|
||||
uiTreeOrdering.add(m_persistentLgrs());
|
||||
}
|
||||
if (hasTemporaryLgrs())
|
||||
{
|
||||
uiTreeOrdering.add(m_temporaryLgrs());
|
||||
uiTreeOrdering.add(m_mainGrid());
|
||||
if (hasPersistentLgrs())
|
||||
{
|
||||
uiTreeOrdering.add(m_persistentLgrs());
|
||||
}
|
||||
if (hasTemporaryLgrs())
|
||||
{
|
||||
uiTreeOrdering.add(m_temporaryLgrs());
|
||||
}
|
||||
}
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
@ -486,7 +489,7 @@ void RimGridCollection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigMainGrid* RimGridCollection::mainGrid() const
|
||||
const RigMainGrid* RimGridCollection::mainEclipseGrid() const
|
||||
{
|
||||
RimEclipseCase* eclipseCase;
|
||||
firstAncestorOrThisOfType(eclipseCase);
|
||||
@ -498,7 +501,7 @@ const RigMainGrid* RimGridCollection::mainGrid() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGridCollection::hasPersistentLgrs() const
|
||||
{
|
||||
auto mainGrid = this->mainGrid();
|
||||
auto mainGrid = this->mainEclipseGrid();
|
||||
if (!mainGrid) return false;
|
||||
|
||||
for (size_t i = 1; i < mainGrid->gridCount(); i++)
|
||||
@ -514,7 +517,7 @@ bool RimGridCollection::hasPersistentLgrs() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGridCollection::hasTemporaryLgrs() const
|
||||
{
|
||||
auto mainGrid = this->mainGrid();
|
||||
auto mainGrid = this->mainEclipseGrid();
|
||||
if (!mainGrid) return false;
|
||||
|
||||
for (size_t i = 1; i < mainGrid->gridCount(); i++)
|
||||
|
@ -103,7 +103,7 @@ public:
|
||||
std::vector<size_t> indicesToVisibleGrids() const;
|
||||
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void syncFromMainGrid();
|
||||
void syncFromMainEclipseGrid();
|
||||
void setMainGridActive(bool active);
|
||||
|
||||
static const QString persistentGridUiName();
|
||||
@ -115,7 +115,7 @@ protected:
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
|
||||
private:
|
||||
const RigMainGrid* mainGrid() const;
|
||||
const RigMainGrid* mainEclipseGrid() const;
|
||||
bool hasPersistentLgrs() const;
|
||||
bool hasTemporaryLgrs() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user