ResInsight/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp

1457 lines
60 KiB
C++
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RiaApplication.h"
#include "PlotTemplates/RimPlotTemplateFileItem.h"
#include "PlotTemplates/RimPlotTemplateFolderItem.h"
#include "Rim3dOverlayInfoConfig.h"
#include "Rim3dWellLogCurveCollection.h"
#include "Rim3dWellLogExtractionCurve.h"
#include "Rim3dWellLogFileCurve.h"
#include "Rim3dWellLogRftCurve.h"
2020-04-17 02:31:42 -05:00
#include "RimAnalysisPlot.h"
#include "RimAnalysisPlotCollection.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationGroupCollection.h"
#include "RimAnnotationInViewCollection.h"
2019-11-26 06:56:02 -06:00
#include "RimBoxIntersection.h"
#include "RimCalcScript.h"
#include "RimCaseCollection.h"
#include "RimCellEdgeColors.h"
#include "RimCellFilterCollection.h"
#include "RimCellRangeFilter.h"
2020-05-13 07:28:06 -05:00
#include "RimColorLegend.h"
#include "RimColorLegendCollection.h"
2020-05-13 07:28:06 -05:00
#include "RimColorLegendItem.h"
2020-04-21 01:56:27 -05:00
#include "RimCorrelationMatrixPlot.h"
2020-04-17 02:31:42 -05:00
#include "RimCorrelationPlot.h"
#include "RimCorrelationPlotCollection.h"
#include "RimCustomObjectiveFunction.h"
#include "RimCustomObjectiveFunctionCollection.h"
#include "RimEclipseCase.h"
#include "RimEclipseCaseCollection.h"
#include "RimEclipseCellColors.h"
2019-10-15 06:50:48 -05:00
#include "RimEclipseContourMapView.h"
#include "RimEclipseContourMapViewCollection.h"
#include "RimEclipseFaultColors.h"
#include "RimEclipseInputProperty.h"
#include "RimEclipsePropertyFilter.h"
#include "RimEclipsePropertyFilterCollection.h"
#include "RimEclipseResultCase.h"
#include "RimEclipseStatisticsCase.h"
#include "RimEclipseView.h"
#include "RimElasticProperties.h"
#include "RimEllipseFractureTemplate.h"
2018-05-31 03:23:51 -05:00
#include "RimEnsembleCurveFilterCollection.h"
#include "RimEnsembleCurveSet.h"
#include "RimEnsembleCurveSetCollection.h"
#include "RimEnsembleFractureStatisticsCollection.h"
2019-11-26 06:56:02 -06:00
#include "RimExtrudedCurveIntersection.h"
#include "RimFaultInView.h"
#include "RimFaultInViewCollection.h"
#include "RimFishbones.h"
2019-04-08 04:04:21 -05:00
#include "RimFishbonesCollection.h"
2017-09-19 07:19:39 -05:00
#include "RimFlowCharacteristicsPlot.h"
#include "RimFlowDiagSolution.h"
#include "RimFlowPlotCollection.h"
#include "RimFormationNames.h"
#include "RimFormationNamesCollection.h"
#include "RimFractureTemplate.h"
#include "RimFractureTemplateCollection.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechCellColors.h"
2019-10-15 06:50:48 -05:00
#include "RimGeoMechContourMapView.h"
#include "RimGeoMechContourMapViewCollection.h"
#include "RimGeoMechPropertyFilter.h"
#include "RimGeoMechPropertyFilterCollection.h"
#include "RimGeoMechView.h"
#include "RimGridCaseSurface.h"
#include "RimGridCollection.h"
3d Cross Plot: First implementation (#4127) * First cross plot commit * Made cross plot deal with "all time steps" and categorise curves based on time step * Support STATIC vs DYNAMIC plotting * #4115 Avoid updating plots in RimEclipseCase::computeCachedData() * Make sure loading of Cross plot from file works * Show Legend in Cross Plot * Uncheck / Check curves to disable/enable * Axis titles and checkable data set * Name config and setting of common plot look * Fix category indentation in GeoMech results * Support name configuration for Grid Cross Plot * Support adding new curve sets * Improve colors and symbols with better cycling * Moved GridCrossPlot files to sub directory in ProjectDataModel and Commands * #4111 3D calculations : Always show difference options * Whitespace * #4111 Move resultDefinition field to private * Whitespace * #4087 Ensemble : When importing and ensemble, show by default an ensemble plot * #4085 3D view: Improve overlay item colors * #4106 Crash on Linux Temporary workaround to avoid crash * #4106 Stop trying to do recursive setting tab order widget * The double pointer was handled wrongly and shift-tab order isn't working anyway. * #4114 Regression Test : Remove cached pointer to eclipse case * Revert "#4114 Regression Test : Remove cached pointer to eclipse case" This reverts commit f2146c600705280c85391f88a861a070812ae83a. * #4114 Regression Test : Missing data for flow diag property filter * #4085 3D view: Add check box for version info text * Whtespace * Improve labelling of static results * Fix update of result property when changing type
2019-02-21 05:52:23 -06:00
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCollection.h"
#include "RimGridCrossPlotDataSet.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimIntersectionCollection.h"
#include "RimIntersectionResultDefinition.h"
#include "RimIntersectionResultsDefinitionCollection.h"
#include "RimModeledWellPath.h"
#include "RimMultiPlot.h"
#include "RimMultiPlotCollection.h"
2019-08-20 08:09:13 -05:00
#include "RimObservedSummaryData.h"
2020-04-17 12:24:12 -05:00
#include "RimParameterResultCrossPlot.h"
2019-04-08 04:04:21 -05:00
#include "RimPerforationCollection.h"
#include "RimPerforationInterval.h"
2020-04-17 02:31:42 -05:00
#include "RimPlotDataFilterCollection.h"
#include "RimPlotDataFilterItem.h"
#include "RimPltPlotCollection.h"
#include "RimPressureTable.h"
#include "RimProject.h"
#include "RimRftPlotCollection.h"
#include "RimSaturationPressurePlotCollection.h"
#include "RimScriptCollection.h"
#include "RimSimWellFracture.h"
#include "RimSimWellInView.h"
#include "RimSimWellInViewCollection.h"
#include "RimStimPlanFractureTemplate.h"
#include "RimStimPlanModel.h"
#include "RimStimPlanModelCollection.h"
#include "RimStimPlanModelPlot.h"
#include "RimStimPlanModelTemplate.h"
#include "RimStimPlanModelTemplateCollection.h"
#include "RimStreamlineInViewCollection.h"
#include "RimSummaryCase.h"
#include "RimSummaryCaseCollection.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSummaryCrossPlot.h"
#include "RimSummaryCrossPlotCollection.h"
#include "RimSummaryCurve.h"
#include "RimSummaryCurveCollection.h"
#include "RimSummaryPlot.h"
#include "RimSummaryPlotCollection.h"
#include "RimSurface.h"
#include "RimSurfaceCollection.h"
#include "RimValveTemplate.h"
#include "RimValveTemplateCollection.h"
#include "RimVfpPlotCollection.h"
#include "RimViewController.h"
#include "RimViewLinker.h"
#include "RimViewLinkerCollection.h"
#include "RimVirtualPerforationResults.h"
#include "RimWellAllocationPlot.h"
#include "RimWellLogCurve.h"
#include "RimWellLogFile.h"
#include "RimWellLogFileChannel.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h"
#include "RimWellLogTrack.h"
#include "RimWellMeasurementCollection.h"
#include "RimWellMeasurementFilePath.h"
#include "RimWellPath.h"
#include "RimWellPathAttributeCollection.h"
#include "RimWellPathCollection.h"
2019-04-08 04:04:21 -05:00
#include "RimWellPathCompletions.h"
#include "RimWellPathFracture.h"
2019-04-08 04:04:21 -05:00
#include "RimWellPathFractureCollection.h"
#include "RimWellPltPlot.h"
#ifdef USE_QTCHARTS
#include "RimEnsembleFractureStatisticsPlotCollection.h"
#include "RimGridStatisticsPlotCollection.h"
#endif
#include "RiuMainWindow.h"
#include "OctaveScriptCommands/RicExecuteScriptForCasesFeature.h"
#include "ToggleCommands/RicToggleItemsFeatureImpl.h"
#include "cafCmdFeature.h"
#include "cafCmdFeatureManager.h"
#include "cafCmdFeatureMenuBuilder.h"
#include "cafPdmUiItem.h"
#include "cafSelectionManager.h"
#include "cafSelectionManagerTools.h"
#include "cafTreeNode.h"
#include "cvfAssert.h"
#include <QDir>
#include <QIcon>
#include <QMenu>
#include <QString>
#include <QStringList>
#include <vector>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
{
std::vector<caf::PdmUiItem*> uiItems;
caf::SelectionManager::instance()->selectedItems( uiItems );
caf::PdmUiItem* firstUiItem = nullptr;
{
if ( !uiItems.empty() )
{
firstUiItem = uiItems[0];
}
}
if ( dynamic_cast<cafTreeNode*>( firstUiItem ) ) return {};
caf::CmdFeatureMenuBuilder menuBuilder;
if ( uiItems.size() == 1 )
{
if ( dynamic_cast<RimEclipseCaseCollection*>( firstUiItem ) )
{
menuBuilder.subMenuStart( "Import" );
menuBuilder << "RicImportEclipseCaseFeature";
menuBuilder << "RicImportEclipseCasesFeature";
menuBuilder << "RicImportInputEclipseCaseFeature";
menuBuilder << "RicCreateGridCaseGroupFromFilesFeature";
menuBuilder.subMenuEnd();
menuBuilder << "RicEclipseCaseNewGroupFeature";
}
else if ( dynamic_cast<RimGeoMechView*>( firstUiItem ) )
{
menuBuilder << "RicPasteGeoMechViewsFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewViewFeature";
menuBuilder << "RicNewContourMapViewFeature";
menuBuilder << "Separator";
menuBuilder << "RicCopyReferencesToClipboardFeature";
menuBuilder << "RicExportContourMapToTextFeature";
}
else if ( dynamic_cast<RimEclipseView*>( firstUiItem ) )
{
menuBuilder << "RicPasteEclipseViewsFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewViewFeature";
menuBuilder << "RicNewContourMapViewFeature";
menuBuilder << "RicCreateGridCrossPlotFeature";
menuBuilder << "RicCreateSaturationPressurePlotsFeature";
menuBuilder << "Separator";
menuBuilder << "RicCopyReferencesToClipboardFeature";
menuBuilder << "RicExportEclipseInputGridFeature";
menuBuilder << "RicSaveEclipseResultAsInputPropertyFeature";
menuBuilder << "RicExportContourMapToTextFeature";
menuBuilder << "RicSaveEclipseInputVisibleCellsFeature";
menuBuilder << "RicAddEclipseInputPropertyFeature";
}
else if ( dynamic_cast<RimEclipseContourMapViewCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewContourMapViewFeature";
}
else if ( dynamic_cast<RimGeoMechContourMapViewCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewContourMapViewFeature";
}
else if ( dynamic_cast<RimCaseCollection*>( firstUiItem ) )
{
menuBuilder << "RicPasteEclipseCasesFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewStatisticsCaseFeature";
}
else if ( dynamic_cast<RimEclipseStatisticsCase*>( firstUiItem ) )
{
menuBuilder << "RicNewViewFeature";
menuBuilder << "RicComputeStatisticsFeature";
menuBuilder << "Separator";
}
else if ( dynamic_cast<RimEclipseCase*>( firstUiItem ) )
{
menuBuilder << "RicPasteEclipseCasesFeature";
menuBuilder << "RicPasteEclipseViewsFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewViewFeature";
menuBuilder << "RicNewContourMapViewFeature";
menuBuilder << "RicShowFlowCharacteristicsPlotFeature";
menuBuilder << "RicEclipseCaseNewGroupFeature";
menuBuilder << "Separator";
menuBuilder << "RicCopyReferencesToClipboardFeature";
menuBuilder << "Separator";
#ifdef USE_ODB_API
if ( dynamic_cast<RimEclipseResultCase*>( firstUiItem ) )
{
menuBuilder << "RicNewFaultReactAssessmentFeature";
menuBuilder << "Separator";
}
#endif
}
else if ( dynamic_cast<RimGridInfoCollection*>( firstUiItem ) )
{
menuBuilder << "RicExportCompletionsForTemporaryLgrsFeature";
menuBuilder << "RicDeleteTemporaryLgrsFeature";
}
else if ( dynamic_cast<RimGeoMechCase*>( firstUiItem ) )
{
menuBuilder << "RicPasteGeoMechViewsFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewViewFeature";
menuBuilder << "RicNewContourMapViewFeature";
menuBuilder << "Separator";
menuBuilder << "RicImportElementPropertyFeature";
menuBuilder << "Separator";
menuBuilder << "RicGeoMechCopyCaseFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewFaultReactAssessmentFeature";
menuBuilder << "Separator";
}
else if ( dynamic_cast<RimIdenticalGridCaseGroup*>( firstUiItem ) )
{
menuBuilder << "RicPasteEclipseCasesFeature";
menuBuilder << "Separator";
menuBuilder << "RicEclipseCaseNewGroupFeature";
}
else if ( dynamic_cast<RimEclipseCellColors*>( firstUiItem ) )
{
menuBuilder << "RicSaveEclipseResultAsInputPropertyFeature";
menuBuilder << "RicExportEclipseInputGridFeature";
menuBuilder << "RicSaveEclipseInputVisibleCellsFeature";
menuBuilder << "RicCreateGridCrossPlotFeature";
menuBuilder << "RicAddEclipseInputPropertyFeature";
}
else if ( dynamic_cast<RimEclipseInputProperty*>( firstUiItem ) )
{
menuBuilder << "RicSaveEclipseInputPropertyFeature";
}
else if ( dynamic_cast<RimEclipsePropertyFilterCollection*>( firstUiItem ) )
{
menuBuilder << "RicEclipsePropertyFilterNewFeature";
}
else if ( dynamic_cast<RimEclipsePropertyFilter*>( firstUiItem ) )
{
menuBuilder << "RicEclipsePropertyFilterInsertFeature";
menuBuilder << "RicApplyPropertyFilterAsCellResultFeature";
}
else if ( dynamic_cast<RimGeoMechPropertyFilterCollection*>( firstUiItem ) )
{
menuBuilder << "RicGeoMechPropertyFilterNewFeature";
}
else if ( dynamic_cast<RimGeoMechPropertyFilter*>( firstUiItem ) )
{
menuBuilder << "RicGeoMechPropertyFilterInsertFeature";
menuBuilder << "RicApplyPropertyFilterAsCellResultFeature";
}
else if ( dynamic_cast<RimWellPathCollection*>( firstUiItem ) )
{
2019-04-08 04:04:21 -05:00
menuBuilder << "RicNewEditableWellPathFeature";
menuBuilder.addSeparator();
menuBuilder.subMenuStart( "Import" );
menuBuilder << "RicWellPathsImportFileFeature";
menuBuilder << "RicWellPathsImportSsihubFeature";
menuBuilder << "RicWellPathFormationsImportFileFeature";
menuBuilder << "RicWellLogsImportFileFeature";
menuBuilder << "RicReloadWellPathFormationNamesFeature";
2019-04-08 04:04:21 -05:00
menuBuilder.addSeparator();
menuBuilder << "RicWellPathImportPerforationIntervalsFeature";
menuBuilder << "RicImportWellMeasurementsFeature";
menuBuilder.subMenuEnd();
menuBuilder.addSeparator();
2020-10-01 10:25:19 -05:00
menuBuilder.subMenuStart( "Export Well Paths", QIcon( ":/Save.svg" ) );
2019-04-08 04:04:21 -05:00
menuBuilder << "RicExportSelectedWellPathsFeature";
menuBuilder << "RicExportVisibleWellPathsFeature";
menuBuilder.subMenuEnd();
appendExportCompletions( menuBuilder );
}
else if ( dynamic_cast<RimWellMeasurementFilePath*>( firstUiItem ) )
{
menuBuilder << "RicReloadWellMeasurementsFeature";
menuBuilder << "RicDeleteWellMeasurementFilePathFeature";
menuBuilder << "RicImportWellMeasurementsFeature";
}
else if ( dynamic_cast<RimWellMeasurementCollection*>( firstUiItem ) )
{
menuBuilder << "RicImportWellMeasurementsFeature";
}
else if ( dynamic_cast<RimWellPath*>( firstUiItem ) )
{
2019-04-08 04:04:21 -05:00
menuBuilder << "RicNewEditableWellPathFeature";
menuBuilder << "RicNewWellPathLateralFeature";
2019-04-08 04:04:21 -05:00
menuBuilder << "RicNewWellPathIntersectionFeature";
appendCreateCompletions( menuBuilder );
2019-04-08 04:04:21 -05:00
menuBuilder.addSeparator();
appendImportMenu( menuBuilder );
2019-04-08 04:04:21 -05:00
menuBuilder.addSeparator();
appendExportCompletions( menuBuilder );
2019-04-08 04:04:21 -05:00
menuBuilder.addSeparator();
appendExportWellPaths( menuBuilder );
2019-04-08 04:04:21 -05:00
menuBuilder.addSeparator();
menuBuilder.subMenuStart( "Well Plots", QIcon( ":/WellLogTrack16x16.png" ) );
menuBuilder << "RicNewRftPlotFeature";
menuBuilder << "RicNewPltPlotFeature";
menuBuilder << "RicShowWellAllocationPlotFeature";
menuBuilder << "RicNewWellBoreStabilityPlotFeature";
menuBuilder << "RicNewWellLogFileCurveFeature";
menuBuilder << "RicNewWellLogCurveExtractionFeature";
menuBuilder.subMenuEnd();
menuBuilder.subMenuStart( "3D Well Log Curves", QIcon( ":/WellLogCurve16x16.png" ) );
menuBuilder << "RicAdd3dWellLogCurveFeature";
menuBuilder << "RicAdd3dWellLogFileCurveFeature";
menuBuilder << "RicAdd3dWellLogRftCurveFeature";
menuBuilder.subMenuEnd();
menuBuilder.addSeparator();
2019-04-08 04:04:21 -05:00
menuBuilder.addSeparator();
if ( dynamic_cast<RimModeledWellPath*>( firstUiItem ) )
2018-09-26 05:38:53 -05:00
{
menuBuilder << "RicShowWellPlanFeature";
}
2019-04-08 04:04:21 -05:00
}
else if ( dynamic_cast<RimWellPathCompletions*>( firstUiItem ) )
2019-04-08 04:04:21 -05:00
{
menuBuilder.subMenuStart( "Create Completions", QIcon( ":/CompletionsSymbol16x16.png" ) );
2019-04-08 04:04:21 -05:00
menuBuilder << "RicNewPerforationIntervalFeature";
menuBuilder << "RicNewFishbonesSubsFeature";
menuBuilder << "RicNewWellPathFractureFeature";
menuBuilder << "RicNewStimPlanModelFeature";
2019-04-08 04:04:21 -05:00
menuBuilder.subMenuEnd();
menuBuilder << "RicCreateTemporaryLgrFeature";
menuBuilder.addSeparator();
appendExportCompletions( menuBuilder );
2019-04-08 04:04:21 -05:00
}
else if ( dynamic_cast<RimPerforationCollection*>( firstUiItem ) ||
dynamic_cast<RimPerforationInterval*>( firstUiItem ) )
2019-04-08 04:04:21 -05:00
{
menuBuilder << "RicNewPerforationIntervalFeature";
if ( dynamic_cast<RimPerforationInterval*>( firstUiItem ) ) menuBuilder << "RicNewValveFeature";
2019-04-08 04:04:21 -05:00
menuBuilder.addSeparator();
menuBuilder << "RicEditPerforationCollectionFeature";
menuBuilder.addSeparator();
appendExportCompletions( menuBuilder );
2019-04-08 04:04:21 -05:00
}
2021-04-13 00:22:56 -05:00
else if ( dynamic_cast<RimFishbonesCollection*>( firstUiItem ) || dynamic_cast<RimFishbones*>( firstUiItem ) )
2019-04-08 04:04:21 -05:00
{
menuBuilder << "RicNewFishbonesSubsFeature";
appendExportCompletions( menuBuilder );
2019-04-08 04:04:21 -05:00
}
else if ( dynamic_cast<RimWellPathFractureCollection*>( firstUiItem ) ||
dynamic_cast<RimWellPathFracture*>( firstUiItem ) )
2019-04-08 04:04:21 -05:00
{
menuBuilder << "RicNewWellPathFractureFeature";
appendExportCompletions( menuBuilder );
}
else if ( dynamic_cast<RimWellPathAttributeCollection*>( firstUiItem ) )
{
menuBuilder << "RicDeleteWellPathAttributeFeature";
}
else if ( dynamic_cast<RimStimPlanModel*>( firstUiItem ) )
{
menuBuilder << "RicNewStimPlanModelFeature";
menuBuilder << "RicNewStimPlanModelPlotFeature";
menuBuilder << "RicExportStimPlanModelToFileFeature";
}
else if ( dynamic_cast<RimPressureTable*>( firstUiItem ) )
{
menuBuilder << "RicNewPressureTableItemFeature";
}
else if ( dynamic_cast<RimStimPlanModelCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewStimPlanModelFeature";
}
else if ( dynamic_cast<Rim3dWellLogCurveCollection*>( firstUiItem ) ||
dynamic_cast<Rim3dWellLogExtractionCurve*>( firstUiItem ) ||
dynamic_cast<Rim3dWellLogFileCurve*>( firstUiItem ) ||
dynamic_cast<Rim3dWellLogRftCurve*>( firstUiItem ) )
{
menuBuilder << "RicAdd3dWellLogCurveFeature";
menuBuilder << "RicAdd3dWellLogFileCurveFeature";
menuBuilder << "RicAdd3dWellLogRftCurveFeature";
}
else if ( dynamic_cast<RimWellLogFile*>( firstUiItem ) )
{
menuBuilder << "RicWellPathsImportFileFeature";
menuBuilder << "RicWellLogsImportFileFeature";
menuBuilder << "Separator";
menuBuilder.subMenuStart( "Move LAS file to well path" );
RimWellPath* parentWellPath = caf::firstAncestorOfTypeFromSelectedObject<RimWellPath*>();
QString parentWellPathName = parentWellPath ? parentWellPath->name() : "";
for ( RimWellPath* wellPath : allWellPaths() )
{
if ( wellPath->name() != parentWellPathName )
{
menuBuilder.addCmdFeatureWithUserData( "RicMoveWellLogFilesFeature", wellPath->name(), wellPath->name() );
}
}
menuBuilder.subMenuEnd();
}
else if ( dynamic_cast<RimCalcScript*>( firstUiItem ) )
{
menuBuilder << "RicEditScriptFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewOctaveScriptFeature";
#ifdef ENABLE_GRPC
menuBuilder << "RicNewPythonScriptFeature";
#endif
menuBuilder << "Separator";
menuBuilder << "RicExecuteScriptFeature";
}
else if ( dynamic_cast<RimScriptCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewOctaveScriptFeature";
#ifdef ENABLE_GRPC
menuBuilder << "RicNewPythonScriptFeature";
#endif
menuBuilder << "Separator";
menuBuilder << "RicAddScriptPathFeature";
menuBuilder << "RicRefreshScriptsFeature";
menuBuilder << "RicExecuteLastUsedScriptFeature";
menuBuilder << "Separator";
menuBuilder << "RicDeleteScriptPathFeature";
}
else if ( dynamic_cast<RimViewController*>( firstUiItem ) )
{
menuBuilder << "RicShowAllLinkedViewsFeature";
}
else if ( dynamic_cast<RimViewLinker*>( firstUiItem ) || dynamic_cast<RimViewLinkerCollection*>( firstUiItem ) )
{
menuBuilder << "RicShowAllLinkedViewsFeature";
menuBuilder << "Separator";
menuBuilder << "RicDeleteAllLinkedViewsFeature";
}
else if ( dynamic_cast<RimWellLogPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicPasteWellLogPlotFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewWellLogPlotFeature";
menuBuilder << "RicNewWellBoreStabilityPlotFeature";
}
else if ( dynamic_cast<RimRftPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewRftPlotFeature";
}
else if ( dynamic_cast<RimPltPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewPltPlotFeature";
}
else if ( dynamic_cast<RimVfpPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewVfpPlotFeature";
}
else if ( dynamic_cast<RimSummaryPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicPasteSummaryPlotFeature";
menuBuilder << "RicPasteAsciiDataToSummaryPlotFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewSummaryPlotFeature";
menuBuilder << "RicNewDefaultSummaryPlotFeature";
menuBuilder << "Separator";
menuBuilder << "RicShowSummaryCurveCalculatorFeature";
}
else if ( dynamic_cast<RimAnalysisPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewAnalysisPlotFeature";
}
else if ( dynamic_cast<RimAnalysisPlot*>( firstUiItem ) )
{
menuBuilder << "RicNewAnalysisPlotFeature";
menuBuilder << "RicNewPlotDataFilterFeature";
}
2020-04-17 02:31:42 -05:00
else if ( dynamic_cast<RimCorrelationPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewCorrelationPlotFeature";
2020-04-21 01:56:27 -05:00
menuBuilder << "RicNewCorrelationMatrixPlotFeature";
2020-04-17 12:24:12 -05:00
menuBuilder << "RicNewParameterResultCrossPlotFeature";
2020-04-29 01:11:30 -05:00
menuBuilder << "RicNewCorrelationReportPlotFeature";
2020-04-17 02:31:42 -05:00
}
else if ( dynamic_cast<RimCorrelationPlot*>( firstUiItem ) )
{
menuBuilder << "RicNewCorrelationPlotFeature";
}
2020-04-21 01:56:27 -05:00
else if ( dynamic_cast<RimCorrelationMatrixPlot*>( firstUiItem ) )
{
menuBuilder << "RicNewCorrelationMatrixPlotFeature";
}
2020-04-17 12:24:12 -05:00
else if ( dynamic_cast<RimParameterResultCrossPlot*>( firstUiItem ) )
{
menuBuilder << "RicNewParameterResultCrossPlotFeature";
}
else if ( dynamic_cast<RimPlotDataFilterCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewPlotDataFilterFeature";
}
else if ( dynamic_cast<RimPlotDataFilterItem*>( firstUiItem ) )
{
menuBuilder << "RicNewPlotDataFilterFeature";
}
else if ( dynamic_cast<RimSummaryCrossPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicPasteSummaryCrossPlotFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewSummaryCrossPlotFeature";
}
else if ( dynamic_cast<RimWellLogPlot*>( firstUiItem ) && !dynamic_cast<RimWellPltPlot*>( firstUiItem ) )
{
menuBuilder << "RicPasteWellLogPlotFeature";
menuBuilder << "RicPasteWellLogTrackFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewWellLogPlotTrackFeature";
menuBuilder << "RicAsciiExportWellLogPlotFeature";
}
else if ( dynamic_cast<RimWellLogTrack*>( firstUiItem ) )
{
menuBuilder << "RicPasteWellLogTrackFeature";
menuBuilder << "RicPasteWellLogCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewWellLogCurveExtractionFeature";
menuBuilder << "RicNewWellLogRftCurveFeature";
menuBuilder << "RicNewWellLogFileCurveFeature";
menuBuilder << "RicNewWellMeasurementCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicDeleteSubPlotFeature";
}
else if ( dynamic_cast<RimWellLogCurve*>( firstUiItem ) )
{
menuBuilder << "RicPasteWellLogCurveFeature";
}
else if ( dynamic_cast<RimGridCrossPlotCollection*>( firstUiItem ) )
3d Cross Plot: First implementation (#4127) * First cross plot commit * Made cross plot deal with "all time steps" and categorise curves based on time step * Support STATIC vs DYNAMIC plotting * #4115 Avoid updating plots in RimEclipseCase::computeCachedData() * Make sure loading of Cross plot from file works * Show Legend in Cross Plot * Uncheck / Check curves to disable/enable * Axis titles and checkable data set * Name config and setting of common plot look * Fix category indentation in GeoMech results * Support name configuration for Grid Cross Plot * Support adding new curve sets * Improve colors and symbols with better cycling * Moved GridCrossPlot files to sub directory in ProjectDataModel and Commands * #4111 3D calculations : Always show difference options * Whitespace * #4111 Move resultDefinition field to private * Whitespace * #4087 Ensemble : When importing and ensemble, show by default an ensemble plot * #4085 3D view: Improve overlay item colors * #4106 Crash on Linux Temporary workaround to avoid crash * #4106 Stop trying to do recursive setting tab order widget * The double pointer was handled wrongly and shift-tab order isn't working anyway. * #4114 Regression Test : Remove cached pointer to eclipse case * Revert "#4114 Regression Test : Remove cached pointer to eclipse case" This reverts commit f2146c600705280c85391f88a861a070812ae83a. * #4114 Regression Test : Missing data for flow diag property filter * #4085 3D view: Add check box for version info text * Whtespace * Improve labelling of static results * Fix update of result property when changing type
2019-02-21 05:52:23 -06:00
{
menuBuilder << "RicCreateGridCrossPlotFeature";
}
else if ( dynamic_cast<RimSaturationPressurePlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicCreateSaturationPressurePlotsFeature";
}
#ifdef USE_QTCHARTS
else if ( dynamic_cast<RimGridStatisticsPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicCreateGridStatisticsPlotFeature";
}
else if ( dynamic_cast<RimEnsembleFractureStatisticsPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicCreateEnsembleFractureStatisticsPlotFeature";
}
#endif
else if ( dynamic_cast<RimGridCrossPlot*>( firstUiItem ) )
3d Cross Plot: First implementation (#4127) * First cross plot commit * Made cross plot deal with "all time steps" and categorise curves based on time step * Support STATIC vs DYNAMIC plotting * #4115 Avoid updating plots in RimEclipseCase::computeCachedData() * Make sure loading of Cross plot from file works * Show Legend in Cross Plot * Uncheck / Check curves to disable/enable * Axis titles and checkable data set * Name config and setting of common plot look * Fix category indentation in GeoMech results * Support name configuration for Grid Cross Plot * Support adding new curve sets * Improve colors and symbols with better cycling * Moved GridCrossPlot files to sub directory in ProjectDataModel and Commands * #4111 3D calculations : Always show difference options * Whitespace * #4111 Move resultDefinition field to private * Whitespace * #4087 Ensemble : When importing and ensemble, show by default an ensemble plot * #4085 3D view: Improve overlay item colors * #4106 Crash on Linux Temporary workaround to avoid crash * #4106 Stop trying to do recursive setting tab order widget * The double pointer was handled wrongly and shift-tab order isn't working anyway. * #4114 Regression Test : Remove cached pointer to eclipse case * Revert "#4114 Regression Test : Remove cached pointer to eclipse case" This reverts commit f2146c600705280c85391f88a861a070812ae83a. * #4114 Regression Test : Missing data for flow diag property filter * #4085 3D view: Add check box for version info text * Whtespace * Improve labelling of static results * Fix update of result property when changing type
2019-02-21 05:52:23 -06:00
{
menuBuilder << "RicPasteGridCrossPlotDataSetFeature";
menuBuilder << "Separator";
menuBuilder << "RicCreateGridCrossPlotDataSetFeature";
menuBuilder << "RicSwapGridCrossPlotDataSetAxesFeature";
}
else if ( dynamic_cast<RimGridCrossPlotDataSet*>( firstUiItem ) )
{
menuBuilder << "RicPasteGridCrossPlotDataSetFeature";
menuBuilder << "Separator";
menuBuilder << "RicSwapGridCrossPlotDataSetAxesFeature";
3d Cross Plot: First implementation (#4127) * First cross plot commit * Made cross plot deal with "all time steps" and categorise curves based on time step * Support STATIC vs DYNAMIC plotting * #4115 Avoid updating plots in RimEclipseCase::computeCachedData() * Make sure loading of Cross plot from file works * Show Legend in Cross Plot * Uncheck / Check curves to disable/enable * Axis titles and checkable data set * Name config and setting of common plot look * Fix category indentation in GeoMech results * Support name configuration for Grid Cross Plot * Support adding new curve sets * Improve colors and symbols with better cycling * Moved GridCrossPlot files to sub directory in ProjectDataModel and Commands * #4111 3D calculations : Always show difference options * Whitespace * #4111 Move resultDefinition field to private * Whitespace * #4087 Ensemble : When importing and ensemble, show by default an ensemble plot * #4085 3D view: Improve overlay item colors * #4106 Crash on Linux Temporary workaround to avoid crash * #4106 Stop trying to do recursive setting tab order widget * The double pointer was handled wrongly and shift-tab order isn't working anyway. * #4114 Regression Test : Remove cached pointer to eclipse case * Revert "#4114 Regression Test : Remove cached pointer to eclipse case" This reverts commit f2146c600705280c85391f88a861a070812ae83a. * #4114 Regression Test : Missing data for flow diag property filter * #4085 3D view: Add check box for version info text * Whtespace * Improve labelling of static results * Fix update of result property when changing type
2019-02-21 05:52:23 -06:00
}
else if ( dynamic_cast<RimSummaryPlot*>( firstUiItem ) ) // This is also the definition for RimSummaryCrossPlot
{
RimSummaryCrossPlot* summaryCrossPlot = dynamic_cast<RimSummaryCrossPlot*>( firstUiItem );
menuBuilder << "RicPasteSummaryCurveFeature";
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
menuBuilder << "RicPasteSummaryPlotFeature";
menuBuilder << "RicPasteAsciiDataToSummaryPlotFeature";
menuBuilder << "RicPasteEnsembleCurveSetFeature";
menuBuilder << "Separator";
menuBuilder << "RicEditSummaryPlotFeature";
menuBuilder << "RicDuplicateSummaryPlotFeature";
menuBuilder << "RicNewSummaryEnsembleCurveSetFeature";
menuBuilder << "RicDuplicateSummaryCrossPlotFeature";
menuBuilder << "RicNewSummaryCrossPlotCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicSavePlotTemplateFeature";
// Export is not supported for cross plot
if ( !summaryCrossPlot ) menuBuilder << "RicAsciiExportSummaryPlotFeature";
menuBuilder << "RicShowSummaryCurveCalculatorFeature";
menuBuilder << "Separator";
menuBuilder << "RicCopyReferencesToClipboardFeature";
menuBuilder << "Separator";
menuBuilder << "RicViewZoomAllFeature";
menuBuilder << "Separator";
menuBuilder << "RicDeleteSubPlotFeature";
}
else if ( dynamic_cast<RimSummaryCurve*>( firstUiItem ) )
{
menuBuilder << "RicPasteSummaryCurveFeature";
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewSummaryCurveFeature";
menuBuilder << "RicDuplicateSummaryCurveFeature";
menuBuilder << "RicNewSummaryCrossPlotCurveFeature";
menuBuilder << "RicDuplicateSummaryCrossPlotCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicSetSourceSteppingSummaryCurveFeature";
menuBuilder << "RicClearSourceSteppingSummaryCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicStackSelectedCurvesFeature";
menuBuilder << "RicUnstackSelectedCurvesFeature";
menuBuilder << "Separator";
menuBuilder << "RicCopyReferencesToClipboardFeature";
menuBuilder << "Separator";
menuBuilder << "RicEditSummaryCurveCalculationFeature";
}
else if ( dynamic_cast<RimSummaryCurveCollection*>( firstUiItem ) )
{
menuBuilder << "RicPasteSummaryCurveFeature";
menuBuilder << "RicPasteSummaryCrossPlotCurveFeature";
menuBuilder << "Separator";
menuBuilder << "RicEditSummaryPlotFeature";
menuBuilder << "RicNewSummaryCurveFeature";
menuBuilder << "RicNewSummaryCrossPlotCurveFeature";
}
else if ( dynamic_cast<RimEnsembleCurveSetCollection*>( firstUiItem ) )
{
2018-04-19 07:00:00 -05:00
menuBuilder << "RicNewSummaryEnsembleCurveSetFeature";
menuBuilder << "RicPasteEnsembleCurveSetFeature";
}
else if ( dynamic_cast<RimEnsembleCurveSet*>( firstUiItem ) )
{
menuBuilder << "RicNewSummaryEnsembleCurveSetFeature";
menuBuilder << "Separator";
menuBuilder << "RicSetSourceSteppingEnsembleCurveSetFeature";
menuBuilder << "RicClearSourceSteppingEnsembleCurveSetFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewEnsembleCurveFilterFeature";
}
else if ( dynamic_cast<RimCustomObjectiveFunctionCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewCustomObjectiveFunctionFeature";
}
else if ( dynamic_cast<RimCustomObjectiveFunction*>( firstUiItem ) )
{
menuBuilder << "RicNewCustomObjectiveFunctionWeightFeature";
}
else if ( dynamic_cast<RimEnsembleCurveFilterCollection*>( firstUiItem ) )
2018-05-31 03:23:51 -05:00
{
menuBuilder << "RicNewEnsembleCurveFilterFeature";
}
else if ( dynamic_cast<RimSummaryCaseMainCollection*>( firstUiItem ) )
{
menuBuilder << "RicImportSummaryCaseFeature";
menuBuilder << "RicImportSummaryCasesFeature";
menuBuilder << "RicImportSummaryGroupFeature";
2018-04-19 07:00:00 -05:00
menuBuilder << "RicImportEnsembleFeature";
2018-06-25 08:14:47 -05:00
menuBuilder << "RicNewDerivedEnsembleFeature";
menuBuilder << "RicNewDerivedSummaryFeature";
menuBuilder << "Separator";
menuBuilder << "RicShowSummaryCurveCalculatorFeature";
}
else if ( dynamic_cast<RimSummaryCaseCollection*>( firstUiItem ) )
{
menuBuilder.subMenuStart( "Import" );
menuBuilder << "RicImportSummaryCaseFeature";
menuBuilder << "RicImportSummaryCasesFeature";
menuBuilder << "RicImportSummaryGroupFeature";
2018-04-19 07:00:00 -05:00
menuBuilder << "RicImportEnsembleFeature";
2018-05-07 04:04:42 -05:00
menuBuilder.subMenuEnd();
menuBuilder.addSeparator();
2018-06-25 08:14:47 -05:00
menuBuilder << "RicNewDerivedEnsembleFeature";
menuBuilder << "RicNewSummaryPlotFeature";
menuBuilder << "RicNewDefaultSummaryPlotFeature";
menuBuilder << "RicNewSummaryCrossPlotFeature";
menuBuilder.addSeparator();
menuBuilder << "RicConvertGroupToEnsembleFeature";
menuBuilder.addSeparator();
}
else if ( dynamic_cast<RimSummaryCase*>( firstUiItem ) )
{
menuBuilder.subMenuStart( "Import" );
menuBuilder << "RicImportSummaryCaseFeature";
menuBuilder << "RicImportSummaryCasesFeature";
menuBuilder << "RicImportSummaryGroupFeature";
2018-04-19 07:00:00 -05:00
menuBuilder << "RicImportEnsembleFeature";
2018-05-07 04:04:42 -05:00
menuBuilder.subMenuEnd();
menuBuilder.addSeparator();
menuBuilder << "RicNewSummaryPlotFeature";
menuBuilder << "RicNewDefaultSummaryPlotFeature";
menuBuilder << "RicNewSummaryCrossPlotFeature";
menuBuilder.addSeparator();
menuBuilder << "RicImportGridModelFromSummaryCaseFeature";
if ( !dynamic_cast<RimObservedSummaryData*>( firstUiItem ) )
2017-09-19 07:19:39 -05:00
{
menuBuilder << "RicShowSummaryCurveCalculatorFeature";
// menuBuilder << "RicNewSummaryPlotFeature";
2017-09-19 07:19:39 -05:00
}
}
else if ( dynamic_cast<RimWellLogFileChannel*>( firstUiItem ) )
{
menuBuilder << "RicAddWellLogToPlotFeature";
}
else if ( dynamic_cast<RimIntersectionCollection*>( firstUiItem ) )
{
menuBuilder << "RicPasteIntersectionsFeature";
menuBuilder.addSeparator();
menuBuilder << "RicAppendIntersectionFeature";
menuBuilder << "RicAppendIntersectionBoxFeature";
menuBuilder.addSeparator();
menuBuilder << "RicCopyIntersectionsToAllViewsInCaseFeature";
}
else if ( dynamic_cast<RimExtrudedCurveIntersection*>( firstUiItem ) )
{
menuBuilder << "RicPasteIntersectionsFeature";
menuBuilder.addSeparator();
menuBuilder << "RicAppendIntersectionFeature";
menuBuilder << "RicAppendIntersectionBoxFeature";
menuBuilder.addSeparator();
menuBuilder << "RicNewIntersectionViewFeature";
menuBuilder.addSeparator();
menuBuilder << "RicCopyIntersectionsToAllViewsInCaseFeature";
}
else if ( dynamic_cast<RimBoxIntersection*>( firstUiItem ) )
{
menuBuilder << "RicPasteIntersectionsFeature";
menuBuilder.addSeparator();
menuBuilder << "RicAppendIntersectionFeature";
menuBuilder << "RicAppendIntersectionBoxFeature";
menuBuilder.addSeparator();
menuBuilder << "RicCopyIntersectionsToAllViewsInCaseFeature";
}
else if ( dynamic_cast<RimIntersectionResultsDefinitionCollection*>( firstUiItem ) ||
dynamic_cast<RimIntersectionResultDefinition*>( firstUiItem ) )
{
menuBuilder << "RicAppendSeparateIntersectionResultFeature";
}
else if ( dynamic_cast<RimSimWellInView*>( firstUiItem ) )
{
menuBuilder << "RicNewWellLogCurveExtractionFeature";
menuBuilder << "RicNewWellLogRftCurveFeature";
menuBuilder << "RicNewSimWellIntersectionFeature";
menuBuilder.subMenuStart( "Well Plots", QIcon( ":/WellLogTrack16x16.png" ) );
menuBuilder << "RicNewRftPlotFeature";
menuBuilder << "RicNewPltPlotFeature";
menuBuilder << "Separator";
menuBuilder << "RicPlotProductionRateFeature";
menuBuilder << "RicShowWellAllocationPlotFeature";
menuBuilder << "RicShowCumulativePhasePlotFeature";
menuBuilder.subMenuEnd();
menuBuilder << "RicExportCompletionsForVisibleSimWellsFeature";
}
else if ( dynamic_cast<RimSimWellInViewCollection*>( firstUiItem ) )
{
menuBuilder << "RicExportCompletionsForVisibleSimWellsFeature";
}
else if ( dynamic_cast<RimColorLegendCollection*>( firstUiItem ) )
{
2020-05-13 07:28:06 -05:00
menuBuilder << "RicInsertColorLegendFeature";
menuBuilder << "RicImportColorCategoriesFeature"; // import of color legend from LYR file
}
2020-05-13 07:28:06 -05:00
else if ( dynamic_cast<RimColorLegend*>( firstUiItem ) )
{
menuBuilder << "RicInsertColorLegendFeature";
menuBuilder << "RicCopyStandardLegendFeature";
menuBuilder << "RicInsertColorLegendItemFeature";
}
else if ( dynamic_cast<RimColorLegendItem*>( firstUiItem ) )
{
menuBuilder << "RicInsertColorLegendItemFeature";
}
else if ( dynamic_cast<RimFormationNames*>( firstUiItem ) )
{
menuBuilder << "RicImportFormationNamesFeature";
menuBuilder << "RicReloadFormationNamesFeature";
}
else if ( dynamic_cast<RimFormationNamesCollection*>( firstUiItem ) )
{
menuBuilder << "RicImportFormationNamesFeature";
menuBuilder << "Separator";
menuBuilder << "RicReloadFormationNamesFeature";
}
else if ( dynamic_cast<RimFaultInView*>( firstUiItem ) )
2016-11-25 08:57:17 -06:00
{
menuBuilder << "RicExportFaultsFeature";
2016-11-25 08:57:17 -06:00
}
else if ( dynamic_cast<RimWellAllocationPlot*>( firstUiItem ) )
{
menuBuilder << "RicAddStoredWellAllocationPlotFeature";
}
else if ( dynamic_cast<RimFlowCharacteristicsPlot*>( firstUiItem ) )
{
menuBuilder << "RicAddStoredFlowCharacteristicsPlotFeature";
}
else if ( dynamic_cast<RimFlowDiagSolution*>( firstUiItem ) )
{
menuBuilder << "RicShowFlowCharacteristicsPlotFeature";
}
else if ( dynamic_cast<RimFlowPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicShowFlowCharacteristicsPlotFeature";
}
else if ( dynamic_cast<Rim3dOverlayInfoConfig*>( firstUiItem ) )
{
menuBuilder << "RicShowGridStatisticsFeature";
}
else if ( dynamic_cast<RimSimWellFracture*>( firstUiItem ) )
{
menuBuilder << "RicNewSimWellFractureFeature";
}
else if ( dynamic_cast<RimValveTemplateCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewValveTemplateFeature";
}
else if ( dynamic_cast<RimValveTemplate*>( firstUiItem ) )
{
menuBuilder << "RicDeleteValveTemplateFeature";
}
else if ( dynamic_cast<RimEnsembleFractureStatisticsCollection*>( firstUiItem ) )
{
menuBuilder << "RicImportEnsembleFractureStatisticsFeature";
}
else if ( dynamic_cast<RimStimPlanModelTemplate*>( firstUiItem ) )
{
menuBuilder << "RicImportFaciesFeature";
menuBuilder << "RicImportElasticPropertiesFeature";
}
else if ( dynamic_cast<RimStimPlanModelTemplateCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewStimPlanModelTemplateFeature";
}
else if ( dynamic_cast<RimFractureTemplateCollection*>( firstUiItem ) )
{
menuBuilder << "RicPasteEllipseFractureFeature";
menuBuilder << "RicPasteStimPlanFractureFeature";
menuBuilder.addSeparator();
menuBuilder << "RicNewEllipseFractureTemplateFeature";
menuBuilder << "RicNewStimPlanFractureTemplateFeature";
menuBuilder << "Separator";
menuBuilder << "RicConvertAllFractureTemplatesToMetricFeature";
menuBuilder << "RicConvertAllFractureTemplatesToFieldFeature";
}
else if ( dynamic_cast<RimStimPlanFractureTemplate*>( firstUiItem ) )
{
menuBuilder << "RicPasteStimPlanFractureFeature";
menuBuilder << "RicPasteEllipseFractureFeature";
menuBuilder.addSeparator();
menuBuilder << "RicNewEllipseFractureTemplateFeature";
menuBuilder << "RicNewStimPlanFractureTemplateFeature";
menuBuilder << "Separator";
menuBuilder << "RicConvertFractureTemplateUnitFeature";
}
else if ( dynamic_cast<RimEllipseFractureTemplate*>( firstUiItem ) )
{
menuBuilder << "RicPasteEllipseFractureFeature";
menuBuilder << "RicPasteStimPlanFractureFeature";
menuBuilder.addSeparator();
menuBuilder << "RicNewEllipseFractureTemplateFeature";
menuBuilder << "RicNewStimPlanFractureTemplateFeature";
menuBuilder << "Separator";
menuBuilder << "RicConvertFractureTemplateUnitFeature";
}
else if ( dynamic_cast<RimElasticProperties*>( firstUiItem ) )
{
menuBuilder << "RicNewElasticPropertyScalingFeature";
}
Surfaces: Improve UI and usability for surfaces (#6290) * Add reload command to surface context menus. Still missing the part that actually reloads the data. * Add additional check for null ptr to avoid crash * Surfaces: implements reload command in context menu to reload surface data from its source (i.e. a file). Rename function names to better show what they are actually doing Refactor a bit to give all RimSurface subclasses the same interface for reloading data. Also makes sure new RimGridCaseSurface instances are shown by default in the view(s) * Fixes by clang-format * Include offset and slice index in surface name shown in project explorer * Allow importing the same file multiple times * Disable lighting for surfaces, as it doesn't look good for now. Fixes #6084 * Surfaces: Remove depth offset setting from view. Add slider to depth offset edit for surface * Create new surfaces only on collection context menu * Make sure tree view icon is enabled/disabled when the check box is clicked * Fix depth offset for grid case surfaces, missing base function call. * Make public method .. public. * Add reload command to surface context menus. Still missing the part that actually reloads the data. * Add additional check for null ptr to avoid crash * Surfaces: implements reload command in context menu to reload surface data from its source (i.e. a file). Rename function names to better show what they are actually doing Refactor a bit to give all RimSurface subclasses the same interface for reloading data. Also makes sure new RimGridCaseSurface instances are shown by default in the view(s) * Fixes by clang-format * Include offset and slice index in surface name shown in project explorer * Allow importing the same file multiple times * Disable lighting for surfaces, as it doesn't look good for now. Fixes #6084 * Surfaces: Remove depth offset setting from view. Add slider to depth offset edit for surface * Create new surfaces only on collection context menu * Make sure tree view icon is enabled/disabled when the check box is clicked * Fix depth offset for grid case surfaces, missing base function call. * Make public method .. public. * Fixes by clang-format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-11 04:34:34 -05:00
else if ( dynamic_cast<RimSurfaceCollection*>( firstUiItem ) )
{
menuBuilder << "RicImportSurfacesFeature";
2020-05-03 04:29:33 -05:00
menuBuilder << "RicNewGridSurfaceFeature";
menuBuilder.addSeparator();
menuBuilder << "RicNewSurfaceCollectionFeature";
Surfaces: Improve UI and usability for surfaces (#6290) * Add reload command to surface context menus. Still missing the part that actually reloads the data. * Add additional check for null ptr to avoid crash * Surfaces: implements reload command in context menu to reload surface data from its source (i.e. a file). Rename function names to better show what they are actually doing Refactor a bit to give all RimSurface subclasses the same interface for reloading data. Also makes sure new RimGridCaseSurface instances are shown by default in the view(s) * Fixes by clang-format * Include offset and slice index in surface name shown in project explorer * Allow importing the same file multiple times * Disable lighting for surfaces, as it doesn't look good for now. Fixes #6084 * Surfaces: Remove depth offset setting from view. Add slider to depth offset edit for surface * Create new surfaces only on collection context menu * Make sure tree view icon is enabled/disabled when the check box is clicked * Fix depth offset for grid case surfaces, missing base function call. * Make public method .. public. * Add reload command to surface context menus. Still missing the part that actually reloads the data. * Add additional check for null ptr to avoid crash * Surfaces: implements reload command in context menu to reload surface data from its source (i.e. a file). Rename function names to better show what they are actually doing Refactor a bit to give all RimSurface subclasses the same interface for reloading data. Also makes sure new RimGridCaseSurface instances are shown by default in the view(s) * Fixes by clang-format * Include offset and slice index in surface name shown in project explorer * Allow importing the same file multiple times * Disable lighting for surfaces, as it doesn't look good for now. Fixes #6084 * Surfaces: Remove depth offset setting from view. Add slider to depth offset edit for surface * Create new surfaces only on collection context menu * Make sure tree view icon is enabled/disabled when the check box is clicked * Fix depth offset for grid case surfaces, missing base function call. * Make public method .. public. * Fixes by clang-format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-11 04:34:34 -05:00
}
else if ( dynamic_cast<RimSurface*>( firstUiItem ) )
{
if ( dynamic_cast<RimGridCaseSurface*>( firstUiItem ) )
{
menuBuilder << "RicExportKLayerToPtlFeature";
2020-04-29 03:19:38 -05:00
}
Surfaces: Improve UI and usability for surfaces (#6290) * Add reload command to surface context menus. Still missing the part that actually reloads the data. * Add additional check for null ptr to avoid crash * Surfaces: implements reload command in context menu to reload surface data from its source (i.e. a file). Rename function names to better show what they are actually doing Refactor a bit to give all RimSurface subclasses the same interface for reloading data. Also makes sure new RimGridCaseSurface instances are shown by default in the view(s) * Fixes by clang-format * Include offset and slice index in surface name shown in project explorer * Allow importing the same file multiple times * Disable lighting for surfaces, as it doesn't look good for now. Fixes #6084 * Surfaces: Remove depth offset setting from view. Add slider to depth offset edit for surface * Create new surfaces only on collection context menu * Make sure tree view icon is enabled/disabled when the check box is clicked * Fix depth offset for grid case surfaces, missing base function call. * Make public method .. public. * Add reload command to surface context menus. Still missing the part that actually reloads the data. * Add additional check for null ptr to avoid crash * Surfaces: implements reload command in context menu to reload surface data from its source (i.e. a file). Rename function names to better show what they are actually doing Refactor a bit to give all RimSurface subclasses the same interface for reloading data. Also makes sure new RimGridCaseSurface instances are shown by default in the view(s) * Fixes by clang-format * Include offset and slice index in surface name shown in project explorer * Allow importing the same file multiple times * Disable lighting for surfaces, as it doesn't look good for now. Fixes #6084 * Surfaces: Remove depth offset setting from view. Add slider to depth offset edit for surface * Create new surfaces only on collection context menu * Make sure tree view icon is enabled/disabled when the check box is clicked * Fix depth offset for grid case surfaces, missing base function call. * Make public method .. public. * Fixes by clang-format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-11 04:34:34 -05:00
menuBuilder << "RicExportSurfaceToTsurfFeature";
menuBuilder << "Separator";
menuBuilder << "RicCopySurfaceFeature";
Surfaces: Improve UI and usability for surfaces (#6290) * Add reload command to surface context menus. Still missing the part that actually reloads the data. * Add additional check for null ptr to avoid crash * Surfaces: implements reload command in context menu to reload surface data from its source (i.e. a file). Rename function names to better show what they are actually doing Refactor a bit to give all RimSurface subclasses the same interface for reloading data. Also makes sure new RimGridCaseSurface instances are shown by default in the view(s) * Fixes by clang-format * Include offset and slice index in surface name shown in project explorer * Allow importing the same file multiple times * Disable lighting for surfaces, as it doesn't look good for now. Fixes #6084 * Surfaces: Remove depth offset setting from view. Add slider to depth offset edit for surface * Create new surfaces only on collection context menu * Make sure tree view icon is enabled/disabled when the check box is clicked * Fix depth offset for grid case surfaces, missing base function call. * Make public method .. public. * Add reload command to surface context menus. Still missing the part that actually reloads the data. * Add additional check for null ptr to avoid crash * Surfaces: implements reload command in context menu to reload surface data from its source (i.e. a file). Rename function names to better show what they are actually doing Refactor a bit to give all RimSurface subclasses the same interface for reloading data. Also makes sure new RimGridCaseSurface instances are shown by default in the view(s) * Fixes by clang-format * Include offset and slice index in surface name shown in project explorer * Allow importing the same file multiple times * Disable lighting for surfaces, as it doesn't look good for now. Fixes #6084 * Surfaces: Remove depth offset setting from view. Add slider to depth offset edit for surface * Create new surfaces only on collection context menu * Make sure tree view icon is enabled/disabled when the check box is clicked * Fix depth offset for grid case surfaces, missing base function call. * Make public method .. public. * Fixes by clang-format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-11 04:34:34 -05:00
menuBuilder << "RicReloadSurfaceFeature";
}
else if ( dynamic_cast<RimCellFilterCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewPolygonFilterFeature";
menuBuilder << "RicNewUserDefinedFilterFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewCellRangeFilterFeature";
menuBuilder.subMenuStart( "Slice Filters" );
menuBuilder << "RicNewRangeFilterSliceIFeature";
menuBuilder << "RicNewRangeFilterSliceJFeature";
menuBuilder << "RicNewRangeFilterSliceKFeature";
menuBuilder.subMenuEnd();
}
else if ( dynamic_cast<RimAnnotationCollection*>( firstUiItem ) ||
dynamic_cast<RimAnnotationGroupCollection*>( firstUiItem ) )
{
menuBuilder << "RicCreateTextAnnotationFeature";
menuBuilder << "RicCreateReachCircleAnnotationFeature";
menuBuilder << "RicCreateUserDefinedPolylinesAnnotationFeature";
menuBuilder << "RicImportPolylinesAnnotationFeature";
}
else if ( dynamic_cast<RimAnnotationInViewCollection*>( firstUiItem ) )
{
menuBuilder << "RicCreateTextAnnotationFeature";
}
else if ( dynamic_cast<RimPlotTemplateFolderItem*>( firstUiItem ) ||
dynamic_cast<RimPlotTemplateFileItem*>( firstUiItem ) )
{
menuBuilder << "RicReloadPlotTemplatesFeature";
}
else if ( dynamic_cast<RimMultiPlot*>( firstUiItem ) )
{
menuBuilder << "RicSnapshotViewToPdfFeature";
}
else if ( dynamic_cast<RimStreamlineInViewCollection*>( firstUiItem ) )
{
menuBuilder << "RicNewStreamlineFeature";
}
if ( dynamic_cast<Rim3dView*>( firstUiItem ) )
{
menuBuilder << "Separator";
menuBuilder << "RicLinkVisibleViewsFeature";
menuBuilder << "RicShowLinkOptionsFeature";
menuBuilder << "RicSetMasterViewFeature";
menuBuilder << "RicUnLinkViewFeature";
}
}
if ( firstUiItem )
{
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.
menuBuilder << "RicPasteTimeHistoryCurveFeature";
menuBuilder << "RicPasteAsciiDataCurveFeature";
menuBuilder << "RicPasteSummaryCaseFeature";
menuBuilder.addSeparator();
menuBuilder << "RicCopyReferencesToClipboardFeature";
2018-10-24 06:45:46 -05:00
menuBuilder << "RicLinkViewFeature";
menuBuilder << "RicShowPlotDataFeature";
menuBuilder << "RicShowTotalAllocationDataFeature";
2018-06-25 08:14:47 -05:00
menuBuilder << "RicNewDerivedEnsembleFeature";
menuBuilder << "RicNewSummaryPlotFeature";
menuBuilder << "RicNewDefaultSummaryPlotFeature";
menuBuilder << "RicNewSummaryCrossPlotFeature";
menuBuilder << "RicSummaryCurveSwitchAxisFeature";
menuBuilder << "RicNewDerivedSummaryFeature";
menuBuilder.addSeparator();
menuBuilder << "RicConvertGroupToEnsembleFeature";
menuBuilder.addSeparator();
menuBuilder.addSeparator();
menuBuilder << "RicStackSelectedCurvesFeature";
menuBuilder << "RicUnstackSelectedCurvesFeature";
menuBuilder.addSeparator();
menuBuilder << "RicFlyToObjectFeature";
menuBuilder << "RicImportObservedDataFeature";
2019-08-20 08:09:13 -05:00
menuBuilder << "RicImportObservedFmuDataFeature";
menuBuilder << "RicReloadSummaryCaseFeature";
menuBuilder << "RicReplaceSummaryCaseFeature";
menuBuilder << "RicCreateSummaryCaseCollectionFeature";
menuBuilder << "Separator";
menuBuilder << "RicCutReferencesToClipboardFeature";
menuBuilder << "Separator";
if ( dynamic_cast<RimSummaryCase*>( firstUiItem ) || dynamic_cast<RimSummaryCaseCollection*>( firstUiItem ) )
{
menuBuilder << "RicCreatePlotFromSelectionFeature";
menuBuilder << "RicCreatePlotFromTemplateByShortcutFeature";
}
menuBuilder << "Separator";
2018-03-12 05:12:39 -05:00
menuBuilder << "RicCloseSummaryCaseFeature";
menuBuilder << "RicCloseSummaryCaseInCollectionFeature";
menuBuilder << "RicDeleteSummaryCaseCollectionFeature";
menuBuilder << "RicCloseObservedDataFeature";
2017-02-06 06:33:56 -06:00
menuBuilder << "RicNewMultiPlotFeature";
2017-02-06 06:33:56 -06:00
// Work in progress -- End
appendCreateCompletions( menuBuilder, menuBuilder.itemCount() > 0u );
bool addedExportWellPaths = appendExportWellPaths( menuBuilder, menuBuilder.itemCount() > 0u ) > 0;
appendExportCompletions( menuBuilder, menuBuilder.itemCount() > 0u && !addedExportWellPaths );
if ( menuBuilder.itemCount() > 0u )
{
menuBuilder.addSeparator();
}
2017-02-06 06:33:56 -06:00
if ( dynamic_cast<RimWellLogFileChannel*>( firstUiItem ) )
{
menuBuilder << "RicAddWellLogToPlotFeature";
}
else if ( dynamic_cast<RimEclipseStatisticsCase*>( firstUiItem ) )
{
createExecuteScriptForCasesFeatureMenu( menuBuilder );
}
else if ( dynamic_cast<RimEclipseCase*>( firstUiItem ) )
{
menuBuilder << "RicAddEclipseInputPropertyFeature";
menuBuilder << "RicReloadCaseFeature";
menuBuilder << "RicReplaceCaseFeature";
createExecuteScriptForCasesFeatureMenu( menuBuilder );
menuBuilder << "RicCloseSourSimDataFeature";
}
else if ( dynamic_cast<RimSummaryPlot*>( firstUiItem ) )
{
RimSummaryCrossPlot* summaryCrossPlot = dynamic_cast<RimSummaryCrossPlot*>( firstUiItem );
if ( !summaryCrossPlot )
{
menuBuilder << "RicAsciiExportSummaryPlotFeature";
}
}
else if ( dynamic_cast<RimWellLogPlot*>( firstUiItem ) )
{
menuBuilder << "RicAsciiExportWellLogPlotFeature";
menuBuilder << "RicExportToLasFileFeature";
menuBuilder << "RicChangeDataSourceFeature";
}
else if ( dynamic_cast<RimWellLogCurve*>( firstUiItem ) || dynamic_cast<RimWellLogTrack*>( firstUiItem ) )
2016-11-22 01:48:11 -06:00
{
menuBuilder << "RicExportToLasFileFeature";
menuBuilder << "RicChangeDataSourceFeature";
2016-11-22 01:48:11 -06:00
}
else if ( dynamic_cast<RimWellLogPlotCollection*>( firstUiItem ) )
{
menuBuilder << "RicExportToLasFileFeature";
}
else if ( dynamic_cast<RimFaultInView*>( firstUiItem ) )
2016-11-25 08:57:17 -06:00
{
menuBuilder << "RicExportFaultsFeature";
#ifdef USE_ODB_API
menuBuilder.subMenuStart( "Reactivation Assessment" );
menuBuilder << "RicRunBasicFaultReactAssessmentFeature";
menuBuilder << "RicRunAdvFaultReactAssessmentFeature";
menuBuilder.subMenuEnd();
}
else if ( dynamic_cast<RimFaultInViewCollection*>( firstUiItem ) )
{
menuBuilder.subMenuStart( "Reactivation Assessment" );
menuBuilder << "RicRunBasicFaultReactAssessmentFeature";
menuBuilder << "RicRunAdvFaultReactAssessmentFeature";
menuBuilder.subMenuEnd();
#endif
2016-11-25 08:57:17 -06:00
}
else if ( dynamic_cast<RimSimWellInView*>( firstUiItem ) )
{
menuBuilder << "RicShowContributingWellsFeature";
menuBuilder << "Separator";
menuBuilder << "RicEclipseWellShowLabelFeature";
menuBuilder << "RicEclipseWellShowHeadFeature";
menuBuilder << "RicEclipseWellShowPipeFeature";
menuBuilder << "RicEclipseWellShowSpheresFeature";
menuBuilder << "RicEclipseWellShowWellCellsFeature";
menuBuilder << "RicEclipseWellShowWellCellFenceFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewSimWellFractureFeature";
}
menuBuilder.addSeparator();
menuBuilder << "RicCopyIntersectionsToAllViewsInCaseFeature";
}
{
bool toggleCommandCandidate = true;
if ( firstUiItem )
{
if ( dynamic_cast<RimEclipseCellColors*>( firstUiItem ) )
{
toggleCommandCandidate = false;
}
else if ( dynamic_cast<RimCellEdgeColors*>( firstUiItem ) )
{
toggleCommandCandidate = false;
}
else if ( dynamic_cast<RimEclipseFaultColors*>( firstUiItem ) )
{
toggleCommandCandidate = false;
}
else if ( dynamic_cast<RimEclipseFaultColors*>( firstUiItem ) )
{
toggleCommandCandidate = false;
}
else if ( dynamic_cast<RimVirtualPerforationResults*>( firstUiItem ) )
{
toggleCommandCandidate = false;
}
else if ( dynamic_cast<RimGeoMechCellColors*>( firstUiItem ) )
{
toggleCommandCandidate = false;
}
}
bool addSeparator = true;
if ( toggleCommandCandidate && RicToggleItemsFeatureImpl::isToggleCommandsAvailable() )
{
menuBuilder << "Separator";
menuBuilder << "RicToggleItemsOnFeature";
menuBuilder << "RicToggleItemsOffFeature";
menuBuilder << "RicToggleItemsFeature";
addSeparator = false;
}
if ( addSeparator )
{
menuBuilder.addSeparator();
}
if ( dynamic_cast<RimRegularLegendConfig*>( firstUiItem ) == nullptr )
{
menuBuilder << "RicToggleItemsOnOthersOffFeature";
}
if ( RicToggleItemsFeatureImpl::isToggleCommandsAvailable() )
{
menuBuilder << "RicCollapseSiblingsFeature";
}
menuBuilder << "RicMoveItemsToTopFeature";
menuBuilder << "RicSearchHelpFeature";
}
if ( caf::CmdFeatureManager::instance()->getCommandFeature( "RicDeleteItemFeature" )->canFeatureBeExecuted() )
{
menuBuilder << "Separator";
menuBuilder << "RicDeleteItemFeature";
}
if ( caf::CmdFeatureManager::instance()->getCommandFeature( "RicDeleteSubItemsFeature" )->canFeatureBeExecuted() )
{
menuBuilder << "Separator";
menuBuilder << "RicDeleteSubItemsFeature";
}
// Special delete commands for specific features
// Placed here to fit context menu location of general delete feature
if ( caf::CmdFeatureManager::instance()->getCommandFeature( "Ric3dWellLogCurveDeleteFeature" )->canFeatureBeExecuted() )
{
menuBuilder << "Separator";
menuBuilder << "Ric3dWellLogCurveDeleteFeature";
}
if ( caf::CmdFeatureManager::instance()->getCommandFeature( "RicWellLogFileCloseFeature" )->canFeatureBeExecuted() )
2017-10-25 04:30:10 -05:00
{
menuBuilder << "Separator";
menuBuilder << "RicWellLogFileCloseFeature";
2017-10-25 04:30:10 -05:00
}
if ( caf::CmdFeatureManager::instance()->getCommandFeature( "RicCloseCaseFeature" )->canFeatureBeExecuted() )
{
menuBuilder << "Separator";
menuBuilder << "RicCloseCaseFeature";
}
return menuBuilder;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellPath*> RimContextCommandBuilder::allWellPaths()
{
RimProject* proj = RimProject::current();
return proj->allWellPaths();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimContextCommandBuilder::createExecuteScriptForCasesFeatureMenu( caf::CmdFeatureMenuBuilder& menuBuilder )
{
// Execute script on selection of cases
RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
if ( ruiMainWindow )
{
std::vector<RimCase*> cases;
ruiMainWindow->selectedCases( cases );
if ( cases.size() > 0 )
{
menuBuilder.subMenuStart( "Execute script" );
RiaApplication* app = RiaApplication::instance();
RimProject* proj = app->project();
if ( proj && proj->scriptCollection() )
{
RimScriptCollection* rootScriptCollection = proj->scriptCollection();
// Root script collection holds a list of subdirectories of user defined script folders
for ( size_t i = 0; i < rootScriptCollection->subDirectories.size(); i++ )
{
RimScriptCollection* subDir = rootScriptCollection->subDirectories[i];
if ( subDir )
{
appendScriptItems( menuBuilder, subDir );
}
}
}
menuBuilder.addSeparator();
menuBuilder.subMenuEnd();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimContextCommandBuilder::appendScriptItems( caf::CmdFeatureMenuBuilder& menuBuilder,
RimScriptCollection* scriptCollection )
{
QDir dir( scriptCollection->directory );
menuBuilder.subMenuStart( dir.dirName() );
for ( size_t i = 0; i < scriptCollection->calcScripts.size(); i++ )
{
RimCalcScript* calcScript = scriptCollection->calcScripts[i];
QFileInfo fi( calcScript->absoluteFileName() );
QString menuText = fi.baseName();
menuBuilder.addCmdFeatureWithUserData( "RicExecuteScriptForCasesFeature",
menuText,
QVariant( calcScript->absoluteFileName() ) );
}
for ( size_t i = 0; i < scriptCollection->subDirectories.size(); i++ )
{
RimScriptCollection* subDir = scriptCollection->subDirectories[i];
appendScriptItems( menuBuilder, subDir );
}
menuBuilder.subMenuEnd();
}
2019-04-08 04:04:21 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimContextCommandBuilder::appendImportMenu( caf::CmdFeatureMenuBuilder& menuBuilder, bool addSeparatorBeforeMenu )
2019-04-08 04:04:21 -05:00
{
QStringList candidates;
candidates << "RicWellPathsImportFileFeature";
candidates << "RicWellPathFormationsImportFileFeature";
candidates << "RicWellLogsImportFileFeature";
candidates << "RicReloadWellPathFormationNamesFeature";
return appendSubMenuWithCommands( menuBuilder, candidates, "Import", QIcon(), addSeparatorBeforeMenu );
}
2019-04-08 04:04:21 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimContextCommandBuilder::appendCreateCompletions( caf::CmdFeatureMenuBuilder& menuBuilder, bool addSeparatorBeforeMenu )
{
QStringList candidates;
candidates << "RicNewPerforationIntervalFeature";
candidates << "RicEditPerforationCollectionFeature";
candidates << "RicNewValveFeature";
candidates << "RicNewFishbonesSubsFeature";
candidates << "RicNewWellPathFractureFeature";
candidates << "RicNewStimPlanModelFeature";
candidates << "Separator";
candidates << "RicCreateMultipleFracturesFeature";
candidates << "RicNewWellPathAttributeFeature";
candidates << "Separator";
candidates << "RicCreateTemporaryLgrFeature";
return appendSubMenuWithCommands( menuBuilder,
candidates,
"Create Completions",
QIcon( ":/CompletionsSymbol16x16.png" ),
addSeparatorBeforeMenu );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimContextCommandBuilder::appendExportCompletions( caf::CmdFeatureMenuBuilder& menuBuilder, bool addSeparatorBeforeMenu )
{
QStringList candidates;
candidates << "RicExportCompletionsForVisibleWellPathsFeature";
candidates << "RicWellPathExportCompletionDataFeature";
candidates << "RicExportFishbonesLateralsFeature";
candidates << "RicExportCompletionsWellSegmentsFeature";
return appendSubMenuWithCommands( menuBuilder,
candidates,
"Export Completions",
QIcon( ":/ExportCompletionsSymbol16x16.png" ),
addSeparatorBeforeMenu );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimContextCommandBuilder::appendExportWellPaths( caf::CmdFeatureMenuBuilder& menuBuilder, bool addSeparatorBeforeMenu )
{
QStringList candidates;
candidates << "RicExportSelectedWellPathsFeature";
candidates << "RicExportVisibleWellPathsFeature";
2020-10-01 10:25:19 -05:00
return appendSubMenuWithCommands( menuBuilder, candidates, "Export Well Paths", QIcon( ":/Save.svg" ), addSeparatorBeforeMenu );
}
//-------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimContextCommandBuilder::appendSubMenuWithCommands( caf::CmdFeatureMenuBuilder& menuBuilder,
const QStringList& commandCandidates,
const QString& menuLabel,
const QIcon& menuIcon /*= QIcon()*/,
bool addSeparatorBeforeMenu /*=false*/ )
{
int actualCommandsAdded = 0;
QStringList validCommands;
for ( QString candidate : commandCandidates )
2019-04-08 04:04:21 -05:00
{
if ( candidate == "Separator" )
{
validCommands << candidate;
}
else
{
if ( caf::CmdFeatureManager::instance()->getCommandFeature( candidate.toStdString() )->canFeatureBeExecuted() &&
!menuBuilder.isCmdFeatureAdded( candidate ) )
{
validCommands << candidate;
actualCommandsAdded++;
}
}
2019-04-08 04:04:21 -05:00
}
if ( actualCommandsAdded > 0 )
2019-04-08 04:04:21 -05:00
{
if ( addSeparatorBeforeMenu )
{
menuBuilder << "Separator";
}
menuBuilder.subMenuStart( menuLabel, menuIcon );
2019-04-08 04:04:21 -05:00
for ( int i = 0; i < validCommands.size(); ++i )
2019-04-08 04:04:21 -05:00
{
bool firstOrLast = i == 0 || i == validCommands.size() - 1;
if ( !firstOrLast || validCommands[i] != "Separator" )
{
menuBuilder << validCommands[i];
}
2019-04-08 04:04:21 -05:00
}
menuBuilder.subMenuEnd();
}
return actualCommandsAdded;
}