mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5019 Add/Delete Separate Intersection Result commands
This commit is contained in:
parent
7aec88de3c
commit
6e99a43247
@ -1,6 +1,7 @@
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicAppendSeparateIntersectionResultFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellIntersectionFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathIntersectionFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineIntersectionFeature.h
|
||||
@ -10,6 +11,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.h
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicAppendSeparateIntersectionResultFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellIntersectionFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathIntersectionFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineIntersectionFeature.cpp
|
||||
|
@ -0,0 +1,119 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// 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 "RicAppendSeparateIntersectionResultFeature.h"
|
||||
|
||||
#include "RimIntersectionResultDefinition.h"
|
||||
#include "RimIntersectionResultsDefinitionCollection.h"
|
||||
#include "RimGridView.h"
|
||||
|
||||
#include "cafCmdExecCommandManager.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicAppendSeparateIntersectionResultFeature, "RicAppendSeparateIntersectionResultFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicAppendSeparateIntersectionResultFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicAppendSeparateIntersectionResultFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
std::vector<caf::PdmObjectHandle*> collection;
|
||||
caf::SelectionManager::instance()->objectsByType( &collection );
|
||||
CVF_ASSERT( collection.size() == 1 );
|
||||
|
||||
RimIntersectionResultsDefinitionCollection* intersectionResCollection = nullptr;
|
||||
collection[0]->firstAncestorOrThisOfType( intersectionResCollection );
|
||||
|
||||
CVF_ASSERT( intersectionResCollection );
|
||||
|
||||
RicAppendSeparateIntersectionResultFeatureCmd* cmd = new RicAppendSeparateIntersectionResultFeatureCmd(
|
||||
intersectionResCollection );
|
||||
caf::CmdExecCommandManager::instance()->processExecuteCommand( cmd );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicAppendSeparateIntersectionResultFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
// actionToSetup->setIcon( QIcon( ":/CrossSection16x16.png" ) );
|
||||
actionToSetup->setText( "New Separate Intersection Result" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicAppendSeparateIntersectionResultFeatureCmd::RicAppendSeparateIntersectionResultFeatureCmd(
|
||||
RimIntersectionResultsDefinitionCollection* intersectionCollection )
|
||||
: CmdExecuteCommand( nullptr )
|
||||
, m_intersectionCollection( intersectionCollection )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicAppendSeparateIntersectionResultFeatureCmd::~RicAppendSeparateIntersectionResultFeatureCmd() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicAppendSeparateIntersectionResultFeatureCmd::name()
|
||||
{
|
||||
return "New Intersection";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicAppendSeparateIntersectionResultFeatureCmd::redo()
|
||||
{
|
||||
CVF_ASSERT( m_intersectionCollection );
|
||||
|
||||
RimIntersectionResultDefinition* intersectionResDef = new RimIntersectionResultDefinition();
|
||||
m_intersectionCollection->appendIntersectionResultDefinition( intersectionResDef );
|
||||
|
||||
m_intersectionCollection->updateConnectedEditors();
|
||||
|
||||
//if ( m_intersectionCollection->intersectionResultsDefinitions().size() < 2 ) // New default created. Possible
|
||||
//{
|
||||
// RimGridView* gridView;
|
||||
// m_intersectionCollection->firstAncestorOrThisOfTypeAsserted( gridView );
|
||||
//
|
||||
// gridView->scheduleCreateDisplayModelAndRedraw();
|
||||
// gridView->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
//}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicAppendSeparateIntersectionResultFeatureCmd::undo() {}
|
@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdExecuteCommand.h"
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
class RimIntersectionResultsDefinitionCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicAppendSeparateIntersectionResultFeatureCmd : public caf::CmdExecuteCommand
|
||||
{
|
||||
public:
|
||||
explicit RicAppendSeparateIntersectionResultFeatureCmd( RimIntersectionResultsDefinitionCollection* intersectionCollection );
|
||||
~RicAppendSeparateIntersectionResultFeatureCmd() override;
|
||||
|
||||
QString name() override;
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimIntersectionResultsDefinitionCollection> m_intersectionCollection;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicAppendSeparateIntersectionResultFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -35,6 +35,7 @@
|
||||
#include "RimFormationNamesCollection.h"
|
||||
#include "RimGeoMechPropertyFilterCollection.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimIntersectionResultsDefinitionCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
@ -101,6 +102,7 @@ void RicDeleteItemExec::redo()
|
||||
|
||||
Rim3dView* view = nullptr;
|
||||
parentObj->firstAncestorOrThisOfType( view );
|
||||
RimGridView* gridView = dynamic_cast<RimGridView*>( view );
|
||||
|
||||
// Range Filters
|
||||
|
||||
@ -144,6 +146,16 @@ void RicDeleteItemExec::redo()
|
||||
}
|
||||
}
|
||||
|
||||
// Intersection Result Definitions
|
||||
|
||||
RimIntersectionResultsDefinitionCollection* separateIntersectResDefColl;
|
||||
parentObj->firstAncestorOrThisOfType( separateIntersectResDefColl );
|
||||
if ( gridView && separateIntersectResDefColl )
|
||||
{
|
||||
gridView->scheduleCreateDisplayModelAndRedraw();
|
||||
gridView->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
}
|
||||
|
||||
// SimWell Fractures
|
||||
RimSimWellInView* simWell;
|
||||
parentObj->firstAncestorOrThisOfType( simWell );
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimIntersection.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionResultDefinition.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimPolylinesAnnotation.h"
|
||||
#include "RimReachCircleAnnotation.h"
|
||||
@ -137,6 +138,8 @@ bool isDeletable( caf::PdmUiItem* uiItem )
|
||||
if ( dynamic_cast<RimTextAnnotation*>( uiItem ) ) return true;
|
||||
if ( dynamic_cast<RimReachCircleAnnotation*>( uiItem ) ) return true;
|
||||
if ( dynamic_cast<RimPolylinesAnnotation*>( uiItem ) ) return true;
|
||||
if ( dynamic_cast<RimIntersectionResultDefinition*>( uiItem ) ) return true;
|
||||
|
||||
if ( dynamic_cast<RimGridCrossPlot*>( uiItem ) )
|
||||
{
|
||||
RimGridPlotWindow* plotWindow = nullptr;
|
||||
|
@ -76,6 +76,8 @@
|
||||
#include "RimIntersection.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimIntersectionResultDefinition.h"
|
||||
#include "RimIntersectionResultsDefinitionCollection.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimObservedSummaryData.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
@ -688,6 +690,11 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder.addSeparator();
|
||||
menuBuilder << "RicCopyIntersectionsToAllViewsInCaseFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimIntersectionResultsDefinitionCollection*>( uiItem ) ||
|
||||
dynamic_cast<RimIntersectionResultDefinition*>( uiItem ) )
|
||||
{
|
||||
menuBuilder << "RicAppendSeparateIntersectionResultFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimSimWellInView*>( uiItem ) )
|
||||
{
|
||||
menuBuilder << "RicNewWellLogCurveExtractionFeature";
|
||||
|
@ -61,6 +61,15 @@ std::vector<RimIntersectionResultDefinition*> RimIntersectionResultsDefinitionCo
|
||||
return m_intersectionResultsDefs.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionResultsDefinitionCollection::appendIntersectionResultDefinition(
|
||||
RimIntersectionResultDefinition* interResDef )
|
||||
{
|
||||
m_intersectionResultsDefs.push_back(interResDef);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -36,6 +36,8 @@ public:
|
||||
|
||||
std::vector<RimIntersectionResultDefinition*> intersectionResultsDefinitions();
|
||||
|
||||
void appendIntersectionResultDefinition( RimIntersectionResultDefinition* interResDef );
|
||||
|
||||
protected:
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
|
Loading…
Reference in New Issue
Block a user