mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add open plot editor to menus
- Add to summary plot node in project tree - Add to empty space in plot window (mdi area)
This commit is contained in:
parent
a6ee41aaee
commit
88ebf857ff
@ -48,6 +48,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryPlotCtxFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryPlotCtxFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicToggleYAxisLinkingFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicToggleYAxisLinkingFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicToggleXAxisLinkingFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicToggleXAxisLinkingFeature.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicOpenSummaryPlotEditorFromMdiAreaFeature.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SOURCE_GROUP_SOURCE_FILES
|
set(SOURCE_GROUP_SOURCE_FILES
|
||||||
@ -100,6 +101,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryPlotCtxFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryPlotCtxFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicToggleYAxisLinkingFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicToggleYAxisLinkingFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicToggleXAxisLinkingFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicToggleXAxisLinkingFeature.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicOpenSummaryPlotEditorFromMdiAreaFeature.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "RimSummaryCaseCollection.h"
|
#include "RimSummaryCaseCollection.h"
|
||||||
#include "RimSummaryCaseMainCollection.h"
|
#include "RimSummaryCaseMainCollection.h"
|
||||||
#include "RimSummaryMultiPlot.h"
|
#include "RimSummaryMultiPlot.h"
|
||||||
|
#include "RimSummaryMultiPlotCollection.h"
|
||||||
#include "RimSummaryPlot.h"
|
#include "RimSummaryPlot.h"
|
||||||
|
|
||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
@ -61,6 +62,10 @@ bool RicOpenSummaryPlotEditorFeature::isCommandEnabled()
|
|||||||
std::vector<RimSummaryCaseCollection*> selectedGroups = caf::selectedObjectsByType<RimSummaryCaseCollection*>();
|
std::vector<RimSummaryCaseCollection*> selectedGroups = caf::selectedObjectsByType<RimSummaryCaseCollection*>();
|
||||||
if ( selectedGroups.size() > 0 ) return true;
|
if ( selectedGroups.size() > 0 ) return true;
|
||||||
|
|
||||||
|
std::vector<RimSummaryMultiPlotCollection*> selectedPlotCollections =
|
||||||
|
caf::selectedObjectsByType<RimSummaryMultiPlotCollection*>();
|
||||||
|
if ( selectedPlotCollections.size() > 0 ) return true;
|
||||||
|
|
||||||
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>( caf::SelectionManager::instance()->selectedItem() );
|
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>( caf::SelectionManager::instance()->selectedItem() );
|
||||||
if ( !selObj ) return false;
|
if ( !selObj ) return false;
|
||||||
|
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2023- 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 "RicOpenSummaryPlotEditorFromMdiAreaFeature.h"
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT( RicOpenSummaryPlotEditorFromMdiAreaFeature, "RicOpenSummaryPlotEditorFromMdiAreaFeature" );
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicOpenSummaryPlotEditorFromMdiAreaFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2023- 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 "RicOpenSummaryPlotEditorFeature.h"
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicOpenSummaryPlotEditorFromMdiAreaFeature : public RicOpenSummaryPlotEditorFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool isCommandEnabled() override;
|
||||||
|
};
|
@ -95,6 +95,7 @@ RiuPlotMainWindow::RiuPlotMainWindow()
|
|||||||
|
|
||||||
caf::CmdFeatureMenuBuilder menuForMdiArea;
|
caf::CmdFeatureMenuBuilder menuForMdiArea;
|
||||||
menuForMdiArea << "RicNewEmptySummaryMultiPlotFeature";
|
menuForMdiArea << "RicNewEmptySummaryMultiPlotFeature";
|
||||||
|
menuForMdiArea << "RicOpenSummaryPlotEditorFromMdiAreaFeature";
|
||||||
new RiuContextMenuLauncher( m_mdiArea, menuForMdiArea );
|
new RiuContextMenuLauncher( m_mdiArea, menuForMdiArea );
|
||||||
|
|
||||||
ads::CDockWidget* cWidget =
|
ads::CDockWidget* cWidget =
|
||||||
|
Loading…
Reference in New Issue
Block a user