mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
(#342) Added "Add property filter" to the 3D view's context menu
This commit is contained in:
parent
320b0c62c4
commit
68a7993105
@ -84,14 +84,14 @@ public:
|
||||
|
||||
// Fields containing child objects :
|
||||
|
||||
caf::PdmField<RimEclipseCellColors*> cellResult;
|
||||
caf::PdmField<RimCellEdgeColors*> cellEdgeResult;
|
||||
caf::PdmField<RimEclipseFaultColors*> faultResultSettings;
|
||||
caf::PdmField<RimEclipseCellColors*> cellResult;
|
||||
caf::PdmField<RimCellEdgeColors*> cellEdgeResult;
|
||||
caf::PdmField<RimEclipseFaultColors*> faultResultSettings;
|
||||
|
||||
caf::PdmField<RimEclipsePropertyFilterCollection*> propertyFilterCollection;
|
||||
caf::PdmField<RimEclipsePropertyFilterCollection*> propertyFilterCollection;
|
||||
|
||||
caf::PdmField<RimEclipseWellCollection*> wellCollection;
|
||||
caf::PdmField<RimFaultCollection*> faultCollection;
|
||||
caf::PdmField<RimEclipseWellCollection*> wellCollection;
|
||||
caf::PdmField<RimFaultCollection*> faultCollection;
|
||||
|
||||
// Fields
|
||||
|
||||
|
@ -27,6 +27,13 @@
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimFaultCollection.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipsePropertyFilter.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimGeoMechPropertyFilter.h"
|
||||
#include "RimGeoMechPropertyFilterCollection.h"
|
||||
#include "RimGeoMechCellColors.h"
|
||||
|
||||
#include "RivSourceInfo.h"
|
||||
#include "RivFemPickSourceInfo.h"
|
||||
@ -140,10 +147,16 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
menu.addAction(QString("J-slice range filter"), this, SLOT(slotRangeFilterJ()));
|
||||
menu.addAction(QString("K-slice range filter"), this, SLOT(slotRangeFilterK()));
|
||||
|
||||
// Hide faults command
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_reservoirView.p());
|
||||
if (eclipseView)
|
||||
{
|
||||
RimEclipseCellColors* cellColors = eclipseView->cellResult().p();
|
||||
if (cellColors)
|
||||
{
|
||||
menu.addAction(QString("Add property filter"), this, SLOT(slotAddEclipsePropertyFilter()));
|
||||
}
|
||||
|
||||
// Hide faults command
|
||||
const RigCaseData* reservoir = eclipseView->eclipseCase()->reservoirData();
|
||||
const RigFault* fault = reservoir->mainGrid()->findFaultFromCellIndexAndCellFace(m_currentCellIndex, m_currentFaceIndex);
|
||||
if (fault)
|
||||
@ -155,6 +168,16 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
}
|
||||
}
|
||||
|
||||
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>(m_reservoirView.p());
|
||||
if (geoMechView)
|
||||
{
|
||||
RimGeoMechCellColors* cellColors = geoMechView->cellResult().p();
|
||||
if (cellColors)
|
||||
{
|
||||
menu.addAction(QString("Add property filter"), this, SLOT(slotAddGeoMechPropertyFilter()));
|
||||
}
|
||||
}
|
||||
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
|
||||
@ -257,6 +280,54 @@ void RiuViewerCommands::slotHideFault()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewerCommands::slotAddEclipsePropertyFilter()
|
||||
{
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_reservoirView.p());
|
||||
if (eclipseView)
|
||||
{
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
RimUiTreeModelPdm* myModel = mainWindow->uiPdmModel();
|
||||
if (myModel)
|
||||
{
|
||||
RimEclipsePropertyFilterCollection* filterCollection = eclipseView->propertyFilterCollection();
|
||||
|
||||
QModelIndex collectionModelIndex = myModel->getModelIndexFromPdmObject(filterCollection);
|
||||
|
||||
QModelIndex insertedIndex;
|
||||
RimEclipsePropertyFilter* propertyFilter = myModel->addPropertyFilter(collectionModelIndex, insertedIndex);
|
||||
|
||||
mainWindow->setCurrentObjectInTreeView(propertyFilter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewerCommands::slotAddGeoMechPropertyFilter()
|
||||
{
|
||||
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>(m_reservoirView.p());
|
||||
if (geoMechView)
|
||||
{
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
RimUiTreeModelPdm* myModel = mainWindow->uiPdmModel();
|
||||
if (myModel)
|
||||
{
|
||||
RimGeoMechPropertyFilterCollection* filterCollection = geoMechView->propertyFilterCollection();
|
||||
|
||||
QModelIndex collectionModelIndex = myModel->getModelIndexFromPdmObject(filterCollection);
|
||||
|
||||
QModelIndex insertedIndex;
|
||||
RimGeoMechPropertyFilter* propertyFilter = myModel->addGeoMechPropertyFilter(collectionModelIndex, insertedIndex);
|
||||
|
||||
mainWindow->setCurrentObjectInTreeView(propertyFilter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -22,6 +22,9 @@
|
||||
|
||||
class RiuViewer;
|
||||
class RimView;
|
||||
class RimEclipseView;
|
||||
class RimGeoMechView;
|
||||
|
||||
class QMouseEvent;
|
||||
|
||||
#include "cvfStructGrid.h"
|
||||
@ -51,11 +54,14 @@ private slots:
|
||||
void slotRangeFilterJ();
|
||||
void slotRangeFilterK();
|
||||
void slotHideFault();
|
||||
void slotAddEclipsePropertyFilter();
|
||||
void slotAddGeoMechPropertyFilter();
|
||||
|
||||
private:
|
||||
void ijkFromCellIndex(size_t gridIdx, size_t cellIndex, size_t* i, size_t* j, size_t* k);
|
||||
void createSliceRangeFilter(int ijOrk);
|
||||
void extractIntersectionData(const cvf::HitItemCollection& hitItems, cvf::Vec3d* localIntersectionPoint, cvf::Part** firstPart, uint* firstPartFaceHit, cvf::Part** nncPart, uint* nncPartFaceHit);
|
||||
|
||||
size_t m_currentGridIdx;
|
||||
size_t m_currentCellIndex;
|
||||
cvf::StructGridInterface::FaceType m_currentFaceIndex;
|
||||
|
Loading…
Reference in New Issue
Block a user