mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Polygon filter updates (#7216)
* Rename polylinefilter to polygonfilter * Update icon name, too * Some GUI adjustments * Remove obsolete code that came back in a merge somewhere. Disable auto-enable polygon filter after picking corner points. * Add option to delete a point in polygon filter point editor by extending generic picker interface * Rename enum, too. * Improved filter naming Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineFilterFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilterFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewUserDefinedFilterFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewCellRangeFilterFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceFeature.h
|
||||
@@ -8,11 +8,11 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceIFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceJFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceKFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSlice3dviewFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineFilter3dviewFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilter3dviewFeature.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineFilterFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilterFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewUserDefinedFilterFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewCellRangeFilterFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceFeature.cpp
|
||||
@@ -20,7 +20,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceIFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceJFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceKFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSlice3dviewFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineFilter3dviewFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilter3dviewFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND COMMAND_CODE_HEADER_FILES
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicNewPolylineFilter3dviewFeature.h"
|
||||
#include "RicNewPolygonFilter3dviewFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimCellFilterCollection.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimPolylineFilter.h"
|
||||
#include "RimPolygonFilter.h"
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
@@ -30,12 +30,12 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicNewPolylineFilter3dviewFeature, "RicNewPolylineFilter3dviewFeature" );
|
||||
CAF_CMD_SOURCE_INIT( RicNewPolygonFilter3dviewFeature, "RicNewPolygonFilter3dviewFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewPolylineFilter3dviewFeature::isCommandEnabled()
|
||||
bool RicNewPolygonFilter3dviewFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ bool RicNewPolylineFilter3dviewFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPolylineFilter3dviewFeature::onActionTriggered( bool isChecked )
|
||||
void RicNewPolygonFilter3dviewFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
// Get the selected Cell Filter Collection
|
||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||
@@ -53,7 +53,7 @@ void RicNewPolylineFilter3dviewFeature::onActionTriggered( bool isChecked )
|
||||
// and the case to use
|
||||
RimCase* sourceCase = viewOrComparisonView->ownerCase();
|
||||
|
||||
RimPolylineFilter* lastCreatedOrUpdated = filtColl->addNewPolylineFilter( sourceCase );
|
||||
RimPolygonFilter* lastCreatedOrUpdated = filtColl->addNewPolygonFilter( sourceCase );
|
||||
if ( lastCreatedOrUpdated )
|
||||
{
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( lastCreatedOrUpdated );
|
||||
@@ -63,8 +63,8 @@ void RicNewPolylineFilter3dviewFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPolylineFilter3dviewFeature::setupActionLook( QAction* actionToSetup )
|
||||
void RicNewPolygonFilter3dviewFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/CellFilter_Polyline.png" ) );
|
||||
actionToSetup->setText( "Polyline Filter" );
|
||||
actionToSetup->setIcon( QIcon( ":/CellFilter_Polygon.png" ) );
|
||||
actionToSetup->setText( "Polygon Filter" );
|
||||
}
|
||||
@@ -23,12 +23,11 @@
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewPolylineFilter3dviewFeature : public caf::CmdFeature
|
||||
class RicNewPolygonFilter3dviewFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
@@ -16,11 +16,11 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicNewPolylineFilterFeature.h"
|
||||
#include "RicNewPolygonFilterFeature.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimCellFilterCollection.h"
|
||||
#include "RimPolylineFilter.h"
|
||||
#include "RimPolygonFilter.h"
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
@@ -28,12 +28,12 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicNewPolylineFilterFeature, "RicNewPolylineFilterFeature" );
|
||||
CAF_CMD_SOURCE_INIT( RicNewPolygonFilterFeature, "RicNewPolygonFilterFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewPolylineFilterFeature::isCommandEnabled()
|
||||
bool RicNewPolygonFilterFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ bool RicNewPolylineFilterFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPolylineFilterFeature::onActionTriggered( bool isChecked )
|
||||
void RicNewPolygonFilterFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
// Find the selected Cell Filter Collection
|
||||
std::vector<RimCellFilterCollection*> colls = caf::selectedObjectsByTypeStrict<RimCellFilterCollection*>();
|
||||
@@ -52,7 +52,7 @@ void RicNewPolylineFilterFeature::onActionTriggered( bool isChecked )
|
||||
RimCase* sourceCase = nullptr;
|
||||
filtColl->firstAncestorOrThisOfTypeAsserted( sourceCase );
|
||||
|
||||
RimPolylineFilter* lastCreatedOrUpdated = filtColl->addNewPolylineFilter( sourceCase );
|
||||
RimPolygonFilter* lastCreatedOrUpdated = filtColl->addNewPolygonFilter( sourceCase );
|
||||
if ( lastCreatedOrUpdated )
|
||||
{
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( lastCreatedOrUpdated );
|
||||
@@ -62,8 +62,8 @@ void RicNewPolylineFilterFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPolylineFilterFeature::setupActionLook( QAction* actionToSetup )
|
||||
void RicNewPolygonFilterFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setIcon( QIcon( ":/CellFilter_Polyline.png" ) );
|
||||
actionToSetup->setText( "New Polyline Filter" );
|
||||
actionToSetup->setIcon( QIcon( ":/CellFilter_Polygon.png" ) );
|
||||
actionToSetup->setText( "New Polygon Filter" );
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewPolylineFilterFeature : public caf::CmdFeature
|
||||
class RicNewPolygonFilterFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2020- Equinor ASA
|
||||
// Copyright (C) 2020 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2020- Equinor ASA
|
||||
// Copyright (C) 2020 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
|
||||
@@ -29,7 +29,6 @@ protected:
|
||||
RicNewRangeFilterSliceFeature( QString cmdText, int sliceDirection );
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- Equinor ASA
|
||||
// Copyright (C) 2020 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
|
||||
@@ -15,15 +15,18 @@
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicDeletePolylineTargetFeature.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicDeletePolylineTargetFeature, "RicDeletePolylineTargetFeature" );
|
||||
|
||||
#include "RimPolylinePickerInterface.h"
|
||||
#include "RimPolylineTarget.h"
|
||||
#include "RimUserDefinedPolylinesAnnotation.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicDeletePolylineTargetFeature, "RicDeletePolylineTargetFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -50,7 +53,7 @@ void RicDeletePolylineTargetFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
if ( !targets.empty() )
|
||||
{
|
||||
RimUserDefinedPolylinesAnnotation* polylineDef = nullptr;
|
||||
RimPolylinePickerInterface* polylineDef = nullptr;
|
||||
targets[0]->firstAncestorOrThisOfTypeAsserted( polylineDef );
|
||||
|
||||
for ( auto target : targets )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- Equinor ASA
|
||||
// Copyright (C) 2020 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
|
||||
@@ -28,7 +28,6 @@ class RicDeletePolylineTargetFeature : public caf::CmdFeature
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
Reference in New Issue
Block a user