mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Remove unused code and clean up includes
This commit is contained in:
@@ -19,11 +19,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "cafPdmObject.h"
|
|
||||||
#include "cafPdmField.h"
|
|
||||||
#include "cafPdmChildArrayField.h"
|
#include "cafPdmChildArrayField.h"
|
||||||
#include "cafAppEnum.h"
|
|
||||||
#include "cafPdmChildField.h"
|
|
||||||
|
|
||||||
#include "RiaDefines.h"
|
#include "RiaDefines.h"
|
||||||
#include "RimViewWindow.h"
|
#include "RimViewWindow.h"
|
||||||
|
|||||||
@@ -18,18 +18,7 @@
|
|||||||
|
|
||||||
#include "RimSummaryPlotCollection.h"
|
#include "RimSummaryPlotCollection.h"
|
||||||
|
|
||||||
#include "RifEclipseSummaryTools.h"
|
|
||||||
#include "RifReaderEclipseSummary.h"
|
|
||||||
#include "RifSummaryReaderInterface.h"
|
|
||||||
|
|
||||||
#include "RimEclipseResultCase.h"
|
|
||||||
#include "RimSummaryPlot.h"
|
#include "RimSummaryPlot.h"
|
||||||
#include "RimProject.h"
|
|
||||||
|
|
||||||
#include "RiuProjectPropertyView.h"
|
|
||||||
|
|
||||||
#include <QDockWidget>
|
|
||||||
#include "RiuMainWindow.h"
|
|
||||||
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimSummaryPlotCollection, "SummaryPlotCollection");
|
CAF_PDM_SOURCE_INIT(RimSummaryPlotCollection, "SummaryPlotCollection");
|
||||||
@@ -43,7 +32,6 @@ RimSummaryPlotCollection::RimSummaryPlotCollection()
|
|||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&summaryPlots, "SummaryPlots", "Summary Plots", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&summaryPlots, "SummaryPlots", "Summary Plots", "", "", "");
|
||||||
summaryPlots.uiCapability()->setUiHidden(true);
|
summaryPlots.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -52,72 +40,6 @@ RimSummaryPlotCollection::RimSummaryPlotCollection()
|
|||||||
RimSummaryPlotCollection::~RimSummaryPlotCollection()
|
RimSummaryPlotCollection::~RimSummaryPlotCollection()
|
||||||
{
|
{
|
||||||
summaryPlots.deleteAllChildObjects();
|
summaryPlots.deleteAllChildObjects();
|
||||||
|
|
||||||
for (auto it = m_summaryFileReaders.begin(); it != m_summaryFileReaders.end(); it++)
|
|
||||||
{
|
|
||||||
delete it->second;
|
|
||||||
}
|
|
||||||
m_summaryFileReaders.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RifSummaryReaderInterface* RimSummaryPlotCollection::getOrCreateSummaryFileReader(const QString& eclipseCaseFilePathBasename)
|
|
||||||
{
|
|
||||||
auto it = m_summaryFileReaders.find(eclipseCaseFilePathBasename);
|
|
||||||
if (it != m_summaryFileReaders.end())
|
|
||||||
{
|
|
||||||
return it->second;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return createSummaryFileReader(eclipseCaseFilePathBasename);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RifSummaryReaderInterface* RimSummaryPlotCollection::getOrCreateSummaryFileReader(const RimEclipseResultCase* eclipseCase)
|
|
||||||
{
|
|
||||||
if (!eclipseCase) return NULL;
|
|
||||||
|
|
||||||
QString caseName = eclipseCase->gridFileName();
|
|
||||||
QString caseNameWithNoExtension = caseName.remove(".egrid", Qt::CaseInsensitive);
|
|
||||||
|
|
||||||
QString caseNameAbsPath = caseNameWithNoExtension.replace("/", "\\");
|
|
||||||
|
|
||||||
return this->getOrCreateSummaryFileReader(caseNameAbsPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RifSummaryReaderInterface* RimSummaryPlotCollection::createSummaryFileReader(const QString& eclipseCaseFilePathBasename)
|
|
||||||
{
|
|
||||||
std::string headerFile;
|
|
||||||
bool isFormatted = false;
|
|
||||||
RifEclipseSummaryTools::findSummaryHeaderFile(eclipseCaseFilePathBasename.toStdString(), &headerFile, &isFormatted);
|
|
||||||
|
|
||||||
if (headerFile.empty()) return nullptr;
|
|
||||||
|
|
||||||
std::vector<std::string> dataFiles = RifEclipseSummaryTools::findSummaryDataFiles(eclipseCaseFilePathBasename.toStdString());
|
|
||||||
|
|
||||||
if (!dataFiles.size()) return nullptr;
|
|
||||||
|
|
||||||
RifSummaryReaderInterface* reader = new RifReaderEclipseSummary;
|
|
||||||
if (!reader->open(headerFile, dataFiles))
|
|
||||||
{
|
|
||||||
delete reader;
|
|
||||||
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_summaryFileReaders.insert(std::make_pair(eclipseCaseFilePathBasename, reader));
|
|
||||||
return reader;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -19,17 +19,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "cafPdmChildArrayField.h"
|
#include "cafPdmChildArrayField.h"
|
||||||
#include "cafPdmField.h"
|
|
||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
|
|
||||||
#include <QPointer>
|
|
||||||
#include <QDockWidget>
|
|
||||||
|
|
||||||
class RimSummaryPlot;
|
class RimSummaryPlot;
|
||||||
class RicDropEnabledMainWindow;
|
|
||||||
class RifReaderEclipseSummary;
|
|
||||||
class RifSummaryReaderInterface;
|
|
||||||
class RimEclipseResultCase;
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@@ -42,19 +34,8 @@ public:
|
|||||||
RimSummaryPlotCollection();
|
RimSummaryPlotCollection();
|
||||||
virtual ~RimSummaryPlotCollection();
|
virtual ~RimSummaryPlotCollection();
|
||||||
|
|
||||||
RifSummaryReaderInterface* getOrCreateSummaryFileReader(const RimEclipseResultCase* eclipseCase);
|
|
||||||
|
|
||||||
caf::PdmChildArrayField<RimSummaryPlot*> summaryPlots;
|
caf::PdmChildArrayField<RimSummaryPlot*> summaryPlots;
|
||||||
|
|
||||||
void updateSummaryNameHasChanged();
|
void updateSummaryNameHasChanged();
|
||||||
|
|
||||||
void summaryPlotItemInfos(QList<caf::PdmOptionItemInfo>* optionInfos) const;
|
void summaryPlotItemInfos(QList<caf::PdmOptionItemInfo>* optionInfos) const;
|
||||||
|
|
||||||
private:
|
|
||||||
RifSummaryReaderInterface* createSummaryFileReader(const QString& eclipseCaseFilePathBasename);
|
|
||||||
RifSummaryReaderInterface* getOrCreateSummaryFileReader(const QString& eclipseCaseFilePathBasename);
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Map from path to case to summary file reader objects
|
|
||||||
std::map<QString, RifSummaryReaderInterface*> m_summaryFileReaders;
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,17 +25,20 @@
|
|||||||
#include "RimSummaryPlot.h"
|
#include "RimSummaryPlot.h"
|
||||||
|
|
||||||
#include "RiuMainPlotWindow.h"
|
#include "RiuMainPlotWindow.h"
|
||||||
#include "RiuQwtScalePicker.h"
|
|
||||||
#include "RiuQwtCurvePointTracker.h"
|
#include "RiuQwtCurvePointTracker.h"
|
||||||
|
#include "RiuQwtPlotWheelZoomer.h"
|
||||||
|
#include "RiuQwtPlotZoomer.h"
|
||||||
|
#include "RiuQwtScalePicker.h"
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
#include "qwt_date_scale_engine.h"
|
|
||||||
#include "qwt_date_scale_draw.h"
|
#include "qwt_date_scale_draw.h"
|
||||||
|
#include "qwt_date_scale_engine.h"
|
||||||
#include "qwt_legend.h"
|
#include "qwt_legend.h"
|
||||||
#include "qwt_plot_curve.h"
|
#include "qwt_plot_curve.h"
|
||||||
#include "qwt_plot_grid.h"
|
#include "qwt_plot_grid.h"
|
||||||
#include "qwt_plot_layout.h"
|
#include "qwt_plot_layout.h"
|
||||||
|
#include "qwt_plot_magnifier.h"
|
||||||
#include "qwt_plot_panner.h"
|
#include "qwt_plot_panner.h"
|
||||||
#include "qwt_plot_zoomer.h"
|
#include "qwt_plot_zoomer.h"
|
||||||
#include "qwt_scale_engine.h"
|
#include "qwt_scale_engine.h"
|
||||||
@@ -45,9 +48,6 @@
|
|||||||
#include <QWheelEvent>
|
#include <QWheelEvent>
|
||||||
|
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include "qwt_plot_magnifier.h"
|
|
||||||
#include "RiuQwtPlotWheelZoomer.h"
|
|
||||||
#include "RiuQwtPlotZoomer.h"
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -18,11 +18,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "qwt_plot.h"
|
#include "RiuInterfaceToViewWindow.h"
|
||||||
|
|
||||||
#include "cafPdmPointer.h"
|
#include "cafPdmPointer.h"
|
||||||
|
|
||||||
|
#include "qwt_plot.h"
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include "RiuInterfaceToViewWindow.h"
|
|
||||||
|
|
||||||
class QwtPlotCurve;
|
class QwtPlotCurve;
|
||||||
class QwtPlotGrid;
|
class QwtPlotGrid;
|
||||||
|
|||||||
Reference in New Issue
Block a user