mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
#12614 Histogram: make it easier to create histograms.
This commit is contained in:
1 parent
f6ca88f54b
commit
35a77b9778
7 files changed
+95
-26
No files matched your search
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RimHistogramMultiPlotCollection.h"
|
||||
|
||||
#include "RicHistogramPlotTools.h"
|
||||
#include "RimHistogramMultiPlot.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
@@ -94,5 +95,12 @@ size_t RimHistogramMultiPlotCollection::plotCount() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimHistogramMultiPlotCollection::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const
|
||||
{
|
||||
menuBuilder.addCmdFeature( "RicNewHistogramMultiPlotFeature", "New Histogram Plot" );
|
||||
menuBuilder.subMenuStart( "New Histogram Plot" );
|
||||
|
||||
for ( RicHistogramPlotTools::DataSourceType dataSourceType : RicHistogramPlotTools::allDataSourceTypes() )
|
||||
{
|
||||
caf::AppEnum<RicHistogramPlotTools::DataSourceType> dstEnum( dataSourceType );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicNewHistogramMultiPlotFeature", dstEnum.uiText(), QVariant( dstEnum.text() ) );
|
||||
}
|
||||
menuBuilder.subMenuEnd();
|
||||
}
|
||||
@@ -163,6 +163,7 @@
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "OctaveScriptCommands/RicExecuteScriptForCasesFeature.h"
|
||||
#include "RicHistogramPlotTools.h"
|
||||
#include "ToggleCommands/RicToggleItemsFeatureImpl.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
@@ -979,19 +980,24 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
}
|
||||
else if ( dynamic_cast<RimHistogramMultiPlot*>( firstUiItem ) )
|
||||
{
|
||||
menuBuilder << "RicNewDefaultHistogramPlotFeature";
|
||||
menuBuilder.subMenuStart( "New Histogram Plot" );
|
||||
|
||||
for ( RicHistogramPlotTools::DataSourceType dataSourceType : RicHistogramPlotTools::allDataSourceTypes() )
|
||||
{
|
||||
caf::AppEnum<RicHistogramPlotTools::DataSourceType> dstEnum( dataSourceType );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicNewDefaultHistogramPlotFeature", dstEnum.uiText(), QVariant( dstEnum.text() ) );
|
||||
}
|
||||
|
||||
menuBuilder.subMenuEnd();
|
||||
}
|
||||
else if ( dynamic_cast<RimHistogramPlot*>( firstUiItem ) )
|
||||
{
|
||||
menuBuilder.subMenuStart( "New Histogram Curve" );
|
||||
|
||||
// TODO: make an enum of these?
|
||||
std::vector<QString> curveTypes = { "Ensemble Parameter", "Grid Statistics", "Summary Vector", "Ensemble Fracture Statistics" };
|
||||
|
||||
for ( const QString& curveType : curveTypes )
|
||||
for ( RicHistogramPlotTools::DataSourceType dataSourceType : RicHistogramPlotTools::allDataSourceTypes() )
|
||||
{
|
||||
QString menuText = curveType;
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicNewHistogramCurveFeature", menuText, QVariant( curveType ) );
|
||||
caf::AppEnum<RicHistogramPlotTools::DataSourceType> dstEnum( dataSourceType );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicNewHistogramCurveFeature", dstEnum.uiText(), QVariant( dstEnum.text() ) );
|
||||
}
|
||||
|
||||
menuBuilder.subMenuEnd();
|
||||
|
||||
Reference in new issue
Block a user