109 lines
3.8 KiB
C++
109 lines
3.8 KiB
C++
#ifndef QMYCUSTOMPLOT_H
|
|
#define QMYCUSTOMPLOT_H
|
|
|
|
#include "qcustomplot.h"
|
|
#include "LogIO.h"
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
class QMyCustomPlot : public QCustomPlot
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
QMyCustomPlot(QWidget *parent = nullptr, QString strSlfName="", QString strWellName="", QString strTrackName="", QString strLineName="");
|
|
|
|
virtual ~QMyCustomPlot()
|
|
{
|
|
}
|
|
|
|
protected:
|
|
virtual void mouseMoveEvent(QMouseEvent *event);
|
|
|
|
public:
|
|
QString m_strUuid;
|
|
QString m_strSlfName;
|
|
QString m_strWellName;
|
|
QString m_strTrackName;
|
|
QString m_strLineName;
|
|
|
|
//
|
|
float m_iX1, m_iX2;
|
|
float m_iY1, m_iY2;
|
|
|
|
//其他曲线
|
|
QString m_newFillType;
|
|
QString m_newTargetLine;
|
|
QColor m_newColor;
|
|
QString m_newLithosImage;
|
|
QString m_newHeadFill;
|
|
float m_vMin;
|
|
float m_vMax;
|
|
QString m_strOtherScaleType;
|
|
QString m_strScaleType="线性";//刻度类型(线性,对数)
|
|
|
|
QColor m_frontColor;//岩性前景色
|
|
QColor m_backColor;//岩性背景色
|
|
QString m_newFillMode;
|
|
bool m_bFillNow = true;
|
|
|
|
QContextMenuEvent *m_event;
|
|
|
|
bool m_bDrawRect = true;
|
|
|
|
public:
|
|
//分段刷新
|
|
QVector<double> m_x;
|
|
QVector<double> m_y;
|
|
int m_iCurNum=0;
|
|
int m_iSplitNum=2000; //2000000; //2000;
|
|
public slots:
|
|
void slot_time();
|
|
|
|
public:
|
|
void init(QString strName, QVector<double> x, QVector<double> y);
|
|
void addImageToPlot(double left_Low, double right_Hight, const QString imagePath);
|
|
void addRandomGraph(QVector<double> x, QVector<double> y, QString strSlfName, QString strLineName, QString strAliasName, QString strUnit,
|
|
double newLeftScale, double newRightScale, QString strScaleType, QColor newlineColor, double width, Qt::PenStyle lineStyle);
|
|
|
|
public slots:
|
|
void s_LineClicked(int index);
|
|
void onResetZoom();
|
|
void removeSelectedGraph();
|
|
void removeSelectedGraphByTitle();
|
|
|
|
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
|
|
|
//属性
|
|
//左刻度
|
|
void s_ChangeLeftScale(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double newLeftScale);
|
|
//右刻度
|
|
void s_ChangeRightScale(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double newRightScale);
|
|
//刻度类型
|
|
void s_ChangeScaleType(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strScaleType);
|
|
|
|
//线颜色
|
|
void s_ChangeLineColor(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor);
|
|
//线宽
|
|
void s_ChangeLineWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double width);
|
|
//线型
|
|
void s_ChangeLineStyle(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, Qt::PenStyle lineStyle);
|
|
//岩性填充-不填充
|
|
void s_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
|
//岩性填充-填充
|
|
void s_ChangeFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
|
|
QString newFillType, QString newTargetLine, QColor newColor, QString newLithosImage, QString newHeadFill,
|
|
float vMin, float vMax, QString strOtherScaleType, QColor frontColor, QColor backColor, QString newFillMode, bool bFillNow);
|
|
|
|
void onAddRect();
|
|
|
|
public:
|
|
//
|
|
virtual void mousePressEvent(QMouseEvent *event);
|
|
virtual void contextMenuEvent(QContextMenuEvent *event);
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
#endif // QMYCUSTOMPLOT_H
|