#ifndef TRANSPARENTDRAGGABLEGEOLITH_H #define TRANSPARENTDRAGGABLEGEOLITH_H #include #include "qmycustomplot.h" #include #include #include "geometryutils.h" #include #include "GeoIndicatorGenerator.h" #pragma execution_character_set("utf-8") // 强制指定执行字符集为 UTF-8 class TransparentDraggableGeoLith : public QObject { Q_OBJECT public: explicit TransparentDraggableGeoLith(QMyCustomPlot *parentPlot, QString strUuid="", double minWidth = 1.0, QString strTitle = ""); ~TransparentDraggableGeoLith(); void DrawSVGNormal(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout); //拉伸 void DrawSVGSteched(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout); //平铺 void DrawSVGTiled(QPainter* painter,QString svgFileName,QRectF borderRect,bool IsWellSectonHorizonLayout); //设置最小宽度 void setMinWidth(double minWidth); //设置标题 void setTitle(QString strTitle); //设置解释结论 void setLith(QString filePath, QString colorPath); void drawLith(double left_Low, double right_Hight, double lY1, double lY2); void setColor(QString filePath); //设置m_Oil void setOil(QString filePath); void drawOil(double left_Low, double right_Hight, double lY1, double lY2); // 设置矩形范围 void setRange(double left_Low, double right_Hight); // 获取当前范围 QCPRange getRange(); // 设置矩形颜色 void setColor(const QColor &color); // 删除框图 void deleteRect(); signals: void rangeChanged(QCPRange newRange); private: void initRect(); void updateHandles() ; private slots: void onDelRect(); void onMousePress(QMouseEvent *event); void onMouseMove(QMouseEvent *event); void onMouseRelease(QMouseEvent *event); double getMyLower(); double getMyUpper(); private: QMyCustomPlot *mPlot; QCPItemRect *mRect; QCPItemRect *mLeftHandle; QCPItemRect *mRightHandle; QCPItemPixmap *mPixmap_Lith; QCPItemPixmap *mPixmap_Oil; QCPItemPixmap *mPixmap_Color; QCPItemText *mItemTitle; QString mstrTitle=""; QString m_strUuid = ""; QString m_Lith; QString m_Oil; QString m_Color; GeoIndicatorGenerator m_drawGeo; enum DragMode { DragNone, DragLeft, DragRight, DragRect }; DragMode mDragMode = DragNone; //double mDragStartX = 0; double mDragStartY = 0; QCPRange mDragStartRange; // 添加最小宽度成员变量 double mMinWidth; }; #endif // TRANSPARENTDRAGGABLEGEOLITH_H