mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#739 Moved the new RimPlotCurve class to a separate set of files
This commit is contained in:
@@ -19,167 +19,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "RimPlotCurve.h"
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RigWellLogCurveData;
|
||||
class RiuWellLogTrack;
|
||||
class RiuLineSegmentQwtPlotCurve;
|
||||
|
||||
class QwtPlot;
|
||||
class QwtPlotCurve;
|
||||
|
||||
class QString;
|
||||
#if 0
|
||||
class RimPlotCurve : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
enum LineStyleEnum
|
||||
{
|
||||
STYLE_NONE,
|
||||
STYLE_SOLID,
|
||||
STYLE_DASH,
|
||||
STYLE_DOT,
|
||||
STYLE_DASH_DOT
|
||||
};
|
||||
|
||||
enum PointSymbolEnum
|
||||
{
|
||||
SYMBOL_NONE,
|
||||
SYMBOL_ELLIPSE,
|
||||
SYMBOL_RECT,
|
||||
SYMBOL_DIAMOND,
|
||||
SYMBOL_TRIANGLE,
|
||||
SYMBOL_CROSS,
|
||||
SYMBOL_XCROSS
|
||||
};
|
||||
public:
|
||||
RimPlotCurve();
|
||||
virtual ~RimPlotCurve();
|
||||
|
||||
void setColor(const cvf::Color3f& color);
|
||||
void detachQwtCurve();
|
||||
|
||||
bool isCurveVisible() const;
|
||||
|
||||
QwtPlotCurve* plotCurve() const;
|
||||
|
||||
QString name() const { return m_curveName; }
|
||||
void updateCurveName();
|
||||
void updatePlotTitle();
|
||||
|
||||
protected:
|
||||
void updatePlotConfiguration();
|
||||
void updateCurveVisibility();
|
||||
void updateOptionSensitivity();
|
||||
void updateCurveAppearance();
|
||||
protected:
|
||||
|
||||
// Overridden PDM methods
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
protected:
|
||||
RiuLineSegmentQwtPlotCurve* m_qwtPlotCurve;
|
||||
|
||||
caf::PdmField<bool> m_showCurve;
|
||||
caf::PdmField<QString> m_curveName;
|
||||
caf::PdmField<QString> m_customCurveName;
|
||||
|
||||
caf::PdmField<bool> m_autoName;
|
||||
caf::PdmField<cvf::Color3f> m_curveColor;
|
||||
caf::PdmField<float> m_curveThickness;
|
||||
|
||||
caf::PdmField< caf::AppEnum< PointSymbolEnum > > m_pointSymbol;
|
||||
caf::PdmField< caf::AppEnum< LineStyleEnum > > m_lineStyle;
|
||||
};
|
||||
#endif
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimPlotCurve : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
enum LineStyleEnum
|
||||
{
|
||||
STYLE_NONE,
|
||||
STYLE_SOLID,
|
||||
STYLE_DASH,
|
||||
STYLE_DOT,
|
||||
STYLE_DASH_DOT
|
||||
};
|
||||
|
||||
enum PointSymbolEnum
|
||||
{
|
||||
SYMBOL_NONE,
|
||||
SYMBOL_ELLIPSE,
|
||||
SYMBOL_RECT,
|
||||
SYMBOL_DIAMOND,
|
||||
SYMBOL_TRIANGLE,
|
||||
SYMBOL_CROSS,
|
||||
SYMBOL_XCROSS
|
||||
};
|
||||
public:
|
||||
RimPlotCurve();
|
||||
virtual ~RimPlotCurve();
|
||||
|
||||
void loadDataAndUpdate();
|
||||
|
||||
void setParentQwtPlot(QwtPlot* plot);
|
||||
void detachQwtCurve();
|
||||
QwtPlotCurve* qwtPlotCurve() const;
|
||||
|
||||
void setColor(const cvf::Color3f& color);
|
||||
bool isCurveVisible() const;
|
||||
QString curveName() const { return m_curveName; }
|
||||
|
||||
protected:
|
||||
|
||||
virtual QString createCurveAutoName() = 0;
|
||||
virtual void zoomAllParentPlot() = 0;
|
||||
virtual void onLoadDataAndUpdate() = 0;
|
||||
|
||||
void updateCurvePresentation();
|
||||
void updateCurveName();
|
||||
void updateCurveVisibility();
|
||||
void updateCurveAppearance();
|
||||
|
||||
void updateOptionSensitivity();
|
||||
|
||||
protected:
|
||||
|
||||
// Overridden PDM methods
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
virtual void initAfterRead();
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly);
|
||||
|
||||
protected:
|
||||
QPointer<QwtPlot> m_parentQwtPlot;
|
||||
RiuLineSegmentQwtPlotCurve* m_qwtPlotCurve;
|
||||
|
||||
caf::PdmField<bool> m_showCurve;
|
||||
caf::PdmField<QString> m_curveName;
|
||||
caf::PdmField<QString> m_customCurveName;
|
||||
|
||||
caf::PdmField<bool> m_isUsingAutoName;
|
||||
caf::PdmField<cvf::Color3f> m_curveColor;
|
||||
caf::PdmField<float> m_curveThickness;
|
||||
|
||||
caf::PdmField< caf::AppEnum< PointSymbolEnum > > m_pointSymbol;
|
||||
caf::PdmField< caf::AppEnum< LineStyleEnum > > m_lineStyle;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user