mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1840 Summary case: Rename and code clean up
This commit is contained in:
@@ -27,8 +27,7 @@ class RicCloseSummaryCaseInCollectionFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
private:
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
|
||||
@@ -47,9 +47,10 @@ void RicCreateSummaryCaseCollectionFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimSummaryCase*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
if (selection.size() == 0) return;
|
||||
|
||||
RimSummaryCaseMainCollection* summaryCaseMainCollection = nullptr;
|
||||
selection.at(0)->firstAncestorOrThisOfTypeAsserted(summaryCaseMainCollection);
|
||||
selection[0]->firstAncestorOrThisOfTypeAsserted(summaryCaseMainCollection);
|
||||
|
||||
summaryCaseMainCollection->addCaseCollection(selection);
|
||||
summaryCaseMainCollection->updateConnectedEditors();
|
||||
|
||||
@@ -22,11 +22,14 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicCreateSummaryCaseCollectionFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
private:
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
|
||||
@@ -143,6 +143,14 @@ RimSummaryCase* RimSummaryCaseMainCollection::findSummaryCaseFromFileName(const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseMainCollection::addCase(RimSummaryCase* summaryCase)
|
||||
{
|
||||
m_cases.push_back(summaryCase);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -155,14 +163,6 @@ void RimSummaryCaseMainCollection::removeCase(RimSummaryCase* summaryCase)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseMainCollection::addCase(RimSummaryCase* summaryCase)
|
||||
{
|
||||
m_cases.push_back(summaryCase);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -26,6 +26,9 @@ class RimSummaryCase;
|
||||
class RimEclipseResultCase;
|
||||
class RimSummaryCaseCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimSummaryCaseMainCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
@@ -45,9 +48,9 @@ public:
|
||||
RimSummaryCase* findSummaryCaseFromEclipseResultCase(RimEclipseResultCase* eclResCase) const;
|
||||
RimSummaryCase* findSummaryCaseFromFileName(const QString& fileName) const;
|
||||
|
||||
void addCase(RimSummaryCase* summaryCase);
|
||||
void removeCase(RimSummaryCase* summaryCase);
|
||||
|
||||
void addCase(RimSummaryCase* summaryCase);
|
||||
void addCaseCollection(std::vector<RimSummaryCase*> summaryCases);
|
||||
void removeCaseCollection(RimSummaryCaseCollection* caseCollection);
|
||||
|
||||
@@ -57,8 +60,6 @@ public:
|
||||
|
||||
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimSummaryCase*> m_cases;
|
||||
caf::PdmChildArrayField<RimSummaryCaseCollection*> m_caseCollections;
|
||||
|
||||
Reference in New Issue
Block a user