190 lines
5.1 KiB
C++
190 lines
5.1 KiB
C++
#ifndef TRANSPARENTDRAGGABLECOREPHYSICS_H
|
|
#define TRANSPARENTDRAGGABLECOREPHYSICS_H
|
|
|
|
#include <QObject>
|
|
#include "qmycustomplot.h"
|
|
#include <QString>
|
|
#include <QMenu>
|
|
|
|
#pragma execution_character_set("utf-8") // 强制指定执行字符集为 UTF-8
|
|
|
|
//曲线校深--线段
|
|
class TransparentDraggableCorePhysics : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit TransparentDraggableCorePhysics(QMyCustomPlot *parentPlot, QString strUuid="", double minWidth = 5.0, QString strTitle = "");
|
|
|
|
|
|
~TransparentDraggableCorePhysics();
|
|
|
|
//设置最小宽度
|
|
void setMinWidth(double minWidth);
|
|
//设置标题
|
|
void setTitle(QString strTitle);
|
|
|
|
// 设置矩形范围
|
|
void setRange(double left_Low, double right_Hight, bool bReplot=true);
|
|
// 获取当前范围
|
|
QCPRange getRange();
|
|
|
|
// 设置矩形颜色
|
|
void setColor(const QColor &color);
|
|
// 删除框图
|
|
void deleteRect();
|
|
|
|
// Get / Set 方法声明
|
|
double getSelectedWellCurve() const;
|
|
void setSelectedWellCurve(double value);
|
|
|
|
double getExampleAreaHeightCm() const;
|
|
void setExampleAreaHeightCm(double value);
|
|
|
|
double getRotationAngle() const;
|
|
void setRotationAngle(double value);
|
|
|
|
std::string getDisplayName() const;
|
|
void setDisplayName(const std::string& value);
|
|
|
|
int getLineWidth() const;
|
|
void setLineWidth(int value);
|
|
|
|
int getLineColor() const;
|
|
void setLineColor(int value);
|
|
|
|
int getLineStyle() const;
|
|
void setLineStyle(int value);
|
|
|
|
double getLeftScale() const;
|
|
void setLeftScale(double value);
|
|
|
|
double getRightScale() const;
|
|
void setRightScale(double value);
|
|
|
|
int getScaleType() const;
|
|
void setScaleType(int value);
|
|
|
|
int getScaleDivisionsOrCustom() const;
|
|
void setScaleDivisionsOrCustom(int value);
|
|
|
|
std::string getDisplayUnit() const;
|
|
void setDisplayUnit(const std::string& value);
|
|
|
|
std::string getCurveName() const;
|
|
void setCurveName(const std::string& value);
|
|
|
|
std::string getCurveUnit() const;
|
|
void setCurveUnit(const std::string& value);
|
|
|
|
double getCurveScale() const;
|
|
void setCurveScale(double value);
|
|
|
|
bool getDrawAsBar() const;
|
|
void setDrawAsBar(bool value);
|
|
|
|
double getLeftBoundary() const;
|
|
void setLeftBoundary(double value);
|
|
|
|
bool getSkipZeroInvalidValues() const;
|
|
void setSkipZeroInvalidValues(bool value);
|
|
|
|
bool getDrawEnvelope() const;
|
|
void setDrawEnvelope(bool value);
|
|
|
|
bool getDrawAsDot() const;
|
|
void setDrawAsDot(bool value);
|
|
|
|
int getSymbolType() const;
|
|
void setSymbolType(int value);
|
|
|
|
int getSymbolBorderColor() const;
|
|
void setSymbolBorderColor(int value);
|
|
|
|
int getSymbolSize() const;
|
|
void setSymbolSize(int value);
|
|
|
|
int getSymbolFillColor() const;
|
|
void setSymbolFillColor(int value);
|
|
|
|
std::string getFieldName() const;
|
|
void setFieldName(const std::string& value);
|
|
|
|
int getSerialNumber() const;
|
|
void setSerialNumber(int value);
|
|
|
|
double getDepth() const;
|
|
void setDepth(double value);
|
|
|
|
double getCorrectedDepth() const;
|
|
void setCorrectedDepth(double value);
|
|
|
|
double getValue() const;
|
|
void setValue(double value);
|
|
|
|
signals:
|
|
void rangeChanged(QCPRange newRange);
|
|
|
|
private:
|
|
QString m_cp_selectedWellCurve; // 选择井曲线
|
|
double m_cp_exampleAreaHeightCm; // 例区高度(cm)
|
|
double m_cp_rotationAngle; // 旋转角度
|
|
QString m_cp_displayName; // 显示名称
|
|
int m_cp_lineWidth; // 线宽
|
|
int m_cp_lineColor; // 线条颜色
|
|
int m_cp_lineStyle; // 线型
|
|
double m_cp_leftScale; // 左刻度
|
|
double m_cp_rightScale; // 右刻度
|
|
int m_cp_scaleType; // 刻度类型
|
|
int m_cp_scaleDivisionsOrCustom; // 等分刻度数或自定序列
|
|
QString m_cp_displayUnit; // 显示单位
|
|
QString m_cp_curveName; // 曲线名称
|
|
QString m_cp_curveUnit; // 曲线单位
|
|
double m_cp_curveScale; // 曲线刻度
|
|
bool m_cp_drawAsBar; // 杆状
|
|
double m_cp_leftBoundary; // 左界
|
|
bool m_cp_skipZeroInvalidValues; // 不绘零等无效值
|
|
bool m_cp_drawEnvelope; // 绘制包络线
|
|
bool m_cp_drawAsDot; // 点状
|
|
int m_cp_symbolType; // 符号类型
|
|
int m_cp_symbolBorderColor; // 边框颜色
|
|
int m_cp_symbolSize; // 大小
|
|
int m_cp_symbolFillColor; // 填充颜色
|
|
QString m_cp_fieldName; // 字段名称
|
|
int m_cp_serialNumber; // 序号
|
|
double m_cp_depth; // 深度
|
|
double m_cp_correctedDepth; // 校正深度
|
|
double m_cp_value; // 数值
|
|
|
|
void initRect();
|
|
void updateHandles() ;
|
|
|
|
private slots:
|
|
void onDelRect();
|
|
void onMousePress(QMouseEvent *event);
|
|
void onMouseMove(QMouseEvent *event);
|
|
void onMouseRelease(QMouseEvent *event);
|
|
|
|
public:
|
|
// 父级组件
|
|
QMyCustomPlot *mPlot;
|
|
// 当前组件
|
|
QCPItemLine *qcpItemLine;
|
|
|
|
|
|
QString mstrTitle="";
|
|
QString m_strUuid = "";
|
|
enum DragMode { DragNone, DragLeft, DragRight, DragRect };
|
|
DragMode mDragMode = DragNone;
|
|
//double mDragStartX = 0;
|
|
double mDragStartY = 0;
|
|
double m_left_Low = 0;
|
|
double m_right_Hight = 0;
|
|
double m_lY1 = 0;
|
|
// 添加最小宽度成员变量
|
|
double mMinWidth;
|
|
|
|
|
|
};
|
|
|
|
#endif // TRANSPARENTDRAGGABLECOREPHYSICS_H
|