mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#401) WIP: Prototyped total cell visibility calculation and
calculation of overridden cell visibility.
This commit is contained in:
@@ -838,11 +838,13 @@ void RimEclipseView::scheduleGeometryRegen(RivCellSetEnum geometryType)
|
||||
{
|
||||
m_reservoirGridPartManager->scheduleGeometryRegen(geometryType);
|
||||
|
||||
RimViewLinker* viewLinker = viewLinkerWithDepViews();
|
||||
RimViewLinker* viewLinker = viewLinkerWithMyDepViews();
|
||||
if (viewLinker)
|
||||
{
|
||||
viewLinker->scheduleGeometryRegenForDepViews(geometryType);
|
||||
}
|
||||
|
||||
m_currentReservoirCellVisibility = NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1547,3 +1549,31 @@ void RimEclipseView::setOverridePropertyFilterCollection(RimEclipsePropertyFilte
|
||||
this->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
this->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility)
|
||||
{
|
||||
size_t gridCount = this->eclipseCase()->reservoirData()->gridCount();
|
||||
size_t cellCount = this->eclipseCase()->reservoirData()->mainGrid()->cells().size();
|
||||
|
||||
totalVisibility->resize(cellCount);
|
||||
totalVisibility->setAll(false);
|
||||
|
||||
for (size_t gridIdx = 0; gridIdx < gridCount; ++gridIdx)
|
||||
{
|
||||
RigGridBase * grid = this->eclipseCase()->reservoirData()->grid(gridIdx);
|
||||
int gridCellCount = static_cast<int>(grid->cellCount());
|
||||
|
||||
for (size_t gpIdx = 0; gpIdx < m_visibleGridParts.size(); ++gpIdx)
|
||||
{
|
||||
cvf::cref<cvf::UByteArray> visibility = m_reservoirGridPartManager->cellVisibility(m_visibleGridParts[gpIdx], gridIdx, m_currentTimeStep);
|
||||
|
||||
for (int lcIdx = 0; lcIdx < gridCellCount; ++ lcIdx)
|
||||
{
|
||||
(*totalVisibility)[grid->reservoirCellIndex(lcIdx)] |= (*visibility)[lcIdx];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +164,8 @@ private:
|
||||
|
||||
virtual RimCase* ownerCase();
|
||||
|
||||
virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility);
|
||||
|
||||
caf::PdmChildField<RimEclipsePropertyFilterCollection*> m_propertyFilterCollection;
|
||||
caf::PdmPointer<RimEclipsePropertyFilterCollection> m_overridePropertyFilterCollection;
|
||||
|
||||
|
||||
@@ -516,11 +516,12 @@ void RimGeoMechView::scheduleGeometryRegen(RivCellSetEnum geometryType)
|
||||
{
|
||||
m_vizLogic->scheduleGeometryRegen(geometryType);
|
||||
|
||||
RimViewLinker* viewLinker = viewLinkerWithDepViews();
|
||||
RimViewLinker* viewLinker = viewLinkerWithMyDepViews();
|
||||
if (viewLinker)
|
||||
{
|
||||
viewLinker->scheduleGeometryRegenForDepViews(geometryType);
|
||||
}
|
||||
m_currentReservoirCellVisibility = NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -549,3 +550,11 @@ RimGeoMechPropertyFilterCollection* RimGeoMechView::propertyFilterCollection()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility)
|
||||
{
|
||||
m_vizLogic->calculateCurrentTotalCellVisibility(totalVisibility, m_currentTimeStep);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,8 @@ private:
|
||||
|
||||
virtual RimCase* ownerCase();
|
||||
|
||||
virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility);
|
||||
|
||||
caf::PdmChildField<RimGeoMechPropertyFilterCollection*> m_propertyFilterCollection;
|
||||
caf::PdmPointer<RimGeoMechPropertyFilterCollection> m_overridePropertyFilterCollection;
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ void RimView::updateViewerWidget()
|
||||
void RimView::scheduleCreateDisplayModelAndRedraw()
|
||||
{
|
||||
RiaApplication::instance()->scheduleDisplayModelUpdateAndRedraw(this);
|
||||
RimViewLinker* viewLinker = viewLinkerWithDepViews();
|
||||
RimViewLinker* viewLinker = viewLinkerWithMyDepViews();
|
||||
if (viewLinker)
|
||||
{
|
||||
viewLinker->scheduleCreateDisplayModelAndRedrawForDependentViews();
|
||||
@@ -723,7 +723,7 @@ bool RimView::isBoundingBoxesOverlappingOrClose(const cvf::BoundingBox& sourceBB
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewLinker* RimView::viewLinkerWithDepViews()
|
||||
RimViewLinker* RimView::viewLinkerWithMyDepViews()
|
||||
{
|
||||
RimViewLinker* viewLinker = NULL;
|
||||
std::vector<caf::PdmObjectHandle*> reffingObjs;
|
||||
@@ -739,3 +739,36 @@ RimViewLinker* RimView::viewLinkerWithDepViews()
|
||||
return viewLinker;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewLink* RimView::controllingViewLink()
|
||||
{
|
||||
RimViewLink* viewLink = NULL;
|
||||
std::vector<caf::PdmObjectHandle*> reffingObjs;
|
||||
|
||||
this->objectsWithReferringPtrFields(reffingObjs);
|
||||
for (size_t i = 0; i < reffingObjs.size(); ++i)
|
||||
{
|
||||
viewLink = dynamic_cast<RimViewLink*>(reffingObjs[i]);
|
||||
if (viewLink) break;
|
||||
}
|
||||
|
||||
return viewLink;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::UByteArray> RimView::currentTotalCellVisibility()
|
||||
{
|
||||
if (m_currentReservoirCellVisibility.isNull())
|
||||
{
|
||||
m_currentReservoirCellVisibility = new cvf::UByteArray;
|
||||
this->calculateCurrentTotalCellVisibility(m_currentReservoirCellVisibility.p());
|
||||
}
|
||||
|
||||
return m_currentReservoirCellVisibility;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
|
||||
#include "RivCellSetEnum.h"
|
||||
|
||||
#include "cvfArray.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
class Rim3dOverlayInfoConfig;
|
||||
@@ -36,6 +41,7 @@ class RimCase;
|
||||
class RimCellRangeFilterCollection;
|
||||
class RiuViewer;
|
||||
class RimViewLinker;
|
||||
class RimViewLink;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
@@ -120,6 +126,8 @@ public:
|
||||
virtual void scheduleGeometryRegen(RivCellSetEnum geometryType) = 0;
|
||||
void scheduleCreateDisplayModelAndRedraw();
|
||||
void createDisplayModelAndRedraw();
|
||||
RimViewLink* controllingViewLink();
|
||||
cvf::ref<cvf::UByteArray> currentTotalCellVisibility();
|
||||
|
||||
public:
|
||||
virtual void loadDataAndUpdate() = 0;
|
||||
@@ -129,7 +137,7 @@ public:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() { return &name; }
|
||||
protected:
|
||||
|
||||
RimViewLinker* viewLinkerWithDepViews();
|
||||
RimViewLinker* viewLinkerWithMyDepViews();
|
||||
void setDefaultView();
|
||||
|
||||
void addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
|
||||
@@ -152,7 +160,8 @@ protected:
|
||||
virtual void updateViewerWidgetWindowTitle() = 0;
|
||||
|
||||
virtual void resetLegendsInViewer() = 0;
|
||||
|
||||
virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility) = 0;
|
||||
|
||||
QPointer<RiuViewer> m_viewer;
|
||||
|
||||
caf::PdmField<int> m_currentTimeStep;
|
||||
@@ -166,13 +175,13 @@ protected:
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
|
||||
cvf::ref<cvf::UByteArray> m_currentReservoirCellVisibility;
|
||||
private:
|
||||
static bool isBoundingBoxesOverlappingOrClose(const cvf::BoundingBox& sourceBB, const cvf::BoundingBox& destBB);
|
||||
|
||||
private:
|
||||
bool m_previousGridModeMeshLinesWasFaults;
|
||||
caf::PdmField<bool> m_disableLighting;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -500,3 +500,15 @@ void RimViewLink::doSyncCellResult()
|
||||
linkedViews->updateCellResult();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewLinker* RimViewLink::ownerViewLinker()
|
||||
{
|
||||
RimViewLinker* viewLinker = NULL;
|
||||
this->firstAnchestorOrThisOfType(viewLinker);
|
||||
CVF_ASSERT(viewLinker);
|
||||
|
||||
return viewLinker;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
class RimView;
|
||||
class RimEclipseView;
|
||||
class RimGeoMechView;
|
||||
class RimViewLinker;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -44,6 +45,7 @@ public:
|
||||
|
||||
RimView* managedView();
|
||||
void setManagedView(RimView* view);
|
||||
RimViewLinker* ownerViewLinker();
|
||||
|
||||
// Linked (both ways) properties
|
||||
caf::PdmField<bool> syncCamera;
|
||||
|
||||
Reference in New Issue
Block a user