2015-11-18 02:35:38 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// 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 "RimContextCommandBuilder.h"
|
|
|
|
|
|
|
|
#include "RimCalcScript.h"
|
|
|
|
#include "RimCaseCollection.h"
|
|
|
|
#include "RimCellRangeFilter.h"
|
|
|
|
#include "RimCellRangeFilterCollection.h"
|
|
|
|
#include "RimEclipseCase.h"
|
|
|
|
#include "RimEclipseCaseCollection.h"
|
|
|
|
#include "RimEclipseCellColors.h"
|
|
|
|
#include "RimEclipseInputProperty.h"
|
|
|
|
#include "RimEclipseInputPropertyCollection.h"
|
|
|
|
#include "RimEclipsePropertyFilter.h"
|
|
|
|
#include "RimEclipsePropertyFilterCollection.h"
|
|
|
|
#include "RimEclipseStatisticsCase.h"
|
|
|
|
#include "RimEclipseView.h"
|
2017-10-13 08:01:52 -05:00
|
|
|
#include "RimFaultInView.h"
|
2017-09-19 07:19:39 -05:00
|
|
|
#include "RimFlowCharacteristicsPlot.h"
|
2017-03-28 16:35:53 -05:00
|
|
|
#include "RimFlowDiagSolution.h"
|
2017-03-29 02:28:14 -05:00
|
|
|
#include "RimFlowPlotCollection.h"
|
2016-08-24 01:30:12 -05:00
|
|
|
#include "RimFormationNames.h"
|
|
|
|
#include "RimFormationNamesCollection.h"
|
2015-11-18 02:35:38 -06:00
|
|
|
#include "RimGeoMechCase.h"
|
|
|
|
#include "RimGeoMechPropertyFilter.h"
|
|
|
|
#include "RimGeoMechPropertyFilterCollection.h"
|
|
|
|
#include "RimGeoMechView.h"
|
|
|
|
#include "RimIdenticalGridCaseGroup.h"
|
2017-01-02 04:59:30 -06:00
|
|
|
#include "RimIntersection.h"
|
2016-09-20 05:03:26 -05:00
|
|
|
#include "RimIntersectionBox.h"
|
2017-01-02 04:59:30 -06:00
|
|
|
#include "RimIntersectionCollection.h"
|
2017-09-19 07:19:39 -05:00
|
|
|
#include "RimObservedData.h"
|
2017-01-02 04:59:30 -06:00
|
|
|
#include "RimScriptCollection.h"
|
2017-10-13 02:29:42 -05:00
|
|
|
#include "RimSimWellInView.h"
|
2017-10-13 07:20:47 -05:00
|
|
|
#include "RimSimWellInViewCollection.h"
|
2016-07-01 02:20:20 -05:00
|
|
|
#include "RimSummaryCase.h"
|
2016-05-25 06:15:17 -05:00
|
|
|
#include "RimSummaryCurve.h"
|
2017-10-02 06:03:45 -05:00
|
|
|
#include "RimSummaryCurveCollection.h"
|
2016-08-03 02:54:05 -05:00
|
|
|
#include "RimSummaryCurveFilter.h"
|
2016-07-01 02:20:20 -05:00
|
|
|
#include "RimSummaryPlot.h"
|
|
|
|
#include "RimSummaryPlotCollection.h"
|
2015-11-18 02:35:38 -06:00
|
|
|
#include "RimViewController.h"
|
|
|
|
#include "RimViewLinker.h"
|
2017-02-02 05:32:01 -06:00
|
|
|
#include "RimWellAllocationPlot.h"
|
2015-11-18 02:35:38 -06:00
|
|
|
#include "RimWellLogCurve.h"
|
|
|
|
#include "RimWellLogFileChannel.h"
|
|
|
|
#include "RimWellLogPlot.h"
|
|
|
|
#include "RimWellLogPlotCollection.h"
|
|
|
|
#include "RimWellLogTrack.h"
|
|
|
|
#include "RimWellPath.h"
|
|
|
|
#include "RimWellPathCollection.h"
|
2017-09-29 04:24:18 -05:00
|
|
|
#include "RimWellRftPlot.h"
|
2017-08-21 13:44:28 -05:00
|
|
|
|
|
|
|
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
|
|
|
#include "RimEllipseFractureTemplate.h"
|
|
|
|
#include "RimStimPlanFractureTemplate.h"
|
|
|
|
#include "RimFractureTemplateCollection.h"
|
|
|
|
#include "RimFractureTemplate.h"
|
|
|
|
#include "RimSimWellFracture.h"
|
2017-01-02 04:59:30 -06:00
|
|
|
#include "RimWellPathFracture.h"
|
|
|
|
#include "RimWellPathFractureCollection.h"
|
2017-08-21 13:44:28 -05:00
|
|
|
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
2016-12-19 03:30:14 -06:00
|
|
|
|
2015-11-18 02:35:38 -06:00
|
|
|
#include "ToggleCommands/RicToggleItemsFeatureImpl.h"
|
|
|
|
|
2017-01-02 04:59:30 -06:00
|
|
|
#include "cafCmdFeature.h"
|
|
|
|
#include "cafCmdFeatureManager.h"
|
2015-11-18 02:35:38 -06:00
|
|
|
#include "cafPdmUiItem.h"
|
|
|
|
#include "cafSelectionManager.h"
|
|
|
|
|
2017-01-02 04:59:30 -06:00
|
|
|
#include "cvfAssert.h"
|
2015-11-19 11:57:32 -06:00
|
|
|
|
2015-11-18 02:35:38 -06:00
|
|
|
#include <vector>
|
2015-11-19 11:57:32 -06:00
|
|
|
#include <QMenu>
|
2017-10-05 09:25:04 -05:00
|
|
|
#include "RimRftPlotCollection.h"
|
2015-11-19 11:57:32 -06:00
|
|
|
|
2015-11-18 02:35:38 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QStringList RimContextCommandBuilder::commandsFromSelection()
|
|
|
|
{
|
|
|
|
QStringList commandIds;
|
|
|
|
|
|
|
|
std::vector<caf::PdmUiItem*> uiItems;
|
|
|
|
caf::SelectionManager::instance()->selectedItems(uiItems);
|
|
|
|
|
2017-06-16 08:46:22 -05:00
|
|
|
if (uiItems.size() == 1)
|
2015-11-18 02:35:38 -06:00
|
|
|
{
|
|
|
|
caf::PdmUiItem* uiItem = uiItems[0];
|
|
|
|
CVF_ASSERT(uiItem);
|
|
|
|
|
|
|
|
if (dynamic_cast<RimEclipseCaseCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicImportEclipseCaseFeature";
|
|
|
|
commandIds << "RicImportInputEclipseCaseFeature";
|
|
|
|
commandIds << "RicCreateGridCaseGroupFeature";
|
|
|
|
commandIds << "RicEclipseCaseNewGroupFeature";
|
2017-08-30 01:54:59 -05:00
|
|
|
commandIds << "RicCalculateNumberOfFloodedPoreVolumes";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimGeoMechView*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicPasteGeoMechViewsFeature";
|
|
|
|
commandIds << "Separator";
|
2016-11-17 10:46:36 -06:00
|
|
|
|
|
|
|
commandIds << "RicNewViewFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "RicCopyReferencesToClipboardFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimEclipseView*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicPasteEclipseViewsFeature";
|
|
|
|
commandIds << "Separator";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "RicNewViewFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "RicCopyReferencesToClipboardFeature";
|
2017-08-29 07:29:45 -05:00
|
|
|
commandIds << "RicSaveEclipseInputVisibleCellsFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimCaseCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicPasteEclipseCasesFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicNewStatisticsCaseFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimEclipseStatisticsCase*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicNewViewFeature";
|
|
|
|
commandIds << "RicComputeStatisticsFeature";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimEclipseCase*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicPasteEclipseCasesFeature";
|
|
|
|
commandIds << "RicPasteEclipseViewsFeature";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
|
|
|
|
commandIds << "RicNewViewFeature";
|
2017-03-28 16:35:53 -05:00
|
|
|
commandIds << "RicShowFlowCharacteristicsPlotFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicEclipseCaseNewGroupFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "RicCopyReferencesToClipboardFeature";
|
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimGeoMechCase*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicPasteGeoMechViewsFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicNewViewFeature";
|
|
|
|
commandIds << "Separator";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimIdenticalGridCaseGroup*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicPasteEclipseCasesFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicEclipseCaseNewGroupFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimEclipseCellColors*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicSaveEclipseResultAsInputPropertyFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimEclipseInputPropertyCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicAddEclipseInputPropertyFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimEclipseInputProperty*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicSaveEclipseInputPropertyFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimCellRangeFilterCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicRangeFilterNewFeature";
|
|
|
|
commandIds << "RicRangeFilterNewSliceIFeature";
|
|
|
|
commandIds << "RicRangeFilterNewSliceJFeature";
|
|
|
|
commandIds << "RicRangeFilterNewSliceKFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimCellRangeFilter*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicRangeFilterInsertFeature";
|
|
|
|
commandIds << "RicRangeFilterNewSliceIFeature";
|
|
|
|
commandIds << "RicRangeFilterNewSliceJFeature";
|
|
|
|
commandIds << "RicRangeFilterNewSliceKFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimEclipsePropertyFilterCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicEclipsePropertyFilterNewFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimEclipsePropertyFilter*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicEclipsePropertyFilterInsertFeature";
|
2017-02-21 08:25:36 -06:00
|
|
|
commandIds << "RicApplyPropertyFilterAsCellResultFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimGeoMechPropertyFilterCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicGeoMechPropertyFilterNewFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimGeoMechPropertyFilter*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicGeoMechPropertyFilterInsertFeature";
|
2017-02-21 08:37:56 -06:00
|
|
|
commandIds << "RicApplyPropertyFilterAsCellResultFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimWellPathCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicWellPathsImportFileFeature";
|
|
|
|
commandIds << "RicWellPathsImportSsihubFeature";
|
|
|
|
commandIds << "RicWellLogsImportFileFeature";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimWellPath*>(uiItem))
|
|
|
|
{
|
2017-09-29 04:24:18 -05:00
|
|
|
commandIds << "RicNewRftPlotFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicNewWellLogFileCurveFeature";
|
|
|
|
commandIds << "RicNewWellLogCurveExtractionFeature";
|
2016-09-21 04:38:37 -05:00
|
|
|
commandIds << "RicNewWellPathIntersectionFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
2017-09-29 04:24:18 -05:00
|
|
|
else if (dynamic_cast<RimWellRftPlot*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicDeleteRftPlotFeature";
|
|
|
|
}
|
2015-11-18 02:35:38 -06:00
|
|
|
else if (dynamic_cast<RimCalcScript*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicEditScriptFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicNewScriptFeature";
|
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicExecuteScriptFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimScriptCollection*>(uiItem))
|
|
|
|
{
|
2016-07-18 08:36:53 -05:00
|
|
|
commandIds << "RicNewScriptFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "RicAddScriptPathFeature";
|
2016-07-18 08:01:14 -05:00
|
|
|
commandIds << "RicRefreshScriptsFeature";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicDeleteScriptPathFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimViewController*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicShowAllLinkedViewsFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimViewLinker*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicShowAllLinkedViewsFeature";
|
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicDeleteAllLinkedViewsFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimWellLogPlotCollection*>(uiItem))
|
|
|
|
{
|
2016-11-22 02:31:48 -06:00
|
|
|
commandIds << "RicPasteWellLogPlotFeature";
|
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicNewWellLogPlotFeature";
|
|
|
|
}
|
2017-10-05 09:25:04 -05:00
|
|
|
else if (dynamic_cast<RimRftPlotCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicNewRftPlotFeature";
|
|
|
|
}
|
2016-05-25 06:15:17 -05:00
|
|
|
else if (dynamic_cast<RimSummaryPlotCollection*>(uiItem))
|
|
|
|
{
|
2016-11-05 08:17:46 -05:00
|
|
|
commandIds << "RicPasteSummaryPlotFeature";
|
2017-08-21 04:18:21 -05:00
|
|
|
commandIds << "RicPasteAsciiDataToSummaryPlotFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicNewSummaryPlotFeature";
|
2016-05-25 06:15:17 -05:00
|
|
|
}
|
2015-11-18 02:35:38 -06:00
|
|
|
else if (dynamic_cast<RimWellLogPlot*>(uiItem))
|
|
|
|
{
|
2016-11-22 02:31:48 -06:00
|
|
|
commandIds << "RicPasteWellLogPlotFeature";
|
2016-11-22 02:11:25 -06:00
|
|
|
commandIds << "RicPasteWellLogTrackFeature";
|
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicNewWellLogPlotTrackFeature";
|
2017-03-09 07:27:41 -06:00
|
|
|
commandIds << "RicAsciiExportWellLogPlotFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimWellLogTrack*>(uiItem))
|
|
|
|
{
|
2016-11-22 02:11:25 -06:00
|
|
|
commandIds << "RicPasteWellLogTrackFeature";
|
2016-11-22 01:48:11 -06:00
|
|
|
commandIds << "RicPasteWellLogCurveFeature";
|
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicNewWellLogCurveExtractionFeature";
|
2017-10-06 08:15:37 -05:00
|
|
|
commandIds << "RicNewWellLogRftCurveFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicNewWellLogFileCurveFeature";
|
2016-08-03 02:54:05 -05:00
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicDeleteWellLogPlotTrackFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimWellLogCurve*>(uiItem))
|
|
|
|
{
|
2016-11-22 01:48:11 -06:00
|
|
|
commandIds << "RicPasteWellLogCurveFeature";
|
2016-05-25 06:15:17 -05:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimSummaryPlot*>(uiItem))
|
|
|
|
{
|
2016-11-06 11:55:05 -06:00
|
|
|
commandIds << "RicPasteSummaryCurveFeature";
|
|
|
|
commandIds << "RicPasteSummaryCurveFilterFeature";
|
2016-11-06 12:09:15 -06:00
|
|
|
commandIds << "RicPasteSummaryPlotFeature";
|
2017-08-21 04:18:21 -05:00
|
|
|
commandIds << "RicPasteAsciiDataToSummaryPlotFeature";
|
2016-11-06 11:55:05 -06:00
|
|
|
commandIds << "Separator";
|
2017-09-21 03:47:55 -05:00
|
|
|
commandIds << "RicEditSummaryPlotFeature";
|
2017-10-12 00:30:37 -05:00
|
|
|
commandIds << "RicShowSummaryCurveCalculatorFeature";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "RicNewSummaryPlotFeature";
|
2016-08-03 02:54:05 -05:00
|
|
|
commandIds << "RicNewSummaryCurveFeature";
|
2017-03-07 06:48:17 -06:00
|
|
|
commandIds << "RicAsciiExportSummaryPlotFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2016-11-06 11:55:05 -06:00
|
|
|
commandIds << "RicCopyReferencesToClipboardFeature";
|
2016-08-03 02:54:05 -05:00
|
|
|
commandIds << "Separator";
|
2016-07-05 03:47:03 -05:00
|
|
|
commandIds << "RicViewZoomAllFeature";
|
2016-05-25 06:15:17 -05:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimSummaryCurve*>(uiItem))
|
|
|
|
{
|
2016-11-06 11:55:05 -06:00
|
|
|
commandIds << "RicPasteSummaryCurveFeature";
|
|
|
|
commandIds << "Separator";
|
2016-08-03 02:54:05 -05:00
|
|
|
commandIds << "RicNewSummaryCurveFilterFeature";
|
|
|
|
commandIds << "RicNewSummaryCurveFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2016-11-06 01:30:58 -06:00
|
|
|
commandIds << "RicCopyReferencesToClipboardFeature";
|
2016-08-03 02:54:05 -05:00
|
|
|
}
|
2017-10-02 06:03:45 -05:00
|
|
|
else if (dynamic_cast<RimSummaryCurveCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicEditSummaryPlotFeature";
|
|
|
|
}
|
2016-08-03 02:54:05 -05:00
|
|
|
else if(dynamic_cast<RimSummaryCurveFilter*>(uiItem))
|
|
|
|
{
|
2016-11-06 11:55:05 -06:00
|
|
|
commandIds << "RicPasteSummaryCurveFilterFeature";
|
|
|
|
commandIds << "Separator";
|
2016-08-03 02:54:05 -05:00
|
|
|
commandIds << "RicNewSummaryCurveFilterFeature";
|
|
|
|
commandIds << "RicNewSummaryCurveFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2016-11-06 11:55:05 -06:00
|
|
|
commandIds << "RicCopyReferencesToClipboardFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
2016-07-01 02:20:20 -05:00
|
|
|
else if (dynamic_cast<RimSummaryCase*>(uiItem))
|
|
|
|
{
|
2017-09-19 07:19:39 -05:00
|
|
|
if (!dynamic_cast<RimObservedData*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicNewSummaryPlotFeature";
|
|
|
|
}
|
2016-07-01 02:20:20 -05:00
|
|
|
}
|
2015-11-18 02:35:38 -06:00
|
|
|
else if (dynamic_cast<RimWellLogFileChannel*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicAddWellLogToPlotFeature";
|
|
|
|
}
|
2016-09-21 03:52:16 -05:00
|
|
|
else if (dynamic_cast<RimIntersectionCollection*>(uiItem))
|
2015-11-18 03:06:42 -06:00
|
|
|
{
|
2016-09-21 04:09:37 -05:00
|
|
|
commandIds << "RicAppendIntersectionFeature";
|
2016-09-30 01:40:46 -05:00
|
|
|
commandIds << "RicAppendIntersectionBoxFeature";
|
2015-11-18 03:06:42 -06:00
|
|
|
}
|
2016-09-21 03:48:25 -05:00
|
|
|
else if (dynamic_cast<RimIntersection*>(uiItem))
|
2015-11-18 03:06:42 -06:00
|
|
|
{
|
2016-09-21 04:09:37 -05:00
|
|
|
commandIds << "RicAppendIntersectionFeature";
|
2016-09-30 01:40:46 -05:00
|
|
|
commandIds << "RicAppendIntersectionBoxFeature";
|
2015-11-18 03:06:42 -06:00
|
|
|
}
|
2016-09-20 05:03:26 -05:00
|
|
|
else if (dynamic_cast<RimIntersectionBox*>(uiItem))
|
|
|
|
{
|
2016-09-30 01:40:46 -05:00
|
|
|
commandIds << "RicAppendIntersectionFeature";
|
2016-09-20 05:03:26 -05:00
|
|
|
commandIds << "RicAppendIntersectionBoxFeature";
|
2015-11-18 03:06:42 -06:00
|
|
|
}
|
2017-10-13 02:29:42 -05:00
|
|
|
else if (dynamic_cast<RimSimWellInView*>(uiItem))
|
2015-11-18 08:09:50 -06:00
|
|
|
{
|
2017-05-02 00:43:42 -05:00
|
|
|
commandIds << "RicNewWellLogCurveExtractionFeature";
|
2017-10-09 05:03:18 -05:00
|
|
|
commandIds << "RicNewWellLogRftCurveFeature";
|
2016-09-21 04:44:28 -05:00
|
|
|
commandIds << "RicNewSimWellIntersectionFeature";
|
2017-10-17 04:02:44 -05:00
|
|
|
commandIds << "RicNewRftPlotFeature";
|
2017-02-28 08:46:08 -06:00
|
|
|
commandIds << "RicShowWellAllocationPlotFeature";
|
2015-11-18 08:09:50 -06:00
|
|
|
}
|
2016-08-24 01:30:12 -05:00
|
|
|
else if(dynamic_cast<RimFormationNames*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicImportFormationNamesFeature";
|
2016-08-26 09:12:55 -05:00
|
|
|
commandIds << "RicReloadFormationNamesFeature";
|
2016-08-24 01:30:12 -05:00
|
|
|
}
|
|
|
|
else if(dynamic_cast<RimFormationNamesCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicImportFormationNamesFeature";
|
2016-11-18 04:41:20 -06:00
|
|
|
commandIds << "Separator";
|
2016-08-26 09:12:55 -05:00
|
|
|
commandIds << "RicReloadFormationNamesFeature";
|
2016-08-24 01:30:12 -05:00
|
|
|
}
|
2017-10-13 08:01:52 -05:00
|
|
|
else if ( dynamic_cast<RimFaultInView*>(uiItem) )
|
2016-11-25 08:57:17 -06:00
|
|
|
{
|
|
|
|
commandIds << "RicExportFaultsFeature";
|
|
|
|
}
|
2017-02-02 05:32:01 -06:00
|
|
|
else if (dynamic_cast<RimWellAllocationPlot*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicAddStoredWellAllocationPlotFeature";
|
|
|
|
}
|
2017-08-17 05:52:18 -05:00
|
|
|
else if (dynamic_cast<RimFlowCharacteristicsPlot*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicAddStoredFlowCharacteristicsPlotFeature";
|
|
|
|
}
|
2017-03-28 16:35:53 -05:00
|
|
|
else if (dynamic_cast<RimFlowDiagSolution*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicShowFlowCharacteristicsPlotFeature";
|
|
|
|
}
|
2017-03-29 02:28:14 -05:00
|
|
|
else if (dynamic_cast<RimFlowPlotCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicShowFlowCharacteristicsPlotFeature";
|
|
|
|
}
|
2017-08-21 13:44:28 -05:00
|
|
|
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
2017-02-22 07:40:13 -06:00
|
|
|
else if (dynamic_cast<RimSimWellFracture*>(uiItem))
|
2017-01-02 04:10:25 -06:00
|
|
|
{
|
|
|
|
commandIds << "RicNewSimWellFractureFeature";
|
|
|
|
}
|
2017-02-07 04:08:56 -06:00
|
|
|
else if (dynamic_cast<RimFractureTemplateCollection*>(uiItem) ||
|
2017-02-14 02:49:14 -06:00
|
|
|
dynamic_cast<RimStimPlanFractureTemplate*>(uiItem))
|
2016-12-19 04:23:02 -06:00
|
|
|
{
|
2017-02-07 02:09:00 -06:00
|
|
|
commandIds << "RicNewEllipseFractureTemplateFeature";
|
|
|
|
commandIds << "RicNewStimPlanFractureTemplateFeature";
|
2017-02-23 01:21:45 -06:00
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicConvertAllFractureTemplatesToMetricFeature";
|
|
|
|
commandIds << "RicConvertAllFractureTemplatesToFieldFeature";
|
2016-12-19 04:23:02 -06:00
|
|
|
}
|
2017-02-14 02:49:14 -06:00
|
|
|
else if (dynamic_cast<RimEllipseFractureTemplate*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicNewEllipseFractureTemplateFeature";
|
|
|
|
commandIds << "RicNewStimPlanFractureTemplateFeature";
|
2017-02-23 01:21:45 -06:00
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicConvertFractureTemplateUnitFeature";
|
2017-02-14 02:49:14 -06:00
|
|
|
}
|
2017-08-21 13:44:28 -05:00
|
|
|
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
2016-11-18 04:41:20 -06:00
|
|
|
|
|
|
|
|
2015-11-18 02:35:38 -06:00
|
|
|
if (dynamic_cast<RimView*>(uiItem))
|
|
|
|
{
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicLinkVisibleViewsFeature";
|
|
|
|
commandIds << "RicLinkViewFeature";
|
|
|
|
commandIds << "RicShowLinkOptionsFeature";
|
|
|
|
commandIds << "RicSetMasterViewFeature";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "RicUnLinkViewFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-15 03:36:17 -05:00
|
|
|
// Command supporting multiple selected objects
|
|
|
|
if (uiItems.size() > 0)
|
|
|
|
{
|
2017-02-06 06:33:56 -06:00
|
|
|
// Work in progress -- Start
|
|
|
|
// All commands should be aware of selection of multiple objects
|
|
|
|
// Based on the selection, the command feature can decide if the command
|
|
|
|
// can be executed, communicated by isCommandEnabled(). When a command feature
|
|
|
|
// is aware of multiple selected items, move the command to this list
|
|
|
|
// without using dyncamic_cast.
|
|
|
|
|
2017-10-06 07:55:20 -05:00
|
|
|
|
2017-03-24 02:36:58 -05:00
|
|
|
commandIds << "RicPasteTimeHistoryCurveFeature";
|
2017-08-22 06:31:21 -05:00
|
|
|
commandIds << "RicPasteAsciiDataCurveFeature";
|
2017-02-06 06:33:56 -06:00
|
|
|
commandIds << "RicCopyReferencesToClipboardFeature";
|
2017-03-24 02:36:58 -05:00
|
|
|
|
2017-03-15 14:15:04 -05:00
|
|
|
commandIds << "RicShowPlotDataFeature";
|
2017-04-19 06:44:08 -05:00
|
|
|
commandIds << "RicShowTotalAllocationDataFeature";
|
|
|
|
|
2017-03-19 03:02:06 -05:00
|
|
|
commandIds << "RicSummaryCurveSwitchAxisFeature";
|
2017-05-05 04:21:40 -05:00
|
|
|
|
|
|
|
commandIds << "RicNewFishbonesSubsFeature";
|
2017-05-11 06:34:00 -05:00
|
|
|
commandIds << "RicNewPerforationIntervalFeature";
|
2017-05-11 08:07:31 -05:00
|
|
|
commandIds << "RicEditPerforationCollectionFeature";
|
2017-05-08 03:48:11 -05:00
|
|
|
commandIds << "RicExportFishbonesLateralsFeature";
|
2017-05-29 08:39:37 -05:00
|
|
|
commandIds << "RicExportFishbonesWellSegmentsFeature";
|
2017-05-30 04:56:18 -05:00
|
|
|
commandIds << "RicWellPathImportPerforationIntervalsFeature";
|
2017-05-15 09:04:11 -05:00
|
|
|
commandIds << "RicWellPathExportCompletionDataFeature";
|
2017-05-10 10:09:54 -05:00
|
|
|
commandIds << "RicWellPathImportCompletionsFileFeature";
|
2017-05-21 02:15:54 -05:00
|
|
|
commandIds << "RicFlyToObjectFeature";
|
2017-06-29 15:36:51 -05:00
|
|
|
commandIds << "RicExportCarfin";
|
2017-09-12 07:08:09 -05:00
|
|
|
|
2017-09-18 07:16:35 -05:00
|
|
|
commandIds << "RicImportObservedDataFeature";
|
2017-09-12 07:08:09 -05:00
|
|
|
commandIds << "RicPasteSummaryCaseFeature";
|
2017-09-06 07:09:15 -05:00
|
|
|
commandIds << "RicReloadSummaryCaseFeature";
|
2017-09-07 05:01:40 -05:00
|
|
|
commandIds << "RicCreateSummaryCaseCollectionFeature";
|
2017-09-19 03:12:41 -05:00
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicCutReferencesToClipboardFeature";
|
2017-09-08 08:26:13 -05:00
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicCloseSummaryCaseFeature";
|
|
|
|
commandIds << "RicCloseSummaryCaseInCollectionFeature";
|
|
|
|
commandIds << "RicDeleteSummaryCaseCollectionFeature";
|
2017-09-27 08:07:27 -05:00
|
|
|
commandIds << "RicCloseObservedDataFeature";
|
2017-02-06 06:33:56 -06:00
|
|
|
|
2017-10-06 07:55:20 -05:00
|
|
|
|
2017-06-09 05:19:14 -05:00
|
|
|
// Fracture commands
|
2017-08-21 13:44:28 -05:00
|
|
|
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
2017-06-09 05:19:14 -05:00
|
|
|
commandIds << "RicNewWellPathFractureFeature";
|
2017-08-21 13:44:28 -05:00
|
|
|
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
2017-06-09 05:19:14 -05:00
|
|
|
|
2017-02-06 06:33:56 -06:00
|
|
|
// Work in progress -- End
|
|
|
|
|
2016-07-15 03:36:17 -05:00
|
|
|
caf::PdmUiItem* uiItem = uiItems[0];
|
|
|
|
if (dynamic_cast<RimWellLogFileChannel*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicAddWellLogToPlotFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimEclipseStatisticsCase*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicExecuteScriptForCasesFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimEclipseCase*>(uiItem))
|
|
|
|
{
|
2017-04-21 05:02:48 -05:00
|
|
|
commandIds << "RicReloadCaseFeature";
|
2016-07-15 03:36:17 -05:00
|
|
|
commandIds << "RicExecuteScriptForCasesFeature";
|
2017-08-17 07:39:30 -05:00
|
|
|
commandIds << "RicCloseSourSimDataFeature";
|
2016-07-15 03:36:17 -05:00
|
|
|
}
|
2017-03-08 06:37:44 -06:00
|
|
|
else if (dynamic_cast<RimSummaryPlot*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicAsciiExportSummaryPlotFeature";
|
|
|
|
}
|
2017-03-10 06:16:53 -06:00
|
|
|
else if (dynamic_cast<RimWellLogPlot*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicAsciiExportWellLogPlotFeature";
|
|
|
|
}
|
2016-09-21 06:04:34 -05:00
|
|
|
else if (dynamic_cast<RimWellLogCurve*>(uiItem) ||
|
|
|
|
dynamic_cast<RimWellLogTrack*>(uiItem) ||
|
2016-11-22 01:48:11 -06:00
|
|
|
dynamic_cast<RimWellLogPlot*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicExportToLasFileFeature";
|
2016-12-17 09:45:02 -06:00
|
|
|
commandIds << "RicChangeDataSourceFeature";
|
2016-11-22 01:48:11 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimWellLogPlotCollection*>(uiItem))
|
2016-09-16 05:46:25 -05:00
|
|
|
{
|
|
|
|
commandIds << "RicExportToLasFileFeature";
|
|
|
|
}
|
2017-10-13 08:01:52 -05:00
|
|
|
else if (dynamic_cast<RimFaultInView*>(uiItem) )
|
2016-11-25 08:57:17 -06:00
|
|
|
{
|
|
|
|
commandIds << "RicExportFaultsFeature";
|
|
|
|
}
|
2017-10-13 02:29:42 -05:00
|
|
|
else if (dynamic_cast<RimSimWellInView*>(uiItem))
|
2017-01-25 01:08:11 -06:00
|
|
|
{
|
2017-03-08 04:42:08 -06:00
|
|
|
commandIds << "RicPlotProductionRateFeature";
|
2017-03-09 04:16:27 -06:00
|
|
|
commandIds << "RicShowContributingWellsFeature";
|
2017-02-28 08:46:08 -06:00
|
|
|
commandIds << "Separator";
|
2017-01-25 01:08:11 -06:00
|
|
|
commandIds << "RicEclipseWellShowLabelFeature";
|
|
|
|
commandIds << "RicEclipseWellShowHeadFeature";
|
|
|
|
commandIds << "RicEclipseWellShowPipeFeature";
|
|
|
|
commandIds << "RicEclipseWellShowSpheresFeature";
|
2017-01-26 10:52:13 -06:00
|
|
|
commandIds << "RicEclipseWellShowWellCellsFeature";
|
|
|
|
commandIds << "RicEclipseWellShowWellCellFenceFeature";
|
2017-08-21 13:44:28 -05:00
|
|
|
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
2017-02-22 07:40:13 -06:00
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicNewSimWellFractureFeature";
|
2017-08-21 13:44:28 -05:00
|
|
|
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
2017-02-02 04:38:55 -06:00
|
|
|
}
|
2016-07-15 03:36:17 -05:00
|
|
|
}
|
|
|
|
|
2016-11-17 07:47:43 -06:00
|
|
|
|
2015-11-18 02:35:38 -06:00
|
|
|
if (RicToggleItemsFeatureImpl::isToggleCommandsAvailable())
|
|
|
|
{
|
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicToggleItemsOnFeature";
|
|
|
|
commandIds << "RicToggleItemsOffFeature";
|
|
|
|
commandIds << "RicToggleItemsFeature";
|
|
|
|
}
|
|
|
|
|
2016-11-17 10:46:36 -06:00
|
|
|
if ( caf::CmdFeatureManager::instance()->getCommandFeature("RicDeleteItemFeature")->canFeatureBeExecuted() )
|
|
|
|
{
|
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicDeleteItemFeature";
|
|
|
|
}
|
|
|
|
|
2017-03-08 05:06:05 -06:00
|
|
|
if (caf::CmdFeatureManager::instance()->getCommandFeature("RicDeleteSubItemsFeature")->canFeatureBeExecuted())
|
|
|
|
{
|
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicDeleteSubItemsFeature";
|
|
|
|
}
|
|
|
|
|
2017-02-23 01:42:27 -06:00
|
|
|
if (caf::CmdFeatureManager::instance()->getCommandFeature("RicWellPathDeleteFeature")->canFeatureBeExecuted())
|
|
|
|
{
|
|
|
|
// Special delete command for Well paths
|
|
|
|
// Placed here to fit context menu location of general delete feature
|
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicWellPathDeleteFeature";
|
|
|
|
}
|
|
|
|
|
2016-11-17 10:46:36 -06:00
|
|
|
if ( caf::CmdFeatureManager::instance()->getCommandFeature("RicCloseCaseFeature")->canFeatureBeExecuted() )
|
|
|
|
{
|
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicCloseCaseFeature";
|
|
|
|
}
|
|
|
|
|
2015-11-18 02:35:38 -06:00
|
|
|
return commandIds;
|
|
|
|
}
|
2015-11-19 11:57:32 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimContextCommandBuilder::appendCommandsToMenu(const QStringList& commandIds, QMenu* menu)
|
|
|
|
{
|
|
|
|
CVF_ASSERT(menu);
|
|
|
|
|
|
|
|
caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance();
|
|
|
|
for (int i = 0; i < commandIds.size(); i++)
|
|
|
|
{
|
2017-03-19 02:47:29 -05:00
|
|
|
if (commandIds[i] == "Separator")
|
2015-11-19 11:57:32 -06:00
|
|
|
{
|
2017-03-19 02:47:29 -05:00
|
|
|
menu->addSeparator();
|
|
|
|
}
|
|
|
|
else
|
2015-11-19 11:57:32 -06:00
|
|
|
{
|
2017-03-19 02:47:29 -05:00
|
|
|
caf::CmdFeature* feature = commandManager->getCommandFeature(commandIds[i].toStdString());
|
|
|
|
CVF_ASSERT(feature);
|
2015-11-19 11:57:32 -06:00
|
|
|
|
2017-03-19 02:47:29 -05:00
|
|
|
if (feature->canFeatureBeExecuted())
|
2017-03-16 02:23:27 -05:00
|
|
|
{
|
2017-03-19 02:47:29 -05:00
|
|
|
QAction* act = commandManager->action(commandIds[i]);
|
|
|
|
CVF_ASSERT(act);
|
|
|
|
|
|
|
|
for (QAction* existingAct : menu->actions())
|
|
|
|
{
|
|
|
|
// If action exist, continue to make sure the action is positioned at the first
|
|
|
|
// location of a command ID
|
|
|
|
if (existingAct == act) continue;
|
|
|
|
}
|
2015-11-19 11:57:32 -06:00
|
|
|
|
2017-03-19 02:47:29 -05:00
|
|
|
menu->addAction(act);
|
|
|
|
}
|
2015-11-19 11:57:32 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|