#4857 RicIntersectionBox[XYZ]SliceFeature

This commit is contained in:
Jacob Støren
2019-10-18 10:17:50 +02:00
parent b785969d68
commit 4253c32dac
6 changed files with 174 additions and 78 deletions

View File

@@ -18,6 +18,8 @@
#include "RicIntersectionBoxXSliceFeature.h"
#include "RicIntersectionFeatureImpl.h"
#include "RiaApplication.h"
#include "RimCase.h"
@@ -51,33 +53,32 @@ bool RicIntersectionBoxXSliceFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicIntersectionBoxXSliceFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
if ( activeView )
{
RimIntersectionCollection* coll = activeView->crossSectionCollection();
CVF_ASSERT( coll );
RicIntersectionFeatureImpl::createIntersectionBoxSlize("X-slice (Intersection box)", RimIntersectionBox::PLANE_STATE_X);
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
intersectionBox->name = QString( "X-slice (Intersection box)" );
coll->appendIntersectionBoxAndUpdate( intersectionBox );
cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_X, domainCoord );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
RimGridView* rimView = nullptr;
coll->firstAncestorOrThisOfType( rimView );
if ( rimView )
{
rimView->showGridCells( false );
RiuMainWindow::instance()->refreshDrawStyleActions();
rimView->scheduleCreateDisplayModelAndRedraw();
}
}
// RimGridView* activeView = RiaApplication::instance()->activeGridView();
// RimGridView* activeMainOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
//
// if ( activeMainOrComparisonView )
// {
// RimIntersectionCollection* coll = activeMainOrComparisonView->crossSectionCollection();
// CVF_ASSERT( coll );
//
// RimIntersectionBox* intersectionBox = new RimIntersectionBox();
// intersectionBox->name = QString( "X-slice (Intersection box)" );
//
// coll->appendIntersectionBoxAndUpdate( intersectionBox );
//
// cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
// intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_X, domainCoord );
//
// coll->updateConnectedEditors();
// RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox, false );
//
// activeMainOrComparisonView->showGridCells(false);
// RiuMainWindow::instance()->refreshDrawStyleActions();
//
// activeView->scheduleCreateDisplayModelAndRedraw();
// }
}
//--------------------------------------------------------------------------------------------------