mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2715 Add direct access to RigFemPartCollection from a GeoMechView
This commit is contained in:
parent
8383ee12cf
commit
a0e4f71138
@ -261,11 +261,11 @@ void RivGeoMechVizLogic::calculateCurrentTotalCellVisibility(cvf::UByteArray* to
|
||||
{
|
||||
if (!m_geomechView->geoMechCase()) return;
|
||||
|
||||
size_t gridCount = m_geomechView->geoMechCase()->geoMechData()->femParts()->partCount();
|
||||
size_t gridCount = m_geomechView->femParts()->partCount();
|
||||
|
||||
if (gridCount == 0) return;
|
||||
|
||||
RigFemPart* part = m_geomechView->geoMechCase()->geoMechData()->femParts()->part(0);
|
||||
RigFemPart* part = m_geomechView->femParts()->part(0);
|
||||
int elmCount = part->elementCount();
|
||||
|
||||
totalVisibility->resize(elmCount);
|
||||
|
@ -371,7 +371,7 @@ cvf::ref<RivIntersectionHexGridInterface> RivIntersectionBoxPartMgr::createHexGr
|
||||
m_rimIntersectionBox->firstAncestorOrThisOfType(geoView);
|
||||
if (geoView)
|
||||
{
|
||||
RigFemPart* femPart = geoView->geoMechCase()->geoMechData()->femParts()->part(0);
|
||||
RigFemPart* femPart = geoView->femParts()->part(0);
|
||||
return new RivFemIntersectionGrid(femPart);
|
||||
}
|
||||
|
||||
|
@ -1021,7 +1021,7 @@ cvf::ref<RivIntersectionHexGridInterface> RivIntersectionPartMgr::createHexGridI
|
||||
m_rimCrossSection->firstAncestorOrThisOfType(geoView);
|
||||
if (geoView)
|
||||
{
|
||||
RigFemPart* femPart = geoView->geoMechCase()->geoMechData()->femParts()->part(0);
|
||||
RigFemPart* femPart = geoView->femParts()->part(0);
|
||||
return new RivFemIntersectionGrid(femPart);
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicLi
|
||||
|
||||
if (!m_rimReservoirView->tensorResults()->showTensors()) return;
|
||||
|
||||
RigFemPartCollection* femParts = m_rimReservoirView->geoMechCase()->geoMechData()->femParts();
|
||||
RigFemPartCollection* femParts = m_rimReservoirView->femParts();
|
||||
if (!femParts) return;
|
||||
|
||||
std::vector<TensorVisualization> tensorVisualizations;
|
||||
|
@ -220,7 +220,7 @@ void RimGeoMechView::createDisplayModel()
|
||||
|
||||
// Well path model
|
||||
|
||||
cvf::BoundingBox femBBox = geoMechCase()->geoMechData()->femParts()->boundingBox();
|
||||
cvf::BoundingBox femBBox = femParts()->boundingBox();
|
||||
|
||||
m_wellPathPipeVizModel->removeAllParts();
|
||||
addWellPathsToModel(m_wellPathPipeVizModel.p(), femBBox);
|
||||
@ -285,7 +285,7 @@ void RimGeoMechView::updateCurrentTimeStep()
|
||||
cvf::ref<cvf::ModelBasicList> wellPathModelBasicList = new cvf::ModelBasicList;
|
||||
wellPathModelBasicList->setName(name);
|
||||
|
||||
cvf::BoundingBox femBBox = geoMechCase()->geoMechData()->femParts()->boundingBox();
|
||||
cvf::BoundingBox femBBox = femParts()->boundingBox();
|
||||
addDynamicWellPathsToModel(wellPathModelBasicList.p(), femBBox);
|
||||
|
||||
frameScene->addModel(wellPathModelBasicList.p());
|
||||
@ -530,6 +530,32 @@ std::vector<RimLegendConfig*> RimGeoMechView::legendConfigs() const
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigFemPartCollection* RimGeoMechView::femParts() const
|
||||
{
|
||||
if (m_geomechCase && m_geomechCase->geoMechData())
|
||||
{
|
||||
return m_geomechCase->geoMechData()->femParts();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPartCollection* RimGeoMechView::femParts()
|
||||
{
|
||||
if (m_geomechCase && m_geomechCase->geoMechData())
|
||||
{
|
||||
return m_geomechCase->geoMechData()->femParts();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -32,17 +32,18 @@
|
||||
#include "cvfObject.h"
|
||||
|
||||
class RigFemPart;
|
||||
class RigFemPartCollection;
|
||||
class Rim3dOverlayInfoConfig;
|
||||
class RimCellRangeFilterCollection;
|
||||
class RimGeoMechCase;
|
||||
class RimGeoMechCellColors;
|
||||
class RimGeoMechResultDefinition;
|
||||
class RimGeoMechPropertyFilterCollection;
|
||||
class RimGeoMechResultDefinition;
|
||||
class RimRegularLegendConfig;
|
||||
class RimTensorResults;
|
||||
class RiuViewer;
|
||||
class RivGeoMechPartMgr;
|
||||
class RivGeoMechVizLogic;
|
||||
class RimRegularLegendConfig;
|
||||
class RivTensorResultPartMgr;
|
||||
|
||||
namespace cvf {
|
||||
@ -95,6 +96,9 @@ public:
|
||||
|
||||
std::vector<RimLegendConfig*> legendConfigs() const override;
|
||||
|
||||
const RigFemPartCollection* femParts() const;
|
||||
RigFemPartCollection* femParts();
|
||||
|
||||
protected:
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
virtual void onLoadDataAndUpdate() override;
|
||||
|
@ -590,15 +590,15 @@ const RigCaseToCaseCellMapper* RimViewController::cellMapper()
|
||||
}
|
||||
|
||||
if (masterGeomechView && masterGeomechView->geoMechCase()->geoMechData()
|
||||
&& masterGeomechView->geoMechCase()->geoMechData()->femParts()->partCount())
|
||||
&& masterGeomechView->femParts()->partCount())
|
||||
{
|
||||
masterFemPart = masterGeomechView->geoMechCase()->geoMechData()->femParts()->part(0);
|
||||
masterFemPart = masterGeomechView->femParts()->part(0);
|
||||
}
|
||||
|
||||
if (dependGeomechView && dependGeomechView->geoMechCase()->geoMechData()
|
||||
&& dependGeomechView->geoMechCase()->geoMechData()->femParts()->partCount())
|
||||
&& dependGeomechView->femParts()->partCount())
|
||||
{
|
||||
dependFemPart = dependGeomechView->geoMechCase()->geoMechData()->femParts()->part(0);
|
||||
dependFemPart = dependGeomechView->femParts()->part(0);
|
||||
}
|
||||
|
||||
// If we have the correct mapping already, return it.
|
||||
@ -839,7 +839,7 @@ bool RimViewController::isRangeFilterControlPossible() const
|
||||
if (eclipseView->eclipseCase()->reservoirData() && geomView->geoMechCase()->geoMechData())
|
||||
{
|
||||
RigMainGrid* eclGrid = eclipseView->eclipseCase()->reservoirData()->mainGrid();
|
||||
RigFemPart* femPart = geomView->geoMechCase()->geoMechData()->femParts()->part(0);
|
||||
RigFemPart* femPart = geomView->femParts()->part(0);
|
||||
|
||||
if (eclGrid && femPart)
|
||||
{
|
||||
@ -871,7 +871,7 @@ bool RimViewController::isRangeFilterMappingApliccable() const
|
||||
if (eclipseView->eclipseCase()->eclipseCaseData() && geomView->geoMechCase() && geomView->geoMechCase()->geoMechData())
|
||||
{
|
||||
RigMainGrid* eclGrid = eclipseView->mainGrid();
|
||||
RigFemPart* femPart = geomView->geoMechCase()->geoMechData()->femParts()->part(0);
|
||||
RigFemPart* femPart = geomView->femParts()->part(0);
|
||||
|
||||
if (eclGrid && femPart)
|
||||
{
|
||||
@ -988,7 +988,7 @@ void RimViewController::updateRangeFilterOverrides(RimCellRangeFilter* changedRa
|
||||
if (eclipseMasterView->mainGrid())
|
||||
{
|
||||
RigMainGrid* srcEclGrid = eclipseMasterView->mainGrid();
|
||||
RigFemPart* dstFemPart = depGeomView->geoMechCase()->geoMechData()->femParts()->part(0);
|
||||
RigFemPart* dstFemPart = depGeomView->femParts()->part(0);
|
||||
for (size_t rfIdx = 0; rfIdx < sourceFilterCollection->rangeFilters().size(); ++rfIdx)
|
||||
{
|
||||
RimCellRangeFilter* srcRFilter = sourceFilterCollection->rangeFilters[rfIdx];
|
||||
@ -1002,7 +1002,7 @@ void RimViewController::updateRangeFilterOverrides(RimCellRangeFilter* changedRa
|
||||
{
|
||||
if (depEclView->mainGrid())
|
||||
{
|
||||
RigFemPart* srcFemPart = geoMasterView->geoMechCase()->geoMechData()->femParts()->part(0);
|
||||
RigFemPart* srcFemPart = geoMasterView->femParts()->part(0);
|
||||
RigMainGrid* dstEclGrid = depEclView->mainGrid();
|
||||
for (size_t rfIdx = 0; rfIdx < sourceFilterCollection->rangeFilters().size(); ++rfIdx)
|
||||
{
|
||||
|
@ -616,7 +616,7 @@ public:
|
||||
{
|
||||
const RiuGeoMechSelectionItem* geomechItem = static_cast<const RiuGeoMechSelectionItem*>(item);
|
||||
|
||||
geomechItem->m_view->geoMechCase()->geoMechData()->femParts()->part(geomechItem->m_gridIndex)->structGrid()->ijkFromCellIndex(geomechItem->m_cellIndex, &i, &j, &k);
|
||||
geomechItem->m_view->femParts()->part(geomechItem->m_gridIndex)->structGrid()->ijkFromCellIndex(geomechItem->m_cellIndex, &i, &j, &k);
|
||||
gridIndex = geomechItem->m_gridIndex;
|
||||
caseId = geomechItem->m_view->geoMechCase()->caseId;
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ void RiuMohrsCirclePlot::queryData(RimGeoMechView* geoMechView, size_t gridIndex
|
||||
CVF_ASSERT(geoMechView);
|
||||
m_sourceGeoMechViewOfLastPlot = geoMechView;
|
||||
|
||||
RigFemPart* femPart = geoMechView->geoMechCase()->geoMechData()->femParts()->part(gridIndex);
|
||||
RigFemPart* femPart = geoMechView->femParts()->part(gridIndex);
|
||||
if (femPart->elementType(elmIndex) != HEX8P) return;
|
||||
|
||||
int frameIdx = geoMechView->currentTimeStep();
|
||||
|
@ -1045,7 +1045,7 @@ void RiuViewerCommands::ijkFromCellIndex(size_t gridIdx, size_t cellIndex, size
|
||||
|
||||
if (geomView && geomView->geoMechCase())
|
||||
{
|
||||
geomView->geoMechCase()->geoMechData()->femParts()->part(gridIdx)->structGrid()->ijkFromCellIndex(cellIndex, i, j, k);
|
||||
geomView->femParts()->part(gridIdx)->structGrid()->ijkFromCellIndex(cellIndex, i, j, k);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user