按照张老师意见,重新排列菜单

pull/1/head
剑古敛锋 2024-05-10 13:58:58 +08:00
parent 08d3838adf
commit 2044867fe6
5 changed files with 1433 additions and 57 deletions

File diff suppressed because it is too large Load Diff

View File

@ -159,8 +159,9 @@ namespace MainWidget {
MaximumSurfaceAngle, MaximumAngle, MinimumAngle); MaximumSurfaceAngle, MaximumAngle, MinimumAngle);
ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclremesh); ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclremesh);
emit tc->threadStart(); // emit MSHwriter->start(); emit tc->threadStart(); // emit MSHwriter->start();
DebugInfo("tc overing %s \n", AbFileName.toStdString().c_str());
QFDialog::accept(); QFDialog::accept();
DebugInfo("QFDialog::accept() \n");
} }
void DialogPCLGPMesh::selectedComponentsSlot(QList<MeshData::MeshSet*> components) void DialogPCLGPMesh::selectedComponentsSlot(QList<MeshData::MeshSet*> components)
@ -226,34 +227,37 @@ namespace WBFZ {
ModuleBase::Message msg; ModuleBase::Message msg;
if(_operation == POINTCLOUD_FILTER || _operation == POINTCLOUD_MESH) { if(_operation == POINTCLOUD_FILTER || _operation == POINTCLOUD_MESH) {
if(_success) { if(_success) {
emit _mainwindow->updateMeshTreeSig(); // emit _mainwindow->updateMeshTreeSig();
emit _mainwindow->updateSetTreeSig(); // emit _mainwindow->updateSetTreeSig();
emit _mainwindow->updateActionStatesSig(); // emit _mainwindow->updateActionStatesSig();
// emit _mainwindow->updateActionsStatesSig(); // emit _mainwindow->updateActionsStatesSig();
emit _mainwindow->getSubWindowManager()->openPreWindowSig(); // emit _mainwindow->getSubWindowManager()->openPreWindowSig();
emit _mainwindow->updatePreMeshActorSig(); // emit _mainwindow->updatePreMeshActorSig();
information = QString("Successful Import Mesh From \"%1\"").arg(_fileName); information = QString("Successful Import Mesh From \"%1\"").arg(_fileName);
msg.type = Common::Message::Normal; msg.type = Common::Message::Normal;
msg.message = information; msg.message = information;
auto meshdata = MeshData::MeshData::getInstance(); qDebug()<<"Successful Import Mesh From "<<_fileName;
// meshdata->generateDisplayDataSet(); // auto meshdata = MeshData::MeshData::getInstance();
const int nk = meshdata->getKernalCount(); // // meshdata->generateDisplayDataSet();
if(nk <= 0) // const int nk = meshdata->getKernalCount();
return; // if(nk <= 0)
auto k = meshdata->getKernalAt(nk - 1); // return;
if(k != nullptr) // auto k = meshdata->getKernalAt(nk - 1);
k->setPath(_fileName); // if(k != nullptr)
// k->setPath(_fileName);
} else { } else {
information = QString("Failed Filter From \"%1\"").arg(_fileName); information = QString("Failed Filter From \"%1\"").arg(_fileName);
msg.type = Common::Message::Error; msg.type = Common::Message::Error;
msg.message = information; msg.message = information;
qDebug()<<"Failed Import Mesh From "<<_fileName;
} }
} else { } else {
} }
emit showInformation(information);
emit _mainwindow->printMessageToMessageWindow(msg);
} }
// emit showInformation(information); // ModuleBase::ThreadTask::threadTaskFinished();
// emit _mainwindow->printMessageToMessageWindow(msg); this->threadTaskFinished();
ModuleBase::ThreadTask::threadTaskFinished();
Py::PythonAgent::getInstance()->unLock(); Py::PythonAgent::getInstance()->unLock();
} }
void PCLGPMesh::setThreadRunState(bool flag) void PCLGPMesh::setThreadRunState(bool flag)
@ -362,12 +366,13 @@ namespace WBFZ {
QString("edge count %1 ").arg(QString::number(mesh->polygons.size()))); QString("edge count %1 ").arg(QString::number(mesh->polygons.size())));
DebugInfo("remesh over ,conver init %d \n", mesh->polygons.size()); DebugInfo("remesh over ,conver init %d \n", mesh->polygons.size());
// 转换处理结果 // 转换处理结果
vtkPolyData* polydata = vtkPolyData::New(); // 创建新的指针,智能指针会释放 vtkSmartPointer<vtkPolyData> polydata= vtkSmartPointer<vtkPolyData>::New();
// vtkPolyData* polydata = vtkPolyData::New(); // 创建新的指针,智能指针会释放
size_t pointcount = PointCloudOperator::PointCloudCommon::mesh2vtk(*mesh, polydata); size_t pointcount = PointCloudOperator::PointCloudCommon::mesh2vtk(*mesh, polydata);
DebugInfo("remesh over ,conver over polydata %d , pointcount %d\n", polydata == nullptr, DebugInfo("remesh over ,conver over polydata %d , pointcount %d\n", polydata == nullptr, pointcount);
pointcount);
vtkDataSet* dataset = vtkSmartPointer<vtkDataSet> dataset=vtkDataSet::SafeDownCast(polydata);
vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset // dataset =vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
// outpolyData->Delete(); // 释放指针 , // outpolyData->Delete(); // 释放指针 ,
// 千万不能释放这个指针,不然程序回调时,会直接内存崩溃 // 千万不能释放这个指针,不然程序回调时,会直接内存崩溃
DebugInfo("PCLGPMeshAlg successfully!! wait for writing file \n"); DebugInfo("PCLGPMeshAlg successfully!! wait for writing file \n");
@ -377,6 +382,11 @@ namespace WBFZ {
DebugInfo("remesh \n"); DebugInfo("remesh \n");
QString filepath = _fileName; QString filepath = _fileName;
QFile outfile_presave(_fileName);
if(outfile_presave.exists()){ // 如果存在文件,就删除
outfile_presave.remove();
}
// 加载文件 // 加载文件
QFileInfo info(filepath); QFileInfo info(filepath);
QString name = info.fileName(); QString name = info.fileName();
@ -400,6 +410,7 @@ namespace WBFZ {
QByteArray ba = codec->fromUnicode(_fileName); QByteArray ba = codec->fromUnicode(_fileName);
vtkSmartPointer<vtkSTLWriter> writer = vtkSmartPointer<vtkSTLWriter>::New(); vtkSmartPointer<vtkSTLWriter> writer = vtkSmartPointer<vtkSTLWriter>::New();
writer->SetInputData(dataset); writer->SetInputData(dataset);
writer->SetFileTypeToBinary(); writer->SetFileTypeToBinary();
writer->SetFileName(ba); writer->SetFileName(ba);
@ -409,7 +420,6 @@ namespace WBFZ {
} }
DebugInfo("writing finish !! %d \n", dataset == nullptr); DebugInfo("writing finish !! %d \n", dataset == nullptr);
// 回调函数 // 回调函数
DebugInfo("remeshtaskProcess !! %d \n", dataset == nullptr); DebugInfo("remeshtaskProcess !! %d \n", dataset == nullptr);
@ -417,33 +427,21 @@ namespace WBFZ {
// QString name = info.fileName(); // QString name = info.fileName();
// QString path = info.filePath(); // QString path = info.filePath();
// QString suffix = info.suffix().toLower(); // QString suffix = info.suffix().toLower();
DebugInfo("dataset %d _fileName %s \n", dataset == nullptr, DebugInfo("dataset %d _fileName %s \n", dataset == nullptr, _fileName.toStdString().c_str());
_fileName.toStdString().c_str());
// 保存流程文件
if(dataset != nullptr) {
DebugInfo("load result in meshKernal \n");
auto* k = new MeshData::MeshKernal;
k->setName(name);
k->setPath(path);
auto meshData = MeshData::MeshData::getInstance();
int nKernal = meshData->getKernalCount();
for(int iKernal = 0; iKernal < nKernal; ++iKernal) {
MeshData::MeshKernal* temp = meshData->getKernalAt(iKernal);
if(temp->getPath() == path) { ///< MG same file update
meshData->removeKernalAt(iKernal);
break;
}
}
k->setMeshData(dataset);
meshData->appendMeshKernal(k);
DebugInfo("load result in meshKernal \n");
if(nullptr==dataset){
}else{
dataset=nullptr;
}
QFile outfile(_fileName);
if(outfile.exists()){
DebugInfo("GP main process sucessfully !! \n");
return true; return true;
}else{ }else{
DebugInfo("GP main process fail !! \n");
return false; return false;
} }
DebugInfo("GP main process fail !! \n");
return false; return false;
} }
} // namespace WBFZ } // namespace WBFZ

View File

@ -62,6 +62,7 @@ int EchoTableEditWindow::initTableViewContextMenu()
this->tableViewContextMenu->addAction(m_redoAction); this->tableViewContextMenu->addAction(m_redoAction);
QAction *copyAction= this->tableViewContextMenu->addAction(u8"复制"); // 复制 QAction *copyAction= this->tableViewContextMenu->addAction(u8"复制"); // 复制
copyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C)); copyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
QObject::connect(copyAction, SIGNAL(triggered()), this, SLOT(tableView_CopyAction())); QObject::connect(copyAction, SIGNAL(triggered()), this, SLOT(tableView_CopyAction()));

View File

@ -21,7 +21,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tabEcho"> <widget class="QWidget" name="tabEcho">
<attribute name="title"> <attribute name="title">
@ -34,6 +34,9 @@
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_calibration"> <widget class="QWidget" name="tab_calibration">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title"> <attribute name="title">
<string>定标常数</string> <string>定标常数</string>
</attribute> </attribute>
@ -120,18 +123,9 @@
</property> </property>
<addaction name="actionFEKOCheck"/> <addaction name="actionFEKOCheck"/>
<addaction name="actionEchoSplitExport"/> <addaction name="actionEchoSplitExport"/>
<addaction name="actionEchoCalibration"/>
</widget>
<widget class="QMenu" name="menu_2">
<property name="title">
<string>定标工具</string>
</property>
<addaction name="actionCalibrationConst"/>
<addaction name="actionImportCalibrationCons"/>
</widget> </widget>
<addaction name="menu"/> <addaction name="menu"/>
<addaction name="menu_4"/> <addaction name="menu_4"/>
<addaction name="menu_2"/>
</widget> </widget>
<action name="actionOpen"> <action name="actionOpen">
<property name="text"> <property name="text">

View File

@ -17,7 +17,7 @@
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>FEKO近场文件导入</string> <string>FEKO仿真文件导入</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">