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:
parent
940b452054
commit
7e2b0d20b5
@ -19,11 +19,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildField.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RimViewWindow.h"
|
||||
|
@ -18,18 +18,7 @@
|
||||
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RiuProjectPropertyView.h"
|
||||
|
||||
#include <QDockWidget>
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSummaryPlotCollection, "SummaryPlotCollection");
|
||||
@ -43,7 +32,6 @@ RimSummaryPlotCollection::RimSummaryPlotCollection()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&summaryPlots, "SummaryPlots", "Summary Plots", "", "", "");
|
||||
summaryPlots.uiCapability()->setUiHidden(true);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -52,72 +40,6 @@ RimSummaryPlotCollection::RimSummaryPlotCollection()
|
||||
RimSummaryPlotCollection::~RimSummaryPlotCollection()
|
||||
{
|
||||
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
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include <QDockWidget>
|
||||
|
||||
class RimSummaryPlot;
|
||||
class RicDropEnabledMainWindow;
|
||||
class RifReaderEclipseSummary;
|
||||
class RifSummaryReaderInterface;
|
||||
class RimEclipseResultCase;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -42,19 +34,8 @@ public:
|
||||
RimSummaryPlotCollection();
|
||||
virtual ~RimSummaryPlotCollection();
|
||||
|
||||
RifSummaryReaderInterface* getOrCreateSummaryFileReader(const RimEclipseResultCase* eclipseCase);
|
||||
|
||||
caf::PdmChildArrayField<RimSummaryPlot*> summaryPlots;
|
||||
|
||||
void updateSummaryNameHasChanged();
|
||||
|
||||
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 "RiuMainPlotWindow.h"
|
||||
#include "RiuQwtScalePicker.h"
|
||||
#include "RiuQwtCurvePointTracker.h"
|
||||
#include "RiuQwtPlotWheelZoomer.h"
|
||||
#include "RiuQwtPlotZoomer.h"
|
||||
#include "RiuQwtScalePicker.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "qwt_date_scale_engine.h"
|
||||
#include "qwt_date_scale_draw.h"
|
||||
#include "qwt_date_scale_engine.h"
|
||||
#include "qwt_legend.h"
|
||||
#include "qwt_plot_curve.h"
|
||||
#include "qwt_plot_grid.h"
|
||||
#include "qwt_plot_layout.h"
|
||||
#include "qwt_plot_magnifier.h"
|
||||
#include "qwt_plot_panner.h"
|
||||
#include "qwt_plot_zoomer.h"
|
||||
#include "qwt_scale_engine.h"
|
||||
@ -45,9 +48,6 @@
|
||||
#include <QWheelEvent>
|
||||
|
||||
#include <float.h>
|
||||
#include "qwt_plot_magnifier.h"
|
||||
#include "RiuQwtPlotWheelZoomer.h"
|
||||
#include "RiuQwtPlotZoomer.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -18,11 +18,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "qwt_plot.h"
|
||||
#include "RiuInterfaceToViewWindow.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include "qwt_plot.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include "RiuInterfaceToViewWindow.h"
|
||||
|
||||
class QwtPlotCurve;
|
||||
class QwtPlotGrid;
|
||||
|
Loading…
Reference in New Issue
Block a user