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

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

View File

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

View File

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

View File

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