#3318 Plot editor performance. Several performance fixes

This commit is contained in:
Bjørn Erik Jensen
2018-09-13 12:38:17 +02:00
parent 7d2889c66b
commit b4dd37337a
22 changed files with 294 additions and 48 deletions

View File

@@ -34,6 +34,8 @@
#include "RimSummaryPlotCollection.h"
#include "RimSummaryCase.h"
#include "RimSummaryCaseCollection.h"
#include "RimProject.h"
#include "RimSummaryCaseMainCollection.h"
#include "RiuPlotMainWindow.h"
@@ -89,6 +91,23 @@ void RicNewSummaryPlotFeature::onActionTriggered(bool isChecked)
std::vector<caf::PdmObject*> sourcesToSelect(selectedCases.begin(), selectedCases.end());
if (sourcesToSelect.empty() && selectedGroups.empty())
{
const auto allSingleCases = project->firstSummaryCaseMainCollection()->topLevelSummaryCases();
const auto allGroups = project->summaryGroups();
std::vector<RimSummaryCaseCollection*> allEnsembles;
for (const auto group : allGroups) if (group->isEnsemble()) allEnsembles.push_back(group);
if (!allSingleCases.empty())
{
sourcesToSelect.push_back(allSingleCases.front());
}
else if (!allEnsembles.empty())
{
sourcesToSelect.push_back(allEnsembles.front());
}
}
// Append grouped cases
for (auto group : selectedGroups)
{