#3766 Hide blank grid children in GeoMech cases

This commit is contained in:
Gaute Lindkvist 2018-11-27 13:39:11 +01:00
parent 70eca210bf
commit 5498c2f466
3 changed files with 18 additions and 15 deletions

View File

@ -851,7 +851,7 @@ bool RimEclipseCase::openReserviorCase()
descendantsIncludingThisOfType(gridColls);
for (RimGridCollection* gridCollection : gridColls)
{
gridCollection->syncFromMainGrid();
gridCollection->syncFromMainEclipseGrid();
}
}

View File

@ -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++)

View File

@ -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;