#pragma warning( push ,0) #include #include #include #include #include "completertextedit.h" // #include "ObjectEvent.h" #include "curveline.h" #include "DataHelper.h" #include "ObjWellLogTABLE.h" #include "ObjWellLogINP.h" // #include "DrawCurveCommand.h" #include "ConsoleOutputWidget.h" #include "QtWindowWellSection.h" #include "chooseShiftCurvesDlg.h" // #include "WellSectionWindowDocument.h" #include "GeometryUtils.h" // #include "ObjWellRulerTrack.h" #include "DataImport.h" #include "DataManagger.h" #include "DepthProgress.h" // #include "CreateResoultStructDlg.h" // #include "WellSectionCoordinate.h" // #include "QtWellSceneManager.h" // #include "QtWellSectionViewer.h" // #include "VecWindowCommand.h" // #include "VecDisplayObjectCommand.h" #include "VecViewCommand.h" // #include "ObjDiscreteWellLog.h" #include #include "CurveLine.h" // #include "DataTree.h" QStringList colors,liths,oils,colorinds; // void OSGFRAMEWORK_EXPORT AppendConsole(pai::log::Priority priority,const QString &output); // #define GetViewCmdID_QtZONEDataTable() "{E908856A-6593-41AC-917D-84B5D82F7B3F}" // #define GetViewCmdID_ReFreshZONEDataTable() "{D781590C-46F2-4E50-A356-B8DDA3D1C908}" #pragma warning( pop) // BEGIN_OSGGRAPHICS_NAMESPACE; void qsort(QVector&datx,int left,int right,int idx); CQtWindowWellSection::CQtWindowWellSection()/* : CVecWindow(NULL)*/ { // setFocusPolicy(Qt::StrongFocus); memset(&m_ListTableInf,0,sizeof(struct LIST_TABLE_INF)); // if(::GetStatusBar()) { // QLabel *pLabel=::GetStatusBar()->findChild("BarWL"); // if(pLabel)pLabel->setVisible(true); // } m_clockTimer=NULL; pTDialog=NULL; spinbox1=NULL; spinbox2=NULL; spinbox3=NULL; recordnum=0; record=NULL; thicks=NULL; jiegudtat=NULL; jiegudtatshift=NULL; pairno=NULL; // QStringList strs=GetSimilarCurves("ROW_HEIGHT"); // if(strs.size()) DEFAULT_ROW_HEIGHT=strs[0].toFloat(); // strs=GetSimilarCurves("ZORE_WIDTH"); // if(strs.size()) ZORE_WIDTH=strs[0].toFloat(); // QString path=GetOilFieldName()+"linewidth.ini"; // strs=GetSimilarCurves("WIDTH",(char*)path.toStdString().c_str()); // if(strs.size()) mLineWidth=strs[0].toFloat(); } void CQtWindowWellSection::onTimer() { // QScrollBar *pVbar=GetVecViewer()->GetVScroll(); // if(pVbar) // { // int step=GetVecViewer()->GetHScroll()->pageStep(); // if(step<1) step=10; // CQtWellSceneManager* scene = dynamic_cast(GetSceneManager()); // QRectF rcViewerGDIF = scene->GetCameraCommand().GetViewPortSize( // false,/*indicate the window is wellsection window*/ // false, // false // ); // int maxval=pVbar->maximum(); // int val=pVbar->value(); // if(val+rcViewerGDIF.height()setValue(val+step); // } // else pVbar->setValue(0); // } } // void CQtWindowWellSection::slotRemoveWell() // { // CQtWellSceneManager* m_pWellSceneManager = dynamic_cast(GetSceneManager()); // if(!m_pWellSceneManager) return; // CWellSectionWindowDocument *m_pDoc = dynamic_cast(this->GetWindowDocument()); // if(!m_pDoc) return; // slotClearStandardShift(); // slotClearShiftCurves(); // slotClearShiftZonePoint(); // slotClearShiftZonePoint0(); // slotClearStandardMeg(); // slotClearMegCurves(); // QVector vWellTracks =m_pWellSceneManager->GetWellSectionGeomtry().GetAllWellTrack(true); // foreach(CObjWellTrack *pWellTrack,vWellTracks) // { // if(pWellTrack) // { // CDataTree *pDatatree=(CDataTree *)::GetProject()->m_pDataTree; // PaiObject *pP=pWellTrack->GetParent(); // if(pDatatree) pDatatree->OnObjectDeleted(pP,pWellTrack); // m_pDoc->RemoveWellID(pWellTrack->GetID().toString()); // CVecDisplayObjectCommand::RemoveObjectCommand(pWellTrack,m_pWellSceneManager->GetVecWindow()); // //luol 20200527 // // m_pWellSceneManager->SetCurentPickObject(QUuid()); // if(vWellTracks.size()<=1) m_pDoc->SetCurrentWell(NULL); // else { // } // m_pDoc->GetDocumentDataFromWindow(); // } // } // } CQtWindowWellSection::~CQtWindowWellSection() { // if (m_clockTimer) // { // m_clockTimer->stop(); // } // delete m_clockTimer; // m_clockTimer=NULL; // if(record) delete record; // CVecWindowCommand::SetCurrentWindow(NULL); // if(!::GetStatusBar()) return; // if(SystemExiting()) return; // QLabel *pLabel=::GetStatusBar()->findChild("BarWL"); // if(pLabel){ // pLabel->setVisible(false); // pLabel->setText(""); // } // pTDialog=NULL; } // void CQtWindowWellSection::focusInEvent ( QFocusEvent * event) // { // if(CVecWindowCommand::GetCurrentWindow()!=this) // { // CVecDisplayObjectCommand::ActiveOSGWindow( this ); // QColor currentcolor =Qt::white; // GetVecViewer()->setClearColor( // osg::Vec4f( (float)currentcolor.redF(), // (float)currentcolor.greenF(), // (float)currentcolor.blueF(),0.2) // ); // } // } // void CQtWindowWellSection::GetWindowConfig( EWindowFlag &WindowFlag,CVecSceneManager*&pSceneManager, // QVector&vUIBuilder,CBaseObject *&pDefaultShowObject // ,QVector &vViewCommandID,osg::Vec4f& backgroundColor,bool /*bForDebugData*/) // { // //窗口为2D窗口,配备工具栏,状态栏,滚动条,window resize保持比例 // WindowFlag = (EWindowFlag)(E2DWindow // |EKeepXYScaleWhenResizeWindow|EKeepAspectRatio| ELeftTopNoBlankArea | ERightBottomNoBlankArea | // EToolbar | ELToolbar |EStatusbar|EScrollbar ); // //用自己的场景管理器,加入自动布局功能 // pSceneManager = new CQtWellSceneManager(); // pSceneManager->SetCoordinate( new CWellSectionCoordinate() ); // //配备HUD 的固定Well Head 和 log Head // vUIBuilder << sUIBuilder( GetClassID_FixedWellHead(), GetID_FixedWellHead() ) // << sUIBuilder( GetClassID_FixedWellLogHead(), GetID_FixedWellLogHead() ); // //默认不渲染任何对象 // pDefaultShowObject = NULL; // //配置工具栏上的View Command // vViewCommandID // << GetDigitizerID_QtWellWindowPick() // << GetViewCmdID_RotateWellSection() // << GetViewCmdID_FixedSectionHead() // <filename=defaultTempleteFile; // OnListTableInf(defaultTempleteFile); // pCreateResoultStructDlg->Init(&m_ListTableInf); // pCreateResoultStructDlg->exec(); // delete pCreateResoultStructDlg; } void CQtWindowWellSection::OnListTableInf(QString m_ParFileName) { QStringList DataTypea; DataTypea<<("INT")<<("SHORT")<<("LONG")<<("FLOAT")<<("DOUBLE")<<("STRING")<< ("CHAR")<<("UNSIGNED CHAR")<<("UNSIGNED SHORT")<<("UNSIGNED INT")<<("UNSIGNED LONG"); QStringList GetValueModeStr=GetSimilarCurves("ValueMode"); GetValueModeStr.insert(0,""); QStringList ZDType=GetSimilarCurves("FieldType");//字段类型 FILE *fp=fopen(m_ParFileName.toStdString().c_str(),"rt"); if(fp) { char buf[1000]; m_ListTableInf.m_TableName[0]=0; m_ListTableInf.m_Mode=0; m_ListTableInf.m_Flag=0; fscanf(fp,"%s",m_ListTableInf.m_TableName); fscanf(fp,"%d %d %d ",&m_ListTableInf.Table_Field_Num,&m_ListTableInf.m_Mode,&m_ListTableInf.m_Flag); buf[0]=0; fgets(buf,1000,fp); QString cs=buf; cs.remove("\r\n"); cs.remove("\r"); cs.remove("\n"); strcpy(m_ListTableInf.m_CurveName,cs.toStdString().c_str()); char ss[10][32]; strcpy(ss[1],""); strcpy(ss[2],""); for(int i=0;i=GetValueModeStr.size())m_ListTableInf.GetValueMode[i]=3;//如果没有指定取值方式,则取平均值 } m_ListTableInf.IsHB=0; m_ListTableInf.IsFC=0; m_ListTableInf.m_TableType[0]=0; m_ListTableInf.m_TableSpFIELD[0]=0; fscanf(fp," %d %d %d\n",&m_ListTableInf.lstm,&m_ListTableInf.IsHB,&m_ListTableInf.IsFC); fscanf(fp,"%s\n",&m_ListTableInf.m_TableType); fscanf(fp,"%s\n",&m_ListTableInf.m_TableSpFIELD); if(!m_ListTableInf.m_TableType[0]) strcpy(m_ListTableInf.m_TableType,"TOTALVAL"); if(!m_ListTableInf.m_TableSpFIELD[0]) strcpy(m_ListTableInf.m_TableSpFIELD,"RESULTNO"); m_ListTableInf.SPVALNUM=0; while(!feof(fp)) { buf[0]=0; fgets(buf,1000,fp); cs=buf; cs.remove("\r"); cs.remove("\n"); cs.trimmed(); if(!cs.isEmpty()&&m_ListTableInf.SPVALNUM<100) { strcpy(m_ListTableInf.SPVAL[m_ListTableInf.SPVALNUM],cs.toStdString().c_str()); m_ListTableInf.SPVALNUM++; } } fclose(fp); } else { strcpy(m_ListTableInf.m_CurveName,"GR POR"); m_ListTableInf.m_Mode=0;//取值模式选择:0-每条曲线按各自给定取值方式取值,1-按给定曲线的极值点深度取值 m_ListTableInf.m_Flag=1;//全部结论列表 m_ListTableInf.IsHB=1; m_ListTableInf.IsHB=0; } } // extern "C" // { // extern __declspec (dllexport) struct INC_STRU INC; // extern __declspec (dllexport) struct INP_STRU INP; // extern __declspec (dllexport) struct HD_STRU HD; // } struct INC_STRU INC; struct INP_STRU INP; struct HD_STRU HD; void CreateTableRecord(CMemRdWt &mrw,LAYER_DATA &m_Result,char*buffer,float dep1,LIST_TABLE_INF &m_ListTableInf,int &recno,int pos,float sdep,float edep,float**data,int point,WALLCORE_DATA*mResult,int m_CoreRecNum,int n0,int reclen1,int icount,Slf_TABLE_FIELD*pFIELD,QString fieldname,int isLast=0,int iIndex=-1) { char RecBuf[1000]; int CurveId=0; int recpos=0; float *value=new float[m_ListTableInf.Table_Field_Num+1]; for(int j=0;j-1){ int len=mrw.GetTableRecordLength(iIndex1); int sl=sizeof(LAYER_DATA); if(slmResult1[i].StartDepth){ int ret=mrw.GetTableFieldData(m_ListTableInf.TableName[j],m_ListTableInf.RenName[j],RecBuf,i+1); if(ret<0) break; if(ret==0){ if(Results.indexOf(m_ListTableInf.RenName[j])>-1) { Results.removeOne(m_ListTableInf.RenName[j]); for(int k=0;k0) break; } } } break; } } delete mResult1; } } else if(!isLast&&m_ListTableInf.IsFC&&strncmp(m_ListTableInf.RenName[j],"RESULT",6)==0) { int poslen=0; int k=-1; for(int t=0;t-1){ float v=*(int*)&((char*)&m_Result)[poslen]; mrw.GetReservedValue(v,pFIELD[k].Reserved,(char*)&m_Result,RecBuf,reclen1,true,true); } QStringList strs=QString(RecBuf).split(';'); if(n0=6&&m_ListTableInf.Table_Field[j].RepCode<=6) { strncpy(&buffer[recpos],RecBuf,m_ListTableInf.Table_Field[j].Length); value[j]=0; } else { float val=0; if(strcmp(m_ListTableInf.RenName[j],"THICK")==0) { if(isLast){ float d1=QString::number(sdep+0.0001,'f',1).toFloat(); float d2=QString::number(edep+0.0001,'f',1).toFloat(); val=d2-d1; } else val=dep1; } else if(m_ListTableInf.IsFC&&!m_ListTableInf.lstm){ if(strstr(m_ListTableInf.RenName[j],"DEP")){ if(strstr(m_ListTableInf.RenName[j],"S")) val=sdep; else val=edep; } else val=atof(RecBuf); } else val=value[j];//atof(RecBuf); if(iIndex!=-1&&recno>1&&m_ListTableInf.GetValueMode[j]==20) { float val1=0; mrw.GetTableFieldData(iIndex,j,recno-1,(char*)&val1); val+=val1; } int ind=atoi(m_ListTableInf.ZdIndex[j]); int indv=powf(10,ind); double dval=val; dval=dval*indv; dval=(long long)(dval+0.5)/(float)indv; val=dval; mrw.SetData(m_ListTableInf.Table_Field[j].RepCode,&buffer[recpos],&val); value[j]=val; } } else if(m_ListTableInf.Type[j]==1)//曲线 { float val=-9999; if(isLast) { if(!m_ListTableInf.m_Mode||pos<0)//每条曲线按各自给定取值方式取值 { val=lst(m_ListTableInf.GetValueMode[j],point,data[CurveId],(char *)fieldname.toStdString().c_str(),m_ListTableInf.RenName[j],value,HD.Rlev); } else//按给定曲线的极值点深度取值 { val=data[CurveId][pos]; } /* int ind=atoi(m_ListTableInf.ZdIndex[j]); int indv=powf(10,ind); double vvs=val; vvs*=indv; vvs+=0.5; vvs=(long long)vvs; val=vvs/(float)indv; */ } else { int pos=(dep1-sdep)/HD.Rlev+0.5; if(pos<0) pos=0; if(pos CoreOils; for(int j=0;j=sdep&&mResult[j].Depth<=edep){ if(mResult[j].CoreOil>CoreOil) { CoreOils.clear(); CoreOil=mResult[j].CoreOil; CoreInd=j; CoreOils.append(j); } else if(mResult[j].CoreOil==CoreOil) CoreOils.append(j); } } if(mResult&&CoreOils.size()) { CoreOil=9999; for(int j=0;j=6&&m_ListTableInf.Table_Field[j].RepCode<=6) { QString des=""; if(mResult&&CoreInd>-1) { int ind=colorinds.indexOf(QString::number(mResult[CoreInd].CoreColor)); if(ind<0) ind=0; if(ind>=0&&ind=1&&mResult[CoreInd].CoreOil<=oils.size()) des+=oils[mResult[CoreInd].CoreOil-1]; if(mResult[CoreInd].CoreLith>=1&&mResult[CoreInd].CoreLith<=liths.size()) des+=liths[mResult[CoreInd].CoreLith-1]; des.remove("空白"); des.remove("空白"); des.remove("空白"); removeStr(des,"(",")"); } strncpy(&buffer[recpos],des.toStdString().c_str(),m_ListTableInf.Table_Field[j].Length); buffer[recpos+m_ListTableInf.Table_Field[j].Length]=0; } else { float val=-9999; mrw.SetData(m_ListTableInf.Table_Field[j].RepCode,&buffer[recpos],&val); value[j]=val; } } else { QStringList Results=GetSimilarCurves("RESULT"); int RecordNum=0; LAYER_DATA *mResult1=NULL; int iIndex1=mrw.OpenTable(m_ListTableInf.TableName[j]); float val=0; if(iIndex1>-1){ int len=mrw.GetTableRecordLength(iIndex1); int sl=sizeof(LAYER_DATA); if(sledep) break; float Sdep=mResult1[i].StartDepth; float Edep=mResult1[i].EndDepth; if(Sdepedep) Edep=edep; if(Edep-Sdep==0) continue; for(int lo=0;lo=0 ) { float d1=QString::number(Sdep+0.0001,'f',1).toFloat(); float d2=QString::number(Edep+0.0001,'f',1).toFloat(); val+=d2-d1; } } mrw.SetData(m_ListTableInf.Table_Field[j].RepCode,&buffer[recpos],&val); } else mrw.SetData(m_ListTableInf.Table_Field[j].RepCode,&buffer[recpos],&val); if(mResult1)delete mResult1; value[j]=val; } recpos+=m_ListTableInf.Table_Field[j].Length; } delete value; } void CQtWindowWellSection::OnListBedValue(QString m_csWellName,QString m_OGTableName) { QStringList GetValueModeStr=GetSimilarCurves("ValueMode"); GetValueModeStr.insert(0,""); QStringList ZDType=GetSimilarCurves("FieldType");//字段类型 QMap> zoneOrders; INC.Noi=0; INC.Name[0]=0; HD.Rlev=0.125; HD.Dep=-99999.0; HD.Depo=0; HD.Sdep=0; HD.Edep=-99999; HD.Stdep=99999; HD.StartDep=HD.Stdep; HD.EndDep=HD.Edep; QString cs=GetConfPath(); QString color; int m_CoreRecNum=0; for(int j=0;j<4;j++) { if(j==0) color=cs+"corecolor.ini"; else if(j==1) color=cs+"corelith.ini"; else if(j==2) color=cs+"coreoil.ini"; else color=cs+"colorind.ini"; FILE *fp=fopen(color.toStdString().c_str(),"rt"); QStringList ss; char buf[100]; if(fp) { while(!feof(fp)) { fscanf(fp,"%s",buf); ss.append(buf); } fclose(fp); } if(j==0) colors=ss; else if(j==1) liths=ss; else if(j==2) oils=ss; else colorinds=ss; } // TODO: 在此添加命令处理程序代码 if(m_ListTableInf.Table_Field_Num<=0) { AfxMessageBox("对不起,您没有定义取值表结构,无法进行取值\r\n\r\n请选择“分层曲线取值方式设置”菜单,设置取值表结构"); return; } WALLCORE_DATA *mResult=NULL; LAYER_DATA *m_Result=NULL; int m_RecNum=0; int tabletype=0; int tabletype2=0; CMemRdWt mrw; if ( mrw.Open(m_csWellName.toStdString().c_str()) ) // 打开井文件 { QString OutTab=m_ListTableInf.m_TableName; if(m_OGTableName==OutTab) OutTab+="_LIST"; int iIndex=mrw.OpenTable(OutTab.toStdString().c_str()); if (iIndex>=0) { if(QMessageBox::information(NULL,OutTab,"数据表已存在,重新生成新表吗?",QMessageBox::Yes|QMessageBox::No)!=QMessageBox::Yes) { mrw.CloseTable(iIndex); mrw.Close(); return; } mrw.DiscardObject(iIndex); mrw.Close(); mrw.Open(m_csWellName.toStdString().c_str()); // CQtWellSceneManager *m_pWellSceneManager = dynamic_cast( GetSceneManager() ); // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(m_pWellSceneManager->GetCurrentPickObjectID()); // CObjWellLog *pLog = dynamic_cast(pCurrentObject); // if(pLog) { // CObjWelllogRound*pR=pLog->GetWelllogRound(); // if(pR) { // CDataTree *pDatatree=(CDataTree *)::GetProject()->m_pDataTree; // PaiObject *pB=pR->GetObjectByName(OutTab); // if(pB&&pDatatree) { // PaiObject *pPai=pB->GetParent(); // pDatatree->OnObjectDeleted(pPai,pB); // pPai->RemoveChild(pB,true); // } // } // } iIndex=-1; } //解释结论表 int iIndex1=mrw.OpenTable(m_OGTableName.toStdString().c_str()); if(iIndex1<0) { mrw.Clear(); // AfxMessageBox(m_OGTableName+"不存在!,无法生成对应数据表!"); QMessageBox::information(nullptr, "提示", m_OGTableName+"不存在!,无法生成对应数据表!"); return; } int icount=0; Slf_TABLE_FIELD *pFIELD=NULL; int reclen1=0; if(iIndex1>-1) { icount=mrw.GetTableFieldCount(iIndex1); pFIELD=new Slf_TABLE_FIELD[icount+1]; mrw.GetTableFieldInfo(iIndex1,pFIELD); for(int i=0;i-1) { strcpy(m_ListTableInf.m_TableSpFIELD,name.toStdString().c_str()); break; } } int len=mrw.GetTableRecordLength(iIndex1); int sl=sizeof(LAYER_DATA); if(sl zoneOrder=GetZoneOrder(); for(int i=0;i0&&m_Result[i].MDepth1) iconshotname=zoneOrder.key(result_str.at(0)); else iconshotname=zoneOrder.key(result_str); if(iconshotname!="") result=::GetOilSymbolDir()+iconshotname+".svg"; if(m_Result[i].MDepth1!=0) { if(result_str.length()>1) iconshotname=zoneOrder.key(QString::number(m_Result[i].Result).at(1)); if(iconshotname!="") result1=::GetOilSymbolDir()+iconshotname+".svg"; } if(m_Result[i].MDepth2!=0) { if(result_str.length()>2) iconshotname=zoneOrder.key(result_str.at(2)); if(iconshotname!="") result2=::GetOilSymbolDir()+iconshotname+".svg"; } if(m_Result[i].MDepth3!=0) { if(result_str.length()>3) iconshotname=zoneOrder.key(result_str.at(3)); if(iconshotname!="") result3=::GetOilSymbolDir()+iconshotname+".svg"; } if(m_Result[i].MDepth4!=0) { if(result_str.length()>4) iconshotname=zoneOrder.key(result_str.at(4)); if(iconshotname!="") result4=::GetOilSymbolDir()+iconshotname+".svg"; } if(m_Result[i].MDepth5!=0) { if(result_str.length()>5) iconshotname=zoneOrder.key(result_str.at(5)); if(iconshotname!="") result5=::GetOilSymbolDir()+iconshotname+".svg"; } if(m_Result[i].MDepth6!=0) { if(result_str.length()>6) iconshotname=zoneOrder.key(result_str.at(6)); if(iconshotname!="") result6=::GetOilSymbolDir()+iconshotname+".svg"; } if(m_Result[i].MDepth7!=0) { if(result_str.length()>7) iconshotname=zoneOrder.key(result_str.at(7)); if(iconshotname!="") result7=::GetOilSymbolDir()+iconshotname+".svg"; } if(m_Result[i].MDepth8!=0) { if(result_str.length()>8) iconshotname=zoneOrder.key(result_str.at(8)); if(iconshotname!="") result8=::GetOilSymbolDir()+iconshotname+".svg"; } if(m_Result[i].MDepth9!=0) { if(result_str.length()>9) iconshotname=zoneOrder.key(result_str.at(9)); if(iconshotname!="") result9=::GetOilSymbolDir()+iconshotname+".svg"; } if(m_Result[i].MDepth10!=0) { if(result_str.length()>10) iconshotname=zoneOrder.key(result_str.at(10)); if(iconshotname!="") result10=::GetOilSymbolDir()+iconshotname+".svg"; } ComputeTT(m_Result[i], result, result1, result2, result3, result4, result5, result6, result7, result8, result9, result10 ); mrw.WriteTable(iIndex1,i+1,&m_Result[i]); } } mrw.CloseTable(iIndex1); } ////////////////////////////////////// QString m_CoreTableName="SWALL_CORE"; if(m_OGTableName.size()&&m_OGTableName.at(0)=='V') { m_CoreTableName="VSWALL_CORE"; } int ResultTable1=mrw.OpenTable(m_CoreTableName.toStdString().c_str()); if(ResultTable1>-1) { m_CoreRecNum=mrw.GetTableRecordCount(ResultTable1); mResult=new WALLCORE_DATA[m_CoreRecNum]; memset(mResult,0,m_CoreRecNum*sizeof(WALLCORE_DATA));//清空表记录 for(int i=0;i strs1; for(int j=1;j=0) { mrw.GetCurveInfo(id,&mCurve); HD.Rlev=mCurve.DepLevel; mrw.CloseCurve(id); } } if(INC.Noi>0)strcat(INC.Name," "); strcat(INC.Name,m_ListTableInf.RenName[i]); INC.Noi++; } } if(HD.Rlev==-1) { HD.Rlev=0.125; } if(m_ListTableInf.m_Mode)//按给定曲线的极值点深度取值 { for(int i=0;i1&&!css.at(1).isEmpty()) { if(INC.Noi>0)strcat(INC.Name," "); strcat(INC.Name,css.at(1).toStdString().c_str()); INC.Noi++; } } } int Mpoint=0; mrw.SetStruct(&INC,NULL,&INP,NULL,NULL,NULL,&HD,NULL); mrw.In(); for(int i=0;iMpoint)Mpoint=point; } float **data=new float *[INC.Noi]; for (int j=0; jilen) ilen=reclen+1; char *RecBuf=new char[ilen]; char *buffer=new char[reclen+1]; memset(buffer,0,reclen+1); int recno=0; int point=0; QStringList sMID=GetSimilarCurves("MID"); QStringList sAGE=GetSimilarCurves("AGE"); QStringList sMIN=GetSimilarCurves("MIN"); QStringList sMAX=GetSimilarCurves("MAX"); QStringList types,typet; for(int i=0;i1) { point=(m_Result[i].EndDepth-m_Result[i].StartDepth)/HD.Rlev+1.5; for(int j=0;jHD.EndDep) dep2=HD.EndDep; int j=0; mrw.In(dep1); for (int m=0;m-1) strt.removeAt(i1); i1=strt.indexOf("AC"); if(i1>-1) strt.removeAt(i1); removeStr(RecBuf,"(",")"); if(strt.size()&&strt.indexOf(RecBuf)<0) continue; if(types.indexOf(RecBuf)==-1) { types.append(RecBuf); } typet.append(RecBuf); if(m_ListTableInf.m_Mode)//按给定曲线的极值点深度取值 { pos=0;//对应点位置 int curpos=0; for(int mn=0;mn-1) { float br1=-99999.; for(int k=0;kbr1) { br1=data[curpos][k]; pos=k; } } } else if(sMIN.indexOf(RecBuf)>-1) { float br1=99999.; for(int k=0;k-1) pos=-1; else { pos=point/2; } } } else pos=point/2; if(m_ListTableInf.lstm||m_ListTableInf.IsFC) { QVector deps; int dv=m_ListTableInf.lstm; if(dv<0) dv=abs(dv); QVector depss; depss.append(m_Result[i].StartDepth); if(m_ListTableInf.IsFC){ if(m_Result[i].MDepth1) depss.append(m_Result[i].MDepth1); if(m_Result[i].MDepth2) depss.append(m_Result[i].MDepth2); if(m_Result[i].MDepth3) depss.append(m_Result[i].MDepth3); if(m_Result[i].MDepth4) depss.append(m_Result[i].MDepth4); if(m_Result[i].MDepth5) depss.append(m_Result[i].MDepth5); if(m_Result[i].MDepth6) depss.append(m_Result[i].MDepth6); if(m_Result[i].MDepth7) depss.append(m_Result[i].MDepth7); if(m_Result[i].MDepth8) depss.append(m_Result[i].MDepth8); if(m_Result[i].MDepth9) depss.append(m_Result[i].MDepth9); if(m_Result[i].MDepth10) depss.append(m_Result[i].MDepth10); } depss.append(m_Result[i].EndDepth); for(int n0=0;n01) { point=(depss[n0+1]-depss[n0])/HD.Rlev+1.5; for(int j=0;jHD.EndDep) dep2=HD.EndDep; int j=0; mrw.In(dep1); for (int m=0;m sdep,edep; sdep.append(-9999);edep.append(-9999); CreateTattle(m_csWellName,m_OGTableName,outtable,sdep,edep); CDataImport::ChangetoSlf(m_csWellName); // CWellSectionWindowDocument *pDoc=dynamic_cast(GetWindowDocument()); // int count=pDoc->GetFootSheetCount(); // for(int i=0;iGetFootSheet(i); // if(pSheet) { // pSheet->SetLoadDataFromSLFEnabled(true); // pSheet->LoadDataFromSLF(); // if (m_pSceneManager) // { // // hideEditGraphicsHeadCell(); // } // } // } // m_pSceneManager->UpdateAll(); // CQtViewer* QtViewer=dynamic_cast(m_pSceneManager->GetVecViwer()); // QScrollBar* pHScroll=NULL,*pVScroll=NULL; // if(QtViewer) { // pHScroll=QtViewer->GetHScroll(); // pVScroll=QtViewer->GetVScroll(); // } // if(pHScroll) { // int hval=pHScroll->value(); // pHScroll->setValue(0); // m_pSceneManager->GetCameraCommand().OnHScroll(hval); // } // if(pVScroll) // { // int vval=pVScroll->value(); // pVScroll->setValue(0); // m_pSceneManager->GetCameraCommand().OnHScroll(vval); // } } //this->SetModifiedFlag(); } void CQtWindowWellSection::CreateTattle(QString m_csWellName,QString m_OGTableName,QString OutTableName,QList&sdep,QList&edep) { CMemRdWt mrw; if ( mrw.Open(m_csWellName.toStdString().c_str()) ) // 打开井文件 { int size=sdep.size(); if(size>1) size++; for (int j=0;j zoneOrder=GetZoneOrder(); char RecBuf[200]; QStringList types; char**typet=new char*[m_RecNum+10]; // mrw.IsChange=1; int typen=0; QList INO; for(int i=0;i1&&j==sdep.size()) { for(int jj=0;jj=((LAYER_DATA*)&m_Result[i*len])->StartDepth&& sdep[jj]<=((LAYER_DATA*)&m_Result[i*len])->EndDepth) ((LAYER_DATA*)&m_Result[i*len])->StartDepth=sdep[jj]; if(edep[jj]>=((LAYER_DATA*)&m_Result[i*len])->StartDepth&& edep[jj]<=((LAYER_DATA*)&m_Result[i*len])->EndDepth) ((LAYER_DATA*)&m_Result[i*len])->EndDepth=edep[jj]; if(((LAYER_DATA*)&m_Result[i*len])->StartDepth>=sdep[jj]&&((LAYER_DATA*)&m_Result[i*len])->EndDepth<=edep[jj]) { strcpy(RecBuf,""); mrw.GetTableFieldData(iIndex1,m_ListTableInf.m_TableSpFIELD,RecBuf,i+1); removeStr(RecBuf,"(",")"); if(strstr(RecBuf,"水淹")) strcpy(RecBuf,"水淹层"); if(types.indexOf(RecBuf)==-1) { types.append(RecBuf); } typet[typen]=new char[strlen(RecBuf)*2+1]; strcpy(typet[typen],RecBuf); typen++; INO.append(i); } } else { strcpy(RecBuf,""); mrw.GetTableFieldData(iIndex1,m_ListTableInf.m_TableSpFIELD,RecBuf,i+1); if(strstr(RecBuf,"水淹")) strcpy(RecBuf,"水淹层"); QStringList strt=QString(m_ListTableInf.m_CurveName).split(" "); int i1=strt.indexOf("GR"); if(i1>-1) strt.removeAt(i1); i1=strt.indexOf("AC"); if(i1>-1) strt.removeAt(i1); removeStr(RecBuf,"(",")"); if(strt.size()&&strt.indexOf(RecBuf)<0) continue; if(types.indexOf(RecBuf)==-1) { types.append(RecBuf); } typet[typen]=new char[strlen(RecBuf)*2+1]; strcpy(typet[typen],RecBuf); INO.append(i); typen++; } } } else if(sdep[j]!=-9999&&edep[j]!=-9999) { if(sdep[j]>=((LAYER_DATA*)&m_Result[i*len])->StartDepth&& sdep[j]<=((LAYER_DATA*)&m_Result[i*len])->EndDepth) ((LAYER_DATA*)&m_Result[i*len])->StartDepth=sdep[j]; if(edep[j]>=((LAYER_DATA*)&m_Result[i*len])->StartDepth&& edep[j]<=((LAYER_DATA*)&m_Result[i*len])->EndDepth) ((LAYER_DATA*)&m_Result[i*len])->EndDepth=edep[j]; if(((LAYER_DATA*)&m_Result[i*len])->StartDepth>=sdep[j]&&((LAYER_DATA*)&m_Result[i*len])->EndDepth<=edep[j]) { strcpy(RecBuf,""); mrw.GetTableFieldData(iIndex1,m_ListTableInf.m_TableSpFIELD,RecBuf,i+1); if(strstr(RecBuf,"水淹")) strcpy(RecBuf,"水淹层"); QStringList strt=QString(m_ListTableInf.m_CurveName).split(" "); int i1=strt.indexOf("GR"); if(i1>-1) strt.removeAt(i1); i1=strt.indexOf("AC"); if(i1>-1) strt.removeAt(i1); if(strt.size()&&strt.indexOf(RecBuf)<0) continue; if(types.indexOf(RecBuf)==-1) { types.append(RecBuf); } typet[typen]=new char[strlen(RecBuf)+1]; strcpy(typet[typen],RecBuf); typen++; INO.append(i); } } else { strcpy(RecBuf,""); mrw.GetTableFieldData(iIndex1,m_ListTableInf.m_TableSpFIELD,RecBuf,i+1); if(strstr(RecBuf,"水淹")) strcpy(RecBuf,"水淹层"); QStringList strt=QString(m_ListTableInf.m_CurveName).split(" "); int i1=strt.indexOf("GR"); if(i1>-1) strt.removeAt(i1); i1=strt.indexOf("AC"); if(i1>-1) strt.removeAt(i1); removeStr(RecBuf,"(",")"); if(strt.size()&&strt.indexOf(RecBuf)<0) continue; if(types.indexOf(RecBuf)==-1) { types.append(RecBuf); } typet[typen]=new char[strlen(RecBuf)+1]; strcpy(typet[typen],RecBuf); INO.append(i); typen++; } } mrw.CloseTable(iIndex1); CDataManagger dm; DEFAULTTABLE *DefauleTable=dm.GetDefauleTable();//[DefTabNum]; int DefTabNum=dm.GetDefTabNum(); int tabNo=-1; bool isDefauleTable=false; for (int i=0;i1&&j=0) { mrw.DiscardObject(iIndex); } } if(tabNo<0) { tabNo=0; DefauleTable=new DEFAULTTABLE; DefauleTable->ZdNum=5; DefauleTable->TableName=tname; DefauleTable->tinfo=new Slf_OBJECT_FIELD[DefauleTable->ZdNum]; memset(DefauleTable->tinfo,0,sizeof(Slf_OBJECT_FIELD)*DefauleTable->ZdNum); for(int i=0;iZdNum;i++) { if(i==0) { strcpy(DefauleTable->tinfo[i].Name,"NO"); strcpy(DefauleTable->tinfo[i].HZName,"NO"); DefauleTable->tinfo[i].RepCode=1; DefauleTable->tinfo[i].CodeLength=4; } else if(i==1) { strcpy(DefauleTable->tinfo[i].Name,m_ListTableInf.m_TableSpFIELD); strcpy(DefauleTable->tinfo[i].HZName,m_ListTableInf.m_TableSpFIELD); DefauleTable->tinfo[i].RepCode=6; DefauleTable->tinfo[i].CodeLength=64; } else if(i==2) { strcpy(DefauleTable->tinfo[i].Name,"NUMBER"); strcpy(DefauleTable->tinfo[i].HZName,"NUMBER"); DefauleTable->tinfo[i].RepCode=4; DefauleTable->tinfo[i].CodeLength=4; } else if(i==3) { strcpy(DefauleTable->tinfo[i].Name,"THICK"); strcpy(DefauleTable->tinfo[i].HZName,"THICK"); DefauleTable->tinfo[i].RepCode=4; DefauleTable->tinfo[i].CodeLength=4; } else if(i==4) { strcpy(DefauleTable->tinfo[i].Name,"PESC"); strcpy(DefauleTable->tinfo[i].HZName,"PESC"); DefauleTable->tinfo[i].RepCode=4; DefauleTable->tinfo[i].CodeLength=4; } } } int iIndex=mrw.OpenTable(tname.toStdString().c_str()); if (iIndex<0) { QString name,Length,type,temp,hzname,unit,hzunit; name=""; Length=""; type=""; temp=""; hzname=""; for(int i=0;i=0) { strss.append(types[ind]); types[ind]=""; } } types.removeAll(""); if(types.size())strss.append(types); types=strss; char total1[500]; strcpy(total1,"合计"); for (int i=0;iStartDepth; float en=((LAYER_DATA*)&m_Result[INO[jj]*len])->EndDepth; if(jedep[j]) en=edep[j]; } float d1=QString::number(st+0.0001,'f',1).toFloat(); float d2=QString::number(en+0.0001,'f',1).toFloat(); val[k]+=d2-d1; } else if(stricmp(DefauleTable[tabNo].tinfo[k].Name,"PESC")==0){ val[k]+=0; } } val[2]+=1; } } for(int k=0;k2) tval[k]+=0.00001; if(k==1) mrw.SetTableFieldData(iIndex,DefauleTable[tabNo].tinfo[k].Name,total1,types.size()+1); else mrw.SetTableFieldData(iIndex,DefauleTable[tabNo].tinfo[k].Name,(char*)&tval[k],types.size()+1); } if(stricmp(DefauleTable[tabNo].tinfo[DefauleTable[tabNo].ZdNum-1].Name,"PESC")==0) { for(int k=0;k(GetSceneManager()); // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(scene->GetCurrentPickObjectID()); // CObjWellLog *pLog = dynamic_cast(pCurrentObject); // CObjDiscreteWellLog *pLog1 = dynamic_cast(pCurrentObject); // if((!pLog&&!pLog1)||(!pLog1&&pLog&&pLog->m_ObjectType!=TABLE_OBJECT&&pLog->m_ObjectType!=TABLEE_OBJECT)) { // AfxMessageBox("先选择数据表对象!"); // return; // } // if(!pWin->m_ListTableInf.m_TableName[0]) // { // QString path=GetTemplatePath(); // QString strTplFilter="(*.lst)"; // QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter); // if(defaultTempleteFile.isEmpty()) { // return; // } // pWin->OnListTableInf(defaultTempleteFile); // } // if(pWin->m_ListTableInf.Table_Field_Num<=0) // { // AfxMessageBox("对不起,您没有定义取值表结构,无法进行取值\r\n\r\n请选择“分层曲线取值方式设置”菜单,设置取值表结构"); // return; // } // INC.Noi=0; // INC.Name[0]=0; // HD.Rlev=0.125; // HD.Dep=-99999.0; // HD.Depo=0; // HD.Sdep=0; // HD.Edep=-99999; // HD.Stdep=99999; // HD.StartDep=HD.Stdep; // HD.EndDep=HD.Edep; // CMemRdWt mrw; // LIST_TABLE_INF &m_ListTableInf=pWin->m_ListTableInf; // QString m_csWellName=pLog->GetSlfFileName(); // if ( mrw.Open(m_csWellName.toStdString().c_str()) ) // 打开井文件 // { // QString OutTab=m_ListTableInf.m_TableName; // int iIndex=mrw.OpenTable(OutTab.toStdString().c_str()); // if (iIndex<0) // { // AfxMessageBox(OutTab+"数据表不存在,请先生成表!"); // mrw.Close(); // return; // } // int iIndex1=mrw.OpenTable(pLog->GetName().toStdString().c_str()); // if(iIndex1<0) { // mrw.Clear(); // AfxMessageBox(pLog->GetName()+"不存在!,无法生成对应数据表!"); // return; // } // LAYER_DATA *m_Result=NULL; // int m_RecNum=0; // int tabletype=0; // int tabletype2=0; // m_RecNum=mrw.GetTableRecordCount(iIndex1); // int relen=mrw.GetTableRecordLength(iIndex1); // if(relen=m_Result[i].StartDepth&&dep<=m_Result[i].EndDepth) // { // for (int j=0;j( GetSceneManager() ); // if(!pWellSceneManager) return; // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(!pDoc) return; // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(pWellSceneManager->GetCurrentPickObjectID()); // CObjWellTrack *pWellTrack = dynamic_cast(pCurrentObject); // CObjWellLogTrack *pWelllogTrack = dynamic_cast( pCurrentObject ); // if(pWelllogTrack) pWellTrack=pWelllogTrack->GetWellTrack(); // CObjWelllogRound*pRound=NULL; // CObjWellLog *pLog = dynamic_cast( pCurrentObject ); // if(pLog) { // pRound=pLog->GetWelllogRound(); // } // if(!pRound) { // AfxMessageBox("请先选中结论对象!"); // return; // } // m_LOGS.clear(); // m_LOGS.append(pLog); // QDialog dialog(NULL); // dialog.setModal(false); // Qt::WindowFlags flags = dialog.windowFlags(); // flags |= Qt::WindowStaysOnTopHint; // flags &= ~Qt::WindowContextHelpButtonHint; // dialog.setWindowFlags(flags); // QString path,wellname; // GetWellNameAndPath(pRound->GetSlfFileName(),wellname,path); // dialog.setWindowTitle("深度点-"+wellname); // QGridLayout *verticalLayoutWidget = new QGridLayout(&dialog); // verticalLayoutWidget->setObjectName(QString::fromUtf8("verticalLayoutWidget")); // verticalLayoutWidget->setGeometry(QRect(30, 30, 631, 281)); // QVBoxLayout*form = new QVBoxLayout(); // form->setObjectName(QString::fromUtf8("form")); // form->setContentsMargins(0, 0, 0, 0); // CompleterTextEdit*pTDialog = new CompleterTextEdit(&dialog); // pTDialog->setObjectName(QString::fromUtf8("pTDialog")); // form->addWidget(pTDialog); // pTDialog->setFont(QFont("宋体",24)); // QHBoxLayout*horizontalLayout = new QHBoxLayout(); // horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); // { // CMemRdWt mem(pLog->GetSlfFileName().toStdString().c_str()); // if(!m_ListTableInf.m_TableName[0]) // { // QString path=GetTemplatePath(); // QString strTplFilter="(*.lst)"; // QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter); // if(defaultTempleteFile.isEmpty()) { // return; // } // OnListTableInf(defaultTempleteFile); // } // DWORD bytes_write; // char cardname[200]="valdepth_inp"; // int index_result = mem.OpenStream(cardname); // if(index_result<0) // { // QString OutTab=m_ListTableInf.m_TableName; // int iIndex=mem.OpenTable(OutTab.toStdString().c_str()); // if (iIndex<0) // { // AfxMessageBox(OutTab+"数据表不存在,请先生成表!"); // mem.Close(); // return; // } // int m_RecNum=0; // int tabletype=0; // int tabletype2=0; // m_RecNum=mem.GetTableRecordCount(iIndex); // QStringList STRS; // STRS.append("NO DEPTH"); // char buf[200]; // QString css; // for(int i=0;idocument()->setPlainText(STRS.join("\n")); // } // else if(index_result>-1) // { // int len=mem.GetStreamLength(index_result); // if(len>0) { // char *buff=new char[len+1]; // DWORD lb=0; // mem.ReadStream(index_result,len,&lb,buff); // pTDialog->document()->setPlainText(buff); // delete buff; // } // } // mem.Close(); // } // QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, // Qt::Horizontal, &dialog); // form->addLayout(horizontalLayout); // form->addWidget(&buttonBox); // verticalLayoutWidget->addLayout(form, 0, 0, 1, 1); // connect(pTDialog,SIGNAL(cursorPositionChanged()), // this,SLOT(onCurrentLineHighLight())); // QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); // QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); // dialog.show(); // if (dialog.exec() == QDialog::Accepted) { // QString text=pTDialog->document()->toPlainText(); // DWORD bytes_write; // char cardname[200]="valdepth_inp"; // CMemRdWt mem(pLog->GetSlfFileName().toStdString().c_str()); // int index_result = mem.CreateStream(PARA_OBJECT,cardname,16384,FALSE); // if(index_result>-1) { // int len=strlen(text.toStdString().c_str()); // if(len>0) { // DWORD lb=0; // mem.WriteStream(index_result,len+1,&lb,text.toStdString().c_str()); // } // } // mem.Close(); // QString name=cardname; // CObjWelllogRound *pWelllogRound=dynamic_cast(pRound); // if(pWelllogRound) { // PaiObject*pBase=pWelllogRound->GetObjectByName(name,GetClassID_WellLogINP()); // if(!dynamic_cast(pBase)){ // CObjWellLog * acurve=new CObjWellLogINP(); // if(acurve) { // acurve->m_ObjectType=CARD_OBJECT; // acurve->SetName(name); // acurve->SetAliasName(name); // acurve->SetSlfFileName(pLog->GetSlfFileName()); // acurve->SetWell(pWelllogRound->GetWell()); // pWelllogRound->AddChild(acurve); // } // } // } // QString SDEPS=pTDialog->toPlainText(); // SDEPS.replace("\r\n","\n"); // QStringList sdeps=SDEPS.split("\n"); // sdeps.removeAll(""); // for(int i=0;iGetFootSheetCount(); // for(int index=0;indexGetFootSheet( index ); // if(pSheet) { // pSheet->SetLoadDataFromSLFEnabled(true); // pSheet->LoadDataFromSLF(); // } // } // if (m_pSceneManager) // { // m_pSceneManager->UpdateAll(); // m_pSceneManager->GetCameraCommand().OnHScroll(); // // hideEditGraphicsHeadCell(); // } // } // else { // pTDialog=NULL; // return; // } } void CQtWindowWellSection::slotZoneListData(CObjWellLog *pLog) { // CQtWellSceneManager *m_pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *m_pDoc = dynamic_cast(this->GetWindowDocument()); // if(!m_pDoc) return; // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(m_pWellSceneManager->GetCurrentPickObjectID()); // CObjWellLog *pLog = dynamic_cast(pCurrentObject); // CObjDiscreteWellLog *pLog1 = dynamic_cast(pCurrentObject); // if((!pLog&&!pLog1)||(!pLog1&&pLog&&pLog->m_ObjectType!=TABLE_OBJECT&&pLog->m_ObjectType!=TABLEE_OBJECT)) { // AfxMessageBox("先选择数据表对象!"); // return; // } if(!m_ListTableInf.m_TableName[0]) { QString path=GetTemplatePath(); QString strTplFilter="(*.lst)"; QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter); if(defaultTempleteFile.isEmpty()) { return; } OnListTableInf(defaultTempleteFile); } QDialog dialog(NULL); dialog.setModal(false); Qt::WindowFlags flags = dialog.windowFlags(); flags |= Qt::WindowStaysOnTopHint; flags &= ~Qt::WindowContextHelpButtonHint; dialog.setWindowFlags(flags); dialog.setWindowTitle("深度分段统计"); QFormLayout form(&dialog); form.addWidget(new QLabel("输入深度参数:")); // Value1 QString value1 = QString("起始深度: "); spinbox1 = new QLineEdit(&dialog); form.addRow(value1, spinbox1); value1 = QString("终止深度: "); spinbox2 = new QLineEdit(&dialog); form.addRow(value1, spinbox2); /* if(m_pDoc->m_mergeLineList.size()>1) { QString str; for(int i=0;im_mergeLineList.size()/2;i++) { str+=toString(m_pDoc->m_mergeLineList[i*2]->GetLeftDepth()); if(im_mergeLineList.size()/2-1)str+=" "; } spinbox1->setText(str); } else */spinbox1->setText("-9999.0"); /* if(m_pDoc->m_mergeLineList.size()>1) { QString str; for(int i=0;im_mergeLineList.size()/2;i++) { str+=toString(m_pDoc->m_mergeLineList[i*2+1]->GetLeftDepth()); if(im_mergeLineList.size()/2-1)str+=" "; } spinbox2->setText(str); } else */spinbox2->setText("-9999.0"); spinbox3 = new QLineEdit(&dialog); value1 = QString("输出表名称: "); form.addRow(value1, spinbox3); QString outtable=m_ListTableInf.m_TableName; outtable+="_TT"; spinbox3->setText(outtable); QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog); m_ButtonBox=&buttonBox; form.addWidget(&buttonBox); QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); buttonBox.button(QDialogButtonBox::Ok)->setAutoDefault(false); if (dialog.exec() == QDialog::Accepted) { QList sdep; QString SDEPS=spinbox1->text(); QStringList sdeps; if(SDEPS.indexOf(",")>-1) sdeps=SDEPS.split(","); else sdeps=SDEPS.split(" "); sdeps.removeAll(""); QList edep; QString EDEPS=spinbox2->text(); QStringList edeps; if(EDEPS.indexOf(",")>-1) edeps=EDEPS.split(","); else edeps=EDEPS.split(" "); edeps.removeAll(""); int size=sdeps.size(); for (int i=0;itext(); QString slf=pLog->GetSlfFileName(); CreateTattle(slf,pLog->GetName(),tablename,sdep,edep); // Do something here CDataImport::ChangetoSlf(slf); // CWellSectionWindowDocument *pDoc=dynamic_cast(GetWindowDocument()); // int count=pDoc->GetFootSheetCount(); // for(int i=0;iGetFootSheet(i); // if(pSheet) { // pSheet->SetLoadDataFromSLFEnabled(true); // pSheet->LoadDataFromSLF(); // if (m_pSceneManager) // { // // hideEditGraphicsHeadCell(); // } // } // } // m_pSceneManager->UpdateAll(); // CQtViewer* QtViewer=dynamic_cast(m_pSceneManager->GetVecViwer()); // QScrollBar* pHScroll=NULL,*pVScroll=NULL; // if(QtViewer) { // pHScroll=QtViewer->GetHScroll(); // pVScroll=QtViewer->GetVScroll(); // } // if(pHScroll) { // int hval=pHScroll->value(); // pHScroll->setValue(0); // m_pSceneManager->GetCameraCommand().OnHScroll(hval); // } // if(pVScroll) // { // int vval=pVScroll->value(); // pVScroll->setValue(0); // m_pSceneManager->GetCameraCommand().OnHScroll(vval); // } } } void CQtWindowWellSection::slotListData(CObjWellLog *pLog) { // CQtWellSceneManager *m_pWellSceneManager = dynamic_cast( GetSceneManager() ); // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(m_pWellSceneManager->GetCurrentPickObjectID()); // CObjWellLog *pLog = dynamic_cast(pCurrentObject); // CObjDiscreteWellLog *pLog1 = dynamic_cast(pCurrentObject); // if((!pLog&&!pLog1)||(!pLog1&&pLog&&pLog->m_ObjectType!=TABLE_OBJECT&&pLog->m_ObjectType!=TABLEE_OBJECT)) { // AfxMessageBox("先选择数据表对象!"); // return; // } if(pLog) { QString path=GetTemplatePath(); QString strTplFilter="(*.lst)"; QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter); if(defaultTempleteFile.isEmpty()) { return; } OnListTableInf(defaultTempleteFile); // QString m_OGTableName=pCurrentObject->GetPaiObject()->GetName(); QString m_OGTableName=pLog->GetName(); QString m_csWellName=pLog->GetSlfFileName(); OnListBedValue(m_csWellName,m_OGTableName); // slotClearMegCurves(); } } // void CQtWindowWellSection::slotSetShiftTool() // { // CWellSectionWindowDocument*pDoc=dynamic_cast(this->GetWindowDocument()); // if(!pDoc) return; // QAction *pAction = GetSceneManager()->GetViewCommand().GetAction(GetCmdID_JOINDEPTH()); // if(pAction->isChecked()) { // QToolBar *pRToolbar=GetSceneManager()->GetVecWindow()->GetRToolbar(); // if(pRToolbar) { // pAction->setChecked(false); // pRToolbar->clear(); // pRToolbar->setVisible(true); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Shift.png"), QObject::tr("整体深度平移校正"),this,SLOT(slotChangeAllCurves())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/MoveShift.png"), QObject::tr("深度分段平移校正"),this,SLOT(slotMoveAllCurves())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/DepthShift.png"), QObject::tr("参数卡深度平移校正"),this,SLOT(slotCardMoveCurves())); // pRToolbar->addSeparator(); // pRToolbar->addAction(QIcon( ::GetImagePath()+"icon/Standard.png"),QObject::tr("设置/取消标准曲线"),this,SLOT(slotSetStandardCurve())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Correction.png"), QObject::tr("设置/取消校正曲线"),this,SLOT(slotSetShiftCurve())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Shiftother.png"), QObject::tr("批量设置从校正曲线"),this,SLOT(slotSetOtherShiftCurve())); // pRToolbar->addSeparator(); // // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/copy.png"), QObject::tr("执行可视化校正"),this,SLOT(slotRunShift())); // // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/paste.png"), QObject::tr("放弃可视化校正"),this,SLOT(slotCanelRunShift())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/autocor.png"), QObject::tr("自动对比"),this,SLOT(slotExecuteDepthAutoComp())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/runcor.png"), QObject::tr("执行校正"),this,SLOT(slotExecuteDepthShifting())); // pRToolbar->addSeparator(); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/ClearAllSetCurve.png"), QObject::tr("清除全部曲线设置"),this,SLOT(slotClearStandardShift())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/ClearSetCurve.png"), QObject::tr("清除全部从曲线设置"),this,SLOT(slotClearShiftCurves())); // slotClearMegCurves(); // slotClearStandardMeg(); // // slotClearShiftZonePoint(); // } // return; // } // QToolBar *pRToolbar=GetSceneManager()->GetVecWindow()->GetRToolbar(); // if(pRToolbar) { // if(pRToolbar->isVisible()) { // QList s; // int c=0; // for(int i=0;itext()==QObject::tr("整体深度平移校正")) { // c=1; // break; // } // } // if(c) { // pRToolbar->setVisible(false); // } // } // if(!pRToolbar->isVisible()) { // pRToolbar->clear(); // pRToolbar->setVisible(true); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Shift.png"), QObject::tr("整体深度平移校正"),this,SLOT(slotChangeAllCurves())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/MoveShift.png"), QObject::tr("深度分段平移校正"),this,SLOT(slotMoveAllCurves())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/DepthShift.png"), QObject::tr("参数卡深度平移校正"),this,SLOT(slotCardMoveCurves())); // pRToolbar->addSeparator(); // pRToolbar->addAction(QIcon( ::GetImagePath()+"icon/Standard.png"),QObject::tr("设置/取消标准曲线"),this,SLOT(slotSetStandardCurve())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Correction.png"), QObject::tr("设置/取消校正曲线"),this,SLOT(slotSetShiftCurve())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Shiftother.png"), QObject::tr("批量设置从校正曲线"),this,SLOT(slotSetOtherShiftCurve())); // pRToolbar->addSeparator(); // // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/copy.png"), QObject::tr("执行可视化校正"),this,SLOT(slotRunShift())); // // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/paste.png"), QObject::tr("放弃可视化校正"),this,SLOT(slotCanelRunShift())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/autocor.png"), QObject::tr("自动对比"),this,SLOT(slotExecuteDepthAutoComp())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/runcor.png"), QObject::tr("执行校正"),this,SLOT(slotExecuteDepthShifting())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/checkjiegu.png"), QObject::tr("接箍异常检测"),this,SLOT(slotCheckCCLDepthShift())); // pRToolbar->addSeparator(); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/ClearAllSetCurve.png"), QObject::tr("清除全部曲线设置"),this,SLOT(slotClearStandardShift())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/ClearSetCurve.png"), QObject::tr("清除全部从曲线设置"),this,SLOT(slotClearShiftCurves())); // if(pDoc->m_isShift!=0) { // slotClearMegCurves(); // slotClearStandardMeg(); // } // // slotClearShiftZonePoint(); // } // else { // pRToolbar->setVisible(false); // slotClearMegCurves(); // slotClearStandardMeg(); // // slotClearShiftZonePoint(); // } // } // } // void CQtWindowWellSection::slotSetJoinTool() // { // QAction *pAction = GetSceneManager()->GetViewCommand().GetAction(GetCmdID_SHIFTDEPTH()); // if(pAction->isChecked()) { // pAction->setChecked(false); // QToolBar *pRToolbar=GetSceneManager()->GetVecWindow()->GetRToolbar(); // if(pRToolbar) { // pRToolbar->clear(); // pRToolbar->setVisible(true); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Standard.png"), QObject::tr("设置/取消目标拼接曲线"),this,SLOT(slotSetStandardMegCurve())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Correction.png"), QObject::tr("设置/取消源拼接曲线"),this,SLOT(slotSetMegCurve())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Shiftother.png"), QObject::tr("批量设置从拼接曲线"),this,SLOT(slotSetOtherMegCurve())); // pRToolbar->addSeparator(); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/PreMeg.png"), QObject::tr("拼接效果预览"),this,SLOT(slotDepthScrMerge())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/merge.png"), QObject::tr("执行拼接"),this,SLOT(slotDepthMerge())); // pRToolbar->addSeparator(); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/ClearAllSetCurve.png"), QObject::tr("清除全部曲线设置"),this,SLOT(slotClearStandardMeg())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/ClearSetCurve.png"), QObject::tr("清除全部从曲线设置"),this,SLOT(slotClearMegCurves())); // slotClearStandardShift(); // slotClearShiftCurves(); // } // return; // } // QToolBar *pRToolbar=GetSceneManager()->GetVecWindow()->GetRToolbar(); // if(pRToolbar) { // if(pRToolbar->isVisible()) { // QList s; // int c=0; // for(int i=0;itext()==QObject::tr("设置/取消标准曲线")) { // c=1; // break; // } // } // if(c) { // pRToolbar->setVisible(false); // } // } // if(!pRToolbar->isVisible()) { // pRToolbar->clear(); // pRToolbar->setVisible(true); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Standard.png"), QObject::tr("设置/取消目标拼接曲线"),this,SLOT(slotSetStandardMegCurve())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Correction.png"), QObject::tr("设置/取消源拼接曲线"),this,SLOT(slotSetMegCurve())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/Shiftother.png"), QObject::tr("批量设置从拼接曲线"),this,SLOT(slotSetOtherMegCurve())); // pRToolbar->addSeparator(); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/PreMeg.png"), QObject::tr("拼接效果预览"),this,SLOT(slotDepthScrMerge())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/merge.png"), QObject::tr("执行拼接"),this,SLOT(slotDepthMerge())); // pRToolbar->addSeparator(); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/ClearAllSetCurve.png"), QObject::tr("清除全部曲线设置"),this,SLOT(slotClearStandardMeg())); // pRToolbar->addAction(QIcon( ::GetImagePath() + "icon/ClearSetCurve.png"), QObject::tr("清除全部从曲线设置"),this,SLOT(slotClearMegCurves())); // slotClearStandardShift(); // slotClearShiftCurves(); // // slotClearShiftZonePoint(); // } // else { // pRToolbar->setVisible(false); // slotClearStandardShift(); // slotClearShiftCurves(); // // slotClearShiftZonePoint(); // } // } // } // void CQtWindowWellSection::InitBeforShow(bool bCompositeWindow) // { // PickFirst(); // QAction * pAction = GetSceneManager()->GetViewCommand().GetAction(GetViewCmdID_QtSetDataTableFormat()); // if(pAction) { // connect(pAction, SIGNAL(triggered()), this, SLOT(slotSetListTableStruct())); // } // pAction = GetSceneManager()->GetViewCommand().GetAction(GetCmdID_JOINDEPTH()); // if(pAction){ // connect(pAction, SIGNAL(triggered()), this, SLOT(slotSetJoinTool())); // } // pAction = GetSceneManager()->GetViewCommand().GetAction(GetCmdID_SHIFTDEPTH()); // if(pAction){ // connect(pAction, SIGNAL(triggered()), this, SLOT(slotSetShiftTool())); // } // pAction = GetSceneManager()->GetViewCommand().GetAction(GetViewCmdID_QtCreateDataTable()); // if(pAction){ // connect(pAction, SIGNAL(triggered()), this, SLOT(slotListData())); // } // pAction = GetSceneManager()->GetViewCommand().GetAction(GetViewCmdID_QtZONEDataTable()); // if(pAction){ // connect(pAction, SIGNAL(triggered()), this, SLOT(slotZoneListData())); // } // pAction = GetSceneManager()->GetViewCommand().GetAction(GetViewCmdID_ReFreshZONEDataTable()); // if(pAction){ // connect(pAction, SIGNAL(triggered()), this, SLOT(slotReFreshZoneListData())); // } // pAction = this->GetSceneManager()->GetViewCommand().GetAction(GetCmdID_UndoCommand()); // if (pAction) // { // pAction->setEnabled(this->GetSceneManager()->GetUndoStack()->canUndo()); // } // pAction = this->GetSceneManager()->GetViewCommand().GetAction(GetCmdID_RedoCommand()); // if (pAction) // { // pAction->setEnabled(this->GetSceneManager()->GetUndoStack()->canRedo()); // } // QToolBar *pLToolbar=GetLToolbar(); // if(!pLToolbar) return; // if(this->GetWindowType() == GetWindowTypeID_QtGeoGuideSection()) return; // ////////////////////////////////////////////////////////////////////////// // QFile file(::GetConfPath()+"SingleWellCommand.ini"); // if ( file.open( QIODevice::ReadOnly ) ) { // QTextStream stream( &file ); // QString oneline; // while ( !stream.atEnd() ) { // oneline = stream.readLine(); // 不包括“\n”的一行文本 // QStringList drawitemConfig=oneline.split(","); // if(drawitemConfig.size()>=3) // { // QAction *aAction= new QAction("增加"+drawitemConfig[0],this); // aAction->setToolTip(drawitemConfig[0]); // aAction->setData(drawitemConfig[1]); // aAction->setIcon(QIcon( ::GetImagePath()+"icon/"+drawitemConfig[2])); // connect(aAction,SIGNAL(triggered()),this,SLOT(slotNewDataAndDraw())); // pLToolbar->addAction(aAction); // } // } // file.close(); // pLToolbar->addSeparator(); // } // } // void CQtWindowWellSection::AfterOpenWindow() // { // QAction * pAction = this->GetSceneManager()->GetViewCommand().GetAction(GetViewCmdID_SetSizeAll()); // if (pAction) // { // pAction->setCheckable(true); // } // pAction = this->GetSceneManager()->GetViewCommand().GetAction(GetViewCmdID_SizeAll()); // if (pAction) // { // pAction->setCheckable(true); // } // QToolBar *pRToolbar=GetRToolbar(); // if(!pRToolbar) return; // pRToolbar->setVisible(false); // } // void CQtWindowWellSection::UpdateHUD() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // if(!pWellSceneManager) return; // CQtWindowWellSection *pWin=dynamic_cast(pWellSceneManager->GetVecWindow()); // if(!pWin) return; // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // char buf[200]; // double fTopPixelLen,fMidelPixeLen,fBottomPixelLen ; // double maxval=pWellSceneManager->GetCameraCommand().CalculateScrollValue( false,fTopPixelLen,fMidelPixeLen,fBottomPixelLen ); // double maxwid=pWellSceneManager->GetCameraCommand().CalculateScrollValue( true,fTopPixelLen,fMidelPixeLen,fBottomPixelLen ); // double cmp1=pWellSceneManager->GetCoordinate()->GetPixelPerCm(); // int wid=maxwid; // if(pDoc){ // float val=pDoc->GetWidth()+m_pSceneManager->FIXED_LOGLeft_MARGIN_CM*cmp1; // if(valGetIsDoubleHead()*pDoc->GetCurveHeadHeight()+pDoc->GetHeadHeight())/cmp1+pWellSceneManager->FIXED_LOGHead_MARGIN_CM)*10+0.5)/10.0); // MultiWellWindowViewInfo*pViewInfo=dynamic_cast(pWellSceneManager->GetViewInfo(pDoc->GetID())); // if(pViewInfo&&m_pSceneManager->GetIsDoubleHead()) { // if(pViewInfo->GetisUsePageLength()) // { // int ln=leng/pViewInfo->GetPageLength(); // if(ln*pViewInfo->GetPageLength()GetPageLength(); // } // } // pDoc->PWidth=(float)((int)(wid/cmp1*10+0.5)/10.0+0.5); // pDoc->PLength=leng; // sprintf(buf,"%gcm,%gcm",pDoc->PWidth,pDoc->PLength); // if(::GetStatusBar()){ // QLabel *pLabel=::GetStatusBar()->findChild("BarWL"); // if(pLabel) pLabel->setText(buf); // } // } // if(pDoc&&pDoc->m_mergeLineList.size()) { // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(pWellSceneManager->GetCurrentPickObjectID()); // CObjWellTrack*pWellTrack =dynamic_cast( pCurrentObject ); // if(!pWellTrack) { // CObjWellLog *pLog = dynamic_cast( pCurrentObject ); // if(pLog) { // CObjWellLogTrack*pLogTrack=dynamic_cast(pLog->GetParent()); // if(pLogTrack)pWellTrack = pLogTrack->GetWellTrack(); // } // } // if(!pWellTrack) { // QVector vTrack = pWellSceneManager->GetWellSectionGeomtry().GetAllWellTrack( true ); // if(vTrack.size()) pWellTrack=vTrack[0]; // } // if(pWellTrack) { // updateLines(pWellTrack); // } // } // } // void CQtWindowWellSection::updateLines(CObjWellTrack*m_pWellTrack) // { // if (m_pWellTrack == NULL) // { // return; // } // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // CQtWellTrackNode *pWellNode = dynamic_cast( GetSceneManager()->GetBuilder(m_pWellTrack->GetID() ) ); // float dTopDepth = m_pWellTrack->GetTopWellLogDepth(); // float dBottomDepth = m_pWellTrack->GetBottomWellLogDepth(); // float sdep=dTopDepth,edep=dBottomDepth; // if(pWellNode) pWellNode->GetVisibleDepth(dTopDepth,dBottomDepth,sdep,edep); // //如果曲线拼接线在最后一行区域中,则显示,否则不显示 // QRectF lineRangeRect =getLineRangeRectOSGGLobal(m_pWellTrack); // QGraphicsRectItem*pItem=pWellSceneManager->GetRootHUDTopLayer(); // if(pItem) pItem->setVisible(false); // foreach(CurveLine *pLine, pDoc->m_mergeLineList) // { // if(!pLine) continue; // QVector vecPoints; // if(pWellNode&&pLine->GetLeftDepth()m_curSdep&& // pLine->GetRightDepth()m_curSdep // ) { // pLine->setVisible(false); // continue; // } // if(pWellNode&&pLine->GetLeftDepth()>pWellNode->m_curEdep&& // pLine->GetRightDepth()>pWellNode->m_curEdep // ) { // pLine->setVisible(false); // continue; // } // vecPoints=SetLinePoint(pDoc,m_pWellTrack,pLine,lineRangeRect); // if(vecPoints.size()>1) { // pLine->setVisible(true); // pLine->SetPoints(vecPoints); // } // } // if(pItem) pItem->setVisible(true); // // if(m_pSceneManager)m_pSceneManager->SetDirtyUIElement(true,true); // } // void CQtWindowWellSection::slotChangeAllCurves() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // if(!pWellSceneManager) return; // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(!pDoc) return; // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(pWellSceneManager->GetCurrentPickObjectID()); // CObjWellTrack *pWellTrack = dynamic_cast(pCurrentObject); // if(pWellTrack) { // AfxMessageBox("该功能不支持对井次校正,如果需要井次校正请到数据树上进行!"); // return; // } // CObjWellLogTrack *pWelllogTrack = dynamic_cast( pCurrentObject ); // CObjWellLog *pLog = dynamic_cast( pCurrentObject ); // QList logs; // if(pLog) { // if(pLog->GetShiftOffset()) { // QString cs; // cs+=pLog->GetName()+"曲线移动量"+QString::number(-pLog->GetShiftOffset())+"尚未确认,无法进行该功能操作!\n关闭该提示后可用shif+Y键确认移动或用esc键放弃移动!"; // AfxMessageBox(cs); // return; // } // else // { // if(pDoc->m_RightCurve&&pLog!=pDoc->m_RightCurve) { // AfxMessageBox("已设置主从校正曲线,当前曲线"+pLog->GetName()+"无法执行校正!\n如果想校正当前曲线,请先取消主从曲线设置,\n如果要进行主从校正,则请选中主曲线后再进行此操作!"); // return; // } // } // logs.append(pLog); // pWelllogTrack =pLog->GetWellLogTrack(); // if(!pWelllogTrack) return; // pWellTrack = dynamic_cast(pWelllogTrack->GetWellTrack()); // if(!pWellTrack) return; // CObjWelllogRound *pround=pLog->GetWelllogRound(); // if(!pround) return; // QList names; // if(QMessageBox::information(NULL,"提示","需要附加其它数据(曲线、数据表、参数卡等)校正吗?",QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes) { // if(pDoc->m_RightCurve) { // names.append(pDoc->m_RightCurve); // } // if(pDoc->m_LeftCurve) { // names.append(pDoc->m_LeftCurve); // } // if(pLog) { // names.append(pLog); // } // CchooseShiftCurvesDlg *pShiftCurvesDlg=new CchooseShiftCurvesDlg(pWellTrack,names,pround); // QListm_ShiftCurves; // names.clear(); // pShiftCurvesDlg->Init(m_ShiftCurves); // if(pShiftCurvesDlg->exec()==QDialog::Accepted) { // for(int i=0;i(m_ShiftCurves[i]); // if(pLog1) { // QString slf=pLog1->GetSlfFileName(); // slf.replace("\\","/"); // QString slf1=pLog->GetSlfFileName(); // slf1.replace("\\","/"); // if(slf1.compare(slf,Qt::CaseInsensitive)==0){ // if(pLog->GetName().compare(pLog1->GetName(),Qt::CaseInsensitive)==0) { // continue; // } // } // logs.append(pLog1); // } // } // } // } // } // else if(pWelllogTrack) { // std::vectorvChild; // CPaiObjectHelper::RecursionGetAllChild(pWelllogTrack,vChild); // for(int i=0;i(vChild[i]); // if(!pLog1) continue; // logs.append(pLog1); // } // if(!logs.size()) { // AfxMessageBox("道内曲线对象为空,无对象可校正!"); // return; // } // } // bool ok=0; // double depthshift=QInputDialog::getDouble(NULL,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok); // if(!ok) return; // if(depthshift==0) return; // if(depthshift>10) // { // int flag = QMessageBox::warning(this->parentWidget(),"提示",QString("深度移动量 =")+QString::number(depthshift)+"m\n"+"\n您确定执行校正?", // QMessageBox::Yes,QMessageBox::No); // if(flag==QMessageBox::No) // { // return; // } // } // foreach(CObjWellLog *pLogt,logs) // { // LayerInfo lay; // lay.top=pLogt->GetTopDepth(); // lay.bottom=pLogt->GetBottomDepth(); // pLogt->m_ChangeNo=0; // pLogt->m_vLayers.clear(); // pLogt->m_vLayers.push_back(lay); // } // CDrawCurveCommand * pDrawCurveCommand = new CDrawCurveCommand(pWellSceneManager,logs); // pWellSceneManager->GetUndoStack()->push(pDrawCurveCommand); // foreach(CObjWellLog *pLogt,logs) // { // if(!pLogt) continue; // pLogt->AddShiftDepth(depthshift); // pLogt->ApplyShiftDepth(); // } // pDrawCurveCommand->SetXValue(); // foreach(CObjWellLog *pLogt,logs) // { // pLogt->m_vLayers.clear(); // } // pWellSceneManager->SetDirtyUIElement(true,true); // CVecViewCommand &viewCommand = pWellSceneManager->GetViewCommand(); // QAction *pUndoAction = viewCommand.GetAction(GetCmdID_UndoCommand()); // pUndoAction->setEnabled(pWellSceneManager->GetUndoStack()->canUndo()); // QAction *pRedoAction = viewCommand.GetAction(GetCmdID_RedoCommand()); // pRedoAction->setEnabled(pWellSceneManager->GetUndoStack()->canRedo()); // } // void CQtWindowWellSection::slotMoveAllCurves() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // if(!pWellSceneManager) return; // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(!pDoc) return; // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(pWellSceneManager->GetCurrentPickObjectID()); // CObjWellTrack *pWellTrack = dynamic_cast(pCurrentObject); // if(pWellTrack) { // AfxMessageBox("该功能不支持对井次校正!"); // return; // } // CObjWellLogTrack *pWelllogTrack = dynamic_cast( pCurrentObject ); // if(pWelllogTrack) pWellTrack=pWelllogTrack->GetWellTrack(); // CObjWellLog *pLog = dynamic_cast( pCurrentObject ); // if(pLog) { // pWelllogTrack=dynamic_cast(pLog->GetParent()); // if(pWelllogTrack) pWellTrack=pWelllogTrack->GetWellTrack(); // pWelllogTrack=NULL; // } // QListlogs; // if(pWelllogTrack) { // std::vectorvChild; // CPaiObjectHelper::RecursionGetAllChild(pWelllogTrack,vChild); // for(int i=0;i(vChild[i]); // if(!pLog1) continue; // logs.append(pLog1); // } // if(!logs.size()) { // AfxMessageBox("道内曲线对象为空,无对象可校正!"); // return; // } // } // else if(pLog){ // pDoc->m_shiftoffset=0; // pDoc->m_shiftcurve=NULL; // CObjWelllogRound*pRound=pLog->GetWelllogRound(); // if(QMessageBox::information(NULL,"提示","是否附加其它校正曲线等?",QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) // { // QList names; // if(pDoc->m_RightCurve) { // names.append(pDoc->m_RightCurve); // } // if(pDoc->m_LeftCurve) { // names.append(pDoc->m_LeftCurve); // } // if(pLog) { // names.append(pLog); // } // CchooseShiftCurvesDlg *pShiftCurvesDlg=new CchooseShiftCurvesDlg(pWellTrack,names,pRound); // pShiftCurvesDlg->Init(pDoc->m_ShiftCurves); // if(pShiftCurvesDlg->exec()==QDialog::Accepted) { // QListtemps; // for(int i=0;im_ShiftCurves.size();i++) { // CObjWellLog *pLog1 = dynamic_cast(pDoc->m_ShiftCurves[i]); // if(pLog1) { // if(pDoc->m_RightCurve) { // QString slf=pLog1->GetSlfFileName(); // slf.replace("\\","/"); // QString slf1=pDoc->m_RightCurve->GetSlfFileName(); // slf1.replace("\\","/"); // if(slf1.compare(slf,Qt::CaseInsensitive)==0){ // if(pDoc->m_RightCurve->GetName().compare(pLog1->GetName(),Qt::CaseInsensitive)==0) { // temps.append(pLog1); // continue; // } // } // } // if(pDoc->m_LeftCurve) { // QString slf=pLog1->GetSlfFileName(); // slf.replace("\\","/"); // QString slf1=pDoc->m_LeftCurve->GetSlfFileName(); // slf1.replace("\\","/"); // if(slf1.compare(slf,Qt::CaseInsensitive)==0){ // if(pDoc->m_LeftCurve->GetName().compare(pLog1->GetName(),Qt::CaseInsensitive)==0) { // temps.append(pLog1); // continue; // } // } // } // if(pLog) { // QString slf=pLog1->GetSlfFileName(); // slf.replace("\\","/"); // QString slf1=pLog->GetSlfFileName(); // slf1.replace("\\","/"); // if(slf1.compare(slf,Qt::CaseInsensitive)==0){ // if(pLog->GetName().compare(pLog1->GetName(),Qt::CaseInsensitive)==0) { // temps.append(pLog1); // continue; // } // } // } // if(pLog1->GetShiftOffset()) temps.append(pLog1); // } // } // for(int j=0;jm_ShiftCurves.removeOne(temps[j]); // } // } // logs.append(pLog); // foreach(CObjWellLog *pLogt,pDoc->m_ShiftCurves) // { // if(pLogt) { // logs.append(pLogt); // } // } // } // else return; // QDialog dialog(NULL); // dialog.setModal(false); // Qt::WindowFlags flags = dialog.windowFlags(); // flags |= Qt::WindowStaysOnTopHint; // flags &= ~Qt::WindowContextHelpButtonHint; // dialog.setWindowFlags(flags); // dialog.setWindowTitle("深度分段平移"); // QFormLayout form(&dialog); // form.addWidget(new QLabel("输入深度参数:")); // // Value1 // QString value1 = QString("起始深度: "); // spinbox1 = new QLineEdit(&dialog); // if(pWellTrack&&pWellSceneManager) { // float yGeoNormal =0; // bool isHorLayout=pWellSceneManager->IsWellSectonHorizonLayout(); // //luol 20200508 // if (isHorLayout) // { // yGeoNormal= m_pSceneManager->GetCoordinate()->ConvertX(pWellTrack->GetID(),eCoord_GDIPixel,pDoc->m_MouseCurrentPos.x(),eCoord_GEO); // }else // { // yGeoNormal=getYGeoNormalFromPixel(pWellTrack,pDoc->m_MouseCurrentPos.y()); // } // spinbox1->setText(toString(((int)(yGeoNormal*10+0.5))/10.0)); // } // else spinbox1->setText("-9999.0"); // form.addRow(value1, spinbox1); // value1 = QString("终止深度: "); // spinbox2 = new QLineEdit(&dialog); // form.addRow(value1, spinbox2); // if(pLog) spinbox2->setText(toString(pLog->GetBottomDepth())); // else spinbox2->setText("-9999.0"); // value1 = QString("移动量(上移-,下移+): "); // spinbox3 = new QLineEdit(&dialog); // form.addRow(value1, spinbox3); // spinbox3->setText("0"); // QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, // Qt::Horizontal, &dialog); // m_ButtonBox=&buttonBox; // form.addWidget(&buttonBox); // m_LOGS=logs; // QObject::connect(spinbox1, SIGNAL(returnPressed()), this, SLOT(slotSetDep())); // QObject::connect(spinbox2, SIGNAL(returnPressed()), this, SLOT(slotSetDep())); // QObject::connect(buttonBox.button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(slotRun())); // QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); // buttonBox.button(QDialogButtonBox::Ok)->setAutoDefault(false); // slotSetDep(); // dialog.show(); // if (dialog.exec() == QDialog::Accepted) { // // Do something here // } // if(pLog){ // pLog->m_vLayers.clear(); // } // } // void CQtWindowWellSection::slotSetDep() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // if(!pWellSceneManager) return; // m_ButtonBox->button(QDialogButtonBox::Ok)->setAutoDefault(false); // m_ButtonBox->button(QDialogButtonBox::Ok)->setDefault(false); // float sdep=spinbox1->text().toFloat(); // float edep=spinbox2->text().toFloat(); // if(m_LOGS.size()&&sdep!=-9999&&edep!=-9999) // { // CObjWellLog *pLog=m_LOGS[0]; // LayerInfo lay; // lay.top=sdep; // lay.bottom=edep; // if(sdep==edep) { // lay.top=pLog->GetTopDepth(); // lay.bottom=pLog->GetBottomDepth(); // } // for(float dep=lay.top;depm_Rlev) // { // lay.m_vXData.push_back(pLog->GetData(dep)); // } // pLog->m_ChangeNo=0; // pLog->m_vLayers.clear(); // pLog->m_vLayers.push_back(lay); // pWellSceneManager->SetDirtyUIElement(true,true); // } // } // void CQtWindowWellSection::slotReplace() // { // if(pTDialog) // { // QString sdep=spinbox1->text(); // QString edep=spinbox2->text(); // if(!sdep.isEmpty()&&!edep.isEmpty()) // { // QString str=pTDialog->toPlainText(); // str.replace(sdep,edep); // pTDialog->setText(str); // } // } // } // void CQtWindowWellSection::slotRun() // { // m_ButtonBox->button(QDialogButtonBox::Ok)->setAutoDefault(false); // m_ButtonBox->button(QDialogButtonBox::Ok)->setDefault(false); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // if(!pWellSceneManager) return; // double depthshift=spinbox3->text().toFloat(); // if(depthshift==0) return; // float sdep=spinbox1->text().toFloat(); // float edep=spinbox2->text().toFloat(); // if(sdep>edep) { // float depp=sdep; // sdep=edep; // edep=sdep; // } // foreach(CObjWellLog *pLogt,m_LOGS) // { // LayerInfo lay; // lay.top=sdep; // lay.bottom=edep; // if(sdep==edep) { // lay.top=pLogt->GetTopDepth(); // lay.bottom=pLogt->GetBottomDepth(); // } // pLogt->m_ChangeNo=0; // pLogt->m_vLayers.clear(); // pLogt->m_vLayers.push_back(lay); // } // CDrawCurveCommand * pDrawCurveCommand = new CDrawCurveCommand(pWellSceneManager,m_LOGS); // pWellSceneManager->GetUndoStack()->push(pDrawCurveCommand); // foreach(CObjWellLog *pLogt,m_LOGS) // { // if(!pLogt) continue; // pLogt->SetShiftTopDepth(-9999.0); // pLogt->SetShiftBottomDepth(-9999.0); // pLogt->SetShiftOffset(0); // pLogt->MoveShift(sdep,edep,depthshift); // } // pDrawCurveCommand->SetXValue(); // foreach(CObjWellLog *pLogt,m_LOGS) // { // pLogt->m_vLayers.clear(); // } // pWellSceneManager->SetDirtyUIElement(true,true); // CVecViewCommand &viewCommand = pWellSceneManager->GetViewCommand(); // QAction *pUndoAction = viewCommand.GetAction(GetCmdID_UndoCommand()); // pUndoAction->setEnabled(pWellSceneManager->GetUndoStack()->canUndo()); // QAction *pRedoAction = viewCommand.GetAction(GetCmdID_RedoCommand()); // pRedoAction->setEnabled(pWellSceneManager->GetUndoStack()->canRedo()); // return; // } // void CQtWindowWellSection::onCurrentLineHighLight() // { // QTextEdit *edit = (QTextEdit *)pTDialog; // if(!pTDialog) return; // QTextCursor cursor = edit->textCursor(); // QList extraSelection; // QTextEdit::ExtraSelection selection; // QColor lineColor = QColor(Qt::gray).lighter(140); // selection.format.setBackground(lineColor); // selection.format.setProperty(QTextFormat::FullWidthSelection,true); // selection.cursor = cursor; // selection.cursor.clearSelection(); // //将刚设置的 selection追加到链表当中 // extraSelection.append(selection); // edit->setExtraSelections(extraSelection); // } // void CQtWindowWellSection::slotCardMoveCurves() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // if(!pWellSceneManager) return; // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(!pDoc) return; // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(pWellSceneManager->GetCurrentPickObjectID()); // CObjWellTrack *pWellTrack = dynamic_cast(pCurrentObject); // CObjWellLogTrack *pWelllogTrack = dynamic_cast( pCurrentObject ); // if(pWelllogTrack) pWellTrack=pWelllogTrack->GetWellTrack(); // CObjWelllogRound*pRound=NULL; // CObjWellLog *pLog = dynamic_cast( pCurrentObject ); // if(pLog) { // pRound=pLog->GetWelllogRound(); // } // if(!pRound) { // AfxMessageBox("请先选中一条目标井曲线!"); // return; // } // m_LOGS.clear(); // m_LOGS.append(pLog); // QDialog dialog(NULL); // dialog.setModal(false); // Qt::WindowFlags flags = dialog.windowFlags(); // flags |= Qt::WindowStaysOnTopHint; // flags &= ~Qt::WindowContextHelpButtonHint; // dialog.setWindowFlags(flags); // QString path,wellname; // GetWellNameAndPath(pRound->GetSlfFileName(),wellname,path); // dialog.setWindowTitle("分段平移井次文件-"+wellname); // QGridLayout *verticalLayoutWidget = new QGridLayout(&dialog); // verticalLayoutWidget->setObjectName(QString::fromUtf8("verticalLayoutWidget")); // verticalLayoutWidget->setGeometry(QRect(30, 30, 631, 281)); // QVBoxLayout*form = new QVBoxLayout(); // form->setObjectName(QString::fromUtf8("form")); // form->setContentsMargins(0, 0, 0, 0); // pTDialog = new CompleterTextEdit(&dialog); // pTDialog->setObjectName(QString::fromUtf8("pTDialog")); // form->addWidget(pTDialog); // QHBoxLayout*horizontalLayout = new QHBoxLayout(); // horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); // QLabel*label = new QLabel(&dialog); // label->setObjectName(QString::fromUtf8("label")); // label->setText("原曲线"); // horizontalLayout->addWidget(label); // spinbox1 = new QLineEdit(&dialog); // spinbox1->setObjectName(QString::fromUtf8("lineEdit")); // horizontalLayout->addWidget(spinbox1); // QLabel*label_2 = new QLabel(&dialog); // label_2->setObjectName(QString::fromUtf8("label_2")); // label_2->setText("替换曲线"); // horizontalLayout->addWidget(label_2); // spinbox2 = new QLineEdit(&dialog); // spinbox2->setObjectName(QString::fromUtf8("lineEdit_2")); // horizontalLayout->addWidget(spinbox2); // QFont ft(QString::fromLocal8Bit("宋体"),12); // pTDialog->setFont(ft); // QPushButton*pushButton = new QPushButton(&dialog); // pushButton->setObjectName(QString::fromUtf8("pushButton")); // pushButton->setText("替换"); // horizontalLayout->addWidget(pushButton); // QObject::connect(pushButton, SIGNAL(clicked()), this, SLOT(slotReplace())); // QPushButton*pushButton1 = new QPushButton(&dialog); // pushButton1->setObjectName(QString::fromUtf8("pushButton1")); // pushButton1->setText("连续性检查"); // horizontalLayout->addWidget(pushButton1); // QObject::connect(pushButton1, SIGNAL(clicked()), this, SLOT(slotDepthCheck())); // { // DWORD bytes_write; // char cardname[200]="cardmove_inp"; // CMemRdWt mem(pLog->GetSlfFileName().toStdString().c_str()); // int index_result = mem.OpenStream(cardname); // if(index_result>-1) // { // int len=mem.GetStreamLength(index_result); // if(len>0) { // char *buff=new char[len+1]; // DWORD lb=0; // mem.ReadStream(index_result,len,&lb,buff); // pTDialog->document()->setPlainText(buff); // delete buff; // } // } // mem.Close(); // } // QDialogButtonBox buttonBox(QDialogButtonBox::Yes|QDialogButtonBox::Ok | QDialogButtonBox::Cancel, // Qt::Horizontal, &dialog); // form->addLayout(horizontalLayout); // form->addWidget(&buttonBox); // verticalLayoutWidget->addLayout(form, 0, 0, 1, 1); // connect(pTDialog,SIGNAL(cursorPositionChanged()), // this,SLOT(onCurrentLineHighLight())); // if(buttonBox.button(QDialogButtonBox::Yes)) buttonBox.button(QDialogButtonBox::Yes)->setText("保存"); // if(buttonBox.button(QDialogButtonBox::Ok)) buttonBox.button(QDialogButtonBox::Ok)->setText("执行"); // QObject::connect(buttonBox.button(QDialogButtonBox::Yes), SIGNAL(clicked()), this, SLOT(slotCardSave())); // QObject::connect(buttonBox.button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(slotCardRun())); // QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); // dialog.show(); // if (dialog.exec() == QDialog::Accepted) { // pTDialog=NULL; // } // else { // pTDialog=NULL; // return; // } // } // void CQtWindowWellSection::slotDepthCheck() // { // QString text=pTDialog->document()->toPlainText(); // text.replace("\r\n","\n"); // QStringList lines=text.split("\n"); // lines.removeAll(""); // float sdep1=-9999,edep1=-9999; // QString cname; // QString oline; // for(int i=0;isdep1&&sdep!=edep1)||(sdepparentWidget(), // "提示", // line+"\n深度不连续!", // QMessageBox::Ok); // } // } // sdep1=sdep; // edep1=edep; // cname=vals[0]; // oline=line; // } // } // void CQtWindowWellSection::slotCardRun() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // if(!pWellSceneManager) return; // if(m_LOGS.size()<1) return; // CObjWelllogRound*pRound=NULL; // CObjWellLog *pLog =m_LOGS.at(0); // if(pLog) { // pRound=pLog->GetWelllogRound(); // } // if(!pRound) { // return; // } // QString text=pTDialog->document()->toPlainText(); // text.replace("\r\n","\n"); // QStringList lines=text.split("\n"); // lines.removeAll(""); // QListlogs; // QStringList ovals; // for(int i=0;i10) // { // int flag = QMessageBox::warning(pTDialog->parentWidget(),"提示",QString("深度移动量 >")+QString::number(depthshift)+"m\n"+line+"\n您确定执行校正?", // QMessageBox::Yes,QMessageBox::No); // if(flag==QMessageBox::No) // { // return; // } // } // ovals=vals; // CObjWellLog*pLogt=dynamic_cast(pRound->GetObjectByName(vals[0].toUpper())); // if(!pLogt)continue; // if(logs.indexOf(pLogt)<0){ // pLogt->m_ChangeNo=0; // pLogt->m_vLayers.clear(); // logs.append(pLogt); // } // float sdep=vals[1].toFloat(); // float edep=vals[2].toFloat(); // if(pLogt->m_vLayers.size()<1) { // LayerInfo lay; // lay.top=sdep; // lay.bottom=edep; // pLogt->m_vLayers.push_back(lay); // } // else { // if (pLogt->m_vLayers.at(0).top>sdep) // { // pLogt->m_vLayers.at(0).top=sdep; // } // if (pLogt->m_vLayers.at(0).bottomm_vLayers.at(0).bottom=edep; // } // } // } // CDrawCurveCommand * pDrawCurveCommand = new CDrawCurveCommand(pWellSceneManager,logs); // pWellSceneManager->GetUndoStack()->push(pDrawCurveCommand); // for(int i=0;i(pRound->GetObjectByName(vals[0].toUpper())); // if(!pLogt)continue; // ovals=vals; // float sdep=vals[1].toFloat(); // float edep=vals[2].toFloat(); // pLogt->SetShiftTopDepth(-9999.0); // pLogt->SetShiftBottomDepth(-9999.0); // pLogt->SetShiftOffset(0); // if(sdepGetTopDepth()||edep>pLogt->GetBottomDepth()) // { // QString str; // str+=pLogt->GetName(); // str+="深度"; // str+=vals[1]; // str+="-"; // str+=vals[2]; // str+="不在原曲线深度"; // str+=QString::number(pLogt->GetTopDepth()); // str+="-"; // str+=QString::number(pLogt->GetBottomDepth()); // str+="范围内"; // if(QMessageBox::information(pTDialog->parentWidget(),"提示",str+",是否继续?",QMessageBox::Yes,QMessageBox::No)==QMessageBox::No) break; // } // bool a=pLogt->isRun; // pLogt->isRun=false; // pLogt->MoveShift(sdep,edep,depthshift); // pLogt->isRun=false; // } // foreach(CObjWellLog *pLogt,logs) // { // pLogt->isLoad=false; // pLogt->LoadFromSLF(); // } // pDrawCurveCommand->SetXValue(); // foreach(CObjWellLog *pLogt,logs) // { // pLogt->m_vLayers.clear(); // } // pWellSceneManager->SetDirtyUIElement(true,true); // DWORD bytes_write; // char cardname[200]="cardmove_inp"; // CMemRdWt mem(pLog->GetSlfFileName().toStdString().c_str()); // int index_result = mem.CreateStream(PARA_OBJECT,cardname,16384,FALSE); // if(index_result>-1) { // int len=strlen(text.toStdString().c_str()); // if(len>0) { // DWORD lb=0; // mem.WriteStream(index_result,len+1,&lb,text.toStdString().c_str()); // } // } // mem.Close(); // CVecViewCommand &viewCommand = pWellSceneManager->GetViewCommand(); // QAction *pUndoAction = viewCommand.GetAction(GetCmdID_UndoCommand()); // pUndoAction->setEnabled(pWellSceneManager->GetUndoStack()->canUndo()); // QAction *pRedoAction = viewCommand.GetAction(GetCmdID_RedoCommand()); // pRedoAction->setEnabled(pWellSceneManager->GetUndoStack()->canRedo()); // return; // } // void CQtWindowWellSection::slotCardSave() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // if(!pWellSceneManager) return; // if(m_LOGS.size()<1) return; // CObjWelllogRound*pRound=NULL; // CObjWellLog *pLog =m_LOGS.at(0); // if(!pLog) return; // QString text=pTDialog->document()->toPlainText(); // DWORD bytes_write; // char cardname[200]="cardmove_inp"; // CMemRdWt mem(pLog->GetSlfFileName().toStdString().c_str()); // int index_result = mem.CreateStream(PARA_OBJECT,cardname,16384,FALSE); // if(index_result>-1) { // int len=strlen(text.toStdString().c_str()); // if(len>0) { // DWORD lb=0; // mem.WriteStream(index_result,len+1,&lb,text.toStdString().c_str()); // } // } // mem.Close(); // // AfxMessageBox("保存完毕!"); // return; // } // void CQtWindowWellSection::slotSetShiftCurve() // { // slotSetShiftCurve(0); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // if(pDoc->m_LeftCurve||pDoc->m_RightCurve||pDoc->m_ShiftCurves.size()) pDoc->m_isShift=0; // else pDoc->m_isShift=-1; // } // } // void CQtWindowWellSection::slotSetOtherShiftCurve() // { // slotSetOtherShiftCurve(0); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // if(pDoc->m_LeftCurve||pDoc->m_RightCurve||pDoc->m_ShiftCurves.size()) pDoc->m_isShift=0; // else pDoc->m_isShift=-1; // } // } // void CQtWindowWellSection::slotSetStandardCurve() // { // slotSetStandardCurve(0); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // if(pDoc->m_LeftCurve||pDoc->m_RightCurve||pDoc->m_ShiftCurves.size()) pDoc->m_isShift=0; // else pDoc->m_isShift=-1; // } // } // //////////////////// // void CQtWindowWellSection::slotSetMegCurve() // { // slotSetShiftCurve(1); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // if(pDoc->m_LeftCurve||pDoc->m_RightCurve||pDoc->m_ShiftCurves.size()) pDoc->m_isShift=1; // else pDoc->m_isShift=-1; // } // } // void CQtWindowWellSection::slotSetOtherMegCurve() // { // slotSetOtherShiftCurve(1); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // if(pDoc->m_LeftCurve||pDoc->m_RightCurve||pDoc->m_ShiftCurves.size()) pDoc->m_isShift=1; // else pDoc->m_isShift=-1; // } // } // void CQtWindowWellSection::slotSetStandardMegCurve() // { // slotSetStandardCurve(1); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // if(pDoc->m_LeftCurve||pDoc->m_RightCurve||pDoc->m_ShiftCurves.size()) pDoc->m_isShift=1; // else pDoc->m_isShift=-1; // } // } // void CQtWindowWellSection::slotSetStandardCurve(int type) // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(pWellSceneManager->GetCurrentPickObjectID()); // CObjWellLog *pLog = dynamic_cast( pCurrentObject ); // if(pLog) { // QString name=pLog->GetAliasName(); // QUuid objectID=pLog->GetPaiObject()->GetID(); // CObjectViewInfo *pObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // if(name.isEmpty()) { // if(pObjectViewInfo)name=pObjectViewInfo->GetAliasName(); // if(name.isEmpty()) name=pLog->GetName(); // } // int pos=-1; // if(type==0) pos=name.indexOf("_标"); // else pos=name.indexOf("_目"); // if(pos<0) { // int pos1=-1; // if(type==0) pos1=name.indexOf("_主"); // else pos1=name.indexOf("_源"); // if(pos1>=0) { // name=name.left(pos1); // } // else { // if(type==0) pos1=name.indexOf("_从校"); // else pos1=name.indexOf("_从接"); // if(pos1>=0) { // name=name.left(pos1); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name); // pLog->SetAliasName(name); // pDoc->m_ShiftCurves.removeOne(pLog); // } // } // if(pDoc->m_LeftCurve&&pLog!=pDoc->m_LeftCurve) { // QUuid objectID=pDoc->m_LeftCurve->GetPaiObject()->GetID(); // CObjectViewInfo *pDestObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // QString nn=pDoc->m_LeftCurve->GetAliasName(); // if(nn.isEmpty()&&pDestObjectViewInfo) { // nn=pDestObjectViewInfo->GetAliasName(); // if(nn.isEmpty()&&pDoc->m_LeftCurve) nn=pDoc->m_LeftCurve->GetName(); // } // if(type==0)pos1=nn.indexOf("_从校"); // else pos1=nn.indexOf("_从接"); // if(pos1<0) { // if(type==0)pos1=nn.indexOf("_主"); // else pos1=nn.indexOf("_源"); // } // if(pos1<0) { // if(type==0)pos1=nn.indexOf("_标"); // else pos1=nn.indexOf("_目"); // } // if(pos1>=0) nn=nn.left(pos1); // else { // int a=1; // } // pDoc->m_LeftCurve->SetAliasName(nn); // if(pDestObjectViewInfo)pDestObjectViewInfo->SetAliasName(nn); // } // ////////////////////////////////////// // if(type==0) { // pLog->SetAliasName(name+"_标"); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name+"_标"); // } // else { // pLog->SetAliasName(name+"_目"); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name+"_目"); // } // if(pDoc->m_LeftCurve)pWellSceneManager->UpdateObject(pDoc->m_LeftCurve->GetID(),eUpdate_ViewInfo,NULL ); // pDoc->m_LeftCurve=pLog; // if(pDoc->m_RightCurve&&pLog==pDoc->m_RightCurve) { // pDoc->m_RightCurve=NULL; // if(pDoc->m_ShiftCurves.size()) { // pDoc->m_RightCurve=pDoc->m_ShiftCurves[0]; // pDoc->m_ShiftCurves.removeAt(0); // if(pDoc->m_RightCurve) { // name=pDoc->m_RightCurve->GetAliasName(); // if(type==0)pos1=name.indexOf("_从校"); // else pos1=name.indexOf("_从接"); // if(pos1>-1) name=name.left(pos1); // //设置为主曲线 // QUuid objectID=pDoc->m_RightCurve->GetPaiObject()->GetID(); // CObjectViewInfo *pObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // if(type==0) { // pDoc->m_RightCurve->SetAliasName(name+"_主"); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name+"_主"); // } // else { // pDoc->m_RightCurve->SetAliasName(name+"_源"); // if(pObjectViewInfo) pObjectViewInfo->SetAliasName(name+"_源"); // } // } // } // else { // int aa=0; // } // } // } // else { // name=name.left(pos); // pLog->SetAliasName(name); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name); // pDoc->m_LeftCurve=NULL; // } // UpdateHUD(); // pWellSceneManager->UpdateObject(pLog->GetID(),eUpdate_ViewInfo,NULL ); // } // } // double CQtWindowWellSection::getXOSGGlobalFromPixel(CObjWellTrack*m_pWellTrack,double x) // { // if(!m_pWellTrack) { // CBaseObject *pObject = m_pSceneManager->GetCurentPickObject(); // //找到当前选中对象所在的well track,并选中,如果该well track下没有深度道,创建深度道 // if (pObject != NULL) // { // m_pWellTrack = dynamic_cast(pObject); // } // if(!m_pWellTrack) { // return 0; // } // } // CQtWellTrackNode * pWellTrackNode=dynamic_cast(m_pSceneManager->GetBuilder(m_pWellTrack->GetID())); // if(!pWellTrackNode) return 0; // if(m_pSceneManager->IsWellSectonHorizonLayout()) // { // return pWellTrackNode->ConvertY(eCoord_OSGPixel,x,eCoord_OSGGlobal); // } // osg::Vec3d vecGeoNormal; // m_pSceneManager->GetCoordinate()->ConvertCoordDouble( m_pWellTrack->GetID(),eCoord_OSGPixel,osg::Vec3d(x,0,0),eCoord_OSGGlobal,vecGeoNormal ); // return vecGeoNormal[0]; // } // double CQtWindowWellSection::getYOSGGlobalFromPixel(CObjWellTrack*m_pWellTrack,double y) // { // if(!m_pWellTrack) { // CBaseObject *pObject = m_pSceneManager->GetCurentPickObject(); // //找到当前选中对象所在的well track,并选中,如果该well track下没有深度道,创建深度道 // if (pObject != NULL) // { // m_pWellTrack = dynamic_cast(pObject); // } // if(!m_pWellTrack) { // return 0; // } // } // CQtWellTrackNode * pWellTrackNode=dynamic_cast(m_pSceneManager->GetBuilder(m_pWellTrack->GetID())); // if(!pWellTrackNode) return 0; // if(m_pSceneManager->IsWellSectonHorizonLayout()) // { // return pWellTrackNode->ConvertX(eCoord_OSGPixel,y,eCoord_OSGGlobal); // } // osg::Vec3d vecGeoNormal; // m_pSceneManager->GetCoordinate()->ConvertCoordDouble( m_pWellTrack->GetID(),eCoord_OSGPixel,osg::Vec3d(0,y,0),eCoord_OSGGlobal,vecGeoNormal ); // return vecGeoNormal[1]; // } // double CQtWindowWellSection::getYGeoFromOSGGlobal(CObjWellTrack*m_pWellTrack,double yOSGGlobal) // { // if(!m_pWellTrack) { // CBaseObject *pObject = m_pSceneManager->GetCurentPickObject(); // //找到当前选中对象所在的well track,并选中,如果该well track下没有深度道,创建深度道 // if (pObject != NULL) // { // m_pWellTrack = dynamic_cast(pObject); // } // if(!m_pWellTrack) { // return 0; // } // } // CQtWellTrackNode * pWellTrackNode=dynamic_cast(m_pSceneManager->GetBuilder(m_pWellTrack->GetID())); // if(!pWellTrackNode) return 0; // if(m_pSceneManager->IsWellSectonHorizonLayout()) // { // return pWellTrackNode->ConvertX(eCoord_OSGGlobal,yOSGGlobal,eCoord_GEO); // } // osg::Vec3d vecGeoNormal; // m_pSceneManager->GetCoordinate()->ConvertCoordDouble( m_pWellTrack->GetID(),eCoord_OSGGlobal,osg::Vec3d(0,yOSGGlobal,0),eCoord_GEO,vecGeoNormal ); // return vecGeoNormal[1]; // } // double CQtWindowWellSection::getXGeoFromOSGGlobal(CObjWellTrack*m_pWellTrack,double xOSGGlobal) // { // if(!m_pWellTrack) { // CBaseObject *pObject = m_pSceneManager->GetCurentPickObject(); // //找到当前选中对象所在的well track,并选中,如果该well track下没有深度道,创建深度道 // if (pObject != NULL) // { // m_pWellTrack = dynamic_cast(pObject); // } // if(!m_pWellTrack) { // return 0; // } // } // CQtWellTrackNode * pWellTrackNode=dynamic_cast(m_pSceneManager->GetBuilder(m_pWellTrack->GetID())); // if(!pWellTrackNode) return 0; // if(m_pSceneManager->IsWellSectonHorizonLayout()) // { // return pWellTrackNode->ConvertY(eCoord_OSGGlobal,xOSGGlobal,eCoord_GEO); // } // osg::Vec3d vecGeoNormal; // m_pSceneManager->GetCoordinate()->ConvertCoordDouble( m_pWellTrack->GetID(),eCoord_OSGGlobal,osg::Vec3d(xOSGGlobal,0,0),eCoord_GEO,vecGeoNormal ); // return vecGeoNormal[0]; // } // double CQtWindowWellSection::getYGeoNormalFromPixel(CObjWellTrack*m_pWellTrack,double y) // { // if(!m_pWellTrack) { // CBaseObject *pObject = m_pSceneManager->GetCurentPickObject(); // //找到当前选中对象所在的well track,并选中,如果该well track下没有深度道,创建深度道 // if (pObject != NULL) // { // m_pWellTrack = dynamic_cast(pObject); // } // if(!m_pWellTrack) { // return 0; // } // } // CQtWellTrackNode * pWellTrackNode=dynamic_cast(m_pSceneManager->GetBuilder(m_pWellTrack->GetID())); // if(!pWellTrackNode) return 0; // if(m_pSceneManager->IsWellSectonHorizonLayout()) // { // return pWellTrackNode->ConvertX(eCoord_OSGPixel,y,eCoord_GEONormal); // } // osg::Vec3d vecGeoNormal; // m_pSceneManager->GetCoordinate()->ConvertCoordDouble( m_pWellTrack->GetID(),eCoord_OSGPixel,osg::Vec3d(0,y,0),eCoord_GEONormal,vecGeoNormal ); // return vecGeoNormal[1]; // } // QRectF CQtWindowWellSection::getLineRangeRectOSGGLobal(CObjWellTrack*m_pWellTrack) // { // QRectF r; // if (m_pWellTrack == NULL) // { // return r; // } // CQtWellTrackNode* pWellTrackBuilder = dynamic_cast(GetSceneManager()->GetBuilder(m_pWellTrack->GetID())); // if(pWellTrackBuilder != NULL) // { // r = pWellTrackBuilder->GetWellRect(); // int nEndRow = pWellTrackBuilder->GetWellSheet().GetRowNumber()-1; // QRectF rcF = pWellTrackBuilder->GetWellSheet().GetCellRect( // CellRange(nEndRow, nEndRow ,0 ,pWellTrackBuilder->GetWellSheet().GetColumeNumber()-1 ), // eCoord_OSGGlobal,m_pWellTrack->GetID() ); // r.setTop(rcF.top()); // r.setBottom(rcF.bottom()); // } // return r; // } // QVector CQtWindowWellSection::SetLinePoint(CWellSectionWindowDocument *pDoc,CObjWellTrack*m_pWellTrack,CurveLine *pLine,QRectF lineRangeRect) // { // QVector vecPoints; // if (m_pWellTrack == NULL) // { // return vecPoints; // } // osg::Vec3d vecGeoLeft; // osg::Vec3d vecGeoRight; // QPointF leftpoint; // QPointF rightpoint; // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CQtWellTrackNode *pWellTrackNode=dynamic_cast(pWellSceneManager->GetBuilder(m_pWellTrack->GetID())); // //luol 20200508 水平控制 // if(pWellSceneManager->IsWellSectonHorizonLayout()) // { // osg::Vec3d vecGeoNormal1(0, pLine->GetLeftDepth(), 0); // m_pSceneManager->GetCoordinate()->ConvertCoordDouble( m_pWellTrack->GetID(),eCoord_GEO,vecGeoNormal1,eCoord_GDIPixel,vecGeoLeft ); // osg::Vec3d vecGeoNormal2(0, pLine->GetRightDepth(), 0); // m_pSceneManager->GetCoordinate()->ConvertCoordDouble( m_pWellTrack->GetID(),eCoord_GEO,vecGeoNormal2,eCoord_GDIPixel,vecGeoRight ); // if (pDoc&&pDoc->m_LeftCurve) // { // CVecNodeBuilder *pLogNode = dynamic_cast( GetSceneManager()->GetBuilder( pDoc->m_LeftCurve->GetID() ) ); // //luol20200508 此处存在BUG 由于 GetOSGPixelPoint 函数只提供了 X方向像素点获取, // //最终解决方案需要底层新增Y方向获取像素点的函数 // leftpoint=pLogNode->GetOSGPixelPoint(pLine->GetLeftDepth(),0.0f); // if(leftpoint.x()==leftpoint.y()&&leftpoint.x()==0) // { // leftpoint.setX(lineRangeRect.left()); // } // leftpoint.setY(vecGeoLeft[0]); // } // else { // leftpoint.setX(lineRangeRect.left()); // leftpoint.setY(vecGeoLeft[0]); // } // if (pDoc&&pDoc->m_RightCurve) // { // CVecNodeBuilder *pLogNode = dynamic_cast( GetSceneManager()->GetBuilder( pDoc->m_RightCurve->GetID() ) ); // if(pLogNode) { // rightpoint=pLogNode->GetOSGPixelPoint(pLine->GetRightDepth(),0.0f); // if(rightpoint.x()==rightpoint.y()&&rightpoint.x()==0) // { // rightpoint.setX(lineRangeRect.right()); // } // rightpoint.setY(vecGeoRight[0]); // } // else { // rightpoint.setX(lineRangeRect.right()); // rightpoint.setY(vecGeoRight[0]); // } // } // else { // rightpoint.setX(lineRangeRect.right()); // rightpoint.setY(vecGeoRight[0]); // } // }else // { // osg::Vec3d vecGeoNormal1(0, pLine->GetLeftDepth(), 0); // m_pSceneManager->GetCoordinate()->ConvertCoordDouble( m_pWellTrack->GetID(),eCoord_GEO,vecGeoNormal1,eCoord_GDIPixel,vecGeoLeft ); // osg::Vec3d vecGeoNormal2(0, pLine->GetRightDepth(), 0); // m_pSceneManager->GetCoordinate()->ConvertCoordDouble( m_pWellTrack->GetID(),eCoord_GEO,vecGeoNormal2,eCoord_GDIPixel,vecGeoRight ); // if (pDoc&&pDoc->m_LeftCurve) // { // CVecNodeBuilder *pLogNode = dynamic_cast( GetSceneManager()->GetBuilder( pDoc->m_LeftCurve->GetID() ) ); // if(pLogNode) { // leftpoint=pLogNode->GetOSGPixelPoint(pLine->GetLeftDepth(),0.0f); // if(leftpoint.x()==leftpoint.y()&&leftpoint.x()==0) // { // leftpoint.setX(lineRangeRect.left()); // } // leftpoint.setY(vecGeoLeft[1]); // } // else { // leftpoint.setX(lineRangeRect.left()); // leftpoint.setY(vecGeoLeft[1]); // } // } // else { // leftpoint.setX(lineRangeRect.left()); // leftpoint.setY(vecGeoLeft[1]); // } // if (pDoc&&pDoc->m_RightCurve) // { // CVecNodeBuilder *pLogNode = dynamic_cast( GetSceneManager()->GetBuilder( pDoc->m_RightCurve->GetID() ) ); // if(pLogNode){ // rightpoint=pLogNode->GetOSGPixelPoint(pLine->GetRightDepth(),0.0f); // if(rightpoint.x()==rightpoint.y()&&rightpoint.x()==0) // { // rightpoint.setX(lineRangeRect.right()); // } // rightpoint.setY(vecGeoRight[1]); // } // else { // rightpoint.setX(lineRangeRect.right()); // rightpoint.setY(vecGeoRight[1]); // } // } // else { // rightpoint.setX(lineRangeRect.right()); // rightpoint.setY(vecGeoRight[1]); // } // } // if (!pWellTrackNode) // { // return vecPoints; // } // vecPoints <( GetSceneManager() ); // if(!pWellSceneManager) return; // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc->pLine) { // int pos=pDoc->m_mergeLineList.indexOf(pDoc->pLine); // if(pos>-1) { // pDoc->m_mergeLineList.remove(pos); // QList aa; // aa.append(pDoc->pLine); // qDeleteAll(aa); // pDoc->pLine=NULL; // pWellSceneManager->SetDirtyUIElement(true,true); // return; // } // } // ::qDeleteAll(pDoc->m_mergeLineList); // pDoc->m_mergeLineList.clear(); // pDoc->pLine=NULL; // pWellSceneManager->SetDirtyUIElement(true,true); // } // void CQtWindowWellSection::slotClearShiftZonePoint0() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // if(!pWellSceneManager) return; // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc->pLine) { // int pos=pDoc->m_mergeLineList.indexOf(pDoc->pLine); // if(pos>-1) { // pDoc->m_mergeLineList.remove(pos); // QList aa; // aa.append(pDoc->pLine); // qDeleteAll(aa); // pDoc->pLine=NULL; // pWellSceneManager->SetDirtyUIElement(true,true); // return; // } // } // } // void CQtWindowWellSection::slotClearStandardShift(int type) // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(pWellSceneManager->GetCurrentPickObjectID()); // if(pDoc->m_LeftCurve) { // QString name=pDoc->m_LeftCurve->GetAliasName(); // QUuid objectID=pDoc->m_LeftCurve->GetPaiObject()->GetID(); // CObjectViewInfo *pDestObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // if(name.isEmpty()&&pDestObjectViewInfo) { // name=pDestObjectViewInfo->GetAliasName(); // if(name.isEmpty()) name=pDoc->m_LeftCurve->GetName(); // } // int pos=-1; // pos=name.indexOf("_标"); // if(pos<0)pos=name.indexOf("_目"); // if(pos<0)pos=name.indexOf("_主"); // if(pos<0)pos=name.indexOf("_源"); // if(pos<0)pos=name.indexOf("_从校"); // if(pos<0)pos=name.indexOf("_从接"); // if(pos>=0) { // name=name.left(pos); // pDoc->m_LeftCurve->SetAliasName(name); // if(pDestObjectViewInfo)pDestObjectViewInfo->SetAliasName(name); // } // pDoc->m_LeftCurve->SetShiftOffset(0.0); // pDoc->m_LeftCurve->SetShiftTopDepth(-9999.0); // pDoc->m_LeftCurve->SetShiftBottomDepth(-9999); // pWellSceneManager->UpdateObject(pDoc->m_LeftCurve->GetID(),eUpdate_ViewInfo,NULL); // } // if(pDoc->m_RightCurve) { // QString name=pDoc->m_RightCurve->GetAliasName(); // QUuid objectID=pDoc->m_RightCurve->GetPaiObject()->GetID(); // CObjectViewInfo *pDestObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // if(name.isEmpty()&&pDestObjectViewInfo) { // name=pDestObjectViewInfo->GetAliasName(); // if(name.isEmpty()) name=pDoc->m_RightCurve->GetName(); // } // int pos=-1; // pos=name.indexOf("_标"); // if(pos<0) pos=name.indexOf("_主"); // if(pos<0) pos=name.indexOf("_从校"); // if(pos<0) pos=name.indexOf("_目"); // if(pos<0) pos=name.indexOf("_源"); // if(pos<0) pos=name.indexOf("_从接"); // if(pos>=0) { // name=name.left(pos); // pDoc->m_RightCurve->SetAliasName(name); // if(pDestObjectViewInfo)pDestObjectViewInfo->SetAliasName(name); // } // pDoc->m_RightCurve->SetShiftOffset(0.0); // pDoc->m_RightCurve->SetShiftTopDepth(-9999.0); // pDoc->m_RightCurve->SetShiftBottomDepth(-9999); // pWellSceneManager->UpdateObject(pDoc->m_RightCurve->GetID(),eUpdate_ViewInfo,NULL); // } // foreach(CObjWellLog *pLogt,pDoc->m_ShiftCurves) // { // pLogt->SetShiftOffset(0); // pLogt->SetShiftTopDepth(-9999.0); // pLogt->SetShiftBottomDepth(-9999.0); // QUuid objectID=pLogt->GetPaiObject()->GetID(); // CObjectViewInfo *pDestObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // QString nn=pLogt->GetAliasName(); // if(nn.isEmpty()&&pDestObjectViewInfo) { // nn=pDestObjectViewInfo->GetAliasName(); // if(nn.isEmpty()&&pDoc->m_LeftCurve) nn=pDoc->m_LeftCurve->GetName(); // } // int pos1=-1; // pos1=nn.indexOf("_从校"); // if(pos1<0) pos1=nn.indexOf("_主"); // if(pos1<0) pos1=nn.indexOf("_标"); // if(pos1<0){ // pos1=nn.indexOf("_从接"); // if(pos1<0) pos1=nn.indexOf("_源"); // if(pos1<0) pos1=nn.indexOf("_目"); // } // if(pos1>=0) nn=nn.left(pos1); // if (pos1>=0) // { // pLogt->SetAliasName(nn); // if(pDestObjectViewInfo) pDestObjectViewInfo->SetAliasName(nn); // } // pWellSceneManager->UpdateObject(pLogt->GetID(),eUpdate_ViewInfo,NULL); // } // pDoc->m_ShiftCurves.clear(); // pDoc->m_RightCurve=NULL; // pDoc->m_LeftCurve=NULL; // // slotClearShiftZonePoint(); // UpdateHUD(); // // pWellSceneManager->UpdateAllNonHUD(); // } // void CQtWindowWellSection::slotClearShiftCurve(CObjWellLog *pLogt) // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pLogt) // { // pLogt->SetShiftOffset(0); // pLogt->SetShiftTopDepth(-9999.0); // pLogt->SetShiftBottomDepth(-9999.0); // QUuid objectID=pLogt->GetPaiObject()->GetID(); // CObjectViewInfo *pDestObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // QString nn=pLogt->GetAliasName(); // if(nn.isEmpty()&&pDestObjectViewInfo) { // nn=pDestObjectViewInfo->GetAliasName(); // if(nn.isEmpty()&&pDoc->m_LeftCurve) nn=pDoc->m_LeftCurve->GetName(); // } // int pos1=-1; // pos1=nn.indexOf("_从校"); // if(pos1<0) pos1=nn.indexOf("_主"); // if(pos1<0) pos1=nn.indexOf("_标"); // if(pos1<0){ // pos1=nn.indexOf("_从接"); // if(pos1<0) pos1=nn.indexOf("_源"); // if(pos1<0) pos1=nn.indexOf("_目"); // } // if(pos1>=0) nn=nn.left(pos1); // pLogt->SetAliasName(nn); // if(pDestObjectViewInfo)pDestObjectViewInfo->SetAliasName(nn); // pWellSceneManager->UpdateObject(pLogt->GetID(),eUpdate_ViewInfo,NULL); // } // int i=pDoc->m_ShiftCurves.indexOf(pLogt); // if(i>-1) pDoc->m_ShiftCurves.removeAt(i); // UpdateHUD(); // } // void CQtWindowWellSection::slotClearShiftCurves(int type) // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // foreach(CObjWellLog *pLogt,pDoc->m_ShiftCurves) // { // pLogt->SetShiftOffset(0); // pLogt->SetShiftTopDepth(-9999.0); // pLogt->SetShiftBottomDepth(-9999.0); // QUuid objectID=pLogt->GetPaiObject()->GetID(); // CObjectViewInfo *pDestObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // QString nn=pLogt->GetAliasName(); // if(nn.isEmpty()&&pDestObjectViewInfo) { // nn=pDestObjectViewInfo->GetAliasName(); // if(nn.isEmpty()&&pDoc->m_LeftCurve) nn=pDoc->m_LeftCurve->GetName(); // } // int pos1=-1; // pos1=nn.indexOf("_从校"); // if(pos1<0) pos1=nn.indexOf("_主"); // if(pos1<0) pos1=nn.indexOf("_标"); // if(pos1<0){ // pos1=nn.indexOf("_从接"); // if(pos1<0) pos1=nn.indexOf("_源"); // if(pos1<0) pos1=nn.indexOf("_目"); // } // if(pos1>=0) nn=nn.left(pos1); // pLogt->SetAliasName(nn); // if(pDestObjectViewInfo)pDestObjectViewInfo->SetAliasName(nn); // pWellSceneManager->UpdateObject(pLogt->GetID(),eUpdate_ViewInfo,NULL); // } // pDoc->m_ShiftCurves.clear(); // UpdateHUD(); // } // void CQtWindowWellSection::slotSetOtherShiftCurve(int type) // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(!pDoc) return; // CBaseObject *pCurrentObject = CObjProject::GetObjectByID( pWellSceneManager->GetCurrentPickObjectID() ); // CObjWellLog *pLog = dynamic_cast( pCurrentObject ); // if(!pLog) return; // PaiObject *pPai=pLog->GetParent(); // if(!pPai) return; // pPai=pPai->GetParent(); // if(!pPai) return; // CObjWellTrack *pWellTrack=dynamic_cast(pPai); // if(!pWellTrack) return; // QListtemp_ss=pDoc->m_ShiftCurves; // QList names; // if(pDoc->m_RightCurve) { // names.append(pDoc->m_RightCurve); // } // if(pDoc->m_LeftCurve) { // names.append(pDoc->m_LeftCurve); // } // CObjWelllogRound*pRound=NULL; // if(type==1) { // if(!pDoc->m_LeftCurve) { // AfxMessageBox("请先选择目标曲线!"); // return; // } // pRound=pDoc->m_LeftCurve->GetWelllogRound(); // } // CchooseShiftCurvesDlg *pShiftCurvesDlg=new CchooseShiftCurvesDlg(pWellTrack,names,pRound); // pShiftCurvesDlg->Init(pDoc->m_ShiftCurves); // if(pShiftCurvesDlg->exec()==QDialog::Accepted) { // QListtemps; // for(int i=0;im_ShiftCurves.size();i++) { // CObjWellLog *pLog = dynamic_cast(pDoc->m_ShiftCurves[i]); // if(pLog) { // if(pDoc->m_RightCurve) { // QString slf=pLog->GetSlfFileName(); // slf.replace("\\","/"); // QString slf1=pDoc->m_RightCurve->GetSlfFileName(); // slf1.replace("\\","/"); // if(slf1.compare(slf,Qt::CaseInsensitive)==0){ // if(pDoc->m_RightCurve->GetName().compare(pLog->GetName(),Qt::CaseInsensitive)==0) { // temps.append(pLog); // continue; // } // } // } // if(pDoc->m_LeftCurve) { // QString slf=pLog->GetSlfFileName(); // slf.replace("\\","/"); // QString slf1=pDoc->m_LeftCurve->GetSlfFileName(); // slf1.replace("\\","/"); // if(slf1.compare(slf,Qt::CaseInsensitive)==0){ // if(pDoc->m_LeftCurve->GetName().compare(pLog->GetName(),Qt::CaseInsensitive)==0) { // temps.append(pLog); // continue; // } // } // } // QString name=pLog->GetAliasName(); // QUuid objectID=pLog->GetPaiObject()->GetID(); // if(m_pSceneManager->GetBuilder(objectID)) { // CObjectViewInfo *pObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // if(name.isEmpty()) { // if(pObjectViewInfo)name=pObjectViewInfo->GetAliasName(); // if(name.isEmpty()) name=pLog->GetName(); // } // int pos=-1; // if(type==0) { // pos=name.indexOf("_主"); // if(pos<0) { // pos=name.indexOf("_标"); // if(pos<1)pos=name.indexOf("_从校");// // } // if(pos<0){//当前曲线为从曲线 // name=name+"_从校"; // pLog->SetAliasName(name); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name); // } // } // else { // pos=name.indexOf("_源"); // if(pos<0) { // pos=name.indexOf("_目"); // if(pos<1)pos=name.indexOf("_从接");// // } // if(pos<0){//当前曲线为从曲线 // name=name+"_从接"; // pLog->SetAliasName(name); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name); // } // } // } // } // } // for(int j=0;jm_ShiftCurves.removeOne(temps[j]); // for(int k=0;km_ShiftCurves.size();k++) { // for(int j=0;jm_ShiftCurves.indexOf(temp_ss[j])>-1) temp_ss.removeAt(j); // } // } // UpdateHUD(); // if(pWellSceneManager) { // for(int j=0;jGetAliasName(); // QUuid objectID=pLog->GetPaiObject()->GetID(); // int pos=name.indexOf("_主"); // if(pos<0) { // pos=name.indexOf("_标"); // if(pos<1)pos=name.indexOf("_从校");// // } // if(pos<0)pos=name.indexOf("_源"); // if(pos<0) { // pos=name.indexOf("_目"); // if(pos<1)pos=name.indexOf("_从接");// // } // if(pos>=0){//当前曲线为从曲线 // name=name.left(pos); // pLog->SetAliasName(name); // if(m_pSceneManager->GetBuilder(objectID)) { // CObjectViewInfo *pObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name); // } // pWellSceneManager->UpdateObject(pLog->GetID(),eUpdate_ViewInfo,NULL); // } // } // for(int i=0;im_ShiftCurves.size();i++) { // pWellSceneManager->UpdateObject(pDoc->m_ShiftCurves[i]->GetID(),eUpdate_ViewInfo,NULL); // } // } // delete pShiftCurvesDlg; // } // } // void CQtWindowWellSection::slotClearStandardShift() // { // slotClearStandardShift(0); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // pDoc->m_isShift=-1; // } // } // void CQtWindowWellSection::slotClearShiftCurves() // { // slotClearShiftCurves(0); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // if(!pDoc->m_LeftCurve&&!pDoc->m_RightCurve&&!pDoc->m_ShiftCurves.size()) pDoc->m_isShift=-1; // } // } // void CQtWindowWellSection::slotClearStandardMeg() // { // slotClearStandardShift(1); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // pDoc->m_isShift=-1; // } // } // void CQtWindowWellSection::slotClearMegCurves() // { // slotClearShiftCurves(1); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // if(pDoc) { // if(!pDoc->m_LeftCurve&&!pDoc->m_RightCurve&&!pDoc->m_ShiftCurves.size()) pDoc->m_isShift=-1; // } // } // void CQtWindowWellSection::slotSetShiftCurve(int type) // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // CBaseObject *pCurrentObject = CObjProject::GetObjectByID( pWellSceneManager->GetCurrentPickObjectID() ); // CObjWellLog *pLog = dynamic_cast( pCurrentObject ); // if(pLog) { // QString name=pLog->GetAliasName(); // QUuid objectID=pLog->GetPaiObject()->GetID(); // CObjectViewInfo *pObjectViewInfo = dynamic_cast(m_pSceneManager->GetViewInfo( objectID )); // if(name.isEmpty()) { // if(pObjectViewInfo)name=pObjectViewInfo->GetAliasName(); // if(name.isEmpty()) name=pLog->GetName(); // } // int pos=-1; // if(type==0) pos=name.indexOf("_主"); // else pos=name.indexOf("_源"); // if(pos<0) { // int pos1=-1; // if(type==0) pos1=name.indexOf("_标"); // else pos1=name.indexOf("_目"); // if(pos1>=0) name=name.left(pos1);//当前曲线为主曲线 // else { // pos1=-1; // if(type==0)pos1=name.indexOf("_从校");// // else pos1=name.indexOf("_从接");// // if(pos1>=0){//当前曲线为从曲线 // name=name.left(pos1); // pDoc->m_ShiftCurves.removeOne(pLog); // pLog->SetAliasName(name); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name); // UpdateHUD(); // if(pWellSceneManager)pWellSceneManager->UpdateObject(pLog->GetID(),eUpdate_ViewInfo,NULL); // return; // } // } // if(pDoc->m_RightCurve&&pLog!=pDoc->m_RightCurve) {//主曲线已存在 // //设置为从曲线 // if(type==0) { // pLog->SetAliasName(name+"_从校"); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name+"_从校"); // } // else { // pLog->SetAliasName(name+"_从接"); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name+"_从接"); // } // if(!pDoc->m_ShiftCurves.contains(pLog)) // pDoc->m_ShiftCurves.append(pLog); // } // else {//设置为主曲线 // if(type==0) { // pLog->SetAliasName(name+"_主"); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name+"_主"); // } // else { // pLog->SetAliasName(name+"_源)"); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name+"_源"); // } // pDoc->m_RightCurve=pLog; // } // } // else {//清除主曲线 // name=name.left(pos); // pLog->SetAliasName(name); // if(pObjectViewInfo)pObjectViewInfo->SetAliasName(name); // if(pDoc->m_RightCurve){ // pDoc->m_RightCurve->SetShiftOffset(0.0); // pDoc->m_RightCurve->SetShiftTopDepth(-9999.0); // pDoc->m_RightCurve->SetShiftBottomDepth(-9999); // } // pDoc->m_RightCurve=NULL; // } // UpdateHUD(); // if(pWellSceneManager)pWellSceneManager->UpdateObject(pLog->GetID(),eUpdate_ViewInfo,NULL); // } // } // void CQtWindowWellSection::slotExecuteDepthAutoComp() // { // CWellSectionWindowDocument* pDoc = dynamic_cast(GetSceneManager()->GetDocument()); // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // static float cmins=0.9; // static float winLength=4; // static float stepLength=2; // static float searchLength=4; // static float stdep=-9999; // static float endep=-9999; // CObjWellLog *plog1=pDoc->m_LeftCurve; // if(!plog1) { // AfxMessageBox("请先选择标准曲线!"); // return; // } // CObjWellLogTrack*pLogTrack1=dynamic_cast(plog1->GetParent()); // if(!pLogTrack1) { // QObject *p=plog1->GetParent(); // AfxMessageBox(plog1->GetName()+"某种原因不能作为标准曲线,请重新设置标准曲线!"); // return; // } // CObjWellTrack*pWellTrack1=NULL; // if(pLogTrack1) { // pWellTrack1 = pLogTrack1->GetWellTrack(); // } // CVecNodeBuilder *pLogNode1 = dynamic_cast( GetSceneManager()->GetBuilder( plog1->GetID() ) ); // if(!pLogNode1) { // AfxMessageBox(plog1->GetName()+"某种原因不能作为校正曲线,请重新设置校深曲线!"); // return; // } // CObjWellLog *plog2=pDoc->m_RightCurve; // if(!plog2) { // AfxMessageBox("请先选择校正曲线!"); // return; // } // CObjWellLogTrack*pLogTrack2=dynamic_cast(plog2->GetParent()); // if(!pLogTrack2) { // QObject *p=plog2->GetParent(); // AfxMessageBox(plog2->GetName()+"某种原因不能作为校正曲线,请重新设置校深曲线!"); // return; // } // CObjWellTrack*pWellTrack2=NULL; // if(pLogTrack2) { // pWellTrack2 = pLogTrack2->GetWellTrack(); // } // CVecNodeBuilder *pLogNode2 = dynamic_cast( GetSceneManager()->GetBuilder( plog2->GetID() ) ); // if(!pLogNode2) { // AfxMessageBox(plog2->GetName()+"某种原因不能作为校正曲线,请重新设置校深曲线!"); // return; // } // QDialog dialog(NULL); // dialog.setModal(false); // Qt::WindowFlags flags = dialog.windowFlags(); // flags |= Qt::WindowStaysOnTopHint; // flags &= ~Qt::WindowContextHelpButtonHint; // dialog.setWindowFlags(flags); // dialog.setWindowTitle("自动对比参数"); // QFormLayout form(&dialog); // form.addRow(new QLabel("输入窗长:")); // // Value1 // QString value1 = QString("窗长: "); // QLineEdit *spinbox1 = new QLineEdit(&dialog); // spinbox1->setText(toString(winLength)); // form.addRow(value1, spinbox1); // value1 = QString("步长: "); // QLineEdit *spinbox2 = new QLineEdit(&dialog); // form.addRow(value1, spinbox2); // spinbox2->setText(toString(stepLength)); // value1 = QString("搜索长度: "); // QLineEdit *spinbox3 = new QLineEdit(&dialog); // form.addRow(value1, spinbox3); // spinbox3->setText(toString(searchLength)); // value1 = QString("最小相关系数: "); // QLineEdit *spinbox4 = new QLineEdit(&dialog); // form.addRow(value1, spinbox4); // spinbox4->setText(toString(cmins)); // value1 = QString("起始深度: "); // QLineEdit *spinbox5 = new QLineEdit(&dialog); // form.addRow(value1, spinbox5); // spinbox5->setText(toString(stdep)); // value1 = QString("终止深度: "); // QLineEdit *spinbox6 = new QLineEdit(&dialog); // form.addRow(value1, spinbox6); // spinbox6->setText(toString(endep)); // QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, // Qt::Horizontal, &dialog); // form.addWidget(&buttonBox); // QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); // QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); // dialog.show(); // if (dialog.exec() == QDialog::Accepted) { // // Do something here // } // else return; // winLength=spinbox1->text().toFloat(); // stepLength=spinbox2->text().toFloat(); // searchLength=spinbox3->text().toFloat(); // cmins=spinbox4->text().toFloat(); // stdep=spinbox5->text().toFloat(); // endep=spinbox6->text().toFloat(); // QString Filename=plog1->GetSlfFileName(); // if(Filename=="") return; // QString AC=plog1->GetName(); // QString Filename1=plog2->GetSlfFileName(); // QString AC1=plog2->GetName(); // QLibrary Methodlib; // QString PeModulePath=QCoreApplication::applicationDirPath() + QDir::separator() +"DepPairs.dll"; // Methodlib.setFileName(PeModulePath); // Methodlib.load(); // typedef int (* LPFNDLLFUNC1)(char *Filename,char *Filename1,char *CurveName1,char *CurveName2, // float cmins, // float winLength,float stepLength, float searchLength, // float *FirstDep, // float *SecondDep, // float *corc); // LPFNDLLFUNC1 AutoCompute; // QString funname1="AutoComp"; // AutoCompute = (LPFNDLLFUNC1)(Methodlib.resolve(funname1.toStdString().c_str()));//strDLLFun.toStdString().c_str()) // if(!AutoCompute) { // AppendConsole(pai::log::PAI_ERROR,"GetDepPairs.dll或GetDepPairs.so不存在!"); // Methodlib.unload(); // return; // } // float* FirstDep=new float[5000]; // float* SecondDep=new float[5000]; // float* corc=new float[5000]; // *FirstDep=stdep; // *SecondDep=endep; // int num=AutoCompute((char *)Filename.toStdString().c_str(),(char *)Filename1.toStdString().c_str(),(char *)AC.toStdString().c_str(),(char *)AC1.toStdString().c_str(), // cmins, // winLength, // stepLength, // searchLength, // FirstDep, // SecondDep, // corc // ); // Methodlib.unload(); // pDoc->pLine=NULL; // slotClearShiftZonePoint(); // QRectF lineRangeRect = getLineRangeRectOSGGLobal(pWellTrack1); // pDoc->m_mergeLineList.resize(num); // QVector vecPoints; // vecPoints.resize(2); // ::GetProgressBar()->setVisible(true); // ::GetProgressBar()->setRange(0,num); // ::GetProgressBarHint()->setVisible(true); // ::GetProgressBarHint()->setText("开始绘制对比线..."); // QApplication::processEvents(); // for(int i=0;isetValue(i); // CurveLine * pLine = new CurveLine(); // pLine->Init(2,osg::Vec4f(0,0,1,1),SOLIDLINE ); // pLine->SetLeftDepth(FirstDep[i]); // pLine->SetRightDepth(SecondDep[i]); // QPointF leftpoint=pLogNode1->GetOSGPixelPoint(FirstDep[i],0.0f); // QPointF rightpoint=pLogNode2->GetOSGPixelPoint(SecondDep[i],0.0f); // vecPoints[0]=leftpoint; // vecPoints[1]=rightpoint; // pLine->SetPoints(vecPoints); // pLine->setParentItem(pWellSceneManager->GetRootHUDTopLayer());//m_pQuad); // pDoc->m_mergeLineList[i]=pLine; // } // ::GetProgressBar()->setVisible(false); // ::GetProgressBarHint()->setVisible(false); // QApplication::processEvents(); // delete FirstDep; // delete SecondDep; // delete corc; // qsort(pDoc->m_mergeLineList,0,pDoc->m_mergeLineList.size()-1,0); // if(num>0) { // CString szBuffer=""; // CString szBuffer1=""; // for(int i=0;im_mergeLineList[i]->GetLeftDepth(); // float edep=pDoc->m_mergeLineList[i]->GetRightDepth(); // szBuffer1.Format("%g %g\r\n",sdep,edep); // szBuffer+=szBuffer1; // } // CMemRdWt mem; // if(mem.Open(pDoc->m_RightCurve->GetSlfFileName().toStdString().c_str())) // { // WriteShiftMessage(mem,szBuffer,"Create depths Pairs:","depth_inp"); // } // } // UpdateHUD(); // } // void CQtWindowWellSection::SetCLLDepthShift() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument* pDoc = dynamic_cast(GetSceneManager()->GetDocument()); // QString jiegu="READCCL"; // CLogIO mem; // if(!mem.Open(pDoc->m_RightCurve->GetSlfFileName().toStdString().c_str(),CSlfIO::modeRead)) // { // AfxMessageBox(pDoc->m_RightCurve->GetSlfFileName()+"不存在!"); // return; // } // int index=mem.OpenTable(jiegu.toStdString().c_str()); // if(index<0) { // AfxMessageBox(jiegu+"接箍表不存在!"); // return; // } // int count=mem.GetTableRecordCount(index); // if(!count){ // AfxMessageBox(jiegu+"表记录为空!"); // return; // } // int m_nDepPairsNum=pDoc->m_mergeLineList.size(); // if(m_nDepPairsNum<1) { // AfxMessageBox("请先生成深度对比线!"); // return; // } // jiegunum=count; // if(jiegudtat) delete jiegudtat; // if(jiegudtatshift) delete jiegudtatshift; // jiegudtat=new struct jiegutable_struct[count]; // jiegudtatshift=new struct jiegutable_struct[count]; // if(pairno) delete pairno; // pairno=new int[count]; // float* FirstDep=new float[m_nDepPairsNum+1]; // float* SecondDep=new float[m_nDepPairsNum+1]; // for(int i=0;im_mergeLineList[i]->GetLeftDepth(); // float edep=pDoc->m_mergeLineList[i]->GetRightDepth(); // FirstDep[i]=sdep; // SecondDep[i]=edep; // } // for(int i=0;iFirstDep[j+1]) continue; // jiegudtatshift[i].sdep=SecondDep[j]+(SecondDep[j+1]-SecondDep[j])/(FirstDep[j+1]-FirstDep[j])*(Depth-FirstDep[j]); // pairno[i]=j; // break; // } // } // mem.Close(); // pTDialog->clear(); // QString cs="序号 原接箍点1 校后接箍点1 校后长度 原长度 目标起-止深度\n"; // pTDialog->verticalScrollBar()->setValue(pTDialog->verticalScrollBar()->maximum()); // pTDialog->insertPlainText(cs); // if(thicks) delete thicks; // thicks=new float[count+1]; // if(count)thicks[0]=0; // if(record) delete record; // record=new int[count+1]; // recordnum=0; // char buf[500]; // for(int i=0;i=0.01&&thick>0) { // pTDialog->setTextColor(Qt::red); // record[recordnum]=pairno[i]; // recordnum++; // } // else if(fabsf(thick)-0.2>=0.01&&thick<0) { // pTDialog->setTextColor(Qt::blue); // record[recordnum]=pairno[i]; // recordnum++; // } // else pTDialog->setTextColor(QColor(0,0,0)); // pTDialog->verticalScrollBar()->setValue(pTDialog->verticalScrollBar()->maximum()); // pTDialog->insertPlainText(buf); // } // delete []FirstDep; // delete []SecondDep; // } // void CQtWindowWellSection::slotCheckCCLDepthShift() // { // QString jiegu="READCCL"; // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument* pDoc = dynamic_cast(GetSceneManager()->GetDocument()); // if(!pDoc->m_RightCurve) { // AfxMessageBox("没有设置校正曲线,请设置!"); // return; // } // CLogIO mem; // if(!mem.Open(pDoc->m_RightCurve->GetSlfFileName().toStdString().c_str(),CSlfIO::modeRead)) // { // AfxMessageBox(pDoc->m_RightCurve->GetSlfFileName()+"不存在!"); // return; // } // int index=mem.OpenTable(jiegu.toStdString().c_str()); // if(index<0) { // AfxMessageBox(jiegu+"接箍表不存在!"); // return; // } // int count=mem.GetTableRecordCount(index); // if(!count){ // AfxMessageBox(jiegu+"表记录为空!"); // return; // } // int m_nDepPairsNum=pDoc->m_mergeLineList.size(); // if(m_nDepPairsNum<1) { // AfxMessageBox("请先生成深度对比线!"); // return; // } // mem.Close(); // QDialog dialog(NULL); // dialog.setModal(false); // Qt::WindowFlags flags = dialog.windowFlags(); // flags |= Qt::WindowStaysOnTopHint; // flags &= ~Qt::WindowContextHelpButtonHint; // dialog.setWindowFlags(flags); // dialog.setWindowTitle("异常接箍位置表"); // QVBoxLayout form(&dialog); // pTDialog = new QTextEdit();//&dialog); // QSizePolicy policy = dialog.sizePolicy(); // policy.setVerticalPolicy(QSizePolicy::Expanding); // pTDialog->setSizePolicy(policy); // QSizePolicy dialogpolicy = pTDialog->sizePolicy(); // policy.setVerticalPolicy(QSizePolicy::Expanding); // dialog.setSizePolicy(dialogpolicy); // form.addWidget(pTDialog); // form.setSpacing(10); // form.setMargin(10); // SetCLLDepthShift(); // QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel|QDialogButtonBox::YesToAll|QDialogButtonBox::Yes, // Qt::Horizontal, &dialog); // form.addWidget(&buttonBox); // buttonBox.button(QDialogButtonBox::Ok)->setText("自动均分误差"); // buttonBox.button(QDialogButtonBox::Cancel)->setText("人工处理"); // buttonBox.button(QDialogButtonBox::YesToAll)->setText("删除全部偏差校正线"); // buttonBox.button(QDialogButtonBox::Yes)->setText("重新检测"); // QObject::connect(buttonBox.button(QDialogButtonBox::Yes), SIGNAL(clicked()), this, SLOT(slotJieguReFresh())); // QObject::connect(buttonBox.button(QDialogButtonBox::YesToAll), SIGNAL(clicked()), this, SLOT(slotJieguChangeRun())); // QObject::connect(buttonBox.button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(slotJieguChangeOK())); // QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); // dialog.show(); // dialog.exec(); // pTDialog=NULL; // if(thicks) delete []thicks; // thicks=NULL; // if(jiegudtatshift)delete jiegudtatshift; // jiegudtatshift=NULL; // if(jiegudtat)delete jiegudtat; // jiegudtat=NULL; // if(pairno) delete pairno; // pairno=NULL; // if(record)delete record; // record=NULL; // recordnum=0; // } // void CQtWindowWellSection::slotJieguReFresh() // { // SetCLLDepthShift(); // } // void CQtWindowWellSection::slotJieguChangeOK() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument* pDoc = dynamic_cast(GetSceneManager()->GetDocument()); // if(!pDoc) return; // int m_nDepPairsNum=pDoc->m_mergeLineList.size(); // float* FirstDep=new float[m_nDepPairsNum+1]; // float* SecondDep=new float[m_nDepPairsNum+1]; // for(int i=0;im_mergeLineList[i]->GetLeftDepth(); // float edep=pDoc->m_mergeLineList[i]->GetRightDepth(); // FirstDep[i]=sdep; // SecondDep[i]=edep; // } // int j=0; // int *no=new int[jiegunum]; // memset(no,0,sizeof(int)*jiegunum); // for(int i=0;i=0.01) { // no[j]=i; // j++; // } // else { // if(j==1) { // j=pairno[no[0]]; // if(thicks[no[0]]<0) { // int flg=0; // if(pairno[no[0]-1]==j-1) { // if(thicks[no[0]-1]>=0.1) { // SecondDep[j]-=(-thicks[no[0]]+thicks[no[0]-1])/2; // flg=1; // } // } // if(!flg)SecondDep[j]-=thicks[no[0]]/2; // float Depth=jiegudtat[i].sdep; // // SecondDep[j]=SecondDep[j+1]+(FirstDep[j]-FirstDep[j+1])*(Depth-0.2-SecondDep[j+1])/(Depth-FirstDep[j+1]); // } // else { // if(SecondDep[j+1]0) { // SecondDep[pairno[abs(no[0])]]+=thicks[abs(no[0])]/2; // SecondDep[pairno[abs(no[1])]+1]-=thicks[abs(no[1])]/2; // } // else if(thicks[0]*thicks[1]<0) { // SecondDep[pairno[abs(no[1])]]-=thicks[abs(no[1])]/2; // } // } // j=0; // } // } // delete []no; // CVecNodeBuilder *pLogNode1 = dynamic_cast( GetSceneManager()->GetBuilder( pDoc->m_LeftCurve->GetID() ) ); // CVecNodeBuilder *pLogNode2 = dynamic_cast( GetSceneManager()->GetBuilder( pDoc->m_RightCurve->GetID() ) ); // CObjWellLogTrack*pLogTrack1=dynamic_cast(pDoc->m_LeftCurve->GetParent()); // CObjWellTrack*pWellTrack1=NULL; // if(pLogTrack1&&pLogNode1&&pLogNode2) { // pWellTrack1 = pLogTrack1->GetWellTrack(); // pDoc->pLine=NULL; // slotClearShiftZonePoint(); // QRectF lineRangeRect = getLineRangeRectOSGGLobal(pWellTrack1); // pDoc->m_mergeLineList.resize(m_nDepPairsNum); // for(int i=0;iInit(2,osg::Vec4f(0,0,1,1),SOLIDLINE ); // pLine->SetLeftDepth(FirstDep[i]); // pLine->SetRightDepth(SecondDep[i]); // QVector vecPoints; // QPointF leftpoint=pLogNode1->GetOSGPixelPoint(FirstDep[i],0.0f); // QPointF rightpoint=pLogNode2->GetOSGPixelPoint(SecondDep[i],0.0f); // vecPoints << leftpoint <SetPoints(vecPoints); // pLine->setParentItem(pWellSceneManager->GetRootHUDTopLayer());//m_pQuad); // pDoc->m_mergeLineList[i]=pLine; // } // qsort(pDoc->m_mergeLineList,0,pDoc->m_mergeLineList.size()-1,0); // UpdateHUD(); // } // // AfxMessageBox("修正完成!"); // SetCLLDepthShift(); // } // void CQtWindowWellSection::slotJieguChangeRun() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument* pDoc = dynamic_cast(GetSceneManager()->GetDocument()); // if(!pDoc) return; // for(int i=recordnum-1;i>=0;i--) // { // CurveLine*pLine=pDoc->m_mergeLineList.at(record[i]); // if(pLine) { // pLine->setParentItem(NULL); // delete pLine; // } // pDoc->m_mergeLineList.remove(record[i]); // } // delete record; // record=NULL; // recordnum=0; // UpdateHUD(); // SetCLLDepthShift(); // // AfxMessageBox("删除完成!"); // } // void CQtWindowWellSection::slotExecuteDepthShifting() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument* pDoc = dynamic_cast(GetSceneManager()->GetDocument()); // if(!pDoc->m_RightCurve) { // AfxMessageBox("没有设置校正曲线,请设置!"); // return; // } // int itemCount =pDoc->m_mergeLineList.size() ; // int m_nDepPairsNum=itemCount; // QList m_ShiftCurves; // if(pDoc->m_RightCurve) { // m_ShiftCurves.append(pDoc->m_RightCurve); // } // else { // CBaseObject *pCurrentObject = CObjProject::GetObjectByID(pWellSceneManager->GetCurrentPickObjectID()); // CObjWellLog *pLog = dynamic_cast( pCurrentObject ); // if(pLog&&pLog->GetShiftOffset()) { // m_ShiftCurves.append(pLog); // } // } // m_ShiftCurves.append(pDoc->m_ShiftCurves); // if(m_ShiftCurves.size()<1) return; // QList names; // QListlogs; // foreach(CObjWellLog *pLogt,m_ShiftCurves) // { // if(!pLogt) continue; // QString slf=pLogt->GetSlfFileName()+pLogt->GetName(); // slf.replace("\\","/"); // if(names.indexOf(slf,0)>-1) continue; // names.append(slf); // logs.append(pLogt); // } // m_ShiftCurves=logs; // logs.clear(); // qsort(pDoc->m_mergeLineList,0,m_nDepPairsNum-1,0); // if(itemCount==1) { // int flag = QMessageBox::information(NULL,"确认","确认要执行深度平移校正吗?",QMessageBox::Yes,QMessageBox::No); // if(flag==QMessageBox::No) return; // for(int i=0;iGetTopDepth(); // lay.bottom=pLog->GetBottomDepth(); // pLog->m_ChangeNo=0; // pLog->m_vLayers.clear(); // pLog->m_vLayers.push_back(lay); // logs.append(pLog); // } // CDrawCurveCommand * pDrawCurveCommand = new CDrawCurveCommand(GetSceneManager(),logs); // GetSceneManager()->GetUndoStack()->push(pDrawCurveCommand); // float m_MoveDep=pDoc->m_mergeLineList[0]->GetLeftDepth()-pDoc->m_mergeLineList[0]->GetRightDepth(); // for(int i=0;iGetSlfFileName(); // CMemRdWt mem; // char showname[200]; // if(mem.Open(Filename1.toStdString().c_str())) { // QString curve=m_ShiftCurves[i]->GetName(); // sprintf(showname,"正在校正%s...",curve.toStdString().c_str()); // int iIndex=mem.FindObjectName((char *)curve.toStdString().c_str()); // if (iIndex >= 0) // { // CString szBuffer=""; // szBuffer=QString::number(m_MoveDep,'f',3)+"\r\n"; // WriteShiftMessage(mem,szBuffer,curve); // mem.CorrectObjectDepth(iIndex,m_MoveDep); // mem.Close(); // plog2->isLoad=false; // plog2->LoadFromSLF(); // } // else { // mem.Close(); // plog2->SetShiftOffset(0.0); // plog2->SetShiftBottomDepth(-9999.0); // plog2->SetShiftTopDepth(-9999.0); // plog2->MoveShift(plog2->GetTopDepth(),plog2->GetBottomDepth(),m_MoveDep); // } // } // } // if(pDoc->m_RightCurve) { // pDoc->m_RightCurve->SetShiftOffset(0.0); // pDoc->m_RightCurve->SetShiftBottomDepth(-9999.0); // pDoc->m_RightCurve->SetShiftTopDepth(-9999.0); // pDoc->m_RightCurve->isLoad=false; // pDoc->m_RightCurve->LoadFromSLF(); // } // pDoc->pLine=NULL; // pDrawCurveCommand->SetXValue(); // for(int i=0;im_vLayers.clear(); // } // m_pSceneManager->SetDirtyUIElement(true,true); // CVecViewCommand &viewCommand = m_pSceneManager->GetViewCommand(); // QAction *pUndoAction = viewCommand.GetAction(GetCmdID_UndoCommand()); // pUndoAction->setEnabled(m_pSceneManager->GetUndoStack()->canUndo()); // QAction *pRedoAction = viewCommand.GetAction(GetCmdID_RedoCommand()); // pRedoAction->setEnabled(m_pSceneManager->GetUndoStack()->canRedo()); // return; // } // else if(itemCount==3) { // QMessageBox box(QMessageBox::Warning,"确认","选择校深方式:"); // box.setStandardButtons (QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel); // box.setButtonText(QMessageBox::Yes,QString("压缩拉伸")); // box.setButtonText (QMessageBox::No,QString("平移")); // box.setButtonText (QMessageBox::Cancel,QString("放弃")); // int ret=box.exec(); // if(ret==QMessageBox::Cancel) return; // if(ret==QMessageBox::No) { // QListlogs; // for(int i=0;iGetTopDepth(); // lay.bottom=pLog->GetBottomDepth(); // pLog->m_ChangeNo=0; // pLog->m_vLayers.clear(); // pLog->m_vLayers.push_back(lay); // logs.append(pLog); // } // CDrawCurveCommand * pDrawCurveCommand = new CDrawCurveCommand(GetSceneManager(),logs); // GetSceneManager()->GetUndoStack()->push(pDrawCurveCommand); // float sdep=pDoc->m_mergeLineList[0]->GetLeftDepth(); // float edep=pDoc->m_mergeLineList[2]->GetLeftDepth(); // float m_MoveDep=pDoc->m_mergeLineList[1]->GetLeftDepth()-pDoc->m_mergeLineList[1]->GetRightDepth(); // for(int i=0;iGetSlfFileName(); // CMemRdWt mem; // char showname[200]; // if(mem.Open(Filename1.toStdString().c_str())) { // QString curve=m_ShiftCurves[i]->GetName(); // sprintf(showname,"正在校正%s...",curve.toStdString().c_str()); // int iIndex=mem.OpenChannel(curve.toStdString().c_str()); // if (iIndex >= 0) // { // Slf_CHANNEL mc; // mem.GetChannelInfo(iIndex,&mc); // if(m_MoveDep) { // CString szBuffer=""; // szBuffer.Format("%10.3f %10.3f %10.3f\r\n"); // WriteShiftMessage(mem,szBuffer,curve); // } // } // mem.Close(); // plog2->SetShiftOffset(0.0); // plog2->SetShiftBottomDepth(-9999.0); // plog2->SetShiftTopDepth(-9999.0); // plog2->MoveShift(sdep,edep,m_MoveDep); // } // } // if(pDoc->m_RightCurve) { // pDoc->m_RightCurve->SetShiftOffset(0.0); // pDoc->m_RightCurve->SetShiftBottomDepth(-9999); // pDoc->m_RightCurve->SetShiftTopDepth(-9999); // pDoc->m_RightCurve->isLoad=false; // pDoc->m_RightCurve->LoadFromSLF(); // } // pDoc->pLine=NULL; // pDrawCurveCommand->SetXValue(); // for(int i=0;im_vLayers.clear(); // } // m_pSceneManager->SetDirtyUIElement(true,true); // CVecViewCommand &viewCommand = m_pSceneManager->GetViewCommand(); // QAction *pUndoAction = viewCommand.GetAction(GetCmdID_UndoCommand()); // pUndoAction->setEnabled(m_pSceneManager->GetUndoStack()->canUndo()); // QAction *pRedoAction = viewCommand.GetAction(GetCmdID_RedoCommand()); // pRedoAction->setEnabled(m_pSceneManager->GetUndoStack()->canRedo()); // return; // } // } // else { // if(m_nDepPairsNum<1&&pDoc->m_RightCurve->GetShiftOffset()==0) // { // AfxMessageBox("无校正深度线或深度移动量!"); // return; // } // int flag = QMessageBox::information(NULL,"确认","确认要执行深度校正吗?",QMessageBox::Yes,QMessageBox::No); // if(flag != QMessageBox::Yes) return; // } // for(int i=0;iGetTopDepth(); // lay.bottom=pLog->GetBottomDepth(); // pLog->m_ChangeNo=0; // pLog->m_vLayers.clear(); // pLog->m_vLayers.push_back(lay); // logs.append(pLog); // } // CDrawCurveCommand * pDrawCurveCommand = new CDrawCurveCommand(GetSceneManager(),logs); // GetSceneManager()->GetUndoStack()->push(pDrawCurveCommand); // DepthProgress MyDepthProgress; // MyDepthProgress.CreatProgress(0,m_ShiftCurves.size(),"开始校正..."); // float m_MoveDep=pDoc->m_RightCurve->GetShiftOffset(); // CString szBuffer=""; // if(m_nDepPairsNum>0) { // CString szBuffer1=""; // for(int i=0;im_mergeLineList[i]->GetLeftDepth(); // float edep=pDoc->m_mergeLineList[i]->GetRightDepth()+m_MoveDep; // szBuffer1.Format("%g %g\r\n",sdep,edep); // szBuffer+=szBuffer1; // } // } // else if(m_MoveDep) { // szBuffer=QString::number(-m_MoveDep,'f',3)+"\r\n"; // } // for(int i=0;iSetShiftOffset(0.0); // plog2->SetShiftBottomDepth(-9999.0); // plog2->SetShiftTopDepth(-9999.0); // QString curve=plog2->GetName(); // QString Filename1=plog2->GetSlfFileName(); // CMemRdWt mem; // char showname[200]; // sprintf(showname,"正在校正%s...",curve.toStdString().c_str()); // MyDepthProgress.SetShowName(showname); // MyDepthProgress.SetDepth(i+1); // if(mem.Open(Filename1.toStdString().c_str())) // { // int iIndex=mem.FindObjectName((char *)curve.toStdString().c_str()); // if (iIndex >= 0) { // WriteShiftMessage(mem,szBuffer,curve,"depth_inp"); // WriteShiftMessage(mem,szBuffer,curve); // if(m_MoveDep&&!m_nDepPairsNum) { // mem.CorrectObjectDepth(iIndex,-m_MoveDep); // } // else if(m_nDepPairsNum){ // mem.EShiftDepth((char *)curve.toStdString().c_str()); // } // } // mem.Close(); // } // } // MyDepthProgress.DelProgress(); // if(pDoc->m_RightCurve) { // pDoc->m_RightCurve->SetShiftOffset(0.0); // pDoc->m_RightCurve->SetShiftBottomDepth(-9999.0); // pDoc->m_RightCurve->SetShiftTopDepth(-9999.0); // } // pDoc->pLine=NULL; // /* // for(int i=0;iisLoad=true; // GetObjectEvent().OnDeAttchData(plog2->GetSlfFileName(),plog2->GetName()); // } // */ // for(int i=0;iisLoad=false; // plog2->LoadFromSLF(); // } // pDrawCurveCommand->SetXValue(); // for(int i=0;im_vLayers.clear(); // } // m_pSceneManager->SetDirtyUIElement(true,true); // CVecViewCommand &viewCommand = m_pSceneManager->GetViewCommand(); // QAction *pUndoAction = viewCommand.GetAction(GetCmdID_UndoCommand()); // pUndoAction->setEnabled(m_pSceneManager->GetUndoStack()->canUndo()); // QAction *pRedoAction = viewCommand.GetAction(GetCmdID_RedoCommand()); // pRedoAction->setEnabled(m_pSceneManager->GetUndoStack()->canRedo()); // } // void CQtWindowWellSection::slotDepthScrMerge() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // int pointnum=pDoc->m_mergeLineList.size(); // if(pointnum<1) { // AfxMessageBox("曲线拼接深度点不存在,无法拼接!\n请先设置拼接深度点。"); // return; // } // if(pointnum>2) { // AfxMessageBox("曲线拼接深度点太多,最多可设置2点!\n请重新设置拼接深度点。"); // return; // } // if(pDoc->m_LeftCurve&&pDoc->m_RightCurve) { // float SourSdep=0; // float SourEdep=0; // float DectSdep=0; // if(pointnum==1) { // QMessageBox box(QMessageBox::Warning,"提示","拼接深度点仅有1个,请您选择拼接部位"); // box.setStandardButtons (QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel); // box.setButtonText(QMessageBox::Yes,QString("拼接上段")); // box.setButtonText(QMessageBox::No,QString("拼接下段")); // box.setButtonText(QMessageBox::Cancel,QString("放弃")); // int flag=box.exec();//QMessageBox::information(NULL,"敬告",pwelllog->GetName()+mess,QMessageBox::Yes,QMessageBox::No,QMessageBox::Cancel); // if(flag==QMessageBox::Yes) { // pDoc->isScr=flag; // SourSdep=pDoc->m_RightCurve->GetTopDepth(); // SourEdep=pDoc->m_mergeLineList[0]->GetLeftDepth(); // DectSdep=SourSdep; // } // else if(flag==QMessageBox::No) { // pDoc->isScr=flag; // SourSdep=pDoc->m_mergeLineList[0]->GetLeftDepth(); // SourEdep=pDoc->m_RightCurve->GetBottomDepth(); // DectSdep=pDoc->m_mergeLineList[0]->GetLeftDepth(); // } // else return; // } // else if(pointnum==2) { // SourSdep=pDoc->m_mergeLineList[0]->GetLeftDepth()+pDoc->m_RightCurve->GetShiftOffset(); // SourEdep=pDoc->m_mergeLineList[1]->GetLeftDepth()+pDoc->m_RightCurve->GetShiftOffset(); // DectSdep=pDoc->m_mergeLineList[0]->GetLeftDepth(); // pDoc->isScr=1; // } // else { // pDoc->isScr=1; // } // QString name2=pDoc->m_RightCurve->GetName(); // QString name1=pDoc->m_LeftCurve->GetName(); // if(pDoc->m_RightCurve->m_Rlev==0) return; // int size=(SourEdep-SourSdep)/pDoc->m_RightCurve->m_Rlev+1.5; // LayerInfo lay; // lay.top=DectSdep; // lay.bottom=DectSdep+SourEdep-SourSdep; // PFLOATPROPERTY &vProperty = pDoc->m_RightCurve->GetProperty(); // PFLOATPROPERTY &vMD = pDoc->m_RightCurve->GetMD(); // if(vProperty.size()) { // size=vProperty.size(); // int size1=(SourEdep-SourSdep)/pDoc->m_LeftCurve->GetRlev()+1.5; // if(size1>0) { // lay.m_vXData.reserve(size1); // lay.rlev=pDoc->m_LeftCurve->GetRlev(); // float dep=0; // for(int i=0;im_LeftCurve->GetRlev(); // lay.m_vXData.push_back(pDoc->m_RightCurve->GetData(dep)); // } // pDoc->m_LeftCurve->m_vLayers.clear(); // pDoc->m_LeftCurve->m_ChangeNo=0; // pDoc->m_LeftCurve->m_vLayers.push_back(lay); // pDoc->m_LeftCurve->m_ChangeNo++; // } // } // pWellSceneManager->SetDirtyUIElement(true,true); // } // else if(!pDoc->m_LeftCurve&&!pDoc->m_RightCurve){ // AfxMessageBox("必须设置目标曲线和源曲线!"); // return; // } // else if(!pDoc->m_LeftCurve) // { // AfxMessageBox("必须设置目标曲线!"); // return; // } // else if(!pDoc->m_RightCurve) // { // AfxMessageBox("必须设置源曲线!"); // return; // } // } // void CQtWindowWellSection::slotDepthMerge() // { // CQtWellSceneManager *pWellSceneManager = dynamic_cast( GetSceneManager() ); // CWellSectionWindowDocument *pDoc = pWellSceneManager->GetWellSectionGeomtry().GetSecionWindowDocument(); // int pointnum=pDoc->m_mergeLineList.size(); // if(pointnum<1) { // AfxMessageBox("曲线拼接深度点不存在,无法拼接!\n请先设置拼接深度点。"); // return; // } // if(pointnum>2) { // AfxMessageBox("曲线拼接深度点太多,最多可设置2点!\n请重新设置拼接深度点。"); // return; // } // if(pDoc->m_LeftCurve&&pDoc->m_RightCurve) // { // float SourSdep=0; // float SourEdep=0; // float DectSdep=0; // if(pointnum==1) { // int flag=pDoc->isScr; // if(!pDoc->isScr) { // QMessageBox box(QMessageBox::Warning,"提示","拼接深度点仅有1个,请您选择拼接部位"); // box.setStandardButtons (QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel); // box.setButtonText(QMessageBox::Yes,QString("拼接上段")); // box.setButtonText(QMessageBox::No,QString("拼接下段")); // box.setButtonText(QMessageBox::Cancel,QString("放弃")); // flag=box.exec();//QMessageBox::information(NULL,"敬告",pwelllog->GetName()+mess,QMessageBox::Yes,QMessageBox::No,QMessageBox::Cancel); // } // pDoc->isScr=0; // if(flag==QMessageBox::Yes) { // SourSdep=pDoc->m_RightCurve->GetTopDepth(); // SourEdep=pDoc->m_mergeLineList[0]->GetLeftDepth(); // DectSdep=SourSdep; // } // else if(flag==QMessageBox::No) { // DectSdep=pDoc->m_mergeLineList[0]->GetLeftDepth(); // SourEdep=pDoc->m_RightCurve->GetBottomDepth(); // SourSdep=pDoc->m_mergeLineList[0]->GetRightDepth(); // } // else return; // } // else if(pointnum==2) { // SourSdep=pDoc->m_mergeLineList[0]->GetLeftDepth()+pDoc->m_RightCurve->GetShiftOffset(); // SourEdep=pDoc->m_mergeLineList[1]->GetLeftDepth()+pDoc->m_RightCurve->GetShiftOffset(); // DectSdep=pDoc->m_mergeLineList[0]->GetLeftDepth(); // } // QString name2=pDoc->m_RightCurve->GetName(); // QString name1=pDoc->m_LeftCurve->GetName(); // QList logs; // CObjWelllogRound* pround =pDoc->m_LeftCurve->GetWelllogRound(); // if(!pround) { // AfxMessageBox("无目标井!"); // return; // } // QListm_ShiftCurves; // m_ShiftCurves.push_back(pDoc->m_LeftCurve); // m_ShiftCurves.append(pDoc->m_ShiftCurves); // for(int i=0;i(m_ShiftCurves[i]); // if(!pLogs) continue; // LayerInfo lay; // lay.top=SourSdep; // lay.bottom=SourEdep; // pLogs->m_ChangeNo=0; // pLogs->m_vLayers.clear(); // pLogs->m_vLayers.push_back(lay); // logs.append(pLogs); // } // if(logs.size()<1) { // AfxMessageBox("缺少目标曲线或目标曲线无效!"); // return; // } // CDrawCurveCommand * pDrawCurveCommand = new CDrawCurveCommand(GetSceneManager(),logs); // GetSceneManager()->GetUndoStack()->push(pDrawCurveCommand); // int size=(SourEdep-SourSdep)/pDoc->m_LeftCurve->m_Rlev+1.5; // QString filename2=pDoc->m_RightCurve->GetSlfFileName(); // QString filename1=pDoc->m_LeftCurve->GetSlfFileName(); // CMemRdWt mrw1; // CMemRdWt mrw2; // struct INC_STRU Inc={0},Inc1={0}; // struct INP_STRU Inp,Inp1; // struct HD_STRU Hd={99999.0,-99999.0,0}; // struct HD_STRU Hd1={99999.0,-99999.0,0}; // int flag=0; // if(filename1==filename2) { // CMemRdWt mrw4; // if(mrw4.Open(filename1.toStdString().c_str())) { // CMemRdWt mrw3; // QDir aa; // filename2=::GetLogdataPath()+"temp\\temp001"; // aa.remove(filename2); // if(mrw3.Open(filename2.toStdString().c_str(),CMemRdWt::modeCreate,1024,1024,0,mrw4.IsWis)) { // mrw3.CopyFromFile(mrw4,(char *)name2.toStdString().c_str()); // mrw3.Save(); // mrw3.Close(); // flag=1; // } // mrw1.Close(); // } // } // if (!mrw1.Open(filename1.toStdString().c_str())) { // if(flag) { // QDir aa; // aa.remove(filename2); // } // pDoc->isScr=0; // return; // } // if (!mrw2.Open(filename2.toStdString().c_str())) { // mrw1.Close(); // if(flag) { // QDir aa; // aa.remove(filename2); // } // pDoc->isScr=0; // return; // } // mrw1.SetStruct(&Inc,NULL,&Inp,NULL,NULL,NULL,&Hd,NULL); // mrw2.SetStruct(&Inc1,NULL,&Inp1,NULL,NULL,NULL,&Hd1,NULL); // QList names1,names2; // names1.append(name1); // names2.append(name2); // for(int i=0;im_ShiftCurves.size();i++){ // names1.append(pDoc->m_ShiftCurves.at(i)->GetName()); // names2.append(pDoc->m_ShiftCurves.at(i)->GetName()); // } // int ind1,ind2; // QStringList ERRORS; // int j=0; // for(int i=0;im_RightCurve->SetShiftOffset(0); // pDoc->m_RightCurve->SetShiftBottomDepth(-9999.0); // pDoc->m_RightCurve->SetShiftTopDepth(-9999.0); // foreach(CObjWellLog*pLog,logs) // { // if(pLog) { // GetObjectEvent().OnDeAttchData(pDoc->m_LeftCurve->GetSlfFileName(),pLog->GetName()); // GetObjectEvent().OnRefreshData(pDoc->m_LeftCurve->GetSlfFileName(),pLog->GetName()); // } // } // pDrawCurveCommand->SetXValue(); // pDoc->m_LeftCurve->m_vLayers.clear(); // pDoc->m_LeftCurve->m_ChangeNo=0; // pDoc->isScr=0; // foreach(CObjWellLog*pLog,logs) // { // if(pLog) { // pLog->m_vLayers.clear(); // pLog->m_ChangeNo=0; // } // } // GetSceneManager()->SetDirtyUIElement(true,true); // if(ERRORS.size())AfxMessageBox("目标曲线不存在:"+ERRORS.join(" ")); // CVecViewCommand &viewCommand =GetSceneManager()->GetViewCommand(); // QAction *pUndoAction = viewCommand.GetAction(GetCmdID_UndoCommand()); // pUndoAction->setEnabled(GetSceneManager()->GetUndoStack()->canUndo()); // QAction *pRedoAction = viewCommand.GetAction(GetCmdID_RedoCommand()); // pRedoAction->setEnabled(GetSceneManager()->GetUndoStack()->canRedo()); // } // } // void CQtWindowWellSection::AddDataDrawObject(QVector &welltracks,CWellSectionWindowDocument *pDoc,CObjWellTrack*pWellTrack,CObjWell *well,CBaseObject*objfromplugin) // { // CQtWellSceneManager *p_scene_manager=dynamic_cast(m_pSceneManager); // if(objfromplugin){ // PaiObject *aobj=objfromplugin->GetPaiObject(); // CObjWellLog *pResultLog=dynamic_cast(aobj); // if(aobj){ // //把这种对象藏起来 // ::GetProject()->AddIDMap(aobj->GetID(),objfromplugin); // //2.加道 // pResultLog = dynamic_cast(objfromplugin); // if(pResultLog) // { // QString rname=pResultLog->GetName(); // QStringList rns; // if(rname.indexOf("GUJING")>-1&&welltracks.size()) // { // std::vector vObject; // CPaiObjectHelper::RecursionGetAllChild(welltracks.at(0),vObject); // foreach(PaiObject *pChild,vObject) // { // if(pChild->GetName().indexOf("GUJING")>-1) rns.append(pChild->GetName()); // } // if(rns.size()) { // int ind[3]={-1,-1,-1}; // char buf[20]; // for(int i=0;i<3;i++) // { // sprintf(buf,"GUJING%d_RESULT",i+1); // if(rns.indexOf(buf)>-1) { // ind[i]=i; // } // } // if(ind[0]==-1) { // } // else if(ind[1]==-1){ // pResultLog->SetName("GUJING2_RESULT"); // } // else if(ind[2]==-1) { // pResultLog->SetName("GUJING3_RESULT"); // } // } // } // else if(rname=="RESULT"&&welltracks.size()) // { // std::vector vObject; // CPaiObjectHelper::RecursionGetAllChild(welltracks.at(0),vObject); // foreach(PaiObject *pChild,vObject) // { // if(pChild->GetName().indexOf("RESULT",0)>-1) rns.append(pChild->GetName()); // } // if(rns.size()) { // int ind[3]={-1,-1,-1}; // char buf[20]; // for(int i=0;i<3;i++) // { // if(i==0) sprintf(buf,"RESULT",i); // else sprintf(buf,"RESULT%d",i); // if(rns.indexOf(buf,0)>-1) { // ind[i]=i; // } // } // if(ind[0]==-1) { // } // else if(ind[1]==-1){ // pResultLog->SetName("RESULT1"); // } // else if(ind[2]==-1) { // pResultLog->SetName("RESULT2"); // } // } // } // else if(pResultLog->GetTypeID()==QUuid(GetOSGWellRulerTrackID())) // { // pResultLog->SetName("DEPTH"); // pResultLog->SetAliasName("深度"); // } // } // if(well&&pResultLog&&pResultLog->GetName()!="DEPTH") { // // pResultLog->isLoad=false; // // pResultLog->LoadFromSLF(); // } // objfromplugin->SetCheckState(Qt::Checked); // CVecDisplayObjectCommand::SetObjectCheckState(aobj,Qt::CheckState::Checked,p_scene_manager->GetVecWindow()); // CVecNodeBuilder*pBuilder=m_pSceneManager->GetBuilder(aobj->GetID()); // if(!pBuilder) { // ::GetProject()->RemoveIDMap(dynamic_cast(aobj)); // delete aobj; // return; // } // int type=pBuilder->GetType(); // CObjWellLogTrack *pP=NULL; // if(pBuilder&&(type!=TRACKTYPE/*&&type!=DEPTHTYPE*/)) // { // pP=dynamic_cast(aobj->GetParent()); // if((type==DEPTHTYPE||type>=OGRESULTTYPE)&&pP->GetChildrenCount()<2) // // if(pP&&pP->GetTrackType()==CObjWellLogTrack::OG_RESULT&&pP->GetChildrenCount()<2) // { // if(type==DEPTHTYPE) pP->SetTrackType(CObjWellLogTrack::DEPTH); // else pP->SetTrackType(CObjWellLogTrack::OG_RESULT); // CObjectViewInfo *pLogTrackViewinfo = dynamic_cast(p_scene_manager->GetViewInfo(pP->GetID())); // if(pLogTrackViewinfo) { // if(pLogTrackViewinfo->property("hDrawGrid").isValid()) pLogTrackViewinfo->setProperty("hDrawGrid",0); // if(pLogTrackViewinfo->property("DrawGrid").isValid()) pLogTrackViewinfo->setProperty("DrawGrid",0); // if(pResultLog)pP->SetName(pResultLog->GetAliasName()); // } // } // } // QList< PaiObject* > children; // if(!pWellTrack) { // PaiObject*temp=aobj; // while(temp) { // pWellTrack=dynamic_cast(temp->GetParent()); // if(pWellTrack) { // if(welltracks.indexOf(pWellTrack)<1) welltracks.append(pWellTrack); // break; // } // temp=temp->GetParent(); // } // } // if(pWellTrack) { // CWellViewInfo*pWellViewInfo=dynamic_cast(p_scene_manager->GetViewInfo(pWellTrack->GetID())); // CObjectViewInfo*pViewInfo=dynamic_cast(m_pSceneManager->GetViewInfo(pBuilder->GetID())); // if(pWellViewInfo&&pViewInfo) // { // pViewInfo->SetLogHeadFont(pWellViewInfo->GetLogHeaderFont()); // pViewInfo->SetLogScaleFont(pWellViewInfo->GetLogScaleFont()); // pViewInfo->SetLogUnitFont(pWellViewInfo->GetLogUnitFont()); // } // pWellTrack->GetChildren(children); // if (children.size()==1) { // float sdep=0; // float edep=0; // if(welltracks.size()>1) { // sdep=welltracks[0]->GetTopWellLogDepth(); // edep=welltracks[0]->GetBottomWellLogDepth(); // } // else { // CObjWelllogRound*pWelllogRound=pWellTrack->GetWelllogRound(); // if(pWelllogRound) // { // CObjWell *pWell=pWelllogRound->GetWell(); // if(pWell) { // sdep=pWell->GetStartDep(); // edep=pWell->GetEndDep(); // if(sdep==99999||edep==-99999) { // sdep=0; // edep=0; // } // } // } // } // if(pWellViewInfo) { // pWellViewInfo->SetTopDepth(sdep); // pWellViewInfo->SetBottomDepth(edep); // CVecWindowCommand::ViewInfoPropetyChanged( "TopDepth", pWellViewInfo,sdep); // CVecWindowCommand::ViewInfoPropetyChanged( "BottomDepth", pWellViewInfo,edep); // } // WellWindowViewInfo *pWellWindowViewInfo = dynamic_cast( p_scene_manager->GetViewInfo(p_scene_manager->GetVecWindow()->GetWindowID())); // if(pWellViewInfo) { // if(pWellWindowViewInfo->property("TopDepth").isValid()) { // pWellWindowViewInfo->setProperty("TopDepth",sdep); // } // if(pWellWindowViewInfo->property("BottomDepth").isValid()) { // pWellWindowViewInfo->setProperty("BottomDepth",edep); // } // } // } // } // if(!p_scene_manager->IsWellSectonFixHeader()) { // p_scene_manager->ReAllViews(); // } // else p_scene_manager->UpdateAll(); // CSheet* sheet = p_scene_manager->GetCurrentSheet(); // if(sheet != NULL) // { // QtWellSectionViewer *pViewer = dynamic_cast(p_scene_manager->GetVecWindow()->GetVecViewer() ); // double wellHeadContentHeight= pDoc->GetCurveHeadHeight(); // if(!p_scene_manager->IsWellSectonFixHeader()) { // QList *sheets=pDoc->GetSheets(); // foreach(CSheet* curSheet,*sheets) // { // if(curSheet != NULL) // { // curSheet->SetViewportStartHeight(0); // curSheet->SetViewportHeight(wellHeadContentHeight*p_scene_manager->GetZoomYRatio()); // } // } // } // else { // pViewer->GetHeadVScroll()->setValue(wellHeadContentHeight*p_scene_manager->GetZoomYRatio()); // p_scene_manager->OnHeadVScroll((wellHeadContentHeight-sheet->GetViewportHeight())*p_scene_manager->GetZoomYRatio()); // } // } // } // } // } // void CQtWindowWellSection::slotNewDataAndDraw() // { // CQtWellSceneManager * p_scene_manager= dynamic_cast(GetSceneManager()); // if(!p_scene_manager)return;//说明不是单井多井图,暂时返回 // QAction* aaction=(QAction*)(QObject::sender()); // CWellSectionWindowDocument *pDoc = p_scene_manager->GetWellSectionGeomtry().GetSecionWindowDocument(); // #pragma region luolin // if(!p_scene_manager->GetVecWindow())return; // //QMessageBox::information(NULL,"",QString::number(GetSceneManager()->GetVecWindow()->getTag(GetWindowTypeID_QtGeoGuideActiveOSGWindow()).toBool())); // bool isGuad=p_scene_manager->GetVecWindow()->getTag(GetWindowTypeID_QtGeoGuideActiveOSGWindow()).toBool(); // //地质导引同步 // if(isGuad) // { // CVecDisplayObjectCommand::ActiveOSGWindow(p_scene_manager->GetVecWindow()); // } // #pragma endregion // QVector welltracks; // CObjWellTrack* currentwelltrack=NULL; // QUuid m_CurrentPickObjectID=p_scene_manager->GetCurrentPickObjectID(); // if(m_CurrentPickObjectID!=""){ // CBaseObject* pViewObject = CObjProject::GetObjectByID( m_CurrentPickObjectID ); // CObjWellLogTrack* currentlogtrack=dynamic_cast(pViewObject); // if(!currentlogtrack) { // currentlogtrack=p_scene_manager->GetWellSectionGeomtry().GetLogTrack(m_CurrentPickObjectID); // p_scene_manager->SetCurentPickObject(QUuid()); // m_CurrentPickObjectID=QUuid(); // } // if(currentlogtrack) { // currentwelltrack=p_scene_manager->GetWellSectionGeomtry().GetWellTrack(currentlogtrack); // } // else // { // if(pViewObject&&pViewObject->GetPaiObject()->GetTypeID()==GetOSGWellTrackID()) currentwelltrack=dynamic_cast(pViewObject); // } // if(currentwelltrack) welltracks.append(currentwelltrack); // } // else // { // welltracks=p_scene_manager->GetWellSectionGeomtry().GetAllWellTrack(true); // if(!welltracks.size()) { // currentwelltrack=p_scene_manager->GetWellSectionGeomtry().GetWellTrack(NULL); // if(currentwelltrack) welltracks.append(currentwelltrack); // } // else currentwelltrack=welltracks[0]; // } // if (!currentwelltrack) // { // AppendConsole(pai::log::PAI_ERROR,"不能找到当前的井,请先选择井:"+aaction->text()); // return; // } // foreach(CObjWellTrack *pWellTrack,welltracks) // { // PaiObject * aobj=NULL; // CObjWellTrack* currentwelltrack=NULL; // CObjWell* well = NULL; // well=dynamic_cast(CObjProject::GetObjectByID(pWellTrack->GetWellID())); // if(!well) { // if(pDoc) well=pDoc->GetCurrentWell( ); // if(well) { // pWellTrack->SetWellID(well->GetID()); // pWellTrack->SetWelllogRound(well->GetCurrentObjWellRound()); // pDoc->AddChild(pWellTrack); // p_scene_manager->AddObject(pWellTrack); // } // } // //1.上树 // CBaseObject *objfromplugin=CBaseObject::GetFatory().CreateObject(sObjectClassIDKey(aaction->data().toString())); // if(objfromplugin){ // CObjWellLog * pResultLog = dynamic_cast(objfromplugin); // if(pResultLog) { // CBaseObject *pObject=objfromplugin->GhostObject(); // delete objfromplugin; // objfromplugin=pObject; // pResultLog = dynamic_cast(objfromplugin); // if(pResultLog) { // pResultLog->m_pObjWell=well; // QString wellname=well->GetWellFileName(); // pResultLog->SetSlfFileName(wellname); // } // } // aobj=objfromplugin->GetPaiObject(); // if(!pResultLog&&aobj) // { // aobj->SetName(aaction->toolTip()); // pWellTrack->AddChild(aobj); // } // AddDataDrawObject(welltracks,pDoc,pWellTrack,well,objfromplugin); // } // else // { // AppendConsole(pai::log::PAI_ERROR,"图元创建失败,请检查相关插件是否已经正常加载:"+aaction->text()); // } // } // } // double CQtWindowWellSection::GetDepByPos(double x,double y) // { // double dep=0; // CQtWellSceneManager * m_pWellSceneManager= dynamic_cast(GetSceneManager()); // if(!m_pWellSceneManager) return dep; // CBaseObject* pViewObject = CObjProject::GetObjectByID(m_pWellSceneManager->GetCurrentPickObjectID()); // CObjWellTrack *pWellTrack = dynamic_cast(pViewObject); // CObjWellLogTrack *pWellLogTrack = dynamic_cast( m_pWellSceneManager->GetWellSectionGeomtry().PickLeafTrackObject( x,y ) ); // if(!pWellTrack&&pWellLogTrack) pWellTrack=dynamic_cast(pWellLogTrack->GetWellTrack()); // if(!pWellTrack){ // CObjWellLog *pWellLog=dynamic_cast(pViewObject); // if(pWellLog){ // pWellTrack=pWellLog->GetWellTrack(); // } // if(!pWellTrack) { // QVector vTrack = m_pWellSceneManager->GetWellSectionGeomtry().GetAllWellTrack( true ); // if(vTrack.size()) pWellTrack =vTrack[0]; // } // } // CQtWellTrackNode* pTrackNode=NULL; // if(pWellTrack) { // pTrackNode = dynamic_cast(m_pWellSceneManager->GetBuilder(pWellTrack->GetID())); // if(!pTrackNode) return true; // if(m_pWellSceneManager->IsWellSectonHorizonLayout()) { // dep=pTrackNode->ConvertX(eCoord_OSGPixel,x,eCoord_GEO); // } // else { // dep=pTrackNode->ConvertY(eCoord_OSGPixel,y,eCoord_GEO); // } // } // return dep; // } // CVecViewer* CQtWindowWellSection::CreateViewer() // { // return new QtWellSectionViewer(this); // } // void CQtWindowWellSection::PickFirst() // { // QAction *pAction =NULL; // QUuid id=GetDigitizerID_QtWellWindowPick(); // if(GetWindowType() ==GetWindowTypeID_QtWellSection()) id=GetDigitizerID_QtWellWindowPick(); // else if(GetWindowType() == GetWindowTypeID_QtMultiWellSection()) id=GetDigitizerID_MultiWell(); // else if(GetWindowType() == GetWindowTypeID_QtGeoGuideSection() ) id=GetDigitizerID_QtWellWindowPick(); // pAction=this->GetSceneManager()->GetViewCommand().GetAction(id); // if (pAction) // { // pAction->setChecked(true); // } // GetSceneManager()->GetEventHander().SwitchDigitizer(id,QUuid()); // } // void CQtWindowWellSection::UpdateObject(eUpdateEvent e,CObjectEventParam *pEventParam,QVariant vtPropertyValue) // { // if(!pEventParam) return; // CQtWellSceneManager *pWellSceneManager=dynamic_cast(GetSceneManager()); // if(!pWellSceneManager) return; // if(pEventParam->strPropertyIDName=="MapRatio") // { // double targetfactor=100.0/vtPropertyValue.toInt(); // double currentXfacotr=pWellSceneManager->GetZoomXRatio(); // double currentYfacotr=pWellSceneManager->GetZoomYRatio(); // double zoomXscale=targetfactor/currentXfacotr; // double zoomYscale=targetfactor/currentYfacotr; // pWellSceneManager->GetCameraCommand().Zoom( zoomXscale,zoomYscale ); // return; // } // //修改了全图的深度比例尺 // if(pEventParam->strPropertyIDName=="MapYScaleEnum"|| // pEventParam->strPropertyIDName=="SelfYScaleEnum") // { // QVector vWellTrack; // vWellTrack =pWellSceneManager->GetWellSectionGeomtry().GetAllWellTrack(true); // foreach( CObjWellTrack *pWellTrack,vWellTrack) // { // CVecWindowCommand::SendEventToBuilder( pWellTrack, // this, // eUpdate_WellSectionDepthScale,pEventParam ); // } // pWellSceneManager->UpdateAll(); // return; // } // else if(pEventParam->strPropertyIDName=="DefaultROW_HEIGHTCM") // { // DEFAULT_ROW_HEIGHT=vtPropertyValue.toFloat(); // pWellSceneManager->UpdateAll(); // return; // } // else if(pEventParam->strPropertyIDName=="CloseMegins") // { // if(vtPropertyValue.toBool()) // { // pWellSceneManager->FIXED_LOGBottom_MARGIN_CM_BACK=pWellSceneManager->FIXED_LOGBottom_MARGIN_CM; // pWellSceneManager->FIXED_LOGLeft_MARGIN_CM_BACK=pWellSceneManager->FIXED_LOGLeft_MARGIN_CM; // pWellSceneManager->FIXED_LOGRight_MARGIN_CM_BACK=pWellSceneManager->FIXED_LOGRight_MARGIN_CM; // pWellSceneManager->FIXED_LOGHead_MARGIN_CM_BACK=pWellSceneManager->FIXED_LOGHead_MARGIN_CM; // pWellSceneManager->FIXED_LOGBottom_MARGIN_CM_BACK=pWellSceneManager->FIXED_LOGBottom_MARGIN_CM; // pWellSceneManager->FIXED_LOGBottom_MARGIN_CM=0; // pWellSceneManager->FIXED_LOGLeft_MARGIN_CM=0; // pWellSceneManager->FIXED_LOGRight_MARGIN_CM=0; // pWellSceneManager->FIXED_LOGHead_MARGIN_CM=0; // pWellSceneManager->FIXED_LOGBottom_MARGIN_CM=0; // } // else { // pWellSceneManager->FIXED_LOGBottom_MARGIN_CM=pWellSceneManager->FIXED_LOGBottom_MARGIN_CM_BACK; // pWellSceneManager->FIXED_LOGLeft_MARGIN_CM=pWellSceneManager->FIXED_LOGLeft_MARGIN_CM_BACK; // pWellSceneManager->FIXED_LOGRight_MARGIN_CM=pWellSceneManager->FIXED_LOGRight_MARGIN_CM_BACK; // pWellSceneManager->FIXED_LOGHead_MARGIN_CM=pWellSceneManager->FIXED_LOGHead_MARGIN_CM_BACK; // pWellSceneManager->FIXED_LOGBottom_MARGIN_CM=pWellSceneManager->FIXED_LOGBottom_MARGIN_CM_BACK; // } // pWellSceneManager->UpdateAll(); // return; // } // else // { // QVector vWellTrack; // CObjWellTrack *pWellTrack=dynamic_cast(pWellSceneManager->GetCurentPickObject()); // if(pWellTrack) vWellTrack.append(pWellTrack); // else vWellTrack =pWellSceneManager->GetWellSectionGeomtry().GetAllWellTrack(true); // foreach( CObjWellTrack *pWellTrack,vWellTrack) // { // CWellViewInfo *pWellViewInfo=dynamic_cast(pWellSceneManager->GetViewInfo(pWellTrack->GetID())); // if(pWellViewInfo) { // if(pEventParam->strPropertyIDName=="BigGridLine") pWellViewInfo->SetBigGridLine(vtPropertyValue.toInt()); // else if(pEventParam->strPropertyIDName=="MidGridLine") pWellViewInfo->SetMidGridLine(vtPropertyValue.toInt()); // else if(pEventParam->strPropertyIDName=="MinGridLine") pWellViewInfo->SetMinGridLine(vtPropertyValue.toInt()); // else if(pEventParam->strPropertyIDName=="Angle") pWellViewInfo->SetAngle(vtPropertyValue.toDouble()); // else if(pEventParam->strPropertyIDName=="DepthType") pWellViewInfo->SetDepthType(vtPropertyValue.toDouble()); // } // pEventParam->vtPropertyValue=vtPropertyValue; // CVecWindowCommand::SendEventToBuilder( pWellTrack, // this, // eUpdate_Other,pEventParam); // } // } // } // BEGIN_REGISTER_OSGWINDOW(CQtWindowWellSection) // sVecWindowKey(GetWindowTypeID_QtWellSection(),L"测井绘图","wellsectionwindow.png") // END_REGISTER_OSGWINDOW(CQtWindowWellSection); // END_OSGGRAPHICS_NAMESPACE