mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1670 Move grid functions from RimCellRangeFilterCollection to RigReservoirGridTools
This commit is contained in:
@@ -20,22 +20,15 @@
|
||||
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
|
||||
#include "RigFemPart.h"
|
||||
#include "RigFemPartCollection.h"
|
||||
#include "RigFemPartGrid.h"
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "RimCellRangeFilter.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimView.h"
|
||||
#include "RimViewController.h"
|
||||
#include "RimViewLinker.h"
|
||||
|
||||
#include "cafPdmUiEditorHandle.h"
|
||||
|
||||
#include "cvfStructGridGeometryGenerator.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimCellRangeFilterCollection, "CellRangeFilterCollection");
|
||||
|
||||
@@ -101,35 +94,6 @@ void RimCellRangeFilterCollection::compoundCellRangeFilter(cvf::CellRangeFilter*
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigMainGrid* RimCellRangeFilterCollection::mainGrid() const
|
||||
{
|
||||
RimEclipseView* eclipseView = this->eclipseView();
|
||||
if (eclipseView && eclipseView->mainGrid())
|
||||
{
|
||||
|
||||
return eclipseView->mainGrid();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigActiveCellInfo* RimCellRangeFilterCollection::activeCellInfo() const
|
||||
{
|
||||
RimEclipseView* eclipseView = this->eclipseView();
|
||||
if (eclipseView)
|
||||
{
|
||||
return eclipseView->currentActiveCellInfo();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -168,14 +132,6 @@ void RimCellRangeFilterCollection::updateDisplayModeNotifyManagedViews(RimCellRa
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView* RimCellRangeFilterCollection::eclipseView() const
|
||||
{
|
||||
return dynamic_cast<RimEclipseView*>(baseView());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -214,89 +170,6 @@ bool RimCellRangeFilterCollection::hasActiveIncludeFilters() const
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const cvf::StructGridInterface* RimCellRangeFilterCollection::gridByIndex(int gridIndex) const
|
||||
{
|
||||
RigMainGrid* mnGrid = mainGrid();
|
||||
RigFemPartCollection* femPartColl = this->femPartColl();
|
||||
|
||||
if (mnGrid)
|
||||
{
|
||||
RigGridBase* grid = mnGrid->gridByIndex(gridIndex);
|
||||
|
||||
CVF_ASSERT(grid);
|
||||
|
||||
return grid;
|
||||
}
|
||||
else if (femPartColl)
|
||||
{
|
||||
if (gridIndex < femPartColl->partCount())
|
||||
return femPartColl->part(gridIndex)->structGrid();
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimCellRangeFilterCollection::gridCount() const
|
||||
{
|
||||
RigMainGrid* mnGrid = mainGrid();
|
||||
RigFemPartCollection* femPartColl = this->femPartColl();
|
||||
|
||||
if (mnGrid)
|
||||
{
|
||||
return (int)mnGrid->gridCount();
|
||||
}
|
||||
else if (femPartColl)
|
||||
{
|
||||
return femPartColl->partCount();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimCellRangeFilterCollection::gridName(int gridIndex) const
|
||||
{
|
||||
RigMainGrid* mnGrid = mainGrid();
|
||||
RigFemPartCollection* femPartColl = this->femPartColl();
|
||||
|
||||
if (mnGrid)
|
||||
{
|
||||
return mnGrid->gridByIndex(gridIndex)->gridName().c_str();
|
||||
}
|
||||
else if (femPartColl)
|
||||
{
|
||||
return QString::number(gridIndex);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPartCollection* RimCellRangeFilterCollection::femPartColl() const
|
||||
{
|
||||
RimGeoMechView* geoView = dynamic_cast<RimGeoMechView*>(baseView());
|
||||
if (geoView &&
|
||||
geoView->geoMechCase() &&
|
||||
geoView->geoMechCase()->geoMechData() )
|
||||
{
|
||||
return geoView->geoMechCase()->geoMechData()->femParts();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user