|
|
|
|
|
#include "MLMicroStructureTest.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "MLMicroStructure.h"
|
|
|
|
|
|
#include "MLPlineList.h"
|
|
|
|
|
|
#include "MLFuncom.h"
|
|
|
|
|
|
|
|
|
|
|
|
MLMicroStructureTest::MLMicroStructureTest(QWidget *parent)
|
|
|
|
|
|
: QMainWindow(parent)
|
|
|
|
|
|
{
|
|
|
|
|
|
ui.setupUi(this);
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure = new MLMicroStructure;
|
|
|
|
|
|
|
|
|
|
|
|
ui.lineEdit_minArea->setText(ToString(m_pMicroStructure->m_minArea));
|
|
|
|
|
|
ui.spinBox_limitNum->setValue(m_pMicroStructure->m_limitNum);
|
|
|
|
|
|
ui.lineEdit_faultCloseDis->setText(ToString(m_pMicroStructure->m_faultCloseDis));
|
|
|
|
|
|
|
|
|
|
|
|
ui.lineEdit_extendDis->setText(ToString(m_pMicroStructure->m_extendDis));
|
|
|
|
|
|
ui.lineEdit_closeDis->setText(ToString(m_pMicroStructure->m_closeDis));
|
|
|
|
|
|
|
|
|
|
|
|
ui.lineEdit_offsetDis->setText(ToString(m_pMicroStructure->m_offsetDis));
|
|
|
|
|
|
ui.lineEdit_minAngle->setText(ToString(m_pMicroStructure->m_minAngle));
|
|
|
|
|
|
ui.lineEdit_redundant->setText(ToString(m_pMicroStructure->m_redundant));
|
|
|
|
|
|
ui.lineEdit_radius->setText(ToString(m_pMicroStructure->m_radius));
|
|
|
|
|
|
ui.lineEdit_smooth->setText(ToString(m_pMicroStructure->m_smooth));
|
|
|
|
|
|
|
|
|
|
|
|
ui.lineEdit_unitScale->setText(ToString(m_pMicroStructure->m_unitSacle));
|
|
|
|
|
|
ui.lineEdit_zoomin->setText(ToString(m_pMicroStructure->m_zoomin));
|
|
|
|
|
|
|
|
|
|
|
|
ui.spinBox_removeTimes->setValue(1);
|
|
|
|
|
|
ui.lineEdit_removeAngle->setText("90");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MLMicroStructureTest::on_pushButton_ok_clicked()
|
|
|
|
|
|
{
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD>
|
|
|
|
|
|
double minArea = ui.lineEdit_minArea->text().toDouble();
|
|
|
|
|
|
int limitNum = ui.spinBox_limitNum->value();
|
|
|
|
|
|
|
|
|
|
|
|
// ɾ<><C9BE><EFBFBD>ϲ<EFBFBD><CFB2>ڲ<EFBFBD>
|
|
|
|
|
|
bool bFaultFilter = ui.checkBox_faultFilter->isChecked();
|
|
|
|
|
|
double faultCloseDis = ui.lineEdit_faultCloseDis->text().toDouble();
|
|
|
|
|
|
|
|
|
|
|
|
// <20>պ<EFBFBD>Ȧ<EFBFBD><C8A6>
|
|
|
|
|
|
bool bCloseShape = ui.groupBox_close->isChecked();; // <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ɱպ<C9B1>
|
|
|
|
|
|
double closeDis = ui.lineEdit_closeDis->text().toDouble();
|
|
|
|
|
|
|
|
|
|
|
|
// <20>ϲ<EFBFBD>Ȧ<EFBFBD><C8A6>
|
|
|
|
|
|
bool bFaultShape = ui.groupBox_fault->isChecked();
|
|
|
|
|
|
double extendDis = ui.lineEdit_extendDis->text().toDouble();
|
|
|
|
|
|
|
|
|
|
|
|
// <20><>״
|
|
|
|
|
|
bool bNoseShape = ui.groupBox_nose->isChecked();
|
|
|
|
|
|
double offsetDis = ui.lineEdit_offsetDis->text().toDouble();
|
|
|
|
|
|
double minAngle = ui.lineEdit_minAngle->text().toDouble();
|
|
|
|
|
|
double redundant = ui.lineEdit_redundant->text().toDouble();
|
|
|
|
|
|
double minRadius = ui.lineEdit_radius->text().toDouble();
|
|
|
|
|
|
double smooth = ui.lineEdit_smooth->text().toDouble();
|
|
|
|
|
|
double unitSacle = ui.lineEdit_unitScale->text().toDouble();
|
|
|
|
|
|
|
|
|
|
|
|
double zoomin = ui.lineEdit_zoomin->text().toDouble();
|
|
|
|
|
|
|
|
|
|
|
|
int removeTimes = ui.spinBox_removeTimes->value();
|
|
|
|
|
|
double removeAngle = ui.lineEdit_removeAngle->text().toDouble();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_minArea = minArea;
|
|
|
|
|
|
m_pMicroStructure->m_limitNum = limitNum;
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_bFaultFilter = bFaultFilter;
|
|
|
|
|
|
m_pMicroStructure->m_faultCloseDis = faultCloseDis;
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_bCloseShape = bCloseShape;
|
|
|
|
|
|
m_pMicroStructure->m_closeDis = closeDis;
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_bFaultShape = bFaultShape;
|
|
|
|
|
|
m_pMicroStructure->m_extendDis = extendDis;
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_bNoseShape = bNoseShape;
|
|
|
|
|
|
m_pMicroStructure->m_offsetDis = offsetDis;
|
|
|
|
|
|
m_pMicroStructure->m_minAngle = minAngle;
|
|
|
|
|
|
m_pMicroStructure->m_redundant = redundant;
|
|
|
|
|
|
m_pMicroStructure->m_radius = minRadius;
|
|
|
|
|
|
m_pMicroStructure->m_smooth = smooth;
|
|
|
|
|
|
m_pMicroStructure->m_zoomin = zoomin;
|
|
|
|
|
|
m_pMicroStructure->m_unitSacle = unitSacle;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// sample1
|
|
|
|
|
|
/*{
|
|
|
|
|
|
MLPlineList contourList;
|
|
|
|
|
|
QString polylineFile = "D:/CPP/PEWorks_git/MLMicroStructure/x64/sample1/contour.dfd";
|
|
|
|
|
|
contourList.readPline(polylineFile);
|
|
|
|
|
|
|
|
|
|
|
|
QString faultFile = "D:/CPP/PEWorks_git/MLMicroStructure/x64/sample1/fault.dfd";
|
|
|
|
|
|
MLPlineList faultList;
|
|
|
|
|
|
faultList.readPline(faultFile);
|
|
|
|
|
|
|
|
|
|
|
|
QString gridFile = "D:/CPP/PEWorks_git/MLMicroStructure/x64/sample1/outGrid.dfg";
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->setContourList(contourList);
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->setFaultList(faultList);
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->readDfgBinary(gridFile.toLocal8Bit().data());
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_offsetDis = 100;
|
|
|
|
|
|
m_pMicroStructure->m_radius = 200;
|
|
|
|
|
|
m_pMicroStructure->run();
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_closeObjNegaAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample1/closeObjNega.pldat");
|
|
|
|
|
|
m_pMicroStructure->m_closeObjPosiAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample1/closeObjPosi.pldat");
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_faultObjPosiAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample1/faultObjPosi.pldat");
|
|
|
|
|
|
m_pMicroStructure->m_faultObjNegaAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample1/faultObjNega.pldat");
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_noseObjPosiAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample1/noseObjPosi.pldat");
|
|
|
|
|
|
m_pMicroStructure->m_noseObjNegaAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample1/noseObjNega.pldat");
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->clearMemory();
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
// sample2
|
|
|
|
|
|
/* {
|
|
|
|
|
|
MLPlineList contourList;
|
|
|
|
|
|
QString polylineFile = "D:/CPP/PEWorks_git/MLMicroStructure/x64/sample2/contour.dfd";
|
|
|
|
|
|
contourList.readPline(polylineFile);
|
|
|
|
|
|
|
|
|
|
|
|
QString faultFile = "D:/CPP/PEWorks_git/MLMicroStructure/x64/sample2/fault.dfd";
|
|
|
|
|
|
MLPlineList faultList;
|
|
|
|
|
|
faultList.readPline(faultFile);
|
|
|
|
|
|
|
|
|
|
|
|
QString gridFile = "D:/CPP/PEWorks_git/MLMicroStructure/x64/sample2/_01.dfg";
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->setContourList(contourList);
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->setFaultList(faultList);
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->readDfgBinary(gridFile.toLocal8Bit().data());
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->run();
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_closeObjNegaAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample2/closeObjNega.pldat");
|
|
|
|
|
|
m_pMicroStructure->m_closeObjPosiAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample2/closeObjPosi.pldat");
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_faultObjPosiAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample2/faultObjPosi.pldat");
|
|
|
|
|
|
m_pMicroStructure->m_faultObjNegaAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample2/faultObjNega.pldat");
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_noseObjPosiAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample2/noseObjPosi.pldat");
|
|
|
|
|
|
m_pMicroStructure->m_noseObjNegaAry.writePline("D:/CPP/PEWorks_git/MLMicroStructure/x64/sample2/noseObjNega.pldat");
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->clearMemory();
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// sample3
|
|
|
|
|
|
{
|
|
|
|
|
|
MLPlineList contourList;
|
|
|
|
|
|
//QString polylineFile = "D:/CPP/PEWorks_git/MLMicroStructure/x64/sample3/test.dfd";
|
|
|
|
|
|
QString polylineFile = "C:/temp/test.dfd";
|
|
|
|
|
|
contourList.readPline(polylineFile);
|
|
|
|
|
|
|
|
|
|
|
|
QString faultFile = "C:/temp/testFault.dfd";
|
|
|
|
|
|
MLPlineList faultList;
|
|
|
|
|
|
faultList.readPline(faultFile);
|
|
|
|
|
|
|
|
|
|
|
|
QString gridFile = "C:/temp/test.dfg";
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->setContourList(contourList);
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->setFaultList(faultList);
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->readDfgBinary(gridFile.toLocal8Bit().data());
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->run();
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_closeObjNegaAry.writePline("C:/temp/closeObjNega.pldat");
|
|
|
|
|
|
m_pMicroStructure->m_closeObjPosiAry.writePline("C:/temp/closeObjPosi.pldat");
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_faultObjPosiAry.writePline("C:/temp/faultObjPosi.pldat");
|
|
|
|
|
|
m_pMicroStructure->m_faultObjNegaAry.writePline("C:/temp/faultObjNega.pldat");
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->m_noseObjPosiAry.writePline("C:/temp/noseObjPosi.pldat");
|
|
|
|
|
|
m_pMicroStructure->m_noseObjNegaAry.writePline("C:/temp/noseObjNega.pldat");
|
|
|
|
|
|
|
|
|
|
|
|
m_pMicroStructure->clearMemory();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MLMicroStructureTest::on_pushButton_close_clicked()
|
|
|
|
|
|
{
|
|
|
|
|
|
this->close();
|
|
|
|
|
|
}
|