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"
|
2016-09-21 03:48:25 -05:00
|
|
|
#include "RimIntersection.h"
|
2016-09-21 03:52:16 -05:00
|
|
|
#include "RimIntersectionCollection.h"
|
2015-11-18 02:35:38 -06:00
|
|
|
#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"
|
2015-11-18 08:09:50 -06:00
|
|
|
#include "RimEclipseWell.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"
|
2016-09-20 05:03:26 -05:00
|
|
|
#include "RimIntersectionBox.h"
|
2015-11-18 02:35:38 -06:00
|
|
|
#include "RimScriptCollection.h"
|
2016-07-01 02:20:20 -05:00
|
|
|
#include "RimSummaryCase.h"
|
2016-05-25 06:15:17 -05:00
|
|
|
#include "RimSummaryCurve.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"
|
|
|
|
#include "RimWellLogCurve.h"
|
|
|
|
#include "RimWellLogFileChannel.h"
|
|
|
|
#include "RimWellLogPlot.h"
|
|
|
|
#include "RimWellLogPlotCollection.h"
|
|
|
|
#include "RimWellLogTrack.h"
|
|
|
|
#include "RimWellPath.h"
|
|
|
|
#include "RimWellPathCollection.h"
|
|
|
|
|
2016-12-19 03:30:14 -06:00
|
|
|
#include "RimFractureCollection.h"
|
|
|
|
|
2015-11-18 02:35:38 -06:00
|
|
|
#include "ToggleCommands/RicToggleItemsFeatureImpl.h"
|
|
|
|
|
|
|
|
#include "cafPdmUiItem.h"
|
|
|
|
#include "cafSelectionManager.h"
|
|
|
|
#include "cvfAssert.h"
|
|
|
|
|
2015-11-19 11:57:32 -06:00
|
|
|
#include "cafCmdFeatureManager.h"
|
|
|
|
#include "cafCmdFeature.h"
|
|
|
|
|
2015-11-18 02:35:38 -06:00
|
|
|
#include <vector>
|
|
|
|
|
2015-11-19 11:57:32 -06:00
|
|
|
#include <QMenu>
|
2016-11-25 08:57:17 -06:00
|
|
|
#include "RimFault.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);
|
|
|
|
|
|
|
|
if (uiItems.size() == 0)
|
|
|
|
{
|
|
|
|
commandIds << "RicNewWellLogPlotFeature";
|
2016-05-09 05:13:54 -05:00
|
|
|
commandIds << "RicNewSummaryPlotFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (uiItems.size() == 1)
|
|
|
|
{
|
|
|
|
caf::PdmUiItem* uiItem = uiItems[0];
|
|
|
|
CVF_ASSERT(uiItem);
|
|
|
|
|
|
|
|
if (dynamic_cast<RimEclipseCaseCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicImportEclipseCaseFeature";
|
|
|
|
commandIds << "RicImportInputEclipseCaseFeature";
|
|
|
|
commandIds << "RicCreateGridCaseGroupFeature";
|
|
|
|
commandIds << "RicEclipseCaseNewGroupFeature";
|
|
|
|
}
|
|
|
|
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";
|
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";
|
|
|
|
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";
|
2016-07-12 11:54:55 -05:00
|
|
|
commandIds << "RicAddOpmInputPropertyFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
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";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimGeoMechPropertyFilterCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicGeoMechPropertyFilterNewFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimGeoMechPropertyFilter*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicGeoMechPropertyFilterInsertFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimWellPathCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicWellPathsImportFileFeature";
|
|
|
|
commandIds << "RicWellPathsImportSsihubFeature";
|
|
|
|
commandIds << "RicWellLogsImportFileFeature";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicWellPathsDeleteAllFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimWellPath*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicNewWellLogFileCurveFeature";
|
|
|
|
commandIds << "RicNewWellLogCurveExtractionFeature";
|
2016-09-21 04:38:37 -05:00
|
|
|
commandIds << "RicNewWellPathIntersectionFeature";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "Separator";
|
2015-11-18 02:35:38 -06:00
|
|
|
commandIds << "RicWellPathDeleteFeature";
|
|
|
|
}
|
|
|
|
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";
|
|
|
|
}
|
2016-05-25 06:15:17 -05:00
|
|
|
else if (dynamic_cast<RimSummaryPlotCollection*>(uiItem))
|
|
|
|
{
|
2016-11-05 08:17:46 -05:00
|
|
|
commandIds << "RicPasteSummaryPlotFeature";
|
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";
|
|
|
|
}
|
|
|
|
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";
|
|
|
|
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";
|
2016-11-06 11:55:05 -06:00
|
|
|
commandIds << "Separator";
|
2016-11-17 10:46:36 -06:00
|
|
|
commandIds << "RicNewSummaryPlotFeature";
|
2016-06-13 07:50:28 -05:00
|
|
|
commandIds << "RicNewSummaryCurveFilterFeature";
|
2016-08-03 02:54:05 -05:00
|
|
|
commandIds << "RicNewSummaryCurveFeature";
|
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-11-06 11:55:05 -06:00
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicSummaryCurveSwitchAxisFeature";
|
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";
|
|
|
|
commandIds << "Separator";
|
|
|
|
commandIds << "RicSummaryCurveSwitchAxisFeature";
|
2015-11-18 02:35:38 -06:00
|
|
|
}
|
2016-07-01 02:20:20 -05:00
|
|
|
else if (dynamic_cast<RimSummaryCase*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicNewSummaryPlotFeature";
|
|
|
|
}
|
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
|
|
|
}
|
2015-11-18 08:09:50 -06:00
|
|
|
else if (dynamic_cast<RimEclipseWell*>(uiItem))
|
|
|
|
{
|
2016-09-21 04:44:28 -05:00
|
|
|
commandIds << "RicNewSimWellIntersectionFeature";
|
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
|
|
|
}
|
2016-11-25 08:57:17 -06:00
|
|
|
else if ( dynamic_cast<RimFault*>(uiItem) )
|
|
|
|
{
|
|
|
|
commandIds << "RicExportFaultsFeature";
|
|
|
|
}
|
2016-12-19 03:30:14 -06:00
|
|
|
else if (dynamic_cast<RimFractureCollection*>(uiItem))
|
|
|
|
{
|
|
|
|
commandIds << "RicNewSimWellFractureFeature";
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
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))
|
|
|
|
{
|
|
|
|
commandIds << "RicExecuteScriptForCasesFeature";
|
|
|
|
}
|
2016-11-17 07:47:43 -06:00
|
|
|
else if (dynamic_cast<RimSummaryCurve*>(uiItem) ||
|
|
|
|
dynamic_cast<RimSummaryCurveFilter*>(uiItem) )
|
2016-11-06 11:55:05 -06:00
|
|
|
{
|
|
|
|
commandIds << "RicCopyReferencesToClipboardFeature";
|
2016-11-17 07:47:43 -06:00
|
|
|
commandIds << "RicSummaryCurveSwitchAxisFeature";
|
|
|
|
|
2016-11-06 11:55:05 -06:00
|
|
|
}
|
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 << "RicCopyReferencesToClipboardFeature";
|
|
|
|
commandIds << "RicExportToLasFileFeature";
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimWellLogPlotCollection*>(uiItem))
|
2016-09-16 05:46:25 -05:00
|
|
|
{
|
|
|
|
commandIds << "RicExportToLasFileFeature";
|
|
|
|
}
|
2016-11-25 08:57:17 -06:00
|
|
|
else if (dynamic_cast<RimFault*>(uiItem) )
|
|
|
|
{
|
|
|
|
commandIds << "RicExportFaultsFeature";
|
|
|
|
}
|
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";
|
|
|
|
}
|
|
|
|
|
|
|
|
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++)
|
|
|
|
{
|
|
|
|
caf::CmdFeature* feature = commandManager->getCommandFeature(commandIds[i].toStdString());
|
|
|
|
CVF_ASSERT(feature);
|
|
|
|
|
|
|
|
if (feature->canFeatureBeExecuted())
|
|
|
|
{
|
|
|
|
QAction* act = commandManager->action(commandIds[i]);
|
|
|
|
CVF_ASSERT(act);
|
|
|
|
|
|
|
|
menu->addAction(act);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|