追加井斜三图一表绘制。(采用老代码逻辑修改,需要数据测试验证)

This commit is contained in:
jiayulong 2026-01-14 15:24:23 +08:00
parent 3e8b9650b0
commit e1d2459b90
18 changed files with 4561 additions and 47 deletions

200
DrawBase/include/DrawBase.h Normal file
View File

@ -0,0 +1,200 @@
#ifndef DrawBase_H
#define DrawBase_H
//格线类型
//字体对齐方式
#define LEFT Qt::AlignLeft
#define RIGHT Qt::AlignRight// 1
#define CENTER Qt::AlignCenter// 2
#define VCENTER Qt::AlignVCenter//3
#pragma warning( push ,0)
#include "OSGFramework.h"
// #include "QtWellTrackNode.h"
// #include "QtWellSceneManager.h"
#include "ObjWelllog.h"
// #include "HeadObj.h"
// #include "QtWellLogTrackNode.h"
#include "drawbase_global.h"
#include "VecCoordinate.h"
#include <QImage>
#pragma warning( pop )
//#ifdef _WINDOWS
//#ifdef DRAWBASE_LIB
//#define DRAWBASE_EXPORT __declspec(dllexport)
//#else
//#define DRAWBASE_EXPORT __declspec(dllimport)
//#endif
//#else
//#define DRAWBASE_EXPORT
//#endif
BEGIN_OSGGRAPHICS_NAMESPACE;
struct DRAWBASE_EXPORT ColorMessage
{
int ColorNum; //颜色级数
int Mode; //调色方式
QColor Color[256]; //定义颜色数组
};
// 边结构数据类型
typedef struct Edge{
int ymax; // 边的最大y坐标
float x; // 与当前扫描线的交点x坐标
float dx; // 边所在直线斜率的倒数
struct Edge * pNext; // 指向下一条边
} Edge, * LPEdge;
struct DRAWBASE_EXPORT WaveMessage
{
int WaveType; // 绘图类型0-波形1-填充2-变密度
int Mode; //绘填充或变密度图形时的填充方式1-正半周,-1--负半周0-全周
float m_Left; //波列左刻度时间
float m_Right; //波列右刻度时间
float m_MaxRange; //波列最大幅度
float m_Base; //波列基值
int m_WaveSpace; //绘制波列间隔数即每隔m_WaveSpace个点画一个波列
float m_WaveHight; //波列高度
QColor WaveColor; //波列曲线的颜色
QColor FillColor; //填充的颜色
ColorMessage m_ColorMessage;
};
class DRAWBASE_EXPORT CDrawBase/*:public CQtWellLogTrackNode*/
{
// Q_OBJECT
public:
CDrawBase();
virtual ~CDrawBase();
virtual void Destory();
public:
virtual float ConvertY(eCoordType eInCoordType, double flDep,
eCoordType eOutCoordType );
float ConvertY(float fDep);
virtual void _Build();
virtual void DrawCurve(QPainter* pdc,QRectF mrt);
virtual void _UpdateHUD();
double getYOSGGlobalFromPixel(double y);
double getXOSGGlobalFromPixel(double x);
double getYGeoNormalFromPixel(double y);
double getYGeoFromOSGGlobal(double yOSGGlobal);
double getXGeoFromOSGGlobal(double xOSGGlobal,bool IsWF=0);
// osg::Vec3d OSGPixleToOSGLocal(osg::Vec3d vOSGPixel );
double getYFromOSGPixel(double y);
double getXFromOSGPixel(double x,bool IsWF=0,bool CalType=0);
// float YConvertToGEO(float y);
// float XConvertToGEO(float x);
// virtual void _Update( eUpdateEvent e,CObjectEventParam *pEventParam );
virtual void Refurbish();
virtual void ReadData();
virtual void SaveData();
virtual void InitProperty();
virtual void GetProperty();
void JudgePixel(QImage &pDC,QColor bc,unsigned char *strPixel);
void JudgePixel(unsigned char *iptrn,unsigned char *strPixel);
void FillLith(QPainter *pDC,QPointF *lpPoints,int nCount,QColor crFore,QColor crBack,QPointF *pixels,int *pointn,int nWidth,int nHeight);
void LineFillLith(QPainter *hdc,int x1,int x2,int y,int penw,QColor crFore,QColor crBack,QPointF *pixels,int *pointn,int nWidth,int nHeight);
void LineFillLith(QPainter *hdc,int x1,int x2,int y,int ipen,QColor crFore,QColor crBack,QImage image,int x0,int y0);
void FillLith(QPainter *pDC,QPointF *lpPoints,int nCount,QColor crFore,QColor crBack,QImage image,int x0,int y0);
void DrawLith(QPainter *pDC,QPointF *pt,int nPoint,QBrush FhName,QColor pForeColor,QColor bkColor);
int LITH_HEIGHT,LITH_WIDTH;
int nHeight;
int nWidth;
/*Slf_WAVE WaveInfo;*/
float m_nVertRatio,m_nHoriRatio,m_DepthScale,m_MMScale,m_HDepthScale;
int m_Ishorizontal;
bool m_IsPrint;
int DrawDev;
float m_PlotSdep,m_PlotEdep;//,m_MoveSdep,m_MoveEdep,m_MoveDep;
MyDataTypeEnum v,vCurve;
char* m_Value,*m_BackData;
QBrush m_brush;
float m_SDep,m_EDep,m_Rlev;
bool mIsCut,m_bSecond; //第二比例
float m_LeftVal; //左刻度
float m_RightVal; //右刻度
int m_nMaxAmp; //最大幅度
int m_nWaveHeight; //波形幅度
float m_flRlev2; //二维曲线采样间隔
float m_flStart,m_flEnd; //二维曲线开始值、结束值
int m_nSamples; //每深度间隔的数据点
int m_PointNum;
float *m_WaveValue; //波列数组
short *m_ShortWaveValue; //波列数组
Slf_WAVE WaveInfo; //波列基本信息
// WaveMessage mWaveMes; //波列设置消息
void GetDepth(QPainter *pDC,QRectF &mrt,QRectF &rt,
float &sdep,//屏幕显示起始斜深
float &edep,//屏幕显示终止斜深
float &sdepc,//水平位移显示下,斜深对应的水平位移;垂深显示下,斜深对应的垂深;
float &edepc);//水平位移显示下,斜深对应的水平位移;垂深显示下,斜深对应的垂深;
int iIndex;
QString sName;
QString sUnit;
QString sFilePath;
float ScreenWidth;
float ScreenHeight;
float ComputeCurvePos(float flVal,float lsc,float rsc,float lps,float rps,int iType,float scale,float flMin=-99999,float flMax=99999);
float ComputePosToCurveVal(float x,float lsc,float rsc,float lps,float rps,int iType,float scale,float flMin=-99999,float flMax=99999);
// void WriteStr(QPainter *pDC,QRectF rt1,CString cs,LOGFONT lf,
// QColor crColor,int iAlign,
// BOOL bVert,float flHoriRatio,int iBkMode,QColor crBack,UINT nFormat);
public:
/**
* @brief document的sheet句柄
*/
// void SetWellSheet(CSheet* wellSheet);
/**
* @brief
*/
virtual void SettingHeaderElements();
/**
* @brief 线
*/
virtual void DrawHead(QPainter *pPainter,QRectF rect,QRectF trect=QRectF());
/**
* @brief 线
*/
virtual void DrawClient(QPainter *pPainter,QRectF rt);
virtual void GetClientItem(float sdep,float edep, QVector<QLine> &lines);
virtual void DrawSidelines(QPainter *pPainter,QRectF rt);
double GetDdep();
public:
double GetData(int RepCode,char *buffer);
void SetData(int RepCode,char *buffer,float yy);
// CItemText *m_pLeftText; //左刻度
// CItemText *m_pRightText;//右刻度
// CItemText *m_pUnitText; //单位
// CItemText *m_pCurveNameText;//曲线名称
// virtual CQtWellTrackNode * GetWellTrackNode(); //得到wellNode实例
protected:
CObjWellLog *m_pWellLog;
// CSheet* m_pWellSheet;
protected:
private:
//FontMessage *MyFontMes; //字体类型
// private:
/**
* @brief
*/
/**
* @brief
*/
/**
* @brief
* @param colorMode:01
*/
// HeadObj* hHeadObj;
// ClientItem* m_pWave;
};
END_OSGGRAPHICS_NAMESPACE
#endif // DrawBase_H

View File

@ -0,0 +1,11 @@
#ifndef DRAWBASE_GLOBAL_H
#define DRAWBASE_GLOBAL_H
# ifdef DRAWBASE_LIB_EXPORT
# define DRAWBASE_EXPORT __declspec(dllexport)
# else
# define DRAWBASE_EXPORT __declspec(dllimport)
# endif
#endif

1289
DrawBase/src/DrawBase.cpp Normal file

File diff suppressed because it is too large Load Diff

47
DrawBase/src/DrawBase.pro Normal file
View File

@ -0,0 +1,47 @@
TEMPLATE = lib
TARGET = DrawBase
DEFINES += DRAWBASE_LIB_EXPORT
QT += core \
gui \
opengl
INCLUDEPATH += ../../common \
../include \
../../../OSGParts/include \
../../OSGFramework/include \
../../../ConvertorManager/include\
../../OSGDataModel/include\
../../../DrawBase/include\
../../../DataModel/include\
../../Slfio/include\
../../BaseFun/include
./GeneratedFiles
HEADERS += ../include/*.h
SOURCES += *.cpp
OBJECTS_DIR = ../obj
CONFIG(debug, debug|release){
DESTDIR = ../../Bin
TARGET = $$join(TARGET,,,d) #为debug版本生成的文件增加d的后缀
} else {
DESTDIR = ../../Bin
TARGET = $$join(TARGET,,,)
}
CONFIG += qt warn_off \
debug_and_release
#CONFIG += uitools
DEFINES += QT_DLL
#CPATH = $$system(pwd)
# 目标文件夹
#CATEGORY = OSGDataModel
CONFIG(debug, debug|release){
LIBS += -L../../Bin -lslfiod
} else {
LIBS += -L../../Bin -lslfio
}

View File

@ -7,8 +7,10 @@
#include <QTextCodec>
#include <QTextStream>
#include <QMessageBox>
#include <QPainter>
#include "LogIO.h"
float mLineWidth=0.75;
QString OilField;
QString setdec(QString text,int dec,bool all)
{
@ -1036,3 +1038,27 @@ QString GetOilSymbolDir(QString cs)
{
return GetSymbolDir()+"解释结论符号"+cs;
}
int GetLineWidth(QPainter * painter,int flWidth)
{
float mScale=0.1;
// 线宽1=0.75磅
float temp;
// 1磅 = 1/72英寸
//if(painter->device()&&painter->device()->devType()==QInternal::Printer)
{
float dpi=painter->device()->logicalDpiX();
if(!dpi) dpi=painter->device()->physicalDpiX();
temp = flWidth*mLineWidth/72.*dpi;//GetZoomXRatio();
//0.75
}
/*else
{
temp=flWidth;
}
*/
if(flWidth==3&&abs(temp)<3) temp=3;
else if(flWidth==2&&abs(temp)<2) temp=2;
else if(abs(temp)<=1) temp=1;
return (int)temp;
}

View File

@ -228,6 +228,7 @@ QString GetMudSymbolDir(QString cs=QDir::separator());
QString GetOilSymbolDir(QString cs=QDir::separator());
QString GetLithSymbolDir(QString cs=QDir::separator());
QString GetGujingSymbolDir(QString cs=QDir::separator());
int GetLineWidth(QPainter * painter,int flWidth);
struct WellHead
{

2397
logPlus/DrawTvd.cpp Normal file

File diff suppressed because it is too large Load Diff

215
logPlus/DrawTvd.h Normal file
View File

@ -0,0 +1,215 @@
#ifndef DrawTvd_H
#define DrawTvd_H
#include <QObject>
#include <QPainter>
#include <QGraphicsWidget>
//#include "QtNodeBuilder.h"
//#include "QtWellTrackNode.h"
//#include "QtWellSceneManager.h"
//#include "ObjWelllog.h"
//#include "WellSectionConst.h"
//#include "WellSheetItem.h"
//#include "ObjWellLogWavefile.h"
#include "ViewInfo.h"
//#include "Graphics2D/palettecolor/PaiColorTableData.h"
#include "DrawBase.h"
//BEGIN_OSGGRAPHICS_NAMESPACE;
#define GetClassID_ObjDrawTvd() "{98EB165F-1371-4D9F-9476-E4F5C19869B7}"
typedef struct BxPointMessage
{
int Style;
int Size;
QColor Color;
char MiaoShu[16];
};
struct LSCX_DATA
{
int NO;// 序号 NONE INT 4
float DEPTH;// 深度 m FLOAT 4
float TVD ;// 垂直深度 m FLOAT 4
float DEVI ;// 井斜角 G FLOAT 4
float AZIM ;// 井斜方位 G FLOAT 4
float AZZ ;// 真方位 G FLOAT 4
float XE ;// 东西位移 m FLOAT 4
float YN ;// 南北位移 m FLOAT 4
float HOFS ;// 水平位移 m FLOAT 4
float HOAZ ;// 闭合方位 G FLOAT 4
float GLD ;// 狗腿度 NONE FLOAT 4
};
struct TVD_BXPAR
{
int NO;;//靶心号
float BxDep;//设计垂深
float BxFw;//设计方位
float BxWy;//设计位移
float BxBj;//靶心半径
float BBG;//靶半高
float BBK;//靶半宽
char BNAME[16];
float BxScTDep;//实测垂深
float BxXDep;//对应斜深
float BxScFw;//实测方位
float BxScWy;//实测位移
float BxJ;//靶心距
float BxCzJ;//靶垂直距离
};
struct TVD_BXINF
{
int BxNum;
TVD_BXPAR Tvd_BxPar[10];
};
struct TABLE_ZD_INF
{
char name[16];
char aliasname[32];//字段别名
char unit[16];//单位
int w;//打印宽度(字符数)
int num;//数据位数
int dnum;//小数位数
int mode;//对齐方式
};
struct TABLE_PAR
{
float Head_Height;
float Rec_Height;
int ZdNum;//字段个数
TABLE_ZD_INF Zd_Inf[12];
};
struct FST_PAR
{
float MinXes;
float MaxXes;
float MinYns;
float MaxYns;
float MinXe;
float MaxXe;
float MinYn;
float MaxYn;
};
struct CST_PAR
{
float MaxWys;
float MaxTVD;
float MinTVD;
float MaxWy;
float MinWy;
float DepSpace;
float CsAngle;
};
struct LTGJT_PAR
{
float MaxWys;
float MaxWy;
float DepSpace;
float PrintDepSpace;
float CsAngle;
};
//class CObjDrawTvd :public CObjWellLog
//{
//public:
// CObjDrawTvd(){};
// virtual ~CObjDrawTvd(){};
// virtual QUuid GetTypeID()const{return GetClassID_ObjDrawTvd();};
//};
class CDrawTvd:public CDrawBase
{
public:
CDrawTvd(void);
virtual ~CDrawTvd(void);
virtual void ReadData();
//virtual void SaveData();
virtual void Refurbish();
virtual void InitProperty();
virtual void GetProperty();
//virtual void _Update( eUpdateEvent e,CObjectEventParam *pEventParam );
int m_PointNum;
CViewInfo* objViewInfo;
CViewInfo* m_pViewInfo;
// 以下变量需保存在模板里
//Tvd
QString m_TableName;
QString m_AliasName;
QString m_AliasWellName;//显示井名
bool m_IsDrawBxcs;
bool m_IsDrawTable;
bool m_IsDrawFst;
bool m_IsDrawCst;
bool m_IsDrawCst1;
bool m_IsDrawCst2;
bool m_IsDrawCst3;
bool m_IsDrawLtgjt;
LSCX_DATA *m_Lscx;
int DrawTable(int y_Start, QPainter* pDC,QRectF mrt);
int DrawFst(int y_Start, QPainter* pDC,QRectF mrt);
int DrawCst(int y_Start, QPainter* pDC,QRectF mrt,CST_PAR CPar,int no=3);
int DrawLtgjt(int y_Start, QPainter* pDC,QRectF mrt);
int DrawBxcs(int y_Start, QPainter* pDC,QRectF mrt);
// 4-边框,格线,轨迹线,靶心半径,靶心连线的宽度、类型和颜色
int m_FrameWidth,m_GridWidth,m_GuijiWidth,m_BxbjWidth,m_BxlxWidth;
QColor m_FrameColor,m_GridColor,m_GuijiColor,m_BxbjColor,m_BxlxColor;
//道头(井眼轨迹)、标题(三图一表的标题)、数据表、刻度、注释的字体属性
QFont m_HeadFont,m_TitleFont,m_TableFont,m_ScaleFont,m_NoteFont;
QColor m_HeadColor,m_TitleColor,m_TableColor,m_ScaleColor,m_NoteColor;
int m_FontAngle[5];
BOOL IsVert[5];//字符串方向是否垂直1
int hFormat[5],vFormat[5];//水平、垂直对齐方式
BOOL ShowHComb,ShowVComb,ShowVertCheck;//水平、垂直对齐方式设置组件、字符串方向(垂直)设置
QFont *Font1,*Font2,*FontTable;
QPen m_GuiJiPen,m_FramePen,m_GridPen,m_BxbjPen,m_BxlxPen;
QString m_Title_table,m_Title_cst,m_Title_fst,m_Title_ltgj;
float Xmax,Xmin,Ymax,Ymin,delt;//刻度最大最小值
float Xmaxs,Xmins,Ymaxs,Ymins;//实际最大最小值
float BxDep,BxDep2,BxBj,BxBj2,BxFw,BxFw2,BxWy,BxWy2;
float xfactor,yfactor,xscale,yscale;
int TableFontWidth,ScaleFontWidth,ScaleFontHeight,NoteFontWidth,NoteFontHeight;
int TitleFontWidth,TitleFontHeight;
float m_Width;
float m_Height;
float m_Bottom;
float m_Left;
float m_Right;
float m_Top;
int XCenter;
int flag;
TVD_BXINF Tvd_BxInf,Tvd_BxInf_Int;
FST_PAR FPar;
TABLE_PAR TPar;
CST_PAR CPar;
CST_PAR CPar_HOFF;
CST_PAR CPar_XE;
CST_PAR CPar_YN;
LTGJT_PAR LPar;
// 2013.6.8 add for 绘制靶心
BxPointMessage m_SjBxPointMessage,m_ScBxPointMessage;//设计靶心点信息,实测靶心点信息
BOOL m_FstPlotBx;
BOOL m_CstPlotBx;
BOOL m_LtgjtPlotBx;
BOOL m_PlotBxlx;
BOOL m_bPlotBhx; //绘制闭合线
//Tvd
void DrawTvd(QPainter* pdc,QRectF mrt);
/**
* @brief 线
*/
virtual void DrawHead(QPainter *pPainter,QRectF rect,QRectF trect=QRectF());
/**
* @brief 线
*/
virtual void DrawClient(QPainter *pPainter,QRectF rt);
virtual void DrawSidelines(QPainter *pPainter,QRectF rt);
QPoint ComputeXY(float val_x,float val_y,float val_z,float angle_x,float angle_y,float angle_z,float x0,float y0,float xfac,float yfac);
QFont TableFont;
QFont ScaleFont;
QFont NoteFont;
QFont TitleFont;
QList<QRgb> rgbList;
};
//END_OSGGRAPHICS_NAMESPACE
#endif // DrawTvd_H

95
logPlus/ViewInfo.cpp Normal file
View File

@ -0,0 +1,95 @@
#include "ViewInfo.h"
CViewInfo::CViewInfo()
{
m_sName="井斜三图一表";
//tvd
m_AliasName="井斜三图一表";
m_AliasWellName="";
m_XScale=1;
m_YScale=1;
m_heqw=0;
m_DepSpaceN=0;
// 2-边框,格线,轨迹线,靶心半径,靶心连线的宽度、类型和颜色
m_FrameWidth=3;
m_GridWidth=1;
m_GuijiWidth=m_BxbjWidth=m_BxlxWidth=2;
m_FrameColor=m_GuijiColor=qRgb(0,0,0);
m_GridColor=qRgb(127,127,127);
m_BxbjColor=m_BxlxColor=qRgb(255,0,0);
m_Title_table="井连续井斜仪测量数据表";
m_Title_cst="井井眼侧视图";
m_DepthLeft=false;
m_Title_fst="井井眼俯视图";
m_Title_ltgj="井井身立体空间轨迹图";
//tvd
m_IsDrawBxcs=1;
m_IsDrawTable=1;
m_IsDrawFst=1;
m_IsDrawCst=0;
m_IsDrawCst1=1;
m_IsDrawCst2=1;
m_IsDrawCst3=1;
m_IsDrawLtgjt=1;
m_FrameWidth=3;
m_FrameColor=qRgb(0,0,0);
m_HeadFont=m_TitleFont=QFont("黑体",16);
m_TableFont=m_NoteFont=QFont("黑体",10);
m_ScaleFont=QFont("黑体",8);
m_HeadColor=m_TitleColor=m_TableColor=m_ScaleColor=m_NoteColor=qRgb(0,0,0);
m_Head_Height=1.6;
m_Rec_Height=0.8;
m_MinXe=-100.;
m_MaxXe=100.;
m_MinYn=-100.;
m_MaxYn=100.;
m_CsAngle=90.;
m_DepSpace=100.;
m_MaxWy=100.;
m_MinWy=-100.;
m_MinTVD=0;
m_MaxTVD=10000;
m_LttxDela=5;
m_MaxWy_HOFF=100.;
m_MinWy_HOFF=-100.;
m_MinTVD_HOFF=0;
m_MaxTVD_HOFF=10000;
m_MaxWy_XE=100.;
m_MinWy_XE=-100.;
m_MinTVD_XE=0;
m_MaxTVD_XE=10000;
m_isDrawNote=true;
m_MaxWy_YN=100.;
m_MinWy_YN=-100.;
m_MinTVD_YN=0;
m_MaxTVD_YN=10000;
m_LttAngle=45;
m_LttAngle_X=10;
m_LttAngle_Z=0;
m_is3DFrame=true;
m_DepSpace1=100.;
m_MaxWy1=100.;
m_bPlotBhx = 0;
m_heqw=false;
m_XD=20;
m_YD=20;
m_LTTTVD=0;
m_IsDrawBX=true;
m_IsDrawProperty=0;
m_CurveName1="";
m_CurveName2="";
m_calscale=1;
m_baseval=0;
m_maxval=500;
m_Rlev=5;
m_isBlock=false;
m_DrawBox=true;
}
CViewInfo::~CViewInfo()
{
}

135
logPlus/ViewInfo.h Normal file
View File

@ -0,0 +1,135 @@
/**
* @file ViewInfo.h
* @brief
* @date
* @author:
*/
#ifndef PAI_FRAME_VIEWINFO_H
#define PAI_FRAME_VIEWINFO_H
#include <QObject>
#include <QColor>
#include <QFont>
class CViewInfo : public QObject
{
Q_OBJECT
public:
CViewInfo();
virtual ~CViewInfo();
//通常-井名
QString m_sName;
QString m_WellName;
bool m_DrawBox;
double m_hHeight;
//tvd
bool m_IsDrawBxcs;
bool m_IsDrawTable;
bool m_IsDrawFst;
bool m_IsDrawCst;
bool m_IsDrawCst1;
bool m_IsDrawCst2;
bool m_IsDrawCst3;
bool m_DepthLeft;
bool m_IsDrawLtgjt;
bool m_IsDrawBX;
QString m_AliasName;
QString m_AliasWellName;
float m_XScale;
float m_YScale;
// 1-边框,格线,轨迹线,靶心半径,靶心连线的宽度、类型和颜色
int m_FrameWidth;
int m_GridWidth;
int m_GuijiWidth;
int m_BxbjWidth;
int m_BxlxWidth;
//color
QColor m_FrameColor;
QColor m_GridColor;
QColor m_GuijiColor;
QColor m_BxbjColor;
QColor m_BxlxColor;
bool m_isDrawNote;
//道头(井眼轨迹)、标题(三图一表的标题)、数据表、刻度、注释的字体属性
//font
QFont m_HeadFont;
QFont m_TitleFont;
QFont m_TableFont;
QFont m_ScaleFont;
QFont m_NoteFont;
//color
QColor m_HeadColor;
QColor m_TitleColor;
QColor m_TableColor;
QColor m_ScaleColor;
QColor m_NoteColor;
//井斜数据表参数
QString m_Title_table;
float m_Head_Height;
float m_Rec_Height;
//俯视图参数
QString m_Title_fst;
double m_MinXe;
double m_MaxXe;
double m_MinYn;
double m_MaxYn;
//绘制闭合线
bool m_bPlotBhx;
//侧视图参数
QString m_Title_cst;
bool m_heqw;
double m_MaxWy;
double m_MinWy;
double m_MaxTVD;
double m_MinTVD;
//// 水平位移
double m_MaxWy_HOFF;
double m_MinWy_HOFF;
double m_MaxTVD_HOFF;
double m_MinTVD_HOFF;
//////////////////////////////////////////////////////////////////////////
///向东
double m_MaxWy_XE;
double m_MinWy_XE;
double m_MaxTVD_XE;
double m_MinTVD_XE;
//向北
double m_MaxWy_YN;
double m_MinWy_YN;
double m_MaxTVD_YN;
double m_MinTVD_YN;
double m_DepSpace;
double m_DepSpaceN;
double m_CsAngle;
//立体轨迹图参数
QString m_Title_ltgj;
double m_MaxWy1;
double m_LTTTVD;
double m_DepSpace1;
double m_LttAngle;
double m_LttAngle_X;
double m_LttAngle_Z;
bool m_is3DFrame;
double m_LttxDela;
double m_XD;
double m_YD;
int m_IsDrawProperty;
QString m_CurveName1;
QString m_CurveName2;
int m_ColorTableIndex;
double m_calscale;
double m_baseval;
double m_maxval;
double m_Rlev;
bool m_isBlock;
//tvd
};
#endif

View File

@ -14,6 +14,7 @@
#include "ObjGeostratums.h"
#include "ObjTextResult.h"
#include "DrawNrad.h"
#include "formline.h"
//以下参数从配置文件读取
extern int g_iIndex;
@ -1276,6 +1277,61 @@ void FormDraw::s_addDrawImage(QString strUuid, QString strSlfName, QString strWe
//斜井三图一表
void FormDraw::s_addSantuyibiao(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW)
{
//井名&道名不一致
if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName)
{
}
else
{
return;
}
if(m_listLineName.contains(strLineName))
{
qDebug() << "FormDraw strLineName already exist! " << strLineName;
return;
}
//
FormLine *curv = new FormLine(this, strSlfName, strWellName, strTrackName, strLineName);
curv->m_strUuid = m_strUuid;
//背景设置成透明色
// curv->setBackground(Qt::transparent);
// curv->setStyleSheet("background: transparent;");
double dHight = 0;
dHight = (g_iY2-g_iY1)*100.0/(double)g_iScale * g_dPixelPerCm;
if(g_iShow==1)
{
//显示刻度
dHight = dHight+30;
}
qDebug() << "FormDraw dHight=" << QString::number((int)dHight);
if(dHight>32767)
{
dHight = 32767;
}
curv->setGeometry(0, 0, g_iOneWidth, (int)dHight);
curv->show();
//斜井三图一表
QString strWaveName = "";
int _nSamples = 0;
curv->DrawTvd();
// //
// connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
//
m_listLineName.push_back(strLineName);
QString strAliasName = "斜井三图一表";
QString strUnit = "";
QColor newlineColor=QColor(0,0,0);
double width=2;
QString strScaleType = "";
//道-对象
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strWaveName, strAliasName, strUnit, newlineColor, width, _nSamples, 0, strScaleType, "SantuyibiaoObject");
}
//裂痕

View File

@ -1,15 +1,56 @@
#include "formline.h"
#include "ui_formline.h"
#include <QPainter>
#include "DrawTvd.h"
//demo画线暂时不用
FormLine::FormLine(QWidget *parent) :
FormLine::FormLine(QWidget *parent, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName) :
QWidget(parent),
ui(new Ui::FormLine)
{
ui->setupUi(this);
m_strSlfName = strSlfName;
m_strWellName = strWellName;
m_strTrackName = strTrackName;
m_strLineName = strLineName;
}
void FormLine::DrawTvd()
{
//
QPainter painter(this);
QRect rect = this->rect();
//背景透明
painter.fillRect(rect.left(), rect.top(), rect.width(), rect.height(), QColor(0, 0, 0, 0)); //QColor(67, 67, 67, 100)
CDrawTvd *drawTvd = new CDrawTvd();
drawTvd->sFilePath = m_strSlfName;
drawTvd->DrawTvd(&painter, rect);
}
FormLine::~FormLine()
{
delete ui;
}
void FormLine::paintEvent(QPaintEvent*)
{
// QPainter painter(this);
// QRect rect = this->rect();
// //背景透明
// painter.fillRect(rect.left(), rect.top(), rect.width(), rect.height(), QColor(0, 0, 0, 0)); //QColor(67, 67, 67, 100)
// painter.setPen(QPen(Qt::green,2,Qt::DashLine));
// //painter.setBrush(QBrush(Qt::red,Qt::SolidPattern));
// QFont font1("微软雅黑", 10, false, false); //fontSize 10
// painter.setFont(font1);
// painter.setPen(QColor(0, 0, 0)); // fontColor QColor(220, 220, 220)
// painter.drawText(rect.left() + 10, 10, ("画图")); // titleBarText QStringLiteral("动画")
// QRect rectRound(rect.left()+2,rect.top()+4, rect.width()-3, rect.height()-4);
// painter.drawRoundRect(rectRound);
}

View File

@ -13,11 +13,25 @@ class FormLine : public QWidget
Q_OBJECT
public:
explicit FormLine(QWidget *parent = nullptr);
explicit FormLine(QWidget *parent = nullptr, QString strSlfName="", QString strWellName="", QString strTrackName="", QString strLineName="");
~FormLine();
private:
Ui::FormLine *ui;
protected:
void paintEvent(QPaintEvent *event);
public:
QString m_strUuid;
QString m_strSlfName;
QString m_strWellName;
QString m_strTrackName;
QString m_strLineName;
public:
void DrawTvd();
};
#endif // FORMLINE_H

View File

@ -26,42 +26,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidget">
<property name="styleSheet">
<string notr="true">QTableCornerButton::section
{
background-color: #FF0000;
color:#FFFFFF;
border:1px solid #FF0000;
}
QTableWidget
{
color: #FFFFFF;
gridline-color: #1d6382;
border: 1px solid #FF0000 ;
background-color: #FF0000;
}
QTableWidget::item
{
padding-left:5px
}
QTableWidget::item:hover,QListView::item:hover,QTreeView::item:hover,QHeaderView,QHeaderView::section,QTableCornerButton:section{
color:#FFFFFF;
background:#FF0000;
}
QTableWidget::item:selected
{
background-color: #FF0000;
color:#FFFFFF;
}</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -69,7 +69,9 @@ void FormWell::s_NewTrack(QString strUuid, QString strWellName, QString strSlfNa
}
if(nW <= 0)
{
nW = g_iOneWidth;
}
//因为tableWidget需要提前规定好行数与列数
int rowcount = 3; //总行数

View File

@ -32,6 +32,7 @@ SOURCES += \
ConsoleOutputWidget.cpp \
DrawFac.cpp \
DrawNrad.cpp \
DrawTvd.cpp \
GeoIndicatorGenerator.cpp \
Gradient.cpp \
InDefTableDlg.cpp \
@ -52,6 +53,7 @@ SOURCES += \
TransparentDraggableRect.cpp \
TransparentDraggableResult.cpp \
TransparentDraggableSwallCore.cpp \
ViewInfo.cpp \
backgrounddelegate.cpp \
customtabbar.cpp \
customtabwidget.cpp \
@ -86,6 +88,7 @@ HEADERS += \
DraggablePixmap.h \
DrawFac.h \
DrawNrad.h \
DrawTvd.h \
GeoIndicatorGenerator.h \
Gradient.h \
InDefTableDlg.h \
@ -106,6 +109,7 @@ HEADERS += \
TransparentDraggableRect.h \
TransparentDraggableResult.h \
TransparentDraggableSwallCore.h \
ViewInfo.h \
backgrounddelegate.h \
customtabbar.h \
customtabwidget.h \
@ -184,6 +188,7 @@ INCLUDEPATH += ../../OSGDataModel/include
INCLUDEPATH += ../../OSGFramework/include
INCLUDEPATH += ../../DataOutput/include
INCLUDEPATH += ../../DataMgr/include
INCLUDEPATH += ../../DrawBase/include
CONFIG(debug, debug|release){
LIBS += -L../../Bin -lBaseFund
@ -195,6 +200,7 @@ CONFIG(debug, debug|release){
LIBS += -L../../Bin -lDataOutputd
LIBS += -L../../Bin/ -lCallPlugind -lHPluginManaged
LIBS += -L../../Bin/ -lDataMgrd
LIBS += -L../../Bin/ -lDrawBased
#-lCallManaged
} else {
LIBS += -L../../Bin -lBaseFun
@ -206,5 +212,6 @@ CONFIG(debug, debug|release){
LIBS += -L../../Bin -lDataOutput
LIBS += -L../../Bin/ -lCallPlugin -lHPluginManage
LIBS += -L../../Bin/ -lDataMgr
LIBS += -L../../Bin/ -lDrawBase
#-lCallManage
}

View File

@ -102,7 +102,7 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) :
ui->tableWidget_3->horizontalHeader()->hide();
connect(this, SIGNAL(sig_NewTrackChangeWidth(QString)), this, SLOT(s_NewTrackChangeWidth(QString)));
connect(this, SIGNAL(sig_NewTrackChangeWidth(QString, int)), this, SLOT(s_NewTrackChangeWidth(QString, int)));
//connect(this, SIGNAL(sig_NewWell(QString, QString)), this, SLOT(s_NewWell(QString, QString)));
connect(CallManage::getInstance(), SIGNAL(sig_mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
@ -1005,7 +1005,7 @@ void MainWindowCurve::s_NewSantuyibiao()
return;
//新建井+道+曲线(首条)
NewWellAndTrack(sret.at(0), sret.at(1), "", "SantuyibiaoObject");
NewWellAndTrack(sret.at(0), sret.at(1), "Santuyibiao", "SantuyibiaoObject");
}
//裂缝
@ -1347,7 +1347,7 @@ void MainWindowCurve::s_NewTDT()
NewWellAndTrack(sret.at(0), sret.at(1), "", "TDTObject");
}
void MainWindowCurve::s_NewTrackChangeWidth(QString strWellName)
void MainWindowCurve::s_NewTrackChangeWidth(QString strWellName, int nW)
{
qDebug() << "MainWindowCurve s_NewTrackChangeWidth";
@ -1367,8 +1367,15 @@ void MainWindowCurve::s_NewTrackChangeWidth(QString strWellName)
if(strWellNameTemp==strWellName)
{
int iWidth = ui->tableWidget_2->columnWidth(i);//设置列宽
if(nW<=0)
{
ui->tableWidget_2->setColumnWidth(i, iWidth+g_iOneWidth+6);
}
else
{
ui->tableWidget_2->setColumnWidth(i, iWidth+nW+6);
}
}
}
}
@ -1389,14 +1396,21 @@ void MainWindowCurve::s_AddLine_Property(QString strSlfName, QString strWellName
//新建井+道+曲线(首条)
void MainWindowCurve::NewWellAndTrack(QString strWellName, QString strSlfName, QString strLineName, QString strType)
{
int nW = 0;
if(strType=="SantuyibiaoObject")
{
//斜井三图一表
nW = g_iOneWidth*2;
}
//
if(m_listWell.contains(strWellName))
{
//不在道里,新建道+曲线
//新建道+曲线
emit CallManage::getInstance()->sig_NewTrack(m_strUuid, strWellName, strSlfName, strLineName, strType);
emit CallManage::getInstance()->sig_NewTrack(m_strUuid, strWellName, strSlfName, strLineName, strType, nW);
//改变井宽
emit sig_NewTrackChangeWidth(strWellName);
emit sig_NewTrackChangeWidth(strWellName, nW);
}
else
{
@ -1406,7 +1420,7 @@ void MainWindowCurve::NewWellAndTrack(QString strWellName, QString strSlfName, Q
m_listWell.push_back(strWellName);
//新建道+曲线
emit CallManage::getInstance()->sig_NewTrack(m_strUuid, strWellName, strSlfName, strLineName, strType);
emit CallManage::getInstance()->sig_NewTrack(m_strUuid, strWellName, strSlfName, strLineName, strType, nW);
}
}

View File

@ -100,12 +100,12 @@ public:
QJsonObject makeJson();
signals:
void sig_NewTrackChangeWidth(QString strWellName);//新建道后,改变井宽
void sig_NewTrackChangeWidth(QString strWellName, int nW=0);//新建道后,改变井宽
void sig_NewWell(QString strWellName);
public slots:
void s_NewWell(QString strWellName, QString strSlfName);//新建井
void s_NewTrackChangeWidth(QString strWellName);//新建道后,改变井宽
void s_NewTrackChangeWidth(QString strWellName, int nW=0);//新建道后,改变井宽
void s_NewTrack_No_Line(QString strWellName, QString strTrackName);//新建空白道,没有曲线
void s_AddLine_Property(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName,
double newLeftScale, double newRightScale, QString strScaleType, QColor lineColor, double width, Qt::PenStyle lineStyle);//新建曲线,带属性