mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#902 Create box at position - context command
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
#include "RiaApplication.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicAppendIntersectionBoxFeature, "RicAppendIntersectionBoxFeature");
|
||||
|
||||
@@ -38,10 +40,10 @@ CAF_CMD_SOURCE_INIT(RicAppendIntersectionBoxFeature, "RicAppendIntersectionBoxFe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicAppendIntersectionBoxFeature::isCommandEnabled()
|
||||
{
|
||||
RimIntersectionCollection* coll = RicAppendIntersectionBoxFeature::intersectionCollection();
|
||||
if (coll) return true;
|
||||
//RimIntersectionCollection* coll = RicAppendIntersectionBoxFeature::intersectionCollection();
|
||||
//if (coll) return true;
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -58,7 +60,16 @@ void RicAppendIntersectionBoxFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
coll->appendIntersectionBox(intersectionBox);
|
||||
|
||||
intersectionBox->setToDefaultSizeBox();
|
||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
if(activeView)
|
||||
{
|
||||
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
|
||||
intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_NONE, domainCoord);
|
||||
}
|
||||
else
|
||||
{
|
||||
intersectionBox->setToDefaultSizeBox();
|
||||
}
|
||||
|
||||
coll->updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox);
|
||||
|
||||
@@ -218,6 +218,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
|
||||
menu.addSeparator();
|
||||
|
||||
menu.addAction(caf::CmdFeatureManager::instance()->action("RicAppendIntersectionBoxFeature"));
|
||||
menu.addAction(caf::CmdFeatureManager::instance()->action("RicIntersectionBoxXSliceFeature"));
|
||||
menu.addAction(caf::CmdFeatureManager::instance()->action("RicIntersectionBoxYSliceFeature"));
|
||||
menu.addAction(caf::CmdFeatureManager::instance()->action("RicIntersectionBoxZSliceFeature"));
|
||||
|
||||
Reference in New Issue
Block a user