2025-10-29 17:23:30 +08:00
|
|
|
|
#ifndef QMYCUSTOMPLOT_H
|
|
|
|
|
|
#define QMYCUSTOMPLOT_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "qcustomplot.h"
|
|
|
|
|
|
#include "LogIO.h"
|
2025-12-04 17:55:42 +08:00
|
|
|
|
//#include "TransparentDraggableRect.h"
|
2025-12-01 17:13:17 +08:00
|
|
|
|
#include "QCPSizeHandleManager.h"
|
2026-02-04 12:16:25 +08:00
|
|
|
|
#include "qtColorSchemeComboBox.h"
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
|
|
|
2026-01-04 16:54:55 +08:00
|
|
|
|
const int iFracType=15;
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
class QMyCustomPlot : public QCustomPlot
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
|
|
|
QMyCustomPlot(QWidget *parent = nullptr, QString strSlfName="", QString strWellName="", QString strTrackName="", QString strLineName="");
|
|
|
|
|
|
|
|
|
|
|
|
virtual ~QMyCustomPlot()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 09:20:35 +08:00
|
|
|
|
void changePropertyWaveUpdate();
|
|
|
|
|
|
// 绘图类型-变密度(成像)
|
2026-02-05 14:53:44 +08:00
|
|
|
|
void initWave(QString strSlfName, QString strWaveName);
|
2026-02-06 09:20:35 +08:00
|
|
|
|
// 绘图类型-波形
|
2026-02-05 14:53:44 +08:00
|
|
|
|
void initWave2(QString strSlfName, QString strWaveName);
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-04 12:16:25 +08:00
|
|
|
|
void initColorTable();
|
|
|
|
|
|
void setSchemeIndex(int nidx, int colorNum);
|
2026-02-02 21:32:36 +08:00
|
|
|
|
double** getWavedata(int nrow, int ncol);
|
|
|
|
|
|
QCPColorMap * updateWave();
|
2026-02-06 09:20:35 +08:00
|
|
|
|
|
|
|
|
|
|
float getScaleV();
|
2025-10-29 17:23:30 +08:00
|
|
|
|
protected:
|
2025-12-01 17:13:17 +08:00
|
|
|
|
//virtual void mouseMoveEvent(QMouseEvent *event);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
public:
|
2025-10-30 11:55:37 +08:00
|
|
|
|
QString m_strUuid;
|
2025-10-29 17:23:30 +08:00
|
|
|
|
QString m_strSlfName;
|
|
|
|
|
|
QString m_strWellName;
|
|
|
|
|
|
QString m_strTrackName;
|
|
|
|
|
|
QString m_strLineName;
|
|
|
|
|
|
|
|
|
|
|
|
//
|
2025-11-03 18:14:56 +08:00
|
|
|
|
float m_iX1, m_iX2;
|
|
|
|
|
|
float m_iY1, m_iY2;
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
//其他曲线
|
|
|
|
|
|
QString m_newFillType;
|
|
|
|
|
|
QString m_newTargetLine;
|
|
|
|
|
|
QColor m_newColor;
|
|
|
|
|
|
QString m_newLithosImage;
|
|
|
|
|
|
QString m_newHeadFill;
|
|
|
|
|
|
float m_vMin;
|
2025-11-05 18:15:33 +08:00
|
|
|
|
float m_vMax;
|
|
|
|
|
|
QString m_strOtherScaleType;
|
2025-11-05 14:03:27 +08:00
|
|
|
|
QString m_strScaleType="线性";//刻度类型(线性,对数)
|
2025-11-03 18:14:56 +08:00
|
|
|
|
|
2025-10-31 17:56:50 +08:00
|
|
|
|
QColor m_frontColor;//岩性前景色
|
|
|
|
|
|
QColor m_backColor;//岩性背景色
|
2025-11-03 18:14:56 +08:00
|
|
|
|
QString m_newFillMode;
|
2025-11-24 15:36:38 +08:00
|
|
|
|
bool m_bFillNow = true;
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
QContextMenuEvent *m_event;
|
|
|
|
|
|
|
|
|
|
|
|
bool m_bDrawRect = true;
|
2026-01-06 16:03:55 +08:00
|
|
|
|
bool m_bX2Y = true;
|
2025-11-13 15:23:17 +08:00
|
|
|
|
|
2025-12-25 15:10:14 +08:00
|
|
|
|
//
|
|
|
|
|
|
bool m_bDrawCore_PHYSICS = false; //岩心分析
|
|
|
|
|
|
int dataIndex = -1;
|
|
|
|
|
|
bool singleDragMove = false;
|
|
|
|
|
|
float singleOldPosition = 0;
|
|
|
|
|
|
|
2026-02-02 21:32:36 +08:00
|
|
|
|
QCPColorMap *m_colorMap = NULL;
|
|
|
|
|
|
QCPColorScale * m_colorScale = NULL;
|
|
|
|
|
|
double** m_wavedata = NULL;
|
|
|
|
|
|
int m_nRow = 0;
|
|
|
|
|
|
int m_nCol = 0;
|
2026-02-06 09:20:35 +08:00
|
|
|
|
int m_nDrawType = 3; // 绘图类型
|
2026-02-02 21:32:36 +08:00
|
|
|
|
// 0.全周 1.正半周 2.负半周
|
|
|
|
|
|
int m_nMode = 1;
|
2026-02-06 09:20:35 +08:00
|
|
|
|
float m_fScaleV = 0.0f;
|
2026-02-02 21:32:36 +08:00
|
|
|
|
float m_fmin;
|
|
|
|
|
|
float m_fmax;
|
2026-02-04 12:16:25 +08:00
|
|
|
|
int m_nColorNum = 256;
|
|
|
|
|
|
int m_nSchemeIndex = 1;
|
2026-02-06 11:30:23 +08:00
|
|
|
|
bool m_bDrawDepth = false; // 绘制波深度
|
|
|
|
|
|
bool m_bDrawBase = false; // 绘制波基线
|
|
|
|
|
|
bool m_bOddEven = false; // 奇偶配色
|
2026-02-06 11:55:29 +08:00
|
|
|
|
float m_Base = 0.0f; // 波列基值
|
2026-02-06 11:30:23 +08:00
|
|
|
|
float m_MaxRange = 1023.0f;
|
2026-02-06 09:20:35 +08:00
|
|
|
|
int m_nWaveJg = 100;
|
|
|
|
|
|
int m_nWaveHei = 1;
|
2025-11-13 15:23:17 +08:00
|
|
|
|
public:
|
|
|
|
|
|
//分段刷新
|
|
|
|
|
|
QVector<double> m_x;
|
|
|
|
|
|
QVector<double> m_y;
|
|
|
|
|
|
int m_iCurNum=0;
|
|
|
|
|
|
int m_iSplitNum=2000; //2000000; //2000;
|
2026-01-30 17:37:58 +08:00
|
|
|
|
bool m_addRandomGraph=false;//当前是否绘制曲线 true:是。
|
2026-02-02 13:51:36 +08:00
|
|
|
|
bool m_bEditRect=false; //当前是否正在编辑曲线。
|
2026-02-02 16:37:58 +08:00
|
|
|
|
bool m_bFirstTimeConnect=true; //初次绑定编辑曲线信号槽。
|
2026-02-03 14:40:58 +08:00
|
|
|
|
bool m_bPriviewRightList=false; //当前是否正在预览曲线。
|
2025-12-04 17:55:42 +08:00
|
|
|
|
|
2026-01-09 15:40:04 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_Rect;
|
2025-12-05 18:27:24 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_Result;
|
2025-12-16 18:13:53 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_GeoLith;
|
2025-12-22 18:22:45 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_SwallCore;
|
2025-12-23 17:15:39 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_Gujing;
|
2025-12-29 18:13:00 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_Image;
|
2026-01-09 15:40:04 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_MFac;
|
|
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_Phase;
|
|
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_Fac;
|
2026-01-07 17:39:27 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_Guan;
|
2026-01-09 15:40:04 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_Jiegutext;
|
2026-01-27 17:55:08 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_Line;
|
2026-02-02 13:51:36 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_SelectRect;
|
2026-02-03 14:40:58 +08:00
|
|
|
|
QMap<QString, QObject*> m_mapDraggable_RightList;
|
2026-01-27 17:55:08 +08:00
|
|
|
|
|
|
|
|
|
|
QObject* m_SelectShiftLine=nullptr;//当前选中的分段线
|
2026-02-02 16:37:58 +08:00
|
|
|
|
QObject* m_SelectRect=nullptr;//当前选中的曲线编辑框
|
2025-12-04 17:55:42 +08:00
|
|
|
|
|
2025-11-13 15:23:17 +08:00
|
|
|
|
public slots:
|
|
|
|
|
|
void slot_time();
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
public:
|
|
|
|
|
|
void init(QString strName, QVector<double> x, QVector<double> y);
|
2025-10-30 11:55:37 +08:00
|
|
|
|
void addImageToPlot(double left_Low, double right_Hight, const QString imagePath);
|
2025-11-13 15:23:17 +08:00
|
|
|
|
void addRandomGraph(QVector<double> x, QVector<double> y, QString strSlfName, QString strLineName, QString strAliasName, QString strUnit,
|
2025-12-19 16:59:32 +08:00
|
|
|
|
double newLeftScale, double newRightScale, QString strScaleType, QColor &newlineColor, double width, Qt::PenStyle lineStyle);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
2026-01-05 15:15:37 +08:00
|
|
|
|
void addTextToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
2025-12-04 17:55:42 +08:00
|
|
|
|
|
2025-12-11 15:11:20 +08:00
|
|
|
|
void addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid, QString strText="");
|
2025-12-05 18:27:24 +08:00
|
|
|
|
|
2025-12-16 18:13:53 +08:00
|
|
|
|
void addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor);
|
|
|
|
|
|
|
2025-12-22 18:22:45 +08:00
|
|
|
|
void addSwallCoreToPlot(double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int ind);
|
|
|
|
|
|
|
2025-12-23 17:15:39 +08:00
|
|
|
|
void addGujingToPlot(double left_Low, double right_Hight, const QString strResult);
|
|
|
|
|
|
|
2026-01-09 15:40:04 +08:00
|
|
|
|
void addJiegutextToPlot(double left_Low, double right_Hight, const QStringList strText, int &iMaxNum, QColor crColor=QColor(255, 255, 255, 80));
|
|
|
|
|
|
|
2026-01-06 16:03:55 +08:00
|
|
|
|
void addMFacToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
|
|
|
|
|
void addPhaseToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
|
|
|
|
|
void addFacToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
|
|
|
|
|
|
2026-01-07 17:39:27 +08:00
|
|
|
|
void addGuanToPlot(double left_Low, double right_Hight, const QString imagePath, float in);
|
|
|
|
|
|
|
2026-01-27 17:55:08 +08:00
|
|
|
|
void addLineToPlot(double left_Low, double right_Hight, const QString strText, QColor crColor=QColor(255, 255, 255, 80));
|
|
|
|
|
|
|
2026-02-02 13:51:36 +08:00
|
|
|
|
//框选并编辑曲线
|
|
|
|
|
|
void addSelectRectToPlot(double left_Low, double right_Hight, int left_Low_Number, int right_Hight_Number);
|
|
|
|
|
|
|
2026-02-03 14:40:58 +08:00
|
|
|
|
//预览
|
|
|
|
|
|
void addRightListToPlot( QList<double> new_DepthList, QList<double> new_ValueList);
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
public slots:
|
|
|
|
|
|
void s_LineClicked(int index);
|
|
|
|
|
|
void onResetZoom();
|
|
|
|
|
|
void removeSelectedGraph();
|
|
|
|
|
|
void removeSelectedGraphByTitle();
|
|
|
|
|
|
|
2026-01-26 18:06:51 +08:00
|
|
|
|
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType, QString strFormInfoType);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
|
|
|
|
|
//属性
|
|
|
|
|
|
//左刻度
|
2025-11-04 14:44:14 +08:00
|
|
|
|
void s_ChangeLeftScale(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double newLeftScale);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//右刻度
|
2025-11-04 14:44:14 +08:00
|
|
|
|
void s_ChangeRightScale(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double newRightScale);
|
2025-11-03 18:14:56 +08:00
|
|
|
|
//刻度类型
|
2025-11-04 14:44:14 +08:00
|
|
|
|
void s_ChangeScaleType(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strScaleType);
|
2025-11-03 18:14:56 +08:00
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//线颜色
|
2025-11-04 14:44:14 +08:00
|
|
|
|
void s_ChangeLineColor(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QColor lineColor);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//线宽
|
2025-11-04 14:44:14 +08:00
|
|
|
|
void s_ChangeLineWidth(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double width);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//线型
|
2025-11-04 14:44:14 +08:00
|
|
|
|
void s_ChangeLineStyle(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, Qt::PenStyle lineStyle);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//岩性填充-不填充
|
2025-11-04 14:44:14 +08:00
|
|
|
|
void s_ClearFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//岩性填充-填充
|
2025-11-04 14:44:14 +08:00
|
|
|
|
void s_ChangeFillMode(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
|
2025-10-29 17:23:30 +08:00
|
|
|
|
QString newFillType, QString newTargetLine, QColor newColor, QString newLithosImage, QString newHeadFill,
|
2025-11-24 15:36:38 +08:00
|
|
|
|
float vMin, float vMax, QString strOtherScaleType, QColor frontColor, QColor backColor, QString newFillMode, bool bFillNow);
|
2025-10-29 17:23:30 +08:00
|
|
|
|
|
2026-01-27 17:55:08 +08:00
|
|
|
|
|
|
|
|
|
|
//右键--添加分段线
|
|
|
|
|
|
void onAddShiftLine();
|
|
|
|
|
|
//校深线段
|
|
|
|
|
|
void s_AddShifLineToPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double left_Low, double right_Hight);
|
|
|
|
|
|
|
2026-01-28 16:32:28 +08:00
|
|
|
|
//右键--清除当前分段线
|
|
|
|
|
|
void onDelSelectShiftLine();
|
|
|
|
|
|
//清除当前分段线
|
|
|
|
|
|
void s_DelSelectShiftLineFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
|
|
|
|
|
|
2026-01-27 17:55:08 +08:00
|
|
|
|
//右键--清除全部分段线
|
|
|
|
|
|
void onDelAllShiftLine();
|
|
|
|
|
|
//清除全部分段线
|
|
|
|
|
|
void s_DelAllShiftLineFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
|
|
|
|
|
|
2026-01-30 17:37:58 +08:00
|
|
|
|
//右键--编辑曲线
|
|
|
|
|
|
void onEditLine();
|
|
|
|
|
|
|
2026-01-28 16:32:28 +08:00
|
|
|
|
//执行校正
|
|
|
|
|
|
void s_RuncorFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
|
|
|
|
|
|
2026-01-30 09:47:13 +08:00
|
|
|
|
//执行拼接
|
|
|
|
|
|
void s_MergeFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
|
|
|
|
|
|
2026-02-03 14:40:58 +08:00
|
|
|
|
//执行预览
|
|
|
|
|
|
void s_PreMergeFromPlot(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
|
|
|
|
|
void s_PreMerge_FromRightList(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QList<double> new_DepthList, QList<double> new_ValueList);
|
|
|
|
|
|
//关闭预览框
|
|
|
|
|
|
void s_PreMerge_Close(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName);
|
|
|
|
|
|
|
2026-01-28 16:32:28 +08:00
|
|
|
|
//Plot重新加载数据
|
|
|
|
|
|
void s_ReloadPlot(QString strUuid, QString strSlfName, QString strLineName);
|
|
|
|
|
|
|
2026-02-02 21:32:36 +08:00
|
|
|
|
void s_changeDrawProperty(QVariantList vlist);
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
void onAddRect();
|
|
|
|
|
|
|
2025-12-01 17:13:17 +08:00
|
|
|
|
//蝌蚪图重绘网格线
|
|
|
|
|
|
void drawCustomElements();
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
public:
|
2025-12-01 17:13:17 +08:00
|
|
|
|
//蝌蚪图重绘网格线
|
|
|
|
|
|
bool mKedou = false;
|
2025-10-29 17:23:30 +08:00
|
|
|
|
//
|
2025-12-01 17:13:17 +08:00
|
|
|
|
bool mMousePress = false;
|
|
|
|
|
|
QPoint mLastPos;
|
|
|
|
|
|
QCPSizeHandleManager *mSizeHandleManager;
|
2025-10-29 17:23:30 +08:00
|
|
|
|
virtual void mousePressEvent(QMouseEvent *event);
|
2025-12-01 17:13:17 +08:00
|
|
|
|
virtual void mouseMoveEvent(QMouseEvent *event);
|
|
|
|
|
|
virtual void mouseReleaseEvent(QMouseEvent *event);
|
|
|
|
|
|
|
2025-12-25 15:10:14 +08:00
|
|
|
|
//单点移动功能
|
|
|
|
|
|
void executeSingle(QMouseEvent *event);
|
|
|
|
|
|
|
2025-10-29 17:23:30 +08:00
|
|
|
|
virtual void contextMenuEvent(QContextMenuEvent *event);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // QMYCUSTOMPLOT_H
|