(#884) Added prototype of event handler for interaction with box

This commit is contained in:
Magne Sjaastad
2016-09-27 11:59:06 +02:00
parent fa6a6b4f08
commit d4bdbcb7c8
19 changed files with 1387 additions and 5 deletions

View File

@@ -47,6 +47,7 @@
#include "RimGeoMechCase.h"
#include "RimGeoMechCellColors.h"
#include "RimGeoMechView.h"
#include "RimIntersectionBox.h"
#include "RimLegendConfig.h"
#include "RimTernaryLegendConfig.h"
#include "RimViewController.h"
@@ -133,6 +134,7 @@ 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();
@@ -195,7 +197,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
{
findCellAndGridIndex(crossSectionSourceInfo, firstPartTriangleIndex, &m_currentCellIndex, &m_currentGridIdx);
m_currentFaceIndex = cvf::StructGridInterface::NO_FACE;
m_currentCrossSection = const_cast<RimIntersection*>(crossSectionSourceInfo->crossSection());
m_currentPickedObject = const_cast<RimIntersection*>(crossSectionSourceInfo->crossSection());
menu.addAction(QString("Hide intersection"), this, SLOT(slotHideIntersection()));
}
@@ -203,6 +205,16 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
{
findCellAndGridIndex(intersectionBoxSourceInfo, firstPartTriangleIndex, &m_currentCellIndex, &m_currentGridIdx);
m_currentFaceIndex = cvf::StructGridInterface::NO_FACE;
m_currentPickedObject = const_cast<RimIntersectionBox*>(intersectionBoxSourceInfo->intersectionBox());
menu.addAction(caf::CmdFeatureManager::instance()->action("RicEditIntersectionBoxFeature"));
menu.addAction(caf::CmdFeatureManager::instance()->action("RicEditIntersectionBoxEventFeature"));
menu.addSeparator();
QStringList commandIdList;
commandIdList << "RicEditIntersectionBoxFeature";
commandIdList << "RicEditIntersectionBoxEventFeature";
caf::CmdFeatureManager::instance()->refreshCheckedState(commandIdList);
}
// IJK -slice commands
@@ -442,10 +454,11 @@ void RiuViewerCommands::slotAddGeoMechPropertyFilter()
//--------------------------------------------------------------------------------------------------
void RiuViewerCommands::slotHideIntersection()
{
if (m_currentCrossSection)
RimIntersection* rimIntersection = dynamic_cast<RimIntersection*>(currentPickedObject());
if (rimIntersection)
{
m_currentCrossSection->isActive = false;
m_currentCrossSection->updateConnectedEditors();
rimIntersection->isActive = false;
rimIntersection->updateConnectedEditors();
if (m_reservoirView)
{
@@ -591,6 +604,14 @@ cvf::Vec3d RiuViewerCommands::lastPickPositionInDomainCoords() const
return m_currentPickPositionInDomainCoords;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObject* RiuViewerCommands::currentPickedObject() const
{
return m_currentPickedObject;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------