玫瑰图属性

This commit is contained in:
crqiqi77 2026-04-09 15:18:52 +08:00
parent aee47ed25a
commit bd8c1ea18f
6 changed files with 202 additions and 81 deletions

View File

@ -4455,10 +4455,11 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa
variantMap["m_pl_dataType"] = this->m_formInfo->m_pl_dataType;
variantMap["m_pl_azimuthCurve"] = this->m_formInfo->m_pl_azimuthCurve;
variantMap["m_pl_inclinationCurve"] = this->m_formInfo->m_pl_inclinationCurve;
// 控制曲线
variantMap["m_pl_controlCurveName"] = this->m_formInfo->m_pl_controlCurveName;
variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue;
variantMap["m_pl_controlMaxValue"] = this->m_formInfo->m_pl_controlMaxValue;
variantMap["m_pl_sectorCount"] = this->m_formInfo->m_pl_sectorCount;
variantMap["m_pl_circleRadius"] = this->m_formInfo->m_pl_circleRadius;
variantMap["m_pl_circleColor"] = this->m_formInfo->m_pl_circleColor;
@ -4600,9 +4601,8 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
}
else if ("刻度" == strProperty)
{
QFont temp = varVal.value<QFont>();
this->m_formInfo->m_pl_fontScale = temp;
this->m_formInfo->repaint();
this->m_formInfo->m_pl_fontScale = varVal.value<QFont>();
flag = true;
}
// 控制曲线
else if ("曲线名" == strProperty)
@ -4701,67 +4701,83 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
else if ("深度字段" == strProperty)
{
this->m_formInfo->m_rose_depth_field = varVal.toString();
flag = true;
}
else if ("方位字段" == strProperty)
{
this->m_formInfo->m_rose_azimuth_field = varVal.toString();
flag = true;
}
else if ("倾角字段" == strProperty)
{
this->m_formInfo->m_rose_dip_field = varVal.toString();
flag = true;
}
else if ("属性字段" == strProperty)
{
this->m_formInfo->m_rose_attribute_field = varVal.toString();
flag = true;
}
// 玫瑰图
else if ("扇形" == strProperty)
{
this->m_formInfo->m_rose_sector_enabled = varVal.toInt();
flag = true;
}
else if ("圆半径(cm)" == strProperty)
{
this->m_formInfo->m_rose_circle_radius_cm = varVal.toInt();
flag = true;
}
else if ("辐射圈" == strProperty)
{
this->m_formInfo->m_rose_radiation_circle_enabled = varVal.toInt();
flag = true;
}
else if ("方位打印间隔" == strProperty)
{
this->m_formInfo->m_rose_azimuth_print_interval = varVal.toInt();
flag = true;
}
else if ("圆线颜色" == strProperty)
{
this->m_formInfo->m_rose_circle_line_color = varVal.value<QColor>();
flag = true;
}
else if ("圆线宽度" == strProperty)
{
this->m_formInfo->m_rose_circle_line_width = varVal.toInt();
flag = true;
}
else if ("应力线颜色" == strProperty)
{
this->m_formInfo->m_rose_stress_line_color = varVal.value<QColor>();
flag = true;
}
else if ("垮塌线颜色" == strProperty)
{
this->m_formInfo->m_rose_collapse_line_color = varVal.value<QColor>();
flag = true;
}
else if ("绘制辐射线?" == strProperty)
{
this->m_formInfo->m_rose_draw_radiation_line = varVal.toBool();
flag = true;
}
else if ("绘制井眼垮塌" == strProperty)
{
this->m_formInfo->m_rose_draw_wellbore_collapse = varVal.toBool();
flag = true;
}
else if ("是否填充" == strProperty)
{
this->m_formInfo->m_rose_fill_enabled = varVal.toBool();
flag = true;
}
else if ("是否绘制标注?" == strProperty)
{
this->m_formInfo->m_rose_draw_annotation = varVal.toBool();
flag = true;
}
if(flag)
@ -4778,26 +4794,25 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
variantMap["m_rose_azimuth_field"] = this->m_formInfo->m_rose_azimuth_field;
variantMap["m_rose_dip_field"] = this->m_formInfo->m_rose_dip_field;
variantMap["m_rose_attribute_field"] = this->m_formInfo->m_rose_attribute_field;
// 控制曲线
variantMap["m_pl_controlCurveName"] = this->m_formInfo->m_pl_controlCurveName;
variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue;
variantMap["m_pl_controlMaxValue"] = this->m_formInfo->m_pl_controlMaxValue;
variantMap["m_pl_sectorCount"] = this->m_formInfo->m_pl_sectorCount;
variantMap["m_pl_circleRadius"] = this->m_formInfo->m_pl_circleRadius;
variantMap["m_pl_circleColor"] = this->m_formInfo->m_pl_circleColor;
variantMap["m_pl_circleLineWidth"] = this->m_formInfo->m_pl_circleLineWidth;
variantMap["m_pl_isFillEnabled"] = this->m_formInfo->m_pl_isFillEnabled;
variantMap["m_pl_fillColor"] = this->m_formInfo->m_pl_fillColor;
// 线数
variantMap["m_pl_lineNumber"] = this->m_formInfo->m_pl_lineNumber;
variantMap["m_pl_lineHeight"] = this->m_formInfo->m_pl_lineHeight;
variantMap["m_pl_lineThickness"] = this->m_formInfo->m_pl_lineThickness;
variantMap["m_pl_lineColor"] = this->m_formInfo->m_pl_lineColor;
variantMap["m_pl_drawAnnotation"] = this->m_formInfo->m_pl_drawAnnotation;
variantMap["m_pl_drawHistogram"] = this->m_formInfo->m_pl_drawHistogram;
variantMap["m_pl_baselineWidth"] = this->m_formInfo->m_pl_baselineWidth;
variantMap["m_pl_baselineColor"] = this->m_formInfo->m_pl_baselineColor;
// 字体
variantMap["m_pl_fontScale"] = this->m_formInfo->m_pl_fontScale;
// 玫瑰图
variantMap["m_rose_sector_enabled"] = this->m_formInfo->m_rose_sector_enabled;
variantMap["m_rose_circle_radius_cm"] = this->m_formInfo->m_rose_circle_radius_cm;
variantMap["m_rose_radiation_circle_enabled"] = this->m_formInfo->m_rose_radiation_circle_enabled;
variantMap["m_rose_azimuth_print_interval"] = this->m_formInfo->m_rose_azimuth_print_interval;
variantMap["m_rose_circle_line_color"] = this->m_formInfo->m_rose_circle_line_color;
variantMap["m_rose_circle_line_width"] = this->m_formInfo->m_rose_circle_line_width;
variantMap["m_rose_stress_line_color"] = this->m_formInfo->m_rose_stress_line_color;
variantMap["m_rose_collapse_line_color"] = this->m_formInfo->m_rose_collapse_line_color;
variantMap["m_rose_draw_radiation_line"] = this->m_formInfo->m_rose_draw_radiation_line;
variantMap["m_rose_draw_wellbore_collapse"] = this->m_formInfo->m_rose_draw_wellbore_collapse;
variantMap["m_rose_fill_enabled"] = this->m_formInfo->m_rose_fill_enabled;
variantMap["m_rose_draw_annotation"] = this->m_formInfo->m_rose_draw_annotation;
// 统计间隔
variantMap["m_pl_statInterval"] = this->m_formInfo->m_pl_statInterval;
variantMap["m_pl_minInclination"] = this->m_formInfo->m_pl_minInclination;

View File

@ -376,10 +376,42 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
int dataType = pInfo->m_pl_dataType; // 数据类型
QString azimuthCurve = pInfo->m_pl_azimuthCurve; // 方位曲线
QString inclinationCurve = pInfo->m_pl_inclinationCurve; // 倾角曲线
// 表数据字段
QString m_rose_depth_field = pInfo->m_rose_depth_field; // 深度字段
QString m_rose_azimuth_field = pInfo->m_rose_azimuth_field; // 方位字段
QString m_rose_dip_field = pInfo->m_rose_dip_field; // 倾角字段
QString m_rose_attribute_field = pInfo->m_rose_attribute_field; // 属性字段
// 控制曲线
QString csCurveGrad = pInfo->m_pl_controlCurveName;
double LeftVal3 = pInfo->m_pl_controlMinValue;
double RightVal3 = pInfo->m_pl_controlMaxValue;
// 字体
QFont m_pl_fontScale = pInfo->m_pl_fontScale; // 刻度字体大小
// 玫瑰图
int m_rose_sector_enabled = pInfo->m_rose_sector_enabled; // 扇形(启用开关)
int m_rose_circle_radius_cm = pInfo->m_rose_circle_radius_cm; // 圆半径(cm)
int m_rose_radiation_circle_enabled = pInfo->m_rose_radiation_circle_enabled; // 辐射圈(启用开关)
int m_rose_azimuth_print_interval = pInfo->m_rose_azimuth_print_interval; // 方位打印间隔
QColor m_rose_circle_line_color = pInfo->m_rose_circle_line_color; // 圆线颜色
int m_rose_circle_line_width = pInfo->m_rose_circle_line_width; // 圆线宽度
QColor m_rose_stress_line_color = pInfo->m_rose_stress_line_color; // 应力线颜色
QColor m_rose_collapse_line_color = pInfo->m_rose_collapse_line_color; // 垮塌线颜色
bool m_rose_draw_radiation_line = pInfo->m_rose_draw_radiation_line; // 绘制辐射线?
bool m_rose_draw_wellbore_collapse = pInfo->m_rose_draw_wellbore_collapse; // 绘制井眼垮塌
bool m_rose_fill_enabled = pInfo->m_rose_fill_enabled; // 是否填充
bool m_rose_draw_annotation = pInfo->m_rose_draw_annotation; // 是否绘制标注?
// 统计间隔
int m_pl_statInterval = pInfo->m_pl_statInterval;
double m_pl_minInclination = pInfo->m_pl_minInclination;
double m_pl_maxInclination = pInfo->m_pl_maxInclination;
// curv->drawRose(dataType, azimuthCurve, inclinationCurve);
curv->drawRose(dataType, azimuthCurve, inclinationCurve,
m_rose_depth_field, m_rose_azimuth_field, m_rose_dip_field, m_rose_attribute_field,
csCurveGrad, LeftVal3, RightVal3, m_pl_fontScale,
m_rose_sector_enabled, m_rose_circle_radius_cm, m_rose_radiation_circle_enabled, m_rose_azimuth_print_interval, m_rose_circle_line_color,
m_rose_circle_line_width, m_rose_stress_line_color, m_rose_collapse_line_color, m_rose_draw_radiation_line, m_rose_draw_wellbore_collapse,
m_rose_fill_enabled, m_rose_draw_annotation,
m_pl_statInterval, m_pl_minInclination, m_pl_maxInclination);
}
else if("dcaObject" == strType)
{

View File

@ -184,7 +184,24 @@ void FormInfo::initProperty(QJsonObject obj)
}
else if ("roseObject" == strType)
{
// this->m_pl_baselineColor = QColor(obj["m_pl_baselineColor"].toString()); // 颜色
// 表数据字段
this->m_rose_depth_field = obj["m_rose_depth_field"].toString(); // 深度字段
this->m_rose_azimuth_field = obj["m_rose_azimuth_field"].toString(); // 方位字段
this->m_rose_dip_field = obj["m_rose_dip_field"].toString(); // 倾角字段
this->m_rose_attribute_field = obj["m_rose_attribute_field"].toString(); // 属性字段
// 玫瑰图
this->m_rose_sector_enabled = obj["m_rose_sector_enabled"].toInt(); // 扇形(启用开关)
this->m_rose_circle_radius_cm = obj["m_rose_circle_radius_cm"].toInt(); // 圆半径(cm)
this->m_rose_radiation_circle_enabled = obj["m_rose_radiation_circle_enabled"].toInt(); // 辐射圈(启用开关)
this->m_rose_azimuth_print_interval = obj["m_rose_azimuth_print_interval"].toInt(); // 方位打印间隔
this->m_rose_circle_line_color = QColor(obj["m_rose_circle_line_color"].toString()); // 圆线颜色
this->m_rose_circle_line_width = obj["m_rose_circle_line_width"].toInt(); // 圆线宽度
this->m_rose_stress_line_color = QColor(obj["m_rose_stress_line_color"].toString()); // 应力线颜色
this->m_rose_collapse_line_color = QColor(obj["m_rose_collapse_line_color"].toString()); // 垮塌线颜色
this->m_rose_draw_radiation_line = obj["m_rose_draw_radiation_line"].toBool(); // 绘制辐射线?
this->m_rose_draw_wellbore_collapse = obj["m_rose_draw_wellbore_collapse"].toBool(); // 绘制井眼垮塌
this->m_rose_fill_enabled = obj["m_rose_fill_enabled"].toBool(); // 是否填充
this->m_rose_draw_annotation = obj["m_rose_draw_annotation"].toBool(); // 是否绘制标注?
}
if ("plObject" == strType || ("roseObject" == strType))

View File

@ -257,7 +257,7 @@ public:
double m_pl_controlMinValue = 0; // 控制最小值
double m_pl_controlMaxValue = 100; // 控制最大值
// 统计参数(频率统计图、玫瑰图)
int m_pl_statInterval = 10; // 统计间隔
int m_pl_statInterval = 20; // 统计间隔
double m_pl_minInclination = 0; // 最小倾角
double m_pl_maxInclination = 90; // 最大倾角
// 分类(频率统计图、玫瑰图)
@ -303,9 +303,9 @@ public:
QString m_rose_dip_field = "DIPorS"; // 倾角字段
QString m_rose_attribute_field = "ID"; // 属性字段
// 玫瑰图
int m_rose_sector_enabled = 36; // 扇形(启用开关)
int m_rose_circle_radius_cm = 1; // 圆半径(cm)
int m_rose_radiation_circle_enabled = 9; // 辐射圈(启用开关)
int m_rose_sector_enabled = 36; // 扇形
int m_rose_circle_radius_cm = 50; // 圆半径(cm)
int m_rose_radiation_circle_enabled = 9; // 辐射圈
int m_rose_azimuth_print_interval = 3; // 方位打印间隔
QColor m_rose_circle_line_color = Qt::black; // 圆线颜色
int m_rose_circle_line_width = 2; // 圆线宽度

View File

@ -9996,6 +9996,7 @@ void QMyCustomPlot::s_changePlObjectProperty(QVariantMap variantMap)
QString csCurveGrad = variantMap["m_pl_controlCurveName"].toString();
double LeftVal3 = variantMap["m_pl_controlMinValue"].toDouble();
double RightVal3 = variantMap["m_pl_controlMaxValue"].toDouble();
int nArc = variantMap["m_pl_sectorCount"].toInt();
double nR = variantMap["m_pl_circleRadius"].toDouble();
QColor crArc = variantMap["m_pl_circleColor"].value<QColor>();
@ -10031,7 +10032,8 @@ void QMyCustomPlot::s_changePlObjectProperty(QVariantMap variantMap)
void QMyCustomPlot::drawFgrq (bool bTableData, QString csCurveDDIR, QString csCurveDANG,
QString csCurveGrad, double LeftVal3, double RightVal3, int nArc,
QString csCurveGrad, double LeftVal3, double RightVal3,
int nArc,
double nR, QColor crArc, int nArcLineWidth, bool bFill, QColor crFill,
int lineNumber, double lineHeight, int lineThickness, QColor lineColor, bool drawAnnotation, bool drawHistogram,
int baselineWidth, QColor baselineColor, int nstep, double LeftVal, double RightVal)
@ -10554,67 +10556,95 @@ void QMyCustomPlot::s_changeRoseProperty(QVariantMap variantMap)
QString m_rose_azimuth_field = variantMap["m_rose_azimuth_field"].toString();
QString m_rose_dip_field = variantMap["m_rose_dip_field"].toString();
QString m_rose_attribute_field = variantMap["m_rose_attribute_field"].toString();
// 控制曲线
QString csCurveGrad = variantMap["m_pl_controlCurveName"].toString();
double LeftVal3 = variantMap["m_pl_controlMinValue"].toDouble();
double RightVal3 = variantMap["m_pl_controlMaxValue"].toDouble();
// 字体
QFont m_pl_fontScale = variantMap["m_pl_fontScale"].value<QFont>();
// 玫瑰图
int m_rose_sector_enabled = variantMap["m_rose_sector_enabled"].toInt();
int m_rose_circle_radius_cm = variantMap["m_rose_circle_radius_cm"].toInt();
int m_rose_radiation_circle_enabled = variantMap["m_rose_radiation_circle_enabled"].toInt();
int m_rose_azimuth_print_interval = variantMap["m_rose_azimuth_print_interval"].toInt();
QColor m_rose_circle_line_color = variantMap["m_rose_circle_line_color"].value<QColor>();
int m_rose_circle_line_width = variantMap["m_rose_circle_line_width"].toInt();
QColor m_rose_stress_line_color = variantMap["m_rose_stress_line_color"].value<QColor>();
QColor m_rose_collapse_line_color = variantMap["m_rose_collapse_line_color"].value<QColor>();
bool m_rose_draw_radiation_line = variantMap["m_rose_draw_radiation_line"].toBool();
bool m_rose_draw_wellbore_collapse = variantMap["m_rose_draw_wellbore_collapse"].toBool();
bool m_rose_fill_enabled = variantMap["m_rose_fill_enabled"].toBool();
bool m_rose_draw_annotation = variantMap["m_rose_draw_annotation"].toBool();
// 统计间隔
int m_pl_statInterval = variantMap["m_pl_statInterval"].toInt();
double m_pl_minInclination = variantMap["m_pl_minInclination"].toDouble();
double m_pl_maxInclination = variantMap["m_pl_maxInclination"].toDouble();
// int nstep, double LeftVal, double RightVal
this->drawRose(bTableData, azimuthCurve, inclinationCurve,
m_rose_depth_field, m_rose_azimuth_field, m_rose_dip_field, m_rose_attribute_field);
m_rose_depth_field, m_rose_azimuth_field, m_rose_dip_field, m_rose_attribute_field,
csCurveGrad, LeftVal3, RightVal3, m_pl_fontScale,
m_rose_sector_enabled, m_rose_circle_radius_cm, m_rose_radiation_circle_enabled, m_rose_azimuth_print_interval, m_rose_circle_line_color,
m_rose_circle_line_width, m_rose_stress_line_color, m_rose_collapse_line_color, m_rose_draw_radiation_line, m_rose_draw_wellbore_collapse,
m_rose_fill_enabled, m_rose_draw_annotation,
m_pl_statInterval, m_pl_minInclination, m_pl_maxInclination);
}
void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCurveDANG,
QString qsDepth, QString qsDIR, QString qsDIP, QString qsID)
QString qsDepth, QString qsDIR, QString qsDIP, QString qsID,
QString csCurveGrad, double m_LeftVal3, double m_RightVal3, QFont m_pl_fontScale,
int m_nArc, int nR, int m_nCircle, int m_nAzimStep, QColor m_rose_circle_line_color,
int m_rose_circle_line_width, QColor m_rose_stress_line_color, QColor m_rose_collapse_line_color, bool m_bGrid, bool m_bJykt,
bool m_rose_fill_enabled, bool m_bHint, int nstep, float m_LeftVal, float m_RightVal)
{
// 这个是防止读取为错误 导致软件闪退 读取失败返回false直接退出
bool flag = true;
this->clearGraphs();
this->clearItems();
double m_LeftVal = 0.0f;
double m_RightVal = 90.0f;
// if(m_Value == NULL)
{
m_bTableData = bTableData; // 表格 曲线
m_csCurveDDIR = csCurveDDIR; // 方位曲线
m_csCurveDANG = csCurveDANG; //倾角曲线
m_csCurveGrad = "GRAD";
m_csCurveGrad = csCurveGrad;
m_qsDepth="DEPT"; // 深度字段
m_qsDIR="DDIR"; // 方位字段
m_qsDIP="DANG";// 倾角字段
m_qsID = "ID";
// m_qsDepth="DEPT"; // 深度字段
// m_qsDIR="DDIR"; // 方位字段
// m_qsDIP="DANG";// 倾角字段
// m_qsID = "ID";
m_qsDepth= qsDepth; // 深度字段
m_qsDIR= qsDIR; // 方位字段
m_qsDIP= qsDIP;// 倾角字段
m_qsID = qsID;
m_qsTable="FRAC_HOLE.TABLE";
flag = Refurbish();
if(!flag)
{
return;
}
}
double nR = 40;
QPen wPen(Qt::black, 2);
QPen wPen(m_rose_circle_line_color, 2);
double centerX = this->m_iX2/2;
float flVal = 0.0f;
float x,y,x1,y1,x2,y2;
float ifdir[360];
int m_nArc = 36;
float m_LeftVal3 = 0;
float m_RightVal3 = 100.0;
m_LeftVal = 0.0f;
m_RightVal = 90.0f;
// int nstep = 5;
// float m_LeftVal3 = 0;
// float m_RightVal3 = 100.0;
float mind=min(m_RightVal , m_LeftVal);
float maxd=max(m_RightVal , m_LeftVal);
float dirmax,dipmax,dr;
float deps;
float ftmpSdep = 2890;//m_SDep;
float ftmpEdep = m_EDep;
if (m_bTableData)
{
ReadFracDef();
@ -10629,18 +10659,16 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
int nPointNum = m_FracTabList.count();
int n = m_FracDefList.count();
int nstep = 5;
int tmp = ftmpSdep / nstep;
float flDep = tmp * nstep;
double pi = 3.1415926535;
// 射线
bool m_bGrid = true;
// bool m_bGrid = true;
// 井眼垮塌
bool m_bJykt = true;
// bool m_bJykt = true;
// 标注
bool m_bHint = true;
int m_nAzimStep = 3;
// bool m_bHint = true;
m_Curve.DepLevel = 0.5;
while ( 1)
@ -10650,15 +10678,16 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
double tempf = flDep+(float)(nstep)/2.;
double centerY = tempf * -1.0;
wPen.setWidth(2);
wPen.setColor(Qt::black);
// 最外层圆
QCPItemEllipse* pEse = new QCPItemEllipse(this);
wPen.setWidth(m_rose_circle_line_width);
pEse->setPen(wPen);
pEse->m_bCustom = true;
pEse->m_nRadius = nR;
pEse->topLeft->setCoords(centerY, centerX);
pEse->bottomRight->setCoords(centerY, centerX);
// 圆里面的十字
for(int k = 0; k < 4; k++)
{
QCPItemLine* pLine1 = new QCPItemLine(this);
@ -10672,9 +10701,9 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
}
// 写标注
if ( m_bHint )
if (m_bHint)
{
int psize = 10;
int psize = 15;
flVal = m_nAzimStep*360./m_nArc;
for (int i=0 ;i<360; i+=(int)(flVal))
{
@ -10682,21 +10711,19 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
mItemTitle->position->setCoords(centerY,centerX);
mItemTitle->setText(QString::number(i));
//mItemTitle->setBrush(QBrush(Qt::red));
mItemTitle->setFont(QFont("Arial", 10));
mItemTitle->setColor(Qt::black);
mItemTitle->setFont(m_pl_fontScale);
mItemTitle->setColor(m_rose_circle_line_color);
dr = i*2* 3.1415926535/ 360.;
mItemTitle->m_fx = (nR+psize*0.85)*sin(dr);
mItemTitle->m_fy = (nR+psize*0.85)*cos(dr);
mItemTitle->m_bCustom = true;
}
}
// 画辐射线
if(m_bGrid)
{
wPen.setWidth(1);
double st = 360/m_nArc;
for(int i = 0; i < m_nArc; i++)
{
@ -10715,6 +10742,22 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
}
}
// 画辐射圈
if (m_bGrid)
{
qreal currentRadius = 0;
for (int i = 0; i < m_nCircle; i++)
{
QCPItemEllipse* pEse = new QCPItemEllipse(this);
pEse->setPen(wPen);
pEse->m_bCustom = true;
currentRadius -= nR / m_nCircle;
pEse->m_nRadius = currentRadius;
pEse->topLeft->setCoords(centerY, centerX);
pEse->bottomRight->setCoords(centerY , centerX );
}
}
for(int i=0;i<=m_nArc;i++) ifdir[i]=0.;
x1 = 360./m_nArc;
@ -10828,7 +10871,15 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
pol->topLeft->setCoords(x, y);
pol->bottomRight->setCoords(x, y);
pol->setPoints(myPolygon);
pol->setBrushColor(QColor(255,170,0));
if(m_rose_fill_enabled)
{
m_rose_stress_line_color.setAlpha(255);
}
else
{
m_rose_stress_line_color.setAlpha(0);
}
pol->setBrushColor(QColor(m_rose_stress_line_color));
}
myPolygon.clear();
@ -10861,6 +10912,7 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
oldy = y2;
}
}
// 垮塌线
if (iIndex >=0/*&&m_bFill*/ )
{
x = centerY;
@ -10869,10 +10921,11 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
pol->topLeft->setCoords(x, y);
pol->bottomRight->setCoords(x, y);
pol->setPoints(myPolygon);
pol->setBrushColor(QColor(255,170,0));
pol->setBrushColor(QColor(m_rose_stress_line_color));
}
if ( m_bJykt && iIndex >=0 )
{
// 绘制垮塌方向
@ -10886,28 +10939,27 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
x2 = ifdir[iIndex]*nR*sin(dr)/dirmax;
y2 = ifdir[iIndex]*nR*cos(dr)/dirmax;
wPen.setWidth(2);
wPen.setColor(QColor(0,85,255));
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), wPen);
QPen collapsePen(m_rose_collapse_line_color, 2);
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), collapsePen);
dr=iIndex*flVal;
float x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
float y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), collapsePen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), collapsePen);
dr=iIndex*flVal;
dr = dr-pi;//18*flVal;//m1_nArc*flVal/2;
x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), collapsePen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), collapsePen);
}
flDep += nstep;
}
this->replot();
}
void QMyCustomPlot::addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen)

View File

@ -656,8 +656,13 @@ public:
bool ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve);
bool ReadData(QString strSlfName, QString strLineName);
//
void drawRose(bool bTableData, QString csCurveDDIR, QString csCurveDANG,
QString qsDepth, QString qsDIR, QString qsDIP, QString qsID);
QString qsDepth, QString qsDIR, QString qsDIP, QString qsID,
QString csCurveGrad, double m_LeftVal3, double m_RightVal3, QFont m_pl_fontScale,
int m_nArc, int m_rose_circle_radius_cm, int m_rose_radiation_circle_enabled, int m_rose_azimuth_print_interval, QColor m_rose_circle_line_color,
int m_rose_circle_line_width, QColor m_rose_stress_line_color, QColor m_rose_collapse_line_color, bool m_rose_draw_radiation_line, bool m_rose_draw_wellbore_collapse,
bool m_rose_fill_enabled, bool m_rose_draw_annotation, int nstep, float m_LeftVal, float m_RightVal);
void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen);
private: