mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4857 RicIntersectionBox[XYZ]SliceFeature
This commit is contained in:
parent
b785969d68
commit
4253c32dac
@ -1,5 +1,6 @@
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionBoxFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.h
|
||||
@ -9,6 +10,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionBoxFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.cpp
|
||||
|
@ -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();
|
||||
// }
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#include "RicIntersectionBoxYSliceFeature.h"
|
||||
|
||||
#include "RicIntersectionFeatureImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
@ -51,33 +53,35 @@ bool RicIntersectionBoxYSliceFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionBoxYSliceFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
if ( activeView )
|
||||
{
|
||||
RimIntersectionCollection* coll = activeView->crossSectionCollection();
|
||||
CVF_ASSERT( coll );
|
||||
RicIntersectionFeatureImpl::createIntersectionBoxSlize("Y-slice (Intersection box)", RimIntersectionBox::PLANE_STATE_Y);
|
||||
|
||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
intersectionBox->name = QString( "Y-slice (Intersection box)" );
|
||||
|
||||
coll->appendIntersectionBoxAndUpdate( intersectionBox );
|
||||
|
||||
cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
|
||||
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_Y, 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();
|
||||
//if ( activeView )
|
||||
//{
|
||||
// RimIntersectionCollection* coll = activeView->crossSectionCollection();
|
||||
// CVF_ASSERT( coll );
|
||||
//
|
||||
// RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
// intersectionBox->name = QString( "Y-slice (Intersection box)" );
|
||||
//
|
||||
// coll->appendIntersectionBoxAndUpdate( intersectionBox );
|
||||
//
|
||||
// cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
|
||||
// intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_Y, domainCoord );
|
||||
//
|
||||
// coll->updateConnectedEditors();
|
||||
// RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
|
||||
//
|
||||
// RimGridView* rimView = nullptr;
|
||||
// coll->firstAncestorOrThisOfType( rimView );
|
||||
// if ( rimView )
|
||||
// {
|
||||
// rimView->showGridCells( false );
|
||||
// RiuMainWindow::instance()->refreshDrawStyleActions();
|
||||
//
|
||||
// rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#include "RicIntersectionBoxZSliceFeature.h"
|
||||
|
||||
#include "RicIntersectionFeatureImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
@ -51,33 +53,35 @@ bool RicIntersectionBoxZSliceFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionBoxZSliceFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
if ( activeView )
|
||||
{
|
||||
RimIntersectionCollection* coll = activeView->crossSectionCollection();
|
||||
CVF_ASSERT( coll );
|
||||
RicIntersectionFeatureImpl::createIntersectionBoxSlize("Z-slice (Intersection box)", RimIntersectionBox::PLANE_STATE_Z);
|
||||
|
||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
intersectionBox->name = QString( "Z-slice (Intersection box)" );
|
||||
|
||||
coll->appendIntersectionBoxAndUpdate( intersectionBox );
|
||||
cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
|
||||
|
||||
intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_Z, 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();
|
||||
// if ( activeView )
|
||||
// {
|
||||
// RimIntersectionCollection* coll = activeView->crossSectionCollection();
|
||||
// CVF_ASSERT( coll );
|
||||
//
|
||||
// RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
// intersectionBox->name = QString( "Z-slice (Intersection box)" );
|
||||
//
|
||||
// coll->appendIntersectionBoxAndUpdate( intersectionBox );
|
||||
// cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
|
||||
//
|
||||
// intersectionBox->setToDefaultSizeSlice( RimIntersectionBox::PLANE_STATE_Z, domainCoord );
|
||||
//
|
||||
// coll->updateConnectedEditors();
|
||||
// RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox );
|
||||
//
|
||||
// RimGridView* rimView = nullptr;
|
||||
// coll->firstAncestorOrThisOfType( rimView );
|
||||
// if ( rimView )
|
||||
// {
|
||||
// rimView->showGridCells( false );
|
||||
// RiuMainWindow::instance()->refreshDrawStyleActions();
|
||||
//
|
||||
// rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -0,0 +1,59 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RicIntersectionFeatureImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimGridView.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuViewer.h"
|
||||
#include "RiuViewerCommands.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicIntersectionFeatureImpl::createIntersectionBoxSlize(const QString& name, RimIntersectionBox::SinglePlaneState plane)
|
||||
{
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
RimGridView* activeMainOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView();
|
||||
|
||||
if ( activeMainOrComparisonView )
|
||||
{
|
||||
RimIntersectionCollection* coll = activeMainOrComparisonView->crossSectionCollection();
|
||||
CVF_ASSERT( coll );
|
||||
|
||||
cvf::Vec3d domainCoord = activeView->viewer()->viewerCommands()->lastPickPositionInDomainCoords();
|
||||
|
||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
intersectionBox->name = name;
|
||||
|
||||
coll->appendIntersectionBoxNoUpdate( intersectionBox );
|
||||
intersectionBox->setToDefaultSizeSlice( plane, domainCoord );
|
||||
coll->updateConnectedEditors();
|
||||
|
||||
activeMainOrComparisonView->showGridCells(false);
|
||||
activeMainOrComparisonView->scheduleCreateDisplayModelAndRedraw();
|
||||
activeView->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( intersectionBox, false );
|
||||
RiuMainWindow::instance()->refreshDrawStyleActions();
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimIntersectionBox.h"
|
||||
|
||||
class QString;
|
||||
|
||||
class RicIntersectionFeatureImpl
|
||||
{
|
||||
public :
|
||||
static void createIntersectionBoxSlize(const QString& name, RimIntersectionBox::SinglePlaneState plane );
|
||||
};
|
Loading…
Reference in New Issue
Block a user