mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1913 New summary plot. Command brings up curve creator and creates new plot on Apply/OK
This commit is contained in:
parent
9d56cee1be
commit
292ea3c67f
@ -26,6 +26,7 @@ ${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreator.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorSplitterUi.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorDialog.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorUiKeywords.h
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorFactoryImpl.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -48,6 +49,7 @@ ${CEE_CURRENT_LIST_DIR}RicEditSummaryCurves.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreator.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorSplitterUi.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorDialog.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicSummaryCurveCreatorFactoryImpl.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -30,23 +30,35 @@
|
||||
|
||||
#include "cvfAssert.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "RicSummaryCurveCreatorFactoryImpl.h"
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicEditSummaryCurves, "RicEditSummaryCurves");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicEditSummaryCurves::RicEditSummaryCurves()
|
||||
{
|
||||
m_curveCreatorFactory = RicSummaryCurveCreatorFactoryImpl::instance();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicEditSummaryCurves::closeDialogAndResetTargetPlot()
|
||||
{
|
||||
if (m_dialogWithSplitter && m_dialogWithSplitter->isVisible())
|
||||
auto dialog = m_curveCreatorFactory->dialog();
|
||||
auto curveCreator = m_curveCreatorFactory->curveCreator();
|
||||
|
||||
if (dialog && dialog->isVisible())
|
||||
{
|
||||
m_dialogWithSplitter->hide();
|
||||
dialog->hide();
|
||||
}
|
||||
|
||||
if (m_curveCreator)
|
||||
if (curveCreator)
|
||||
{
|
||||
m_curveCreator->updateFromSummaryPlot(nullptr);
|
||||
curveCreator->updateFromSummaryPlot(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,21 +78,18 @@ void RicEditSummaryCurves::onActionTriggered(bool isChecked)
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
CVF_ASSERT(project);
|
||||
|
||||
if (m_curveCreator == nullptr)
|
||||
{
|
||||
m_curveCreator = new RicSummaryCurveCreator();
|
||||
m_dialogWithSplitter = new RicSummaryCurveCreatorDialog(nullptr, m_curveCreator);
|
||||
}
|
||||
auto dialog = m_curveCreatorFactory->dialog();
|
||||
auto curveCreator = m_curveCreatorFactory->curveCreator();
|
||||
|
||||
if (!m_dialogWithSplitter->isVisible())
|
||||
m_dialogWithSplitter->show();
|
||||
if (!dialog->isVisible())
|
||||
dialog->show();
|
||||
|
||||
// Set target plot
|
||||
std::vector<RimSummaryPlot*> plots;
|
||||
caf::SelectionManager::instance()->objectsByType(&plots);
|
||||
if (plots.size() == 1)
|
||||
{
|
||||
m_curveCreator->updateFromSummaryPlot(plots.front());
|
||||
curveCreator->updateFromSummaryPlot(plots.front());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,7 @@
|
||||
#include "cafCmdFeature.h"
|
||||
#include <QPointer>
|
||||
|
||||
class RicSummaryCurveCreator;
|
||||
class RicSummaryCurveCreatorDialog;
|
||||
class RicSummaryCurveCreatorFactoryImpl;
|
||||
|
||||
namespace caf {
|
||||
class PdmUiPropertyViewDialog;
|
||||
@ -34,6 +33,7 @@ namespace caf {
|
||||
class RicEditSummaryCurves : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
RicEditSummaryCurves();
|
||||
|
||||
public:
|
||||
void closeDialogAndResetTargetPlot();
|
||||
@ -45,6 +45,5 @@ protected:
|
||||
virtual void setupActionLook(QAction* actionToSetup);
|
||||
|
||||
private:
|
||||
RicSummaryCurveCreator* m_curveCreator;
|
||||
QPointer<RicSummaryCurveCreatorDialog> m_dialogWithSplitter;
|
||||
RicSummaryCurveCreatorFactoryImpl* m_curveCreatorFactory;
|
||||
};
|
||||
|
@ -21,25 +21,28 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurveFilter.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuMainPlotWindow.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
#include "cvfAssert.h"
|
||||
#include "RicSummaryCurveCreatorFactoryImpl.h"
|
||||
#include "RicSummaryCurveCreator.h"
|
||||
#include "RicSummaryCurveCreatorDialog.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimSummaryCurveFilter.h"
|
||||
#include "RiuMainPlotWindow.h"
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewSummaryPlotFeature, "RicNewSummaryPlotFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicNewSummaryPlotFeature::RicNewSummaryPlotFeature()
|
||||
{
|
||||
m_curveCreatorFactory = RicSummaryCurveCreatorFactoryImpl::instance();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -56,30 +59,13 @@ void RicNewSummaryPlotFeature::onActionTriggered(bool isChecked)
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
CVF_ASSERT(project);
|
||||
|
||||
RimMainPlotCollection* mainPlotColl = project->mainPlotCollection();
|
||||
CVF_ASSERT(mainPlotColl);
|
||||
auto dialog = m_curveCreatorFactory->dialog();
|
||||
auto curveCreator = m_curveCreatorFactory->curveCreator();
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotColl = mainPlotColl->summaryPlotCollection();
|
||||
CVF_ASSERT(summaryPlotColl);
|
||||
if (!dialog->isVisible())
|
||||
dialog->show();
|
||||
|
||||
RimSummaryCase* summaryCase = nullptr;
|
||||
std::vector<RimSummaryCase*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
if (selection.size() == 1)
|
||||
{
|
||||
summaryCase = selection[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
project->allSummaryCases(cases);
|
||||
if (cases.size() > 0)
|
||||
{
|
||||
summaryCase = cases[0];
|
||||
}
|
||||
}
|
||||
|
||||
createNewSummaryPlot(summaryPlotColl, summaryCase);
|
||||
curveCreator->updateFromSummaryPlot(nullptr);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -92,7 +78,7 @@ void RicNewSummaryPlotFeature::setupActionLook(QAction* actionToSetup)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// This method is not called from within this class, only by other classes
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RicNewSummaryPlotFeature::createNewSummaryPlot(RimSummaryPlotCollection* summaryPlotColl, RimSummaryCase* summaryCase)
|
||||
{
|
||||
|
@ -20,8 +20,9 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryCase;
|
||||
class RicSummaryCurveCreatorFactoryImpl;
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryPlot;
|
||||
|
||||
//==================================================================================================
|
||||
@ -32,6 +33,7 @@ class RicNewSummaryPlotFeature : public caf::CmdFeature
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RicNewSummaryPlotFeature();
|
||||
static RimSummaryPlot* createNewSummaryPlot(RimSummaryPlotCollection* summaryPlotColl, RimSummaryCase* summaryCase);
|
||||
|
||||
protected:
|
||||
@ -40,4 +42,6 @@ protected:
|
||||
virtual void onActionTriggered( bool isChecked );
|
||||
virtual void setupActionLook(QAction* actionToSetup);
|
||||
|
||||
private:
|
||||
RicSummaryCurveCreatorFactoryImpl* m_curveCreatorFactory;
|
||||
};
|
||||
|
@ -179,6 +179,7 @@ RicSummaryCurveCreator::RicSummaryCurveCreator() : m_identifierFieldsMap(
|
||||
CAF_PDM_InitFieldNoDefault(&m_regionAppearanceType, "RegionAppearanceType", "Region", "", "", "");
|
||||
|
||||
m_previewPlot = new RimSummaryPlot();
|
||||
m_hasNewPlot = false;
|
||||
|
||||
for (const auto& itemTypes : m_identifierFieldsMap)
|
||||
{
|
||||
@ -209,9 +210,10 @@ RicSummaryCurveCreator::RicSummaryCurveCreator() : m_identifierFieldsMap(
|
||||
m_closeButtonField.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
||||
m_closeButtonField.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
CAF_PDM_InitField(&m_createNewPlot, "CreateNewPlot", false, "Create New Plot", "", "", "");
|
||||
m_createNewPlot.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
||||
m_createNewPlot.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
CAF_PDM_InitFieldNoDefault(&m_okButtonField, "OK", "", "", "", "");
|
||||
m_okButtonField = false;
|
||||
m_okButtonField.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
||||
m_okButtonField.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
m_appearanceApplyButton = false;
|
||||
m_appearanceApplyButton.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
||||
@ -246,6 +248,7 @@ void RicSummaryCurveCreator::updateFromSummaryPlot(RimSummaryPlot* targetPlot)
|
||||
|
||||
m_targetPlot = targetPlot;
|
||||
m_useAutoAppearanceAssignment = true;
|
||||
m_hasNewPlot = targetPlot == nullptr;
|
||||
|
||||
if (m_targetPlot)
|
||||
{
|
||||
@ -253,6 +256,13 @@ void RicSummaryCurveCreator::updateFromSummaryPlot(RimSummaryPlot* targetPlot)
|
||||
loadDataAndUpdatePlot();
|
||||
}
|
||||
|
||||
// Select all summary categories
|
||||
m_selectedSummaryCategories.v().clear();
|
||||
for (size_t i = 0; i < caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>::size(); ++i)
|
||||
{
|
||||
m_selectedSummaryCategories.v().push_back(caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>::fromIndex(i));
|
||||
}
|
||||
|
||||
caf::PdmUiItem::updateConnectedEditors();
|
||||
}
|
||||
|
||||
@ -277,47 +287,22 @@ void RicSummaryCurveCreator::clearCloseButton()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryCurveCreator::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &m_applyButtonField)
|
||||
if (changedField == &m_applyButtonField || changedField == &m_okButtonField)
|
||||
{
|
||||
m_applyButtonField = false;
|
||||
m_okButtonField = false;
|
||||
|
||||
if (m_targetPlot == nullptr)
|
||||
{
|
||||
createNewPlot();
|
||||
m_hasNewPlot = false;
|
||||
}
|
||||
|
||||
updateTargetPlot();
|
||||
}
|
||||
else if (changedField == &m_createNewPlot)
|
||||
{
|
||||
m_createNewPlot = false;
|
||||
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotColl = proj->mainPlotCollection()->summaryPlotCollection();
|
||||
if (summaryPlotColl)
|
||||
if (changedField == &m_okButtonField)
|
||||
{
|
||||
QString summaryPlotName = QString("SummaryPlot %1").arg(summaryPlotColl->summaryPlots().size() + 1);
|
||||
|
||||
bool ok = false;
|
||||
summaryPlotName = QInputDialog::getText(NULL, "New Summary Plot Name", "New Summary Plot Name", QLineEdit::Normal, summaryPlotName, &ok);
|
||||
if (ok)
|
||||
{
|
||||
RimSummaryPlot* plot = new RimSummaryPlot();
|
||||
summaryPlotColl->summaryPlots().push_back(plot);
|
||||
|
||||
plot->setDescription(summaryPlotName);
|
||||
plot->loadDataAndUpdate();
|
||||
|
||||
summaryPlotColl->updateConnectedEditors();
|
||||
|
||||
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||
if (mainPlotWindow)
|
||||
{
|
||||
mainPlotWindow->selectAsCurrentItem(plot);
|
||||
mainPlotWindow->setExpanded(plot, true);
|
||||
}
|
||||
|
||||
m_createNewPlot = false;
|
||||
m_targetPlot = plot;
|
||||
|
||||
updateTargetPlot();
|
||||
}
|
||||
m_closeButtonField = true;
|
||||
}
|
||||
}
|
||||
else if (changedField == &m_appearanceApplyButton)
|
||||
@ -398,6 +383,12 @@ QList<caf::PdmOptionItemInfo> RicSummaryCurveCreator::calculateValueOptions(cons
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotColl = proj->mainPlotCollection()->summaryPlotCollection();
|
||||
if (m_hasNewPlot)
|
||||
{
|
||||
QString displayName = "( New Plot )";
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo(displayName, nullptr));
|
||||
}
|
||||
if (summaryPlotColl)
|
||||
{
|
||||
summaryPlotColl->summaryPlotItemInfos(&options);
|
||||
@ -611,13 +602,11 @@ void RicSummaryCurveCreator::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
}
|
||||
|
||||
// Fields to be displayed directly in UI
|
||||
uiOrdering.add(&m_createNewPlot);
|
||||
uiOrdering.add(&m_targetPlot);
|
||||
uiOrdering.add(&m_okButtonField);
|
||||
uiOrdering.add(&m_applyButtonField);
|
||||
uiOrdering.add(&m_closeButtonField);
|
||||
|
||||
m_targetPlot.uiCapability()->setUiReadOnly(m_createNewPlot);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
@ -1012,12 +1001,12 @@ void RicSummaryCurveCreator::defineEditorAttribute(const caf::PdmFieldHandle* fi
|
||||
attrib->m_buttonText = "Cancel";
|
||||
}
|
||||
}
|
||||
else if (&m_createNewPlot == field)
|
||||
else if (&m_okButtonField == field)
|
||||
{
|
||||
caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*> (attribute);
|
||||
if (attrib)
|
||||
{
|
||||
attrib->m_buttonText = "New Plot";
|
||||
attrib->m_buttonText = "OK";
|
||||
}
|
||||
}
|
||||
else if (&m_appearanceApplyButton == field)
|
||||
@ -1045,12 +1034,6 @@ void RicSummaryCurveCreator::defineEditorAttribute(const caf::PdmFieldHandle* fi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryCurveCreator::populateCurveCreator(const RimSummaryPlot& sourceSummaryPlot)
|
||||
{
|
||||
m_selectedSummaryCategories.v().clear();
|
||||
for (size_t i = 0; i < caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>::size(); ++i)
|
||||
{
|
||||
m_selectedSummaryCategories.v().push_back(caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>::fromIndex(i));
|
||||
}
|
||||
|
||||
m_previewPlot->deleteAllSummaryCurves();
|
||||
for (const auto& curve : sourceSummaryPlot.summaryCurves())
|
||||
{
|
||||
@ -1243,3 +1226,40 @@ std::set<std::pair<RimSummaryCase*, RifEclipseSummaryAddress>> RicSummaryCurveCr
|
||||
}
|
||||
return allCurveDefs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryCurveCreator::createNewPlot()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
||||
RimSummaryPlotCollection* summaryPlotColl = proj->mainPlotCollection()->summaryPlotCollection();
|
||||
if (summaryPlotColl)
|
||||
{
|
||||
QString summaryPlotName = QString("SummaryPlot %1").arg(summaryPlotColl->summaryPlots().size() + 1);
|
||||
|
||||
bool ok = false;
|
||||
summaryPlotName = QInputDialog::getText(NULL, "New Summary Plot Name", "New Summary Plot Name", QLineEdit::Normal, summaryPlotName, &ok);
|
||||
if (ok)
|
||||
{
|
||||
RimSummaryPlot* plot = new RimSummaryPlot();
|
||||
summaryPlotColl->summaryPlots().push_back(plot);
|
||||
|
||||
plot->setDescription(summaryPlotName);
|
||||
plot->loadDataAndUpdate();
|
||||
|
||||
summaryPlotColl->updateConnectedEditors();
|
||||
|
||||
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
|
||||
if (mainPlotWindow)
|
||||
{
|
||||
mainPlotWindow->selectAsCurrentItem(plot);
|
||||
mainPlotWindow->setExpanded(plot, true);
|
||||
}
|
||||
|
||||
m_targetPlot = plot;
|
||||
updateTargetPlot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -125,6 +125,8 @@ private:
|
||||
void updateAppearanceEditor();
|
||||
std::set<std::pair<RimSummaryCase*, RifEclipseSummaryAddress>>
|
||||
allPreviewCurveDefs() const;
|
||||
void createNewPlot();
|
||||
|
||||
private:
|
||||
caf::PdmPtrArrayField<RimSummaryCase*> m_selectedCases;
|
||||
|
||||
@ -136,6 +138,7 @@ private:
|
||||
caf::PdmPtrField<RimSummaryPlot*> m_targetPlot;
|
||||
|
||||
RimSummaryPlot* m_previewPlot;
|
||||
bool m_hasNewPlot;
|
||||
|
||||
caf::PdmField<bool> m_useAutoAppearanceAssignment;
|
||||
caf::PdmField<bool> m_appearanceApplyButton;
|
||||
@ -145,7 +148,7 @@ private:
|
||||
caf::PdmField< AppearanceTypeAppEnum > m_groupAppearanceType;
|
||||
caf::PdmField< AppearanceTypeAppEnum > m_regionAppearanceType;
|
||||
|
||||
caf::PdmField<bool> m_createNewPlot;
|
||||
caf::PdmField<bool> m_okButtonField;
|
||||
caf::PdmField<bool> m_applyButtonField;
|
||||
caf::PdmField<bool> m_closeButtonField;
|
||||
};
|
||||
|
@ -0,0 +1,74 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
//
|
||||
// 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 "RicSummaryCurveCreatorFactoryImpl.h"
|
||||
#include "RicSummaryCurveCreator.h"
|
||||
#include "RicSummaryCurveCreatorDialog.h"
|
||||
|
||||
|
||||
RicSummaryCurveCreatorFactoryImpl* RicSummaryCurveCreatorFactoryImpl::ms_instance = nullptr;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreatorFactoryImpl::RicSummaryCurveCreatorFactoryImpl()
|
||||
{
|
||||
m_curveCreator = new RicSummaryCurveCreator();
|
||||
m_dialogWithSplitter = new RicSummaryCurveCreatorDialog(nullptr, m_curveCreator);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreatorFactoryImpl::~RicSummaryCurveCreatorFactoryImpl()
|
||||
{
|
||||
if (m_dialogWithSplitter != nullptr)
|
||||
delete m_dialogWithSplitter;
|
||||
if (m_curveCreator != nullptr)
|
||||
delete m_curveCreator;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreator* RicSummaryCurveCreatorFactoryImpl::curveCreator()
|
||||
{
|
||||
if (m_curveCreator == nullptr)
|
||||
m_curveCreator = new RicSummaryCurveCreator();
|
||||
return m_curveCreator;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreatorDialog* RicSummaryCurveCreatorFactoryImpl::dialog()
|
||||
{
|
||||
if (m_dialogWithSplitter == nullptr)
|
||||
m_dialogWithSplitter = new RicSummaryCurveCreatorDialog(nullptr, curveCreator());
|
||||
return m_dialogWithSplitter;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicSummaryCurveCreatorFactoryImpl* RicSummaryCurveCreatorFactoryImpl::instance()
|
||||
{
|
||||
if (ms_instance == nullptr)
|
||||
ms_instance = new RicSummaryCurveCreatorFactoryImpl();
|
||||
return ms_instance;
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include <QPointer>
|
||||
|
||||
class RicSummaryCurveCreator;
|
||||
class RicSummaryCurveCreatorDialog;
|
||||
|
||||
namespace caf {
|
||||
class PdmUiPropertyViewDialog;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicSummaryCurveCreatorFactoryImpl
|
||||
{
|
||||
public:
|
||||
static RicSummaryCurveCreatorFactoryImpl* instance();
|
||||
virtual ~RicSummaryCurveCreatorFactoryImpl();
|
||||
|
||||
RicSummaryCurveCreator* curveCreator();
|
||||
RicSummaryCurveCreatorDialog* dialog();
|
||||
|
||||
private:
|
||||
RicSummaryCurveCreatorFactoryImpl();
|
||||
|
||||
RicSummaryCurveCreator* m_curveCreator;
|
||||
QPointer<RicSummaryCurveCreatorDialog> m_dialogWithSplitter;
|
||||
|
||||
static RicSummaryCurveCreatorFactoryImpl* ms_instance;
|
||||
};
|
Loading…
Reference in New Issue
Block a user