1.井壁取心,修改图形外观,与老版本一致,道宽改变整体不变形。

2.固井结论的黑边,解决不显示问题,与老版本一致,道宽改变岩性不变形。
3.录井剖面,各个组件中间用黑线分割,与老版本一致,道宽改变岩性不变形。
This commit is contained in:
jiayulong 2026-03-27 17:22:51 +08:00
parent 7743fd5691
commit cbc97c6c6b
8 changed files with 260 additions and 70 deletions

View File

@ -109,8 +109,8 @@ void TransparentDraggableGeoLith::drawLith(double left_Low, double right_Hight,
return;
}
double x1 = mPlot->xAxis->coordToPixel(left_Low);
double x2 = mPlot->xAxis->coordToPixel(right_Hight);
double x1 = mPlot->xAxis->coordToPixel(left_Low)-1; //下边上移1像素-1
double x2 = mPlot->xAxis->coordToPixel(right_Hight)+1;//上边下移1像素+1
double y1 = 0;
if(mPlot->m_bShowOil)
{
@ -257,8 +257,8 @@ void TransparentDraggableGeoLith::drawColorLeft(double left_Low, double right_Hi
GetWellNameAndPath(m_Color, filename, path);
QString basename = filename;
double x1 = mPlot->xAxis->coordToPixel(left_Low);
double x2 = mPlot->xAxis->coordToPixel(right_Hight);
double x1 = mPlot->xAxis->coordToPixel(left_Low)-1; //下边上移1像素-1
double x2 = mPlot->xAxis->coordToPixel(right_Hight)+1;//上边下移1像素+1
double y1 = mPlot->yAxis->coordToPixel(lY1);
double y2 = mPlot->yAxis->coordToPixel(lY1+(lY2-lY1)/mPlot->m_dOilZhan);
double newWidth = y2-y1;
@ -293,8 +293,8 @@ void TransparentDraggableGeoLith::drawColorLeft(double left_Low, double right_Hi
//
mPixmap_Color->setPixmap(QPixmap(val)); // 设置图片
mPixmap_Color->topLeft->setCoords(right_Hight, lY1);//right_Hight
mPixmap_Color->bottomRight->setCoords(left_Low, lY1+(lY2-lY1)/mPlot->m_dOilZhan);//left_Low
mPixmap_Color->topLeft->setCoords(right_Hight, mPlot->yAxis->pixelToCoord(y1+1));//right_Hight
mPixmap_Color->bottomRight->setCoords(left_Low, mPlot->yAxis->pixelToCoord(y2-1));//left_Low
}
//设置m_Oil
@ -309,6 +309,13 @@ void TransparentDraggableGeoLith::drawOil(double left_Low, double right_Hight, d
{
mPixmap_Oil->topLeft->setCoords(0, 0); //right_Hight, lY1
mPixmap_Oil->bottomRight->setCoords(0, 0); //left_Low
//含油2条线
m_qcpItemLine1->start->setCoords(0, 0);
m_qcpItemLine1->end->setCoords(0, 0);
//
m_qcpItemLine2->start->setCoords(0, 0);
m_qcpItemLine2->end->setCoords(0, 0);
return;
}
@ -384,13 +391,34 @@ void TransparentDraggableGeoLith::drawOil(double left_Low, double right_Hight, d
if(mPlot->m_bCenterOil)//含油性居中
{
mPixmap_Oil->topLeft->setCoords(xNewRight, lY1+ (lY2-lY1 -(lY2-lY1)/mPlot->m_dOilZhan) / 2.0); //right_Hight, lY1
mPixmap_Oil->bottomRight->setCoords(xNewLeft, lY2- (lY2-lY1 -(lY2-lY1)/mPlot->m_dOilZhan) / 2.0); //left_Low
double yTmp1 = mPlot->yAxis->coordToPixel(lY1+ (lY2-lY1 -(lY2-lY1)/mPlot->m_dOilZhan) / 2.0);
double yTmp2 = mPlot->yAxis->coordToPixel(lY2- (lY2-lY1 -(lY2-lY1)/mPlot->m_dOilZhan) / 2.0);
mPixmap_Oil->topLeft->setCoords(xNewRight, mPlot->yAxis->pixelToCoord(yTmp1+1)); //right_Hight, lY1
mPixmap_Oil->bottomRight->setCoords(xNewLeft, mPlot->yAxis->pixelToCoord(yTmp2-2)); //left_Low
if(mPlot->m_bShowColor || mPlot->m_bShowColorNum) // 绘制颜色号/显示颜色
{
//颜色1条线
m_qcpItemLine1->start->setCoords(right_Hight, mPlot->yAxis->pixelToCoord(y1));
m_qcpItemLine1->end->setCoords(left_Low, mPlot->yAxis->pixelToCoord(y1));
//第2条隐藏
m_qcpItemLine2->start->setCoords(0, 0);
m_qcpItemLine2->end->setCoords(0, 0);
}
}
else
{
mPixmap_Oil->topLeft->setCoords(xNewRight, mPlot->yAxis->pixelToCoord(y1+1)); //right_Hight, lY1
mPixmap_Oil->bottomRight->setCoords(xNewLeft, mPlot->yAxis->pixelToCoord(y2-1)); //left_Low
mPixmap_Oil->bottomRight->setCoords(xNewLeft, mPlot->yAxis->pixelToCoord(y2-2)); //left_Low
//含油2条线
m_qcpItemLine1->start->setCoords(right_Hight, mPlot->yAxis->pixelToCoord(y1));
m_qcpItemLine1->end->setCoords(left_Low, mPlot->yAxis->pixelToCoord(y1));
//
m_qcpItemLine2->start->setCoords(right_Hight, mPlot->yAxis->pixelToCoord(y2));
m_qcpItemLine2->end->setCoords(left_Low, mPlot->yAxis->pixelToCoord(y2));
}
//mPlot->replot();
@ -404,6 +432,12 @@ void TransparentDraggableGeoLith::setRange(double left_Low, double right_Hight,
double lY1 = mPlot->yAxis->range().lower;//+10
double lY2 = mPlot->yAxis->range().upper;
//坐标转像素
double x1 = mPlot->xAxis->coordToPixel(left_Low);
double x2 = mPlot->xAxis->coordToPixel(right_Hight);
double left_Low2 = mPlot->xAxis->pixelToCoord(x1-2);
double right_Hight2 = mPlot->xAxis->pixelToCoord(x2+1);
mRect->topLeft->setCoords(left_Low, lY1);
mRect->bottomRight->setCoords(right_Hight, lY2);
@ -451,13 +485,13 @@ void TransparentDraggableGeoLith::setRange(double left_Low, double right_Hight,
}
}
//
drawLith(left_Low, right_Hight, lY1, lY2);
drawLith(left_Low2, right_Hight2, lY1, lY2);
//位置与rect不一样否则图像反转
drawOil(left_Low, right_Hight, lY1, lY2);
drawOil(left_Low2, right_Hight2, lY1, lY2);
//左侧颜色
drawColorLeft(left_Low, right_Hight, lY1, lY2);
drawColorLeft(left_Low2, right_Hight2, lY1, lY2);
updateHandles();
@ -501,6 +535,9 @@ void TransparentDraggableGeoLith::deleteRect()
mPlot->removeItem(mPixmap_Oil);
mPlot->removeItem(mPixmap_Color);
mPlot->removeItem(mItemTitle);
//含油2边
mPlot->removeItem(m_qcpItemLine1);
mPlot->removeItem(m_qcpItemLine2);
//mPlot->replot();
this->deleteLater();
@ -570,6 +607,14 @@ void TransparentDraggableGeoLith::initRect()
//mItemTitle->position->setType(QCPItemPosition::ptAxisRectRatio);
mItemTitle->position->setCoords(0.5, 0);
mItemTitle->setLayer("overlay");
//含油2边
m_qcpItemLine1 = new QCPItemLine(mPlot);
m_qcpItemLine1->setPen(QPen(QColor(0, 0, 0, 200)));
//
m_qcpItemLine2 = new QCPItemLine(mPlot);
m_qcpItemLine2->setPen(QPen(QColor(0, 0, 0, 200)));
}
void TransparentDraggableGeoLith::updateHandles()

View File

@ -87,6 +87,10 @@ public:
QString mstrTitle="";
QString m_strUuid = "";
//含油 2边
QCPItemLine *m_qcpItemLine1;
QCPItemLine *m_qcpItemLine2;
QString m_Lith;
QString m_Oil;
QString m_Color;

View File

@ -181,9 +181,14 @@ void TransparentDraggableGujing::setRange(double left_Low, double right_Hight, b
mRect->bottomRight->setCoords(right_Hight, lY2);
//位置与rect不一样否则图像反转
mPixmap->topLeft->setCoords(right_Hight, lY1);
mPixmap->bottomRight->setCoords(left_Low, lY2);
drawResult(left_Low, right_Hight, lY1, lY2);
double x1 = mPlot->xAxis->coordToPixel(left_Low);
double x2 = mPlot->xAxis->coordToPixel(right_Hight);
double left_Low2 = mPlot->xAxis->pixelToCoord(x1-2);
double right_Hight2 = mPlot->xAxis->pixelToCoord(x2+1);
//
mPixmap->topLeft->setCoords(right_Hight2, lY1);
mPixmap->bottomRight->setCoords(left_Low2, lY2);
drawResult(left_Low2, right_Hight2, lY1, lY2);
// 设置父锚点,定位点
mItemTitle->position->setCoords((mRect->topLeft->coords().x() + mRect->bottomRight->coords().x())/2,

View File

@ -11,8 +11,8 @@ TransparentDraggableSwallCore::TransparentDraggableSwallCore(QMyCustomPlot *pare
m_strUuid = strUuid;
//图片高度(需要根据高度宏定义,重新计算)
double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
m_fImageHeight = h/2.0;
// double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
// m_fImageHeight = h/2.0;
//
initRect();
@ -101,10 +101,10 @@ void TransparentDraggableSwallCore::drawLith(double left_Low, double right_Hight
return;
}
double x1 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2)+m_fImageHeight;
double x2 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2);
double x1 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2)+m_fImageHeight-1; //下边上移1像素-1
double x2 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2)+1;//上边下移1像素+1
double y1 = mPlot->yAxis->coordToPixel(lY1)+(m_fLeftSpace+m_fTriangleLen);
double y2 = mPlot->yAxis->coordToPixel(lY1)+m_fImageWidth+(m_fLeftSpace+m_fTriangleLen);
double y2 = mPlot->yAxis->coordToPixel(lY1)+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth-1;
bool bWidthBig = false;
double newWidth = y2-y1;
@ -152,35 +152,36 @@ void TransparentDraggableSwallCore::drawLith(double left_Low, double right_Hight
}
else
{
QString path,filename;
GetWellNameAndPath(filePath, filename, path);
QString basename = filename;
// QString path,filename;
// GetWellNameAndPath(filePath, filename, path);
// QString basename = filename;
// QString val=filePath;
// QImage image(newWidth, newHeight, QImage::Format_RGB32);
// QPainter painter(&image);
// QRectF fillRect(0,0,newWidth, newHeight);
// painter.fillRect(fillRect,Qt::white);
// //
// bool isOne=true;
// bool isStech=true;
// bool isHorizon=false;
// float cm = g_dPixelPerCm;//一厘米对应的像素个数
// QColor bkColor = QColor(255,255,255,0);
QString val=filePath;
QImage image(newWidth, newHeight, QImage::Format_RGB32);
QPainter painter(&image);
QRectF fillRect(0,0,newWidth, newHeight);
painter.fillRect(fillRect,Qt::white);
//
bool isOne=true;
bool isStech=true;
bool isHorizon=false;
float cm = g_dPixelPerCm;//一厘米对应的像素个数
QColor bkColor = QColor(255,255,255,0);
float GeoResult = m_drawGeo.seleGeo("岩性符号库", basename, &painter, fillRect, isOne, isStech, isHorizon, cm, bkColor);
val=GetImagePath()+"TempNew";
QDir ss;
if(!ss.exists(val)) {
ss.mkdir(val);
}
val+=QDir::separator();
val+=basename+".png";
image.save(val);
// float GeoResult = m_drawGeo.seleGeo("岩性符号库", basename, &painter, fillRect, isOne, isStech, isHorizon, cm, bkColor);
// val=GetImagePath()+"TempNew";
// QDir ss;
// if(!ss.exists(val)) {
// ss.mkdir(val);
// }
// val+=QDir::separator();
// val+=basename+".png";
// image.save(val);
//
mPixmap_Lith->setPixmap(QPixmap(val)); // 设置图片
// mPixmap_Lith->setPixmap(QPixmap(val)); // 设置图片
//
mPixmap_Lith->setPixmap(QPixmap(m_Lith)); // 设置图片
}
mPixmap_Lith->topLeft->setCoords(mPlot->xAxis->pixelToCoord(x2), mPlot->yAxis->pixelToCoord(y1));//right_Hight+1
mPixmap_Lith->bottomRight->setCoords(mPlot->xAxis->pixelToCoord(x1), mPlot->yAxis->pixelToCoord(y2));//left_Low-1
@ -199,9 +200,9 @@ void TransparentDraggableSwallCore::drawOil(double left_Low, double right_Hight,
return;
}
double x1 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2);
double x2 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2)-m_fImageHeight;
double y1 = mPlot->yAxis->coordToPixel(lY1)+(m_fLeftSpace+m_fTriangleLen);
double x1 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2);
double x2 = mPlot->xAxis->coordToPixel((left_Low+right_Hight)/2)-m_fImageHeight;//
double y1 = mPlot->yAxis->coordToPixel(lY1)+(m_fLeftSpace+m_fTriangleLen)+0.333*m_fImageWidth;
double y2 = mPlot->yAxis->coordToPixel(lY1)+m_fImageWidth+(m_fLeftSpace+m_fTriangleLen);
bool bWidthBig = false;
@ -274,27 +275,51 @@ void TransparentDraggableSwallCore::setRange(double left_Low, double right_Hight
double lY1 = mPlot->yAxis->range().lower;//+10
double lY2 = mPlot->yAxis->range().upper;
mRect->topLeft->setCoords(left_Low, lY1+(m_fLeftSpace+m_fTriangleLen));
mRect->bottomRight->setCoords(right_Hight, lY1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+m_fColorWordLen);
//坐标转像素
double x1 = mPlot->xAxis->coordToPixel(left_Low);
double x2 = mPlot->xAxis->coordToPixel(right_Hight);
double left_Low2 = mPlot->xAxis->pixelToCoord(x1-2);
double right_Hight2 = mPlot->xAxis->pixelToCoord(x2+1);
double y1 = mPlot->yAxis->coordToPixel(lY1);
double y2 = mPlot->yAxis->coordToPixel(lY2);
drawLith(left_Low, right_Hight, lY1, lY2);
mRect->topLeft->setCoords(left_Low, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth));
mRect->bottomRight->setCoords(right_Hight, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+m_fColorWordLen));
drawLith(left_Low2, right_Hight2, lY1, lY2);
drawOil(left_Low2, right_Hight2, lY1, lY2);
mItemTitle->position->setCoords(mPlot->xAxis->pixelToCoord(x2+8),
mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+12));
drawOil(left_Low, right_Hight, lY1, lY2);
mItemTitle->position->setCoords(mRect->bottomRight->coords().x(),
lY1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+20);
//三角形2边
m_qcpItemLine1->start->setCoords((left_Low+right_Hight)/2, lY1+m_fLeftSpace);
m_qcpItemLine1->end->setCoords(left_Low, lY1+(m_fLeftSpace+m_fTriangleLen));
m_qcpItemLine1->start->setCoords((left_Low+right_Hight)/2, mPlot->yAxis->pixelToCoord(y1+m_fLeftSpace));
m_qcpItemLine1->end->setCoords(left_Low, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)));
//
m_qcpItemLine2->start->setCoords((left_Low+right_Hight)/2, lY1+m_fLeftSpace);
m_qcpItemLine2->end->setCoords(right_Hight, lY1+(m_fLeftSpace+m_fTriangleLen));
m_qcpItemLine2->start->setCoords((left_Low+right_Hight)/2, mPlot->yAxis->pixelToCoord(y1+m_fLeftSpace));
m_qcpItemLine2->end->setCoords(right_Hight, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)));
//
m_qcpItemLine3->start->setCoords((left_Low+right_Hight)/2, lY1+m_fLeftSpace);
m_qcpItemLine3->end->setCoords((left_Low+right_Hight)/2, lY1+(m_fLeftSpace+m_fTriangleLen));
m_qcpItemLine3->start->setCoords((left_Low+right_Hight)/2, mPlot->yAxis->pixelToCoord(y1+m_fLeftSpace));
m_qcpItemLine3->end->setCoords((left_Low+right_Hight)/2, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth));
//
m_qcpItemLine4->start->setCoords(right_Hight, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)));
m_qcpItemLine4->end->setCoords(right_Hight, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+m_fColorWordLen));
//
m_qcpItemLine5->start->setCoords(left_Low, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)));
m_qcpItemLine5->end->setCoords(left_Low, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+m_fColorWordLen));
//
m_qcpItemLine6->start->setCoords(right_Hight, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth));
m_qcpItemLine6->end->setCoords(left_Low, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth));
//
m_qcpItemLine7->start->setCoords(right_Hight, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+m_fColorWordLen));
m_qcpItemLine7->end->setCoords(left_Low, mPlot->yAxis->pixelToCoord(y1+(m_fLeftSpace+m_fTriangleLen)+m_fImageWidth+m_fColorWordLen));
updateHandles();
//updateHandles();
//刷新,针对批量修改不在此处刷新,后面统一刷新
if(bReplot)
{
@ -339,6 +364,10 @@ void TransparentDraggableSwallCore::deleteRect()
mPlot->removeItem(m_qcpItemLine1);
mPlot->removeItem(m_qcpItemLine2);
mPlot->removeItem(m_qcpItemLine3);
mPlot->removeItem(m_qcpItemLine4);
mPlot->removeItem(m_qcpItemLine5);
mPlot->removeItem(m_qcpItemLine6);
mPlot->removeItem(m_qcpItemLine7);
//mPlot->replot();
this->deleteLater();
@ -360,8 +389,8 @@ void TransparentDraggableSwallCore::initRect()
// 创建透明矩形
mRect = new QCPItemRect(mPlot);
mRect->setLayer("overlay"); // 确保在最上层
mRect->setBrush(QBrush(QColor(255, 255, 255, 50))); // 半透明蓝色100, 100, 255, 50
mRect->setPen(QPen(QColor(0, 0, 0, 200)));
mRect->setBrush(QBrush(QColor(255, 255, 255, 50))); // 半透明蓝色100, 100, 255, 50
mRect->setPen(QPen(QColor(0, 0, 0, 255)));
// // 创建左右边界控制点
// mLeftHandle = new QCPItemRect(mPlot);
@ -401,7 +430,7 @@ void TransparentDraggableSwallCore::initRect()
mItemTitle = new QCPItemText(mPlot);
mItemTitle->setText(mstrTitle);
//mItemTitle->setBrush(QBrush(Qt::red));
mItemTitle->setFont(QFont("Arial", 12, QFont::Bold));
mItemTitle->setFont(QFont("Arial", 6, QFont::Light));
mItemTitle->setColor(Qt::black);
mItemTitle->setPositionAlignment(Qt::AlignTop | Qt::AlignHCenter);
mItemTitle->position->setType(QCPItemPosition::ptPlotCoords);
@ -418,6 +447,18 @@ void TransparentDraggableSwallCore::initRect()
//
m_qcpItemLine3 = new QCPItemLine(mPlot);
m_qcpItemLine3->setPen(QPen(QColor(0, 0, 0, 200)));
//
m_qcpItemLine4 = new QCPItemLine(mPlot);
m_qcpItemLine4->setPen(QPen(QColor(0, 0, 0, 200)));
//
m_qcpItemLine5 = new QCPItemLine(mPlot);
m_qcpItemLine5->setPen(QPen(QColor(0, 0, 0, 200)));
//
m_qcpItemLine6 = new QCPItemLine(mPlot);
m_qcpItemLine6->setPen(QPen(QColor(0, 0, 0, 200)));
//
m_qcpItemLine7 = new QCPItemLine(mPlot);
m_qcpItemLine7->setPen(QPen(QColor(0, 0, 0, 200)));
}
void TransparentDraggableSwallCore::updateHandles()

View File

@ -81,6 +81,10 @@ public:
QCPItemLine *m_qcpItemLine1;
QCPItemLine *m_qcpItemLine2;
QCPItemLine *m_qcpItemLine3;
QCPItemLine *m_qcpItemLine4;
QCPItemLine *m_qcpItemLine5;
QCPItemLine *m_qcpItemLine6;
QCPItemLine *m_qcpItemLine7;
QString m_Lith;
QString m_Oil;
@ -99,12 +103,12 @@ public:
//
float m_fLeftSpace=0; //左侧空白长度
float m_fTriangleLen=40;//三角形长度
float m_fTriangleLen=16;//三角形长度
//
float m_fImageWidth=70;//图片长度
float m_fImageHeight=20;//图片高度(需要根据高度宏定义,重新计算)
float m_fImageWidth=45;//图片长度
float m_fImageHeight=16;//图片高度(需要根据高度宏定义,重新计算)
//
float m_fColorWordLen=40;//颜色文字长度
float m_fColorWordLen=30;//颜色文字长度
//鼠标形状
bool m_bArrow = false;

View File

@ -2707,6 +2707,9 @@ void FormDraw::setColWidth(int iNewWidth)
{
form->setConclusionProportion(0);
}
//道宽改变后,避免井壁取心等组件变形,需要重新刷新
form->resetPosition();
form->replot();//屏蔽,缩减时间
}
}

View File

@ -4958,7 +4958,7 @@ void QMyCustomPlot::addSwallCoreToPlot(double Depth, QString LithologyImage, QSt
//左侧空白
dragRect->m_fLeftSpace = Sideleft*g_dPixelPerCm;
// 设置初始范围
double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
double h = 32;//SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
double x1 = this->xAxis->coordToPixel(Depth);
//
double Depth2 = this->xAxis->pixelToCoord(x1-h);
@ -9508,3 +9508,79 @@ void QMyCustomPlot::s_changeLineName(QString strUuid, QString strSlfName, QStrin
s_ReloadPlot(strUuid, strSlfName, strNewLineName);
//RefreshItems_Jiegutext();
}
//固井结论
void QMyCustomPlot::resetPosition_Gujing()
{
TransparentDraggableGujing *pDraggableRect =NULL;
QMap<QString,QObject *>::Iterator it = m_mapDraggable_Gujing.begin();
while( it != m_mapDraggable_Gujing.end() )
{
pDraggableRect = (TransparentDraggableGujing*)it.value();
it++;
//
QCPRange tmpRange = pDraggableRect->getRange();
pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false);
}
}
//井壁取心
void QMyCustomPlot::resetPosition_SwallCore()
{
TransparentDraggableSwallCore *pDraggableRect =NULL;
QMap<QString,QObject *>::Iterator it = m_mapDraggable_SwallCore.begin();
while( it != m_mapDraggable_SwallCore.end() )
{
pDraggableRect = (TransparentDraggableSwallCore*)it.value();
it++;
//
QCPRange tmpRange = pDraggableRect->getRange();
pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false);
}
}
//录井剖面
void QMyCustomPlot::resetPosition_GeoLith()
{
TransparentDraggableGeoLith *pDraggableRect =NULL;
QMap<QString,QObject *>::Iterator it = m_mapDraggable_GeoLith.begin();
while( it != m_mapDraggable_GeoLith.end() )
{
pDraggableRect = (TransparentDraggableGeoLith*)it.value();
it++;
//
QCPRange tmpRange = pDraggableRect->getRange();
pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false);
}
}
//地质层位
void QMyCustomPlot::resetPosition_Layer()
{
TransparentDraggableLayer *pDraggableRect =NULL;
QMap<QString,QObject *>::Iterator it = m_mapDraggable_Layer.begin();
while( it != m_mapDraggable_Layer.end() )
{
pDraggableRect = (TransparentDraggableLayer*)it.value();
it++;
//
QCPRange tmpRange = pDraggableRect->getRange();
pDraggableRect->setRange(tmpRange.lower, tmpRange.upper, false);
}
}
//道宽改变后,避免井壁取心等组件变形,需要重新刷新
void QMyCustomPlot::resetPosition()
{
//固井结论
resetPosition_Gujing();
//井壁取心
resetPosition_SwallCore();
//录井剖面
resetPosition_GeoLith();
//地质层位
resetPosition_Layer();
//刷新
replot();
}

View File

@ -80,6 +80,18 @@ public:
void setShowProperty(QVariant val, int ntag);
void setConclusionProportion(int nCopro);
void setShowPos(int nSPos);
//道宽改变后,避免井壁取心等组件变形,需要重新刷新
void resetPosition();
//固井结论
void resetPosition_Gujing();
//井壁取心
void resetPosition_SwallCore();
//录井剖面
void resetPosition_GeoLith();
//地质层位
void resetPosition_Layer();
protected:
//virtual void mouseMoveEvent(QMouseEvent *event);