Remove unused code

This commit is contained in:
Magne Sjaastad 2018-05-02 12:47:12 +02:00
parent 95c11d0085
commit cfab910272
2 changed files with 38 additions and 252 deletions

View File

@ -23,22 +23,18 @@
#include "RifReaderEclipseSummary.h"
#include "RimProject.h"
#include "RimEnsembleCurveSet.h"
#include "RimProject.h"
#include "RimSummaryCase.h"
#include "RimSummaryCrossPlot.h"
#include "RimSummaryCurve.h"
#include "RimSummaryCurveAppearanceCalculator.h"
#include "RimSummaryPlot.h"
#include "RimSummaryPlotSourceStepping.h"
#include "RimSummaryCurveAppearanceCalculator.h"
#include "RiuLineSegmentQwtPlotCurve.h"
#include "RiuSummaryQwtPlot.h"
#include "cafPdmUiTreeViewEditor.h"
#include <QKeyEvent>
CAF_PDM_SOURCE_INIT(RimEnsembleCurveSetCollection, "RimEnsembleCurveSetCollection");
//--------------------------------------------------------------------------------------------------
@ -54,29 +50,6 @@ RimEnsembleCurveSetCollection::RimEnsembleCurveSetCollection()
CAF_PDM_InitField(&m_showCurves, "IsActive", true, "Show Curves", "", "", "");
m_showCurves.uiCapability()->setUiHidden(true);
//CAF_PDM_InitFieldNoDefault(&m_ySourceStepping, "YSourceStepping", "", "", "", "");
//m_ySourceStepping = new RimSummaryPlotSourceStepping;
//m_ySourceStepping->setSourceSteppingType(RimSummaryPlotSourceStepping::Y_AXIS);
//m_ySourceStepping.uiCapability()->setUiHidden(true);
//m_ySourceStepping.uiCapability()->setUiTreeChildrenHidden(true);
//m_ySourceStepping.xmlCapability()->disableIO();
//CAF_PDM_InitFieldNoDefault(&m_xSourceStepping, "XSourceStepping", "", "", "", "");
//m_xSourceStepping = new RimSummaryPlotSourceStepping;
//m_xSourceStepping->setSourceSteppingType(RimSummaryPlotSourceStepping::X_AXIS);
//m_xSourceStepping.uiCapability()->setUiHidden(true);
//m_xSourceStepping.uiCapability()->setUiTreeChildrenHidden(true);
//m_xSourceStepping.xmlCapability()->disableIO();
//CAF_PDM_InitFieldNoDefault(&m_unionSourceStepping, "UnionSourceStepping", "", "", "", "");
//m_unionSourceStepping = new RimSummaryPlotSourceStepping;
//m_unionSourceStepping->setSourceSteppingType(RimSummaryPlotSourceStepping::UNION_X_Y_AXIS);
//m_unionSourceStepping.uiCapability()->setUiHidden(true);
//m_unionSourceStepping.uiCapability()->setUiTreeChildrenHidden(true);
//m_unionSourceStepping.xmlCapability()->disableIO();
}
//--------------------------------------------------------------------------------------------------
@ -105,12 +78,6 @@ void RimEnsembleCurveSetCollection::loadDataAndUpdate(bool updateParentPlot)
curveSet->loadDataAndUpdate(updateParentPlot);
}
//for (RimSummaryCurve* curve : m_curves)
//{
// curve->loadDataAndUpdate(false);
// curve->updateQwtPlotAxis();
//}
if (updateParentPlot)
{
RimSummaryPlot* parentPlot;
@ -214,7 +181,7 @@ std::vector<RimEnsembleCurveSet*> RimEnsembleCurveSetCollection::visibleCurveSet
if (m_showCurves())
{
for (auto c : m_curveSets)
for (const auto& c : m_curveSets)
{
if (c->isCurvesVisible())
{
@ -226,31 +193,6 @@ std::vector<RimEnsembleCurveSet*> RimEnsembleCurveSetCollection::visibleCurveSet
return visible;
}
////--------------------------------------------------------------------------------------------------
/////
////--------------------------------------------------------------------------------------------------
//void RimEnsembleCurveSetCollection::deleteCurvesAssosiatedWithCase(RimSummaryCase* summaryCase)
//{
// std::vector<RimSummaryCurve*> summaryCurvesToDelete;
//
// for (RimSummaryCurve* summaryCurve : m_curves)
// {
// if (!summaryCurve) continue;
// if (!summaryCurve->summaryCaseY()) continue;
//
// if (summaryCurve->summaryCaseY() == summaryCase)
// {
// summaryCurvesToDelete.push_back(summaryCurve);
// }
// }
// for (RimSummaryCurve* summaryCurve : summaryCurvesToDelete)
// {
// m_curves.removeChildObject(summaryCurve);
// delete summaryCurve;
// }
//
//}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -259,22 +201,6 @@ void RimEnsembleCurveSetCollection::deleteAllCurveSets()
m_curveSets.deleteAllChildObjects();
}
////--------------------------------------------------------------------------------------------------
/////
////--------------------------------------------------------------------------------------------------
//void RimEnsembleCurveSetCollection::updateCaseNameHasChanged()
//{
// for (RimSummaryCurve* curve : m_curves)
// {
// curve->updateCurveNameNoLegendUpdate();
// curve->updateConnectedEditors();
// }
//
// RimSummaryPlot* parentPlot;
// firstAncestorOrThisOfTypeAsserted(parentPlot);
// if (parentPlot->qwtPlot()) parentPlot->qwtPlot()->updateLegend();
//}
//
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -285,92 +211,12 @@ void RimEnsembleCurveSetCollection::setCurrentSummaryCurveSet(RimEnsembleCurveSe
updateConnectedEditors();
}
////--------------------------------------------------------------------------------------------------
/////
////--------------------------------------------------------------------------------------------------
//std::vector<caf::PdmFieldHandle*> RimEnsembleCurveSetCollection::fieldsToShowInToolbar()
//{
// RimSummaryCrossPlot* parentCrossPlot;
// firstAncestorOrThisOfType(parentCrossPlot);
//
// if (parentCrossPlot)
// {
// return m_unionSourceStepping->fieldsToShowInToolbar();
// }
//
// return m_ySourceStepping()->fieldsToShowInToolbar();
//}
//
////--------------------------------------------------------------------------------------------------
/////
////--------------------------------------------------------------------------------------------------
//void RimEnsembleCurveSetCollection::handleKeyPressEvent(QKeyEvent* keyEvent)
//{
// if (!keyEvent) return;
//
// RimSummaryPlotSourceStepping* sourceStepping = nullptr;
// {
// RimSummaryCrossPlot* summaryCrossPlot = nullptr;
// this->firstAncestorOrThisOfType(summaryCrossPlot);
//
// if (summaryCrossPlot)
// {
// sourceStepping = m_unionSourceStepping();
// }
// else
// {
// sourceStepping = m_ySourceStepping();
// }
// }
//
// if (keyEvent->key() == Qt::Key_PageUp)
// {
// if (keyEvent->modifiers() & Qt::ShiftModifier)
// {
// sourceStepping->applyPrevCase();
//
// keyEvent->accept();
// }
// else if (keyEvent->modifiers() & Qt::ControlModifier)
// {
// sourceStepping->applyPrevOtherIdentifier();
//
// keyEvent->accept();
// }
// else
// {
// sourceStepping->applyPrevQuantity();
//
// keyEvent->accept();
// }
// }
// else if (keyEvent->key() == Qt::Key_PageDown)
// {
// if (keyEvent->modifiers() & Qt::ShiftModifier)
// {
// sourceStepping->applyNextCase();
//
// keyEvent->accept();
// }
// else if (keyEvent->modifiers() & Qt::ControlModifier)
// {
// sourceStepping->applyNextOtherIdentifier();
//
// keyEvent->accept();
// }
// else
// {
// sourceStepping->applyNextQuantity();
//
// keyEvent->accept();
// }
// }
//}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleCurveSetCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
void RimEnsembleCurveSetCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue)
{
if (changedField == &m_showCurves)
{
@ -382,42 +228,6 @@ void RimEnsembleCurveSetCollection::fieldChangedByUi(const caf::PdmFieldHandle*
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleCurveSetCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
//RimSummaryCrossPlot* parentCrossPlot;
//firstAncestorOrThisOfType(parentCrossPlot);
//if (parentCrossPlot)
//{
// {
// auto group = uiOrdering.addNewGroup("Y Source Stepping");
// m_ySourceStepping()->uiOrdering(uiConfigName, *group);
// }
// {
// auto group = uiOrdering.addNewGroup("X Source Stepping");
// m_xSourceStepping()->uiOrdering(uiConfigName, *group);
// }
// {
// auto group = uiOrdering.addNewGroup("XY Union Source Stepping");
// m_unionSourceStepping()->uiOrdering(uiConfigName, *group);
// }
//}
//else
//{
// auto group = uiOrdering.addNewGroup("Plot Source Stepping");
// m_ySourceStepping()->uiOrdering(uiConfigName, *group);
//}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -425,15 +235,3 @@ caf::PdmFieldHandle* RimEnsembleCurveSetCollection::objectToggleField()
{
return &m_showCurves;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEnsembleCurveSetCollection::defineObjectEditorAttribute(QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
{
//caf::PdmUiTreeViewEditorAttribute* myAttr = dynamic_cast<caf::PdmUiTreeViewEditorAttribute*>(attribute);
//if (myAttr && m_currentSummaryCurve.notNull())
//{
// myAttr->currentObject = m_currentSummaryCurve.p();
//}
}

View File

@ -23,9 +23,7 @@
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPtrArrayField.h"
class RimSummaryCase;
class RimEnsembleCurveSet;
class QwtPlot;
class QwtPlotCurve;
@ -55,22 +53,12 @@ public:
std::vector<RimEnsembleCurveSet*> curveSets() const;
std::vector<RimEnsembleCurveSet*> visibleCurveSets() const;
//void deleteCurvesAssosiatedWithCase(RimSummaryCase* summaryCase);
void deleteAllCurveSets();
//void updateCaseNameHasChanged();
void setCurrentSummaryCurveSet(RimEnsembleCurveSet* curveSet);
//std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
//void handleKeyPressEvent(QKeyEvent* keyEvent);
private:
caf::PdmFieldHandle* objectToggleField();
virtual void defineObjectEditorAttribute(QString uiConfigName,
caf::PdmUiEditorAttribute* attribute) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
caf::PdmFieldHandle* objectToggleField() override;
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
const QVariant& oldValue, const QVariant& newValue) override;