mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2162 Context menu: Remove hide intersection slot and use command features
This commit is contained in:
parent
0a8b2111bc
commit
4b57599162
@ -137,7 +137,6 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
{
|
||||
m_currentGridIdx = cvf::UNDEFINED_SIZE_T;
|
||||
m_currentCellIndex = cvf::UNDEFINED_SIZE_T;
|
||||
m_currentPickedObject = nullptr;
|
||||
|
||||
int winPosX = event->x();
|
||||
int winPosY = event->y();
|
||||
@ -196,16 +195,21 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
{
|
||||
findCellAndGridIndex(crossSectionSourceInfo, firstPartTriangleIndex, &m_currentCellIndex, &m_currentGridIdx);
|
||||
m_currentFaceIndex = cvf::StructGridInterface::NO_FACE;
|
||||
m_currentPickedObject = const_cast<RimIntersection*>(crossSectionSourceInfo->crossSection());
|
||||
|
||||
menu.addAction(QString("Hide intersection"), this, SLOT(slotHideIntersection()));
|
||||
RiuSelectionItem* selItem = new RiuGeneralSelectionItem(crossSectionSourceInfo->crossSection());
|
||||
RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY);
|
||||
|
||||
menuBuilder << "RicHideIntersectionFeature";
|
||||
}
|
||||
else if (intersectionBoxSourceInfo)
|
||||
{
|
||||
findCellAndGridIndex(intersectionBoxSourceInfo, firstPartTriangleIndex, &m_currentCellIndex, &m_currentGridIdx);
|
||||
m_currentFaceIndex = cvf::StructGridInterface::NO_FACE;
|
||||
|
||||
m_currentPickedObject = const_cast<RimIntersectionBox*>(intersectionBoxSourceInfo->intersectionBox());
|
||||
RiuSelectionItem* selItem = new RiuGeneralSelectionItem(intersectionBoxSourceInfo->intersectionBox());
|
||||
RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY);
|
||||
|
||||
menuBuilder << "RicHideIntersectionBoxFeature";
|
||||
}
|
||||
|
||||
// IJK -slice commands
|
||||
@ -386,24 +390,6 @@ void RiuViewerCommands::slotAddGeoMechPropertyFilter()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewerCommands::slotHideIntersection()
|
||||
{
|
||||
RimIntersection* rimIntersection = dynamic_cast<RimIntersection*>(currentPickedObject());
|
||||
if (rimIntersection)
|
||||
{
|
||||
rimIntersection->isActive = false;
|
||||
rimIntersection->updateConnectedEditors();
|
||||
|
||||
if (m_reservoirView)
|
||||
{
|
||||
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -579,14 +565,6 @@ cvf::Vec3d RiuViewerCommands::lastPickPositionInDomainCoords() const
|
||||
return m_currentPickPositionInDomainCoords;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmObject* RiuViewerCommands::currentPickedObject() const
|
||||
{
|
||||
return m_currentPickedObject;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -59,11 +59,8 @@ public:
|
||||
void handlePickAction(int winPosX, int winPosY, Qt::KeyboardModifiers keyboardModifiers);
|
||||
cvf::Vec3d lastPickPositionInDomainCoords() const;
|
||||
|
||||
caf::PdmObject* currentPickedObject() const;
|
||||
|
||||
private slots:
|
||||
void slotAddGeoMechPropertyFilter();
|
||||
void slotHideIntersection();
|
||||
|
||||
private:
|
||||
void findCellAndGridIndex(const RivIntersectionSourceInfo* crossSectionSourceInfo, cvf::uint firstPartTriangleIndex, size_t* cellIndex, size_t* gridIndex);
|
||||
@ -80,7 +77,6 @@ private:
|
||||
cvf::Vec3d m_currentPickPositionInDomainCoords;
|
||||
|
||||
caf::PdmPointer<RimView> m_reservoirView;
|
||||
caf::PdmPointer<caf::PdmObject> m_currentPickedObject;
|
||||
|
||||
QPointer<RiuViewer> m_viewer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user