入所测试前版本--包含泊松、卫星姿态旋转

pull/1/head
剑古敛锋 2024-05-28 08:53:55 +08:00
parent 24b84cbd18
commit 0b4bfa44f5
78 changed files with 3664 additions and 1294 deletions

View File

@ -24,7 +24,11 @@
##
##
##
if(LAMPCAE_QGIS_ALREADY_INCLUDED)
return()
endif()
set(LAMPCAE_QGIS_ALREADY_INCLUDED 1)
#
SET(QGISPROGRAMFILES ${CMAKE_SOURCE_DIR}/extlib) # qgis
SET(OSGEO4W_QGIS_SUBDIR QGIS) # qgis
@ -220,4 +224,3 @@ set_target_properties(QGIS::Analysis PROPERTIES
IMPORTED_IMPLIB_DEBUG "${QGISPROGRAMFILES}/QGIS/lib/qgis_analysis.lib"
IMPORTED_LOCATION_DEBUG "${QGISPROGRAMFILES}/QGIS/bin/qgis_analysis.dll"
)

View File

@ -1,196 +0,0 @@
{
"dependencies": [
{
"name": "embree3",
"platform": "x64"
},
{
"name": "cgns",
"platform": "x64"
},
{
"name": "icu",
"platform": "x64"
},
{
"name": "gdal",
"platform": "x64"
},
{
"name": "zlib",
"platform": "x64"
},
{
"name": "cgal",
"platform": "x64"
},
{
"name": "openmesh",
"platform": "x64"
},
{
"name": "eigen3",
"platform": "x64"
},
{
"name": "mathgl",
"platform": "x64"
},
{
"name": "boost",
"platform": "x64"
},
{
"name": "openmesh",
"platform": "x64"
},
{
"name": "opencv4",
"platform": "x64"
},
{
"name": "opencv3",
"platform": "x64"
},
{
"name": "fftw3",
"platform": "x64"
},
{
"name": "vcglib",
"platform": "x64"
},
{
"name": "netcdf-c",
"platform": "x64"
},
{
"name": "netcdf-cxx4",
"platform": "x64"
},
{
"name": "rapidxml",
"platform": "x64"
},
{
"name": "gsl",
"platform": "x64"
},
{
"name": "tbb",
"platform": "x64"
},
{
"name": "openctm",
"platform": "x64"
},
{
"name": "levmar",
"platform": "x64"
},
{
"name": "libigl",
"platform": "x64"
},
{
"name": "openctm",
"platform": "x64"
},
{
"name": "tinygltf",
"platform": "x64"
},
{
"name": "glew",
"platform": "x64"
},
{
"name": "mpfr",
"platform": "x64"
},
{
"name": "atl",
"platform": "x64"
},
{
"name": "atlmfc",
"platform": "x64"
},
{
"name": "blas",
"platform": "x64"
},
{
"name": "lapack",
"platform": "x64"
},
{
"name": "gmp",
"platform": "x64"
},
{
"name": "qhull",
"platform": "x64"
},
{
"name": "xerces-c",
"platform": "x64"
},
{
"name": "tinyxml",
"platform": "x64"
},
{
"name": "libsvm",
"platform": "x64"
},
{
"name": "libkml",
"platform": "x64"
},
{
"name": "mpi",
"platform": "x64"
},
{
"name": "hdf5",
"platform": "x64"
},
{
"name": "muparser",
"platform": "x64"
},
{
"name": "glfw3",
"platform": "x64"
},
{
"name": "expat",
"platform": "x64"
},
{
"name": "libgeotiff",
"platform": "x64"
},
{
"name": "tiff",
"platform": "x64"
},
{
"name": "flann",
"platform": "x64"
},
{
"name": "gmsh",
"platform": "x64"
},
{
"name": "freetype",
"platform": "x64"
}
],
"overrides":[
],
"builtin-baseline": "cf4ebef2294e164875ce17d7937f44d3e3ea156e"
}

View File

@ -5,7 +5,7 @@ set(SOVERSION ${PROJECT_VERSION} ${PROJECT_VERSION_MAJOR} ${PROJECT_VERSION_MINO
#
#-----------------------------------------------------------------------------
list(APPEND _libraries BaseCppLibrary Common PythonModule SARibbonBar Settings DataProperty MeshData SelfDefObject Material Geometry BCBase ConfigOptions ParaClassFactory ModelData ModuleBase PostAlgorithm PostRenderData PostInterface PostCurveDataManager PostPlotWidget PostWidgets GeometryDataExchange ProjectTree ProjectTreeExtend GeometryCommand GeometryWidgets PluginManager GmshModule IO SolverControl MainWidgets UserGuidence)
list(APPEND _libraries PointCloudOperator )
list(APPEND _libraries PointCloudOperator)
list(APPEND _libraries json qcustomplot qhexedit qscintilla2 llqgisbaselib)
#[[if(_WIN_)
@ -60,6 +60,32 @@ foreach(_library ${_libraries})
endforeach()
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
list(APPEND _TestPlugins PointMeshAlgorithm)
foreach(_TestPlugin ${_TestPlugins})
list(APPEND LAMPCAE_TEST_Libraries ${LAMPCAE_${_TestPlugin}_Runtimes_Libraries})
add_subdirectory(${_TestPlugin})
set_target_properties(${_TestPlugin} PROPERTIES
MACOSX_RPATH ON
SKIP_BUILD_RPATH OFF
BUILD_WITH_INSTALL_RPATH ON
INSTALL_RPATH "${_lib_rpath}"
INSTALL_RPATH_USE_LINK_PATH ON
#POSITION_INDEPENDENT_CODE 1
#OUTPUT_NAME $<LOWER_CASE:${_library}>
#DEBUG_POSTFIX "_d"
VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}
FOLDER Modules
)
endforeach()
#-----------------------------------------------------------------------------
# LAMPCAE
#-----------------------------------------------------------------------------

View File

@ -16,7 +16,7 @@ MainWidget::DialogVTKTransform::DialogVTKTransform(GUI::MainWindow *parent) : QF
{
_ui->setupUi(this);
_ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
setWindowTitle(tr("Mesh Modeling"));
setWindowTitle(tr("Mesh Transform"));
_ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
disabledCustomRotateAxisSlot();

View File

@ -636,6 +636,9 @@
<height>25</height>
</size>
</property>
<property name="decimals">
<number>6</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
@ -677,6 +680,9 @@
<height>25</height>
</size>
</property>
<property name="decimals">
<number>6</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
@ -718,6 +724,9 @@
<height>25</height>
</size>
</property>
<property name="decimals">
<number>6</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>

View File

@ -170,12 +170,11 @@ namespace GUI {
// 控制菜单,这些功能后期开发仿真算法之后,再开放功能
{
qDebug()<< " V1.2";
_ui->postEditorTtoolBar->hide();
_ui->postToolBar->hide();
_ui->postViewerToolBar->hide();
_postToolBar->hide();
_controlPanel->setphysicsTab(false);
_controlPanel->setpostTab(false);
_controlPanel->setplotTab(false);
@ -274,7 +273,7 @@ namespace GUI {
connect(_ui->actionPCLGuassFilter,SIGNAL(triggered()),this,SLOT(on_pclGuassFilter()));
connect(_ui->actionPCLBilateralFilter,SIGNAL(triggered()),this,SLOT(on_pclBilateralFilter()));
connect(_ui->actionPCLGPMesh,SIGNAL(triggered()),this,SLOT(on_pclGPMesh()));
connect(_ui->actionPCLPoissonMesh,SIGNAL(triggered()),this,SLOT(on_pclPoissonMesh()));
// feko 参数
connect(_ui->actionImageSetting,SIGNAL(triggered()),this,SLOT(on_actionImageSetting()));
connect(_ui->actionFEKO2csv,SIGNAL(triggered()),this,SLOT(on_actionFEKO2csv()));
@ -388,6 +387,12 @@ namespace GUI {
connect(this, SIGNAL(importPclSIGN(QString ,QString ,int )),this, SLOT(importPcl(QString ,QString ,int )));
// 绑定 vtk 中世界坐标系
connect(this, SIGNAL(showStateToolbarPositionSIGNGAL(double, double, double)),this,SLOT(showStateToolbarPosition(double, double, double)));
// 采样相关事件
connect(_ui->actionvtkPointSamplor,SIGNAL(triggered()),this,SLOT(on_actionvtkPointSamplor()));
connect(_ui->actionImageShowTool,SIGNAL(triggered()),this,SLOT(on_actionImageShowTool()));
connect(_ui->actionRCShowTool,SIGNAL(triggered()),this,SLOT(on_actionRCShowTool()));
}
void MainWindow::registerMoudel()
@ -1599,5 +1604,25 @@ namespace GUI {
QString text= QString(tr("model world position : %2m, %3m, %4m ")).arg(x).arg(y).arg(z);
_vtkworldPostion->setText(text);
}
void MainWindow::on_actionvtkPointSamplor() {
DebugInfo("on_actionvtkPointSamplor\n");
emit this->on_actionvtkPointSamplorTriggleSIGNAL(this);
}
void MainWindow::on_actionImageShowTool() {
DebugInfo("on_actionImageShowTool\n");
emit this->on_actionImageShowToolTriggleSIGNAL(this);
}
void MainWindow::on_actionRCShowTool() {
DebugInfo("on_actionRCShowTool\n");
emit this->on_actionRCShowToolSIGNAL(this);
}
void MainWindow::on_pclPoissonMesh() {
DebugInfo("on_pclPoissonMesh\n");
emit this->on_pclPoissonMesh(this);
}
} // namespace GUI

View File

@ -316,7 +316,7 @@ namespace GUI {
void on_pclBilateralFilter(GUI::MainWindow* m);
// GP网格重建
void on_pclGPMesh(GUI::MainWindow* m);
void on_pclPoissonMesh(GUI::MainWindow* m);
// FEKO仿真参数的
void on_actionImageSetting(GUI::MainWindow* m);
void on_actionFEKO2csv(GUI::MainWindow* m);
@ -335,7 +335,11 @@ namespace GUI {
// 显示前处理窗口中的世界坐标值
void showStateToolbarPositionSIGNGAL(double x,double y,double z);
void on_actionvtkPointSamplorTriggleSIGNAL(GUI::MainWindow* m);
void on_actionImageShowToolTriggleSIGNAL(GUI::MainWindow* m);
void on_actionRCShowToolSIGNAL(GUI::MainWindow* m);
public slots:
/*状态栏显示信息 */
void setStatusBarInfo(QString);
@ -384,6 +388,7 @@ namespace GUI {
void on_pclBilateralFilter();
// GP网格重建
void on_pclGPMesh();
void on_pclPoissonMesh();
// feko 设置
void on_AttriutionDBShow();
@ -469,6 +474,13 @@ namespace GUI {
// 散射界面设置
void on_actionantScatteringFEKOSetting();
//重采样算法相关
void on_actionvtkPointSamplor();
// 图像
void on_actionImageShowTool();
void on_actionRCShowTool();
private:
/*初始化Menu*/

View File

@ -400,6 +400,8 @@
</property>
<addaction name="actionPre_Window"/>
<addaction name="actionAttriutionDBShow"/>
<addaction name="actionImageShowTool"/>
<addaction name="actionRCShowTool"/>
</widget>
<widget class="QMenu" name="menuGeometry">
<property name="title">
@ -527,9 +529,17 @@
<normaloff>:/PointCloudProcess/PointCloudProcess/images/algorithm/tree.png</normaloff>:/PointCloudProcess/PointCloudProcess/images/algorithm/tree.png</iconset>
</property>
<addaction name="actionPCLGPMesh"/>
<addaction name="actionPCLPoissonMesh"/>
</widget>
<widget class="QMenu" name="menusampling">
<property name="title">
<string>sampling</string>
</property>
<addaction name="actionvtkPointSamplor"/>
</widget>
<addaction name="menuPCLFilter"/>
<addaction name="menureSurfaceMesh"/>
<addaction name="menusampling"/>
</widget>
<widget class="QMenu" name="menuFEKOSimulation">
<property name="title">
@ -541,6 +551,7 @@
<addaction name="actionFEKOImage"/>
<addaction name="separator"/>
<addaction name="actionantScatteringFEKOSetting"/>
<addaction name="separator"/>
</widget>
<widget class="QMenu" name="menuWBZBSubSystem">
<property name="title">
@ -3343,7 +3354,7 @@
<normaloff>:/PointCloudProcess/PointCloudProcess/images/algorithm/nihe.png</normaloff>:/PointCloudProcess/PointCloudProcess/images/algorithm/nihe.png</iconset>
</property>
<property name="text">
<string>GuassFilter</string>
<string>中值滤波</string>
</property>
</action>
<action name="actionPCLBilateralFilter">
@ -3404,6 +3415,26 @@
<string>loadModel</string>
</property>
</action>
<action name="actionvtkPointSamplor">
<property name="text">
<string>vtkPointSamplor</string>
</property>
</action>
<action name="actionImageShowTool">
<property name="text">
<string>ImageShowTool</string>
</property>
</action>
<action name="actionRCShowTool">
<property name="text">
<string>RCShowTool</string>
</property>
</action>
<action name="actionPCLPoissonMesh">
<property name="text">
<string>PoissonMesh</string>
</property>
</action>
</widget>
<resources>
<include location="../qrc/qianfan.qrc"/>

View File

@ -47,6 +47,10 @@ namespace GUI {
connect(this, SIGNAL(setViewValueSig(int, QString, int, int, int, int, int, int, int, int, int)), this, SLOT(setViewValue(int, QString, int, int, int, int, int, int, int, int, int)));
connect(this, SIGNAL(saveImageSig(int, int, int, QString, QString)), this, SLOT(saveImage(int, int, int, QString, QString)));
connect(this, SIGNAL(openPreWindowSig()), this, SLOT(openPreWindow()));
}
SubWindowManager::~SubWindowManager() {}

View File

@ -88,6 +88,9 @@ namespace GUI {
void openPreWindowSig();
void clearSelectModelSig();
public slots:
/*打开前处理窗口 */
@ -122,6 +125,9 @@ namespace GUI {
/// 设置视角
void setView(QString view);
// 保存图片
void saveImage(QString fileName, int winType, Post::PostWindowBase* winhandle, int w,
int h);

View File

@ -133,8 +133,8 @@ target_compile_definitions(PluginMeshDataExchange PRIVATE "NOMINMAX") # 禁用vc
target_compile_definitions(PluginMeshDataExchange PRIVATE "MESHDATAEXCHANGEPLUGIN_API")
list(APPEND _depend_library
Common PointCloudOperator PythonModule DataProperty MeshData Material Geometry BCBase ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GeometryCommand GeometryWidgets IO MainWidgets MainWindow)
Common PointCloudOperator Settings PythonModule DataProperty MeshData Material Geometry BCBase ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GeometryCommand GeometryWidgets IO MainWidgets MainWindow
)
list(APPEND _runtimes_libraries
LAMPCAE::CGNS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml

View File

@ -10,16 +10,51 @@
// You may need to build the project (run Qt uic code generator) to get
// "ui_DialogMeshSurfaceSampling.h" resolved
#include <QMessageBox>
#include <vtkPointSource.h>
#include <vtkUnstructuredGridWriter.h>
#include <vtkSTLWriter.h>
#include <QFileDialog>
#include "Dialogmeshsurfacesampling.h"
#include "ui_DialogMeshSurfaceSampling.h"
#include "MeshData/meshSingleton.h"
#include "MeshData/meshSet.h"
#include "MeshData/meshKernal.h"
#include "PointCloudOperator/PointCloudCommon.h"
#include "PointCloudOperator/PointCloudMesh.h"
#include "Settings/BusAPI.h"
#include "IO/IOConfig.h"
#include "ModuleBase/ThreadControl.h"
#include "ConfigOptions/ConfigOptions.h"
#include "ConfigOptions/MeshConfig.h"
#include "Common/DebugLogger.h"
#include "PythonModule/PyAgent.h"
#include <QTextCodec>
#include <QMenu>
#include <QDebug>
namespace MainWidget {
DialogMeshSurfaceSampling::DialogMeshSurfaceSampling(GUI::MainWindow* parent) : QFDialog(parent),
_ui(new Ui::DialogMeshSurfaceSampling), _mw(parent), _selectdlg(new DialogSelectComponents(parent)) {
namespace MeshSurfaceSampling {
DialogMeshSurfaceVtkPointSampling::DialogMeshSurfaceVtkPointSampling(GUI::MainWindow* parent)
: QFDialog(parent)
, _ui(new Ui::DialogMeshSurfaceVtkPointSampling)
, _mw(parent)
, _selectdlg(new MainWidget::DialogSelectComponents(parent))
{
_ui->setupUi(this);
_ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
setWindowTitle(tr("Fast Bilateral Filter"));
_ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]() {
_selectdlg->clearSelectItems();
_selectdlg->exec();
});
connect(_selectdlg, SIGNAL(selectedComponentsSig(QList<MeshData::MeshSet*>)), this,
SLOT(selectedComponentsSlot(QList<MeshData::MeshSet*>)));
connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this,
SLOT(customContextMenuRequestedSlot(const QPoint&)));
}
DialogMeshSurfaceSampling::~DialogMeshSurfaceSampling()
DialogMeshSurfaceVtkPointSampling::~DialogMeshSurfaceVtkPointSampling()
{
delete _ui;
_ui = NULL;
@ -27,11 +62,295 @@ namespace MainWidget {
_selectdlg = NULL;
}
void DialogMeshSurfaceSampling::removeCurrentItem(QListWidgetItem* curItem) {}
void DialogMeshSurfaceSampling::accept()
void DialogMeshSurfaceVtkPointSampling::removeCurrentItem(QListWidgetItem* curItem)
{
QDialog::accept();
auto meshData = MeshData::MeshData::getInstance();
auto meshSet = meshData->getMeshSetByName(curItem->text());
if(!meshSet)
return;
_components.removeOne(meshSet);
_ui->listWidget->removeItemWidget(curItem);
delete curItem;
}
void DialogMeshSurfaceVtkPointSampling::accept()
{
qDebug()<<"DialogMeshSurfaceVtkPointSampling::accept";
QString AbFileName;
QString componentIds;
size_t pointCount = 0;
double radius = 0;
// meshset选择
{
if(_components.size() == 0)
return;
// 获取选择对象
for(auto component : _components) {
componentIds.append(QString(",%1").arg(component->getID()));
}
componentIds.remove(0, 1);
// 结果重命名
QString outfilename = "filter";
for(auto component : _components)
outfilename.append(QString("_%1").arg(component->getName()));
// 确定是否保存结果文件
QMessageBox::StandardButton result =
QMessageBox::critical(this, "info", "save as result ?");
QString filepath =QDir::cleanPath(Setting::BusAPI::instance()->getWorkingDir() + QDir::separator() +outfilename + "_tmep.vtk");
if(result == QMessageBox::StandardButton::Ok
|| result == QMessageBox::StandardButton::Yes) {
QStringList suffixlist = IO::IOConfigure::getMeshExporters();
if(suffixlist.isEmpty()) {
QMessageBox::warning(this, tr("Warning"),
tr("The MeshPlugin is not installed !"));
return;
}
if(MeshData::MeshData::getInstance()->getKernalCount() == 0) {
QMessageBox::warning(this, tr("Warning"), tr("No one has any grid!"));
return;
}
QStringList meshsuffix =
ConfigOption::ConfigOption::getInstance()
->getMeshConfig()
->getExportSuffix(ConfigOption::MeshDataType::vtkMesh)
.split(";");
QStringList list;
for(QString s : meshsuffix) {
for(int i = 0; i < suffixlist.size(); i++) {
QString suffix = suffixlist.at(i);
if(suffix.contains(s))
list.append(suffix);
}
}
std::sort(list.begin(), list.end());
QString suffixes = list.join(";;");
QString workDir = Setting::BusAPI::instance()->getWorkingDir();
QFileDialog dlg(this, tr("Export sample vtk"), workDir, suffixes);
dlg.setAcceptMode(QFileDialog::AcceptSave);
if(dlg.exec() != QFileDialog::FileName)
return;
QString aSuffix = dlg.selectedNameFilter();
QString aFileName = dlg.selectedFiles().join(",");
if(!(aFileName.isEmpty())) {
filepath = aFileName;
} else {
}
AbFileName = filepath;
QTextCodec* codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(filepath);
std::string outFileName = ba.data();
} else { // 不保存成点云数据
}
}
// 参数
{
pointCount = _ui->PointCountSpinBox->value();
radius = _ui->RadiusDoubleBox->value();
}
qDebug()<<"pclfilter start ";
// 启动算法线程
auto pclfilter = new MeshSurfaceVtkPointSamplingThread(AbFileName, _mainWindow,
componentIds, pointCount, radius);
ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclfilter);
emit tc->threadStart(); // emit MSHwriter->start();
QFDialog::accept();
}
void
DialogMeshSurfaceVtkPointSampling::selectedComponentsSlot(QList<MeshData::MeshSet*> components)
{
for(MeshData::MeshSet* set : components) {
if(_components.contains(set))
continue;
_components.clear();
_ui->listWidget->clear();
_components.append(set);
_ui->listWidget->addItem(set->getName());
}
}
void DialogMeshSurfaceVtkPointSampling::customContextMenuRequestedSlot(const QPoint& point)
{
QListWidgetItem* curItem = _ui->listWidget->itemAt(point);
if(!curItem)
return;
QMenu* menu = new QMenu(this);
QAction* deleteItem = new QAction(tr("delete this item"));
menu->addAction(deleteItem);
connect(menu, &QMenu::triggered, [=]() { removeCurrentItem(curItem); });
menu->exec(QCursor::pos());
}
// 算法
MeshSurfaceVtkPointSamplingThread::MeshSurfaceVtkPointSamplingThread(const QString& fileName,
GUI::MainWindow* mw,
QString componentIds,
size_t pointcount,
double radius)
: ModuleBase::ThreadTask(mw)
, _fileName(fileName)
, _componentIds(componentIds)
, _pointCount(pointcount)
, _radius(radius)
{
}
MeshSurfaceVtkPointSamplingThread::~MeshSurfaceVtkPointSamplingThread() {}
void MeshSurfaceVtkPointSamplingThread::run()
{
ModuleBase::ThreadTask::run();
bool result = vtkpointsampling();
setThreadRunState(result);
DebugInfo("run ok _success %d _threadRuning %d \n", _success, _threadRuning);
defaultMeshFinished();
}
void MeshSurfaceVtkPointSamplingThread::defaultMeshFinished()
{
ModuleBase::ThreadTask::threadTaskFinished();
Py::PythonAgent::getInstance()->unLock();
if(_threadRuning) {
QString information{};
ModuleBase::Message msg;
if(_success) {
information = QString("Successful Import Mesh From \"%1\"").arg(_fileName);
msg.type = Common::Message::Normal;
msg.message = information;
qDebug() << "PointCloudThreadBase::defaultMeshFinished()";
QFileInfo info(_fileName);
QString name = info.fileName();
QString path = info.filePath();
QString suffix = info.suffix().toLower();
if(info.exists()) {
if(suffix.toLower().contains("stl")){
suffix="STL(*.stl)";
emit _mainwindow->importMeshSIGN(_fileName,suffix,-1);
}else if(suffix.toLower().contains("vtk")){
suffix="VTK(*.vtk)";
emit _mainwindow->importMeshSIGN(_fileName,suffix,-1);
}else if(suffix.toLower().contains("neu")){
suffix="Gambit(*.neu)";
emit _mainwindow->importMeshSIGN(_fileName,suffix,-1);
}else{
information = QString("Failed Filter From \"%1\"").arg(_fileName);
msg.type = Common::Message::Error;
msg.message = information;
qDebug() << "Failed Import Mesh From " << _fileName;
}
}
qDebug() << "emit sign to windows ";
} else {
information = QString("Failed Filter From \"%1\"").arg(_fileName);
msg.type = Common::Message::Error;
msg.message = information;
}
emit showInformation(information);
emit _mainwindow->printMessageToMessageWindow(msg);
qDebug() << "filter thread overing !!! ";
}
}
void MeshSurfaceVtkPointSamplingThread::setThreadRunState(bool) {}
bool MeshSurfaceVtkPointSamplingThread::vtkpointsampling()
{
vtkSmartPointer<vtkPolyData> surfaceMesh =
vtkSmartPointer<vtkPolyData>::New(); // 从某个源获取网格表面数据
vtkSmartPointer<vtkPolyData> uniformPointCloud = vtkSmartPointer<vtkPolyData>::New();
{
QString componentIds = _componentIds;
emit _mainwindow->printMessage(Common::Message::Normal, "PCLGPMeshAlg");
QStringList qCompontIds = QString(componentIds).split(',');
MeshData::MeshSet* meshSet = NULL;
MeshData::MeshKernal* meshKernal = NULL;
MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
QString kernalName, transformedName, setType, ids;
vtkSmartPointer<vtkGeometryFilter> cellToPointFilter =
vtkSmartPointer<vtkGeometryFilter>::New();
// 获取网格
{
for(QString compontId : qCompontIds) {
meshSet = meshData->getMeshSetByID(compontId.toInt());
DebugInfo("point count %d : %d \n", compontId.toInt(), meshSet == nullptr);
if(!meshSet)
continue;
QString outfilename = meshSet->getName();
cellToPointFilter->SetInputData(
PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet));
DebugInfo("point count %d \n", compontId.toInt());
}
// 执行过滤操作
cellToPointFilter->Update();
DebugInfo("cellToPointFilter \n");
// 获取过滤后的 vtkPolyData
surfaceMesh = cellToPointFilter->GetOutput();
}
}
bool flag=PointCloudOperator::PointCloudMeshOperator::vtkPointSampling(surfaceMesh,uniformPointCloud,_pointCount,_radius);
if(flag){
qDebug()<<"vtkPointSampling true";
}else{return false;}
// 保存数据
//return false;
{ // 写出到文件中
// 加载文件
QFileInfo info(_fileName);
QString name = info.fileName();
QString path = info.filePath();
QString suffix = info.suffix().toLower();
QTextCodec* codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(_fileName);
std::string outFileName = ba.data();
DebugInfo("writing %s suffix %s !! \n", ba.data(), suffix.toStdString().c_str());
if(suffix == "vtk") {
vtkSmartPointer<vtkUnstructuredGridWriter> writer =
vtkSmartPointer<vtkUnstructuredGridWriter>::New();
writer->SetInputData(uniformPointCloud);
writer->SetFileTypeToBinary();
writer->SetFileName(ba);
writer->Write();
DebugInfo("writing vtk !! \n");
} else if(suffix == "stl") {
QTextCodec* codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(_fileName);
vtkSmartPointer<vtkSTLWriter> writer = vtkSmartPointer<vtkSTLWriter>::New();
writer->SetInputData(uniformPointCloud);
writer->SetFileTypeToBinary();
writer->SetFileName(ba);
writer->Write();
DebugInfo("writing stl !! \n");
} else {
}
}
DebugInfo("dataset %d _fileName %s \n", nullptr==uniformPointCloud, _fileName.toStdString().c_str());
if (nullptr == uniformPointCloud) { } else {
qDebug()<<"vtkPointSampling cell count :\t " + QString::number(uniformPointCloud->GetNumberOfCells())+ " point count :\t "+QString::number(uniformPointCloud->GetNumberOfPoints());
DebugInfo("uniformPointCloud variable is nullptr !! \n");
}
QFile outfile(_fileName);
if (outfile.exists()) {
DebugInfo("vtkpointsampling main process sucessfully !! \n");
return true;
} else {
DebugInfo("vtkpointsampling main process fail !! \n");
return false;
}
DebugInfo("vtkpointsampling main process fail !! \n");
return false;
}
void DialogMeshSurfaceSampling::selectedComponentsSlot(QList<MeshData::MeshSet*> components) {}
void DialogMeshSurfaceSampling::customContextMenuRequestedSlot(const QPoint& point) {}
} // namespace MeshSurfaceSampling

View File

@ -15,57 +15,78 @@
#include "MainWidgets/DialogVTKTransform.h"
#include "MainWindow/MainWindow.h"
#include "MainWindow/SubWindowManager.h"
#include "ModuleBase/ThreadTask.h"
#include <QDialog>
#include <QListWidgetItem>
//=======================
// 窗口部分
//=======================
namespace MainWidget {
class DialogSelectComponents;
}
namespace MeshSurfaceSampling{
namespace Ui {
class DialogMeshSurfaceSampling;
class DialogMeshSurfaceVtkPointSampling;
}
class DialogSelectComponents;
class MeshSurfaceVtkPointSamplingThread:public ModuleBase::ThreadTask{
public:
MeshSurfaceVtkPointSamplingThread(const QString& fileName, GUI::MainWindow* mw, QString componentIds, size_t pointcount, double radius);
virtual ~MeshSurfaceVtkPointSamplingThread();
virtual void run();
void defaultMeshFinished();
void setThreadRunState(bool);
private:
bool vtkpointsampling();
private:
bool _success{false};
QString _fileName;
QString _componentIds;
size_t _pointCount;
double _radius;
};
class MESHDATAEXCHANGEPLUGINAPI DialogMeshSurfaceSampling : public QFDialog {
/*
* @brief MeshSurface vtk PointSampler , dialog
*/
class MESHDATAEXCHANGEPLUGINAPI DialogMeshSurfaceVtkPointSampling : public QFDialog {
Q_OBJECT
public:
DialogMeshSurfaceSampling(GUI::MainWindow* parent);
~DialogMeshSurfaceSampling() ;
DialogMeshSurfaceVtkPointSampling(GUI::MainWindow* parent);
~DialogMeshSurfaceVtkPointSampling() ;
private:
void removeCurrentItem(QListWidgetItem* curItem);
signals: // 这里采用信号来直接与 主界面通信,避免参数浪费
private slots:
virtual void accept();
void selectedComponentsSlot(QList<MeshData::MeshSet*> components);
void customContextMenuRequestedSlot(const QPoint& point);
private:
GUI::MainWindow* _mw;
DialogSelectComponents* _selectdlg;
MainWidget::DialogSelectComponents* _selectdlg;
QList<MeshData::MeshSet*> _components;
private:
Ui::DialogMeshSurfaceSampling* _ui;
Ui::DialogMeshSurfaceVtkPointSampling* _ui;
};
} // namespace MeshSurfaceSampling
#endif // LAMPCAE_DIALOGMESHSURFACESAMPLING_H

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWidget::DialogMeshSurfaceSampling</class>
<widget class="QDialog" name="MainWidget::DialogMeshSurfaceSampling">
<class>MeshSurfaceSampling::DialogMeshSurfaceVtkPointSampling</class>
<widget class="QDialog" name="MeshSurfaceSampling::DialogMeshSurfaceVtkPointSampling">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>622</width>
<height>374</height>
<height>462</height>
</rect>
</property>
<property name="windowTitle">
<string>DialogMeshSurfaceSampling</string>
<string>DialogMeshSurfaceVtkPointSampling</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
@ -106,6 +106,103 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
<width>357</width>
<height>120</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>600</width>
<height>400</height>
</size>
</property>
<property name="title">
<string>params</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="SearchRadiusLabel">
<property name="minimumSize">
<size>
<width>91</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>Sampling Point Count: </string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="MuLabel">
<property name="minimumSize">
<size>
<width>91</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>Sampling search Radius : </string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QDoubleSpinBox" name="RadiusDoubleBox">
<property name="minimumSize">
<size>
<width>238</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>238</width>
<height>25</height>
</size>
</property>
<property name="decimals">
<number>5</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>29999999999999998907688884895744.000000000000000</double>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="value">
<double>2.500000000000000</double>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="PointCountSpinBox">
<property name="maximum">
<number>2000000000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QDialogButtonBox" name="btBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -120,5 +217,38 @@
<resources>
<include location="../qrc/qianfan.qrc"/>
</resources>
<connections/>
<connections>
<connection>
<sender>btBox</sender>
<signal>accepted()</signal>
<receiver>MeshSurfaceSampling::DialogMeshSurfaceVtkPointSampling</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>310</x>
<y>436</y>
</hint>
<hint type="destinationlabel">
<x>310</x>
<y>230</y>
</hint>
</hints>
</connection>
<connection>
<sender>btBox</sender>
<signal>rejected()</signal>
<receiver>MeshSurfaceSampling::DialogMeshSurfaceVtkPointSampling</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>310</x>
<y>436</y>
</hint>
<hint type="destinationlabel">
<x>310</x>
<y>230</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -30,4 +30,12 @@ namespace MeshData
};
}
#endif

View File

@ -21,12 +21,13 @@
#include <QFileInfo>
GUI::MainWindow* MeshData::MeshDataExchangePlugin::_mainwindow = nullptr;
namespace MeshData {
MeshDataExchangePlugin::MeshDataExchangePlugin(GUI::MainWindow* m)
{
_describe = "MeshDataExchangePlugin Installed Successfully";
_mainwindow = m;
connect(_mainwindow, SIGNAL(on_actionvtkPointSamplorTriggleSIGNAL(GUI::MainWindow*)),this,SLOT(vtkPointSamplerDialog(GUI::MainWindow*)));
}
bool MeshDataExchangePlugin::install()
@ -97,7 +98,6 @@ namespace MeshData {
IO::IOConfigure::RemovePclExporter("PDB(*.pdb)");
IO::IOConfigure::RemovePclExporter("vtk polygon Data(*.ply)");
return true;
}
@ -107,40 +107,14 @@ namespace MeshData {
{
return _mainwindow;
}
void MeshDataExchangePlugin::vtkPointSamplerDialog(GUI::MainWindow* m) {
DebugInfo("MeshSurfaceSamplingPlugin::vtkPointSamplerDialog has init\n");
MeshSurfaceSampling::DialogMeshSurfaceVtkPointSampling* w = new MeshSurfaceSampling::DialogMeshSurfaceVtkPointSampling(m);
w->show();
}
}
//namespace MeshSurfaceSampling
//{
// MeshSurfaceSamplingPlugin::MeshSurfaceSamplingPlugin(GUI::MainWindow* m) {
//
//
// }
// bool MeshSurfaceSamplingPlugin::install()
// {
// if(_mainwindow == nullptr)
// return false;
// PluginBase::install();
// DebugInfo("MeshSurfaceSamplingPlugin has install\n ");
// return true;
// }
// bool MeshSurfaceSamplingPlugin::uninstall()
// {
// PluginBase::uninstall();
// return true;
// }
// void MeshSurfaceSamplingPlugin::reTranslate(QString)
// {
//
// }
// GUI::MainWindow* MeshSurfaceSamplingPlugin::getMWpt()
// {
// return _mainwindow;
// }
//} // MeshSurfaceSampling MeshData
@ -156,8 +130,6 @@ void Register(GUI::MainWindow* m, QList<Plugins::PluginBase*>* ps)
Plugins::PluginBase* p_meshdataExchangeplugin = new MeshData::MeshDataExchangePlugin(m);
ps->append(p_meshdataExchangeplugin);
// Plugins::PluginBase* p_meshSurfaceSample = new MeshSurfaceSampling::MeshSurfaceSamplingPlugin(m);
// ps->append(p_meshSurfaceSample);
}

View File

@ -8,6 +8,7 @@ namespace MeshData {
enum MeshOperation { MESH_NONE, MESH_READ, MESH_WRITE };
class MESHDATAEXCHANGEPLUGINAPI MeshDataExchangePlugin : public Plugins::PluginBase {
Q_OBJECT
public:
MeshDataExchangePlugin(GUI::MainWindow* m);
~MeshDataExchangePlugin() = default;
@ -16,33 +17,13 @@ namespace MeshData {
bool uninstall();
void reTranslate(QString);
static GUI::MainWindow* getMWpt();
public slots:
void vtkPointSamplerDialog(GUI::MainWindow* m);
private:
static GUI::MainWindow* _mainwindow;
};
}
//
//namespace MeshSurfaceSampling
//{
// class MESHDATAEXCHANGEPLUGINAPI MeshSurfaceSamplingPlugin: public Plugins::PluginBase
// {
// public:
// MeshSurfaceSamplingPlugin(GUI::MainWindow* m);
// ~MeshSurfaceSamplingPlugin() = default;
//
// bool install();
// bool uninstall();
// void reTranslate(QString);
// static GUI::MainWindow* getMWpt();
//
// private:
// static GUI::MainWindow* _mainwindow;
// };
//
//
//}
extern "C"
{
void MESHDATAEXCHANGEPLUGINAPI Register(GUI::MainWindow* m, QList<Plugins::PluginBase*>* plugs);

View File

@ -43,7 +43,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
#
#-----------------------------------------------------------------------------
set(_qrc "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/qianfan.qrc")
set(_lang "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/translations.qrc")
#set(_lang "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/translations.qrc")
qt5_add_resources(_resource ${_qrc} ${_lang})
#-----------------------------------------------------------------------------
@ -76,6 +76,8 @@ link_directories("C:/PCL/lib")
find_package(Qt5 REQUIRED COMPONENTS Core Quick Sql Core Xml Opengl Gui Svg Xmlpatterns Uitools Widgets Qml Printsupport Sensors Quickwidgets Quick Concurrent Openglextensions Charts Datavisualization)
find_package(PCL )
# QGIS
find_package(QGIS REQUIRED)
# boost
include_directories(D:/vcpkg/installed/x64-windows/include)
@ -99,8 +101,7 @@ target_compile_definitions(PluginRasterTool PRIVATE "NOMINMAX") # 禁用vc++ 中
target_compile_definitions(PluginRasterTool PRIVATE "RASTERTOOLPLUGIN_API")
list(APPEND _depend_library
Common PointCloudOperator PythonModule DataProperty MeshData Material Geometry BCBase ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GeometryCommand GeometryWidgets IO MainWidgets MainWindow)
llqgisbaselib Common PythonModule DataProperty MeshData Material Geometry BCBase ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GeometryCommand GeometryWidgets IO MainWidgets MainWindow)

View File

@ -0,0 +1,27 @@
/**
* @file QGISRasterManaget.cpp
* @brief None
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 24-5-27
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#include "QGISRasterManager.h"
namespace RasterShowTool {
void QGISRasterManager::initialize(){
}
QGISRasterManager::~QGISRasterManager() {
}
QGISRasterManager::QGISRasterManager(QObject* parent, GUI::MainWindow* m): {
this->m=m;
mApp = ll_qgis_base_lib::Instance();
mApp->initialize(this->m);
}
} // namespace RasterShowTool

View File

@ -0,0 +1,37 @@
/**
* @file QGISRasterManaget.h
* @brief None
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 24-5-27
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#ifndef LAMPCAE_QGISRASTERMANAGER_H
#define LAMPCAE_QGISRASTERMANAGER_H
#include "RasterToolPluginAPI.h"
#include <QObject>
#include "MainWindow/MainWindow.h"
#include "llqgisbaselib/ll_qgis_base_lib.h"
namespace RasterShowTool {
class RASTERTOOLPLUGINAPI QGISRasterManager :public QObject{
Q_OBJECT
public:
QGISRasterManager(QObject* parent,GUI::MainWindow* m) ;
~QGISRasterManager() ;
static inline QGISRasterManager *instance() { return sm_instance; };
void initialize();
private:
static QGISRasterManager* sm_instance;
GUI::MainWindow* m;
ll_qgis_base_lib *mApp = nullptr; // 包含stack + mapviewer
};
} // namespace RasterShowTool
#endif // LAMPCAE_QGISRASTERMANAGER_H

View File

@ -2,100 +2,58 @@
#include <QFileInfo>
//
//GUI::MainWindow* MeshData::MeshDataExchangePlugin::_mainwindow = nullptr;
//
//namespace MeshData {
// MeshDataExchangePlugin::MeshDataExchangePlugin(GUI::MainWindow* m)
// {
// _describe = "MeshDataExchangePlugin Installed Successfully";
// _mainwindow = m;
// }
//
// bool MeshDataExchangePlugin::install()
// {
// IO::IOConfigure::RegisterMeshImporter("CGNS(*.cgns)", CGNSimportMesh);
// IO::IOConfigure::RegisterMeshImporter("Fluent(*.msh)", MSHimportMesh);
// IO::IOConfigure::RegisterMeshImporter("OpenFOAM(*.foam)", FOAMimportMesh);
// IO::IOConfigure::RegisterMeshImporter("Gambit(*.neu)", NEUimportMesh);
// IO::IOConfigure::RegisterMeshImporter("STL(*.stl)", VTK_DAT_STL_importMesh);
// IO::IOConfigure::RegisterMeshImporter("Tecplot(*.dat)", VTK_DAT_STL_importMesh);
// IO::IOConfigure::RegisterMeshImporter("VTK(*.vtk)", VTK_DAT_STL_importMesh);
// IO::IOConfigure::RegisterMeshImporter("Abaqus(*.inp)", INPimportMesh);
// IO::IOConfigure::RegisterMeshImporter("CNTM(*.cntm)", CNTMimportMesh);
// IO::IOConfigure::RegisterMeshImporter("SU2(*.su2)", SU2importMesh);
// IO::IOConfigure::RegisterMeshImporter("LS-DYNA(*.k)", KEYimportMesh);
// IO::IOConfigure::RegisterMeshImporter("PDB(*.pdb)", PDBimportMesh);
// IO::IOConfigure::RegisterMeshImporter("Patran(*.bdf)", BDFimportMesh);
// IO::IOConfigure::RegisterPclImporter("VegetationPointCloud(*.xyz)", XYZimportPCL); // 点云
// IO::IOConfigure::RegisterPclImporter("Point Cloud Data(*.pcd)",PCDimportPCL);
// IO::IOConfigure::RegisterPclImporter("Polygon File Format(*.ply)",PLYimportPCL);
//
// IO::IOConfigure::RegisterMeshExporter("CGNS(*.cgns)", CGNSexportMesh);
// IO::IOConfigure::RegisterMeshExporter("Fluent(*.msh)", MSHexportMesh);
// IO::IOConfigure::RegisterMeshExporter("OpenFOAM(*.foam)", FOAMexportMesh);
// IO::IOConfigure::RegisterMeshExporter("Gambit(*.neu)", NEUexportMesh);
// IO::IOConfigure::RegisterMeshExporter("STL(*.stl)", VTK_DAT_STL_exportMesh);
// IO::IOConfigure::RegisterMeshExporter("Tecplot(*.dat)", VTK_DAT_STL_exportMesh);
// IO::IOConfigure::RegisterMeshExporter("VTK(*.vtk)", VTK_DAT_STL_exportMesh);
// IO::IOConfigure::RegisterMeshExporter("Abaqus(*.inp)", INPexportMesh);
// IO::IOConfigure::RegisterMeshExporter("CNTM(*.cntm)", CNTMexportMesh);
// IO::IOConfigure::RegisterMeshExporter("SU2(*.su2)", SU2exportMesh);
// IO::IOConfigure::RegisterMeshExporter("LS-DYNA(*.key)", KEYexportMesh);
// IO::IOConfigure::RegisterMeshExporter("PDB(*.pdb)", PDBexportMesh);
// IO::IOConfigure::RegisterPclExporter("Point Cloud Data(*.pcd)",PCDexportPCL);
// IO::IOConfigure::RegisterPclExporter("vtk polygon Data(*.ply)",PLYexportPCL);
//
//
// return true;
// }
//
// bool MeshDataExchangePlugin::uninstall()
// {
// IO::IOConfigure::RemoveMeshImporter("CGNS(*.cgns)");
// IO::IOConfigure::RemoveMeshImporter("Fluent(*.msh)");
// IO::IOConfigure::RemoveMeshImporter("Gambit(*.neu)");
// IO::IOConfigure::RemoveMeshImporter("STL(*.stl)");
// IO::IOConfigure::RemoveMeshImporter("Tecplot(*.dat)");
// IO::IOConfigure::RemoveMeshImporter("VTK(*.vtk)");
// IO::IOConfigure::RemoveMeshImporter("Abaqus(*.inp)");
// IO::IOConfigure::RemoveMeshImporter("CNTM(*.cntm)");
// IO::IOConfigure::RemoveMeshImporter("SU2(*.su2)");
// IO::IOConfigure::RemoveMeshImporter("LS-DYNA(*.key)");
// IO::IOConfigure::RemoveMeshImporter("PDB(*.pdb)");
// IO::IOConfigure::RemoveMeshImporter("Patran(*.bdf)");
// IO::IOConfigure::RemovePclImporter("VegetationPointCloud(*.xyz)"); // 点云
// IO::IOConfigure::RemovePclImporter("Point Cloud Data(*.pcd)");
// IO::IOConfigure::RemovePclImporter("Polygon File Format(*.ply)");
//
// IO::IOConfigure::RemoveMeshExporter("CGNS(*.cgns)");
// IO::IOConfigure::RemoveMeshExporter("Fluent(*.msh)");
// IO::IOConfigure::RemoveMeshExporter("Gambit(*.neu)");
// IO::IOConfigure::RemoveMeshExporter("STL(*.stl)");
// IO::IOConfigure::RemoveMeshExporter("Tecplot(*.dat)");
// IO::IOConfigure::RemoveMeshExporter("VTK(*.vtk)");
// IO::IOConfigure::RemoveMeshExporter("Abaqus(*.inp)");
// IO::IOConfigure::RemoveMeshExporter("CNTM(*.cntm)");
// IO::IOConfigure::RemoveMeshExporter("SU2(*.su2)");
// IO::IOConfigure::RemoveMeshExporter("LS-DYNA(*.key)");
// IO::IOConfigure::RemovePclExporter("PDB(*.pdb)");
// IO::IOConfigure::RemovePclExporter("vtk polygon Data(*.ply)");
//
//
// return true;
// }
//
// void MeshDataExchangePlugin::reTranslate(QString) {}
//
// GUI::MainWindow* MeshDataExchangePlugin::getMWpt()
// {
// return _mainwindow;
// }
//} // namespace MeshData
//
//void Register(GUI::MainWindow* m, QList<Plugins::PluginBase*>* ps)
//{
// Plugins::PluginBase* p = new MeshData::MeshDataExchangePlugin(m);
// ps->append(p);
//}
//
GUI::MainWindow* RasterShowTool::RasterToolPlugin::_mainwindow = nullptr;
namespace RasterShowTool {
RasterToolPlugin::RasterToolPlugin(GUI::MainWindow* m)
{
_describe = "MeshDataExchangePlugin Installed Successfully";
_mainwindow = m;
// 初始化控制
// 添加界面
// 界面绑定
}
bool RasterToolPlugin::install()
{
return true;
}
bool RasterToolPlugin::uninstall()
{
return true;
}
void RasterToolPlugin::reTranslate(QString) {}
GUI::MainWindow* RasterToolPlugin::getMWpt()
{
return _mainwindow;
}
} // namespace MeshData
void Register(GUI::MainWindow* m, QList<Plugins::PluginBase*>* ps)
{
Plugins::PluginBase* p = new RasterShowTool::RasterToolPlugin(m);
ps->append(p);
}

View File

@ -3,38 +3,34 @@
#include "RasterToolPluginAPI.h"
#include "PluginManager/pluginBase.h"
#include "qgsmapcanvas.h"
//namespace MeshData
//{
// enum MeshOperation
// {
// MESH_NONE,
// MESH_READ,
// MESH_WRITE
// };
//
// class MESHDATAEXCHANGEPLUGINAPI MeshDataExchangePlugin : public Plugins::PluginBase
// {
// public:
// MeshDataExchangePlugin(GUI::MainWindow* m);
// ~MeshDataExchangePlugin() = default;
//
// bool install();
// bool uninstall();
// void reTranslate(QString);
// static GUI::MainWindow* getMWpt();
//
// private:
// static GUI::MainWindow* _mainwindow;
// };
//}
//
//extern "C"
//{
// void MESHDATAEXCHANGEPLUGINAPI Register(GUI::MainWindow* m, QList<Plugins::PluginBase*>* plugs);
// //函数返回值是无效的,不要通过返回值判断
//
//
//}
namespace RasterShowTool
{
class RASTERTOOLPLUGINAPI RasterToolPlugin : public Plugins::PluginBase
{
public:
RasterToolPlugin(GUI::MainWindow* m);
~RasterToolPlugin() = default;
bool install();
bool uninstall();
void reTranslate(QString);
static GUI::MainWindow* getMWpt();
private:
static GUI::MainWindow* _mainwindow;
};
}
extern "C"
{
void RASTERTOOLPLUGINAPI Register(GUI::MainWindow* m, QList<Plugins::PluginBase*>* plugs);
//函数返回值是无效的,不要通过返回值判断
}
#endif

View File

@ -316,6 +316,24 @@
#include "PointManagerClass.h"
#include "WBFZExchangePluginAPI.h"
// qwt
#include <QwtPlot>
#include <QwtColorMap>
#include <QwtPlotSpectrogram>
#include <QwtScaleWidget>
#include <QwtScaleDraw>
#include <QwtPlotZoomer>
#include <QwtPlotPanner>
#include <QwtPlotLayout>
#include <QwtPlotRenderer>
#include <QwtInterval>
#include <QwtPainter>
#include <QPrinter>
#include <QPen>
#include <QPrintDialog>
#include <QElapsedTimer>
enum TaskStatusEnum {

View File

@ -5,12 +5,13 @@
///
/// 基本类、基本函数
///
//#define EIGEN_USE_MKL_ALL
//#define EIGEN_VECTORIZE_SSE4_2
//#include <mkl.h>
///
// #define EIGEN_USE_MKL_ALL
// #define EIGEN_VECTORIZE_SSE4_2
// #include <mkl.h>
//#include <mkl.h>
// #include <mkl.h>
#include "WBFZExchangePluginAPI.h"
#include <complex>
#include <iostream>
#include <Eigen/Core>
@ -22,56 +23,52 @@
#include <gdal.h>
#include <gdal_priv.h>
#include <gdalwarper.h>
#include <ogrsf_frmts.h>
#include <ogrsf_frmts.h>
#include <fstream>
#include "GeoOperator.h"
#include <vector>
#include <string>
using namespace std;
using namespace Eigen;
///////////////////////////////////// 运行时间打印 //////////////////////////////////////////////////////////
///////////////////////////////////// 运行时间打印
/////////////////////////////////////////////////////////////
QString getCurrentTimeString();
QString getCurrentShortTimeString();
QString WBFZAPI getCurrentTimeString();
QString WBFZAPI getCurrentShortTimeString();
std::vector<QString> splitString(const QString& str, char delimiter);
std::vector<QString> WBFZAPI splitString(const QString& str, char delimiter);
/////////////////////////////// 基本图像类 结束
/////////////////////////////////////////////////////////////
/////////////////////////////// 基本图像类 结束 //////////////////////////////////////////////////////////
string Convert(float Num);
QString JoinPath(const QString& path, const QString& filename);
string WBFZAPI Convert(float Num);
QString WBFZAPI JoinPath(const QString& path, const QString& filename);
////////////////////////////// 坐标部分基本方法 //////////////////////////////////////////
////////////////////////////// 坐标部分基本方法 //////////////////////////////////////////
////////////////////////////// 插值 ////////////////////////////////////////////
complex<double> Cubic_Convolution_interpolation(double u, double v, Eigen::MatrixX<complex<double>> img);
complex<double> WBFZAPI Cubic_Convolution_interpolation(double u, double v,
Eigen::MatrixX<complex<double>> img);
complex<double> Cubic_kernel_weight(double s);
complex<double> WBFZAPI Cubic_kernel_weight(double s);
double Bilinear_interpolation(Landpoint p0, Landpoint p11, Landpoint p21, Landpoint p12, Landpoint p22);
bool onSegment(Point_3d Pi, Point_3d Pj, Point_3d Q);
Point_3d invBilinear(Point_3d p, Point_3d a, Point_3d b, Point_3d c, Point_3d d);
double WBFZAPI Bilinear_interpolation(Landpoint p0, Landpoint p11, Landpoint p21, Landpoint p12,
Landpoint p22);
bool WBFZAPI onSegment(Point_3d Pi, Point_3d Pj, Point_3d Q);
Point_3d WBFZAPI invBilinear(Point_3d p, Point_3d a, Point_3d b, Point_3d c, Point_3d d);
//
// WGS84 到J2000 坐标系的变换
// 参考网址https://blog.csdn.net/hit5067/article/details/116894616
// 资料网址http://celestrak.org/spacedata/
// 资料网址http://celestrak.org/spacedata/
// 参数文件:
// a. Earth Orientation Parameter 文件: http://celestrak.org/spacedata/EOP-Last5Years.csv
// b. Space Weather Data 文件: http://celestrak.org/spacedata/SW-Last5Years.csv
@ -86,9 +83,8 @@ step 4: 瞬时真天球坐标系 转到瞬时平天球 坐标系
step 5: J2000
**/
double WBFZAPI sind(double degree);
double sind(double degree);
double cosd(double d);
double WBFZAPI cosd(double d);
#endif

View File

@ -129,8 +129,13 @@ include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
# qwt
include_directories(${Qwt_INCLUDE_DIRS})
link_directories(${Qwt_LIBRARY_DIRS})
message("qwt dir ${Qwt_INCLUDE_DIRS}")
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
@ -149,12 +154,12 @@ get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
list(APPEND _depend_library
qcustomplot qhexedit qscintilla2 Common PointCloudOperator Settings PythonModule DataProperty MeshData Material Geometry BCBase ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GeometryCommand GeometryWidgets IO MainWidgets MainWindow
PointCloudOperator qcustomplot qhexedit qscintilla2 Common Settings PythonModule DataProperty MeshData Material Geometry BCBase ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GeometryCommand GeometryWidgets IO MainWidgets MainWindow
)
list(APPEND _runtimes_libraries
LAMPCAE::CGNS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml
LAMPCAE::CGNS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml LAMPCAE::QWT LAMPCAE::QWTPOLAR
)
@ -208,4 +213,5 @@ set_target_properties(PluginWBFZExchangePlugin
ARCHIVE_OUTPUT_DIRECTORY_DEBUG $<TARGET_FILE_DIR:${PROJECT_NAME}>/plugins
LIBRARY_OUTPUT_DIRECTORY_DEBUG $<TARGET_FILE_DIR:${PROJECT_NAME}>/plugins
RUNTIME_OUTPUT_DIRECTORY_DEBUG $<TARGET_FILE_DIR:${PROJECT_NAME}>/plugins
)
)

View File

@ -32,31 +32,28 @@
#include "ConfigOptions/MeshConfig.h"
#include "Common/DebugLogger.h"
//auto meshData = MeshData::MeshData::getInstance();
// auto meshData = MeshData::MeshData::getInstance();
namespace MainWidget {
DialogPCLBilateralFilter::DialogPCLBilateralFilter(GUI::MainWindow *parent)
: QFDialog(parent),
_ui(new Ui::DialogPCLBilateralFilter),
_mw(parent),
_selectdlg(new DialogSelectComponents(parent))
DialogPCLBilateralFilter::DialogPCLBilateralFilter(GUI::MainWindow* parent)
: QFDialog(parent)
, _ui(new Ui::DialogPCLBilateralFilter)
, _mw(parent)
, _selectdlg(new DialogSelectComponents(parent))
{
_ui->setupUi(this);
_ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
setWindowTitle(tr("Fast Bilateral Filter"));
_ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
{ _selectdlg->clearSelectItems(); _selectdlg->exec(); });
connect(_selectdlg, SIGNAL(selectedComponentsSig(QList<MeshData::MeshSet *>)), this, SLOT(selectedComponentsSlot(QList<MeshData::MeshSet *>)));
connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]() {
_selectdlg->clearSelectItems();
_selectdlg->exec();
});
connect(_selectdlg, SIGNAL(selectedComponentsSig(QList<MeshData::MeshSet*>)), this,
SLOT(selectedComponentsSlot(QList<MeshData::MeshSet*>)));
connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this,
SLOT(customContextMenuRequestedSlot(const QPoint&)));
}
DialogPCLBilateralFilter::~DialogPCLBilateralFilter()
@ -66,31 +63,32 @@ namespace MainWidget {
delete _selectdlg;
_selectdlg = NULL;
}
void DialogPCLBilateralFilter::accept()
{
if (_components.size() == 0)
if(_components.size() == 0)
return;
QString componentIds;
for (auto component : _components)
for(auto component : _components)
componentIds.append(QString(",%1").arg(component->getID()));
componentIds.remove(0, 1);
double sigmaS=_ui->SigmaS->value();
double sigmaR=_ui->SigmaR->value();
double sigmaS = _ui->SigmaS->value();
double sigmaR = _ui->SigmaR->value();
QString outfilename="filter";
for (auto component : _components)
QString outfilename = "filter";
for(auto component : _components)
outfilename.append(QString("_%1").arg(component->getName()));
// 确定是否保存结果文件
QMessageBox::StandardButton result=QMessageBox::critical(this, "info","save as result ?");
QString filepath= JoinPath(Setting::BusAPI::instance()->getWorkingDir() ,outfilename+"_tmep.pcd");
QMessageBox::StandardButton result =
QMessageBox::critical(this, "info", "save as result ?");
QString filepath =
JoinPath(Setting::BusAPI::instance()->getWorkingDir(), outfilename + "_tmep.pcd");
QString AbFileName;
if(result==QMessageBox::StandardButton::Ok||result==QMessageBox::StandardButton::Yes){
if(result == QMessageBox::StandardButton::Ok
|| result == QMessageBox::StandardButton::Yes) {
QStringList suffixlist = IO::IOConfigure::getPclExporters();
if(suffixlist.isEmpty()) {
QMessageBox::warning(this, tr("Warning"), tr("The MeshPlugin is not installed !"));
@ -117,8 +115,8 @@ namespace MainWidget {
}
std::sort(list.begin(), list.end());
QString suffixes = list.join(";;");
QString workDir = Setting::BusAPI::instance()->getWorkingDir();
QString suffixes = list.join(";;");
QString workDir = Setting::BusAPI::instance()->getWorkingDir();
QFileDialog dlg(this, tr("Export Pcl"), workDir, suffixes);
dlg.setAcceptMode(QFileDialog::AcceptSave);
if(dlg.exec() != QFileDialog::FileName)
@ -126,68 +124,65 @@ namespace MainWidget {
QString aSuffix = dlg.selectedNameFilter();
QString aFileName = dlg.selectedFiles().join(",");
if(!(aFileName.isEmpty())){
filepath=aFileName;
if(!(aFileName.isEmpty())) {
filepath = aFileName;
}else{}
} else {
}
AbFileName=filepath;
QTextCodec *codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(filepath);
AbFileName = filepath;
QTextCodec* codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(filepath);
std::string outFileName=ba.data();
}else{ // 不保存成点云数据
std::string outFileName = ba.data();
} else { // 不保存成点云数据
}
// 启动线程
auto pclfilter = new WBFZ::PCLBilateralFilter(
AbFileName,WBFZ::PointCloudOperation::POINTCLOUD_FILTER,_mainWindow,componentIds, sigmaR, sigmaS);
auto pclfilter =
new WBFZ::PCLBilateralFilter(AbFileName, WBFZ::PointCloudOperation::POINTCLOUD_FILTER,
_mainWindow, componentIds, sigmaR, sigmaS);
ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclfilter);
emit tc->threadStart(); // emit MSHwriter->start();
QFDialog::accept();
}
void DialogPCLBilateralFilter::selectedComponentsSlot(QList<MeshData::MeshSet *> components)
void DialogPCLBilateralFilter::selectedComponentsSlot(QList<MeshData::MeshSet*> components)
{
for (MeshData::MeshSet *set : components)
{
if (_components.contains(set))
for(MeshData::MeshSet* set : components) {
if(_components.contains(set))
continue;
_components.append(set);
_ui->listWidget->addItem(set->getName());
}
}
void DialogPCLBilateralFilter::customContextMenuRequestedSlot(const QPoint &point)
void DialogPCLBilateralFilter::customContextMenuRequestedSlot(const QPoint& point)
{
QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
if (!curItem)
QListWidgetItem* curItem = _ui->listWidget->itemAt(point);
if(!curItem)
return;
QMenu *menu = new QMenu(this);
QAction *deleteItem = new QAction(tr("delete this item"));
QMenu* menu = new QMenu(this);
QAction* deleteItem = new QAction(tr("delete this item"));
menu->addAction(deleteItem);
connect(menu, &QMenu::triggered, [=]()
{ removeCurrentItem(curItem); });
connect(menu, &QMenu::triggered, [=]() { removeCurrentItem(curItem); });
menu->exec(QCursor::pos());
}
void DialogPCLBilateralFilter::removeCurrentItem(QListWidgetItem *curItem)
void DialogPCLBilateralFilter::removeCurrentItem(QListWidgetItem* curItem)
{
auto meshData = MeshData::MeshData::getInstance();
auto meshSet = meshData->getMeshSetByName(curItem->text());
if (!meshSet)
auto meshSet = meshData->getMeshSetByName(curItem->text());
if(!meshSet)
return;
_components.removeOne(meshSet);
_ui->listWidget->removeItemWidget(curItem);
delete curItem;
}
} // namespace MainWidget
WBFZ::PCLBilateralFilter::PCLBilateralFilter(const QString& fileName,
WBFZ::PointCloudOperation operation,
@ -200,40 +195,41 @@ WBFZ::PCLBilateralFilter::PCLBilateralFilter(const QString& fileName,
, _sigmaR(sigmaR)
, _sigmaS(sigmaS)
{
}
bool WBFZ::PCLBilateralFilter::filter()
{
bool flag=PCLBilateralFilterAlg( _componentIds, _sigmaR, _sigmaS);
bool flag = PCLBilateralFilterAlg(_componentIds, _sigmaR, _sigmaS);
qDebug("WBFZ::PCLBilateralFilter::filter finish !!");
return flag;
}
bool WBFZ::PCLBilateralFilter::PCLBilateralFilterAlg(QString componentIds, double sigmaR,
double sigmaS)
double sigmaS)
{
emit _mainwindow->printMessage(Common::Message::Normal,"PCLBilateralFilterAlg");
emit _mainwindow->printMessage(Common::Message::Normal, "PCLBilateralFilterAlg");
// 获取vtdataset
QStringList qCompontIds = QString(componentIds).split(',');
QStringList qCompontIds = QString(componentIds).split(',');
MeshData::MeshSet* meshSet = NULL;
MeshData::MeshKernal* meshKernal = NULL;
MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
QString kernalName, transformedName, setType, ids;
MeshData::MeshSet* meshSet = NULL;
MeshData::MeshKernal* meshKernal = NULL;
MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
QString kernalName, transformedName, setType, ids;
// 筛选其中的点云数据
// 创建 vtkCellDataToPointData 过滤器
vtkSmartPointer<vtkGeometryFilter> cellToPointFilter = vtkSmartPointer<vtkGeometryFilter>::New();
vtkSmartPointer<vtkGeometryFilter> cellToPointFilter =
vtkSmartPointer<vtkGeometryFilter>::New();
QString outfilename;
for(QString compontId : qCompontIds) {
meshSet = meshData->getMeshSetByID(compontId.toInt());
DebugInfo("point count %d : %d ",compontId.toInt(),meshSet==nullptr);
DebugInfo("point count %d : %d ", compontId.toInt(), meshSet == nullptr);
if(!meshSet)
continue;
outfilename=meshSet->getName();
vtkPolyData* temppolyData=PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
outfilename = meshSet->getName();
vtkPolyData* temppolyData =
PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
cellToPointFilter->SetInputData(temppolyData);
DebugInfo("point count %d : %d ",compontId.toInt(),temppolyData==nullptr);
DebugInfo("point count %d : %d ", compontId.toInt(), temppolyData == nullptr);
}
// 执行过滤操作
@ -243,37 +239,37 @@ bool WBFZ::PCLBilateralFilter::PCLBilateralFilterAlg(QString componentIds, doubl
vtkSmartPointer<vtkPolyData> outpolyData = cellToPointFilter->GetOutput();
DebugInfo("outpolyData ");
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_with_rgba(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_filtered(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::io::vtkPolyDataToPointCloud(outpolyData,*cloud_with_rgba);
pcl::io::vtkPolyDataToPointCloud(outpolyData, *cloud_with_rgba);
// 创建滤波器对象
if(false) {
pcl::FastBilateralFilter<pcl::PointXYZRGBA> fbf;
fbf.setInputCloud(cloud_with_rgba);
fbf.setSigmaS(sigmaS);
fbf.setSigmaR(sigmaR);
fbf.filter(*cloud_filtered);
pcl::FastBilateralFilter<pcl::PointXYZRGBA> fbf;
fbf.setInputCloud(cloud_with_rgba);
fbf.setSigmaS(sigmaS);
fbf.setSigmaR(sigmaR);
fbf.filter(*cloud_filtered);
DebugInfo("Set up the Convolution Filter \n ");
// 转换处理结果
vtkSmartPointer<vtkPolyData> polydata=vtkSmartPointer<vtkPolyData>::New();
// polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
vtkSmartPointer<vtkDataSet> dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
size_t pointCount = dataset->GetNumberOfPoints();
DebugInfo("vtkpolydata --> vtkdataset \n ");
if(pointCount==0){
//outpolyData->Delete(); // 释放指针
return false;
DebugInfo("Set up the Convolution Filter \n ");
// 转换处理结果
vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();
// polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
pcl::io::pointCloudTovtkPolyData(*cloud_filtered, polydata);
vtkSmartPointer<vtkDataSet> dataset =
vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
size_t pointCount = dataset->GetNumberOfPoints();
DebugInfo("vtkpolydata --> vtkdataset \n ");
if(pointCount == 0) {
// outpolyData->Delete(); // 释放指针
return false;
}
}
emit _mainwindow->printMessage(Common::Message::Normal, "PCLGuassFilterAlg successfully!!");
// outpolyData->Delete(); // 释放指针
emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg successfully!! Point Count : "+QString::number(pointCount));
//outpolyData->Delete(); // 释放指针
qDebug()<<"WBFZ::PCLGuassFilter::PCLGuassFilterAlg finish !!!";
bool saveflag=this->saveFilterResultFile(cloud_filtered);
qDebug()<<"saveFilterResultFile finish !!!";
qDebug() << "WBFZ::PCLGuassFilter::PCLGuassFilterAlg finish !!!";
bool saveflag = this->saveFilterResultFile(cloud_with_rgba);
qDebug() << "saveFilterResultFile finish !!!";
return saveflag;
}
WBFZ::PCLBilateralFilter::~PCLBilateralFilter() {}

View File

@ -24,6 +24,7 @@
#include <QFileInfo>
#include "MeshData/meshKernal.h"
#include "PointCloudOperator/PointCloudCommon.h"
#include "PointCloudOperator/PointCloudMesh.h"
#include "Settings/BusAPI.h"
#include "BaseTool.h"
#include "IO/IOConfig.h"
@ -209,12 +210,6 @@ 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->updateActionsStatesSig();
// emit _mainwindow->getSubWindowManager()->openPreWindowSig();
// emit _mainwindow->updatePreMeshActorSig();
information = QString("Successful resurface Mesh From \"%1\"").arg(_fileName);
msg.type = Common::Message::Normal;
msg.message = information;
@ -281,49 +276,6 @@ namespace WBFZ {
defaultMeshFinished();
}
bool PCLGPMesh::GP(vtkSmartPointer<vtkPolyData>& inpolygon,vtkSmartPointer<vtkPolyData>& polydata) { // 点云处理模块
// 可用变量
double SearchRadius = _SearchRadius;
double Mu = _Mu;
int MaximumNearestNeighbors = _MaximumNearestNeighbors;
double MaximumSurfaceAngle = _MaximumSurfaceAngle;
double MaximumAngle = _MaximumAngle;
double MinimumAngle = _MinimumAngle;
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_with_rgba(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_filtered( new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr output( new pcl::PointCloud<pcl::PointXYZRGBA>); // 输出结果
pcl::PointCloud<pcl::PointNormal>::Ptr cloud_with_normals(new pcl::PointCloud<pcl::PointNormal>); // 法线向量
pcl::search::KdTree<pcl::PointNormal>::Ptr tree2(new pcl::search::KdTree<pcl::PointNormal>);
pcl::io::vtkPolyDataToPointCloud(inpolygon, *cloud_with_rgba);
PointCloudOperator::PointCloudCommon::NormalEstimation(cloud_with_rgba, cloud_with_normals);
tree2->setInputCloud(cloud_with_normals); // 构建搜索树
std::shared_ptr<pcl::PolygonMesh> mesh (new pcl::PolygonMesh); // 非智能指针,需要释放
pcl::GreedyProjectionTriangulation<pcl::PointNormal> gp3; // 定义三角化对象
gp3.setSearchRadius(SearchRadius); // 设置连接点之间的最大距离(即三角形的最大边长)
gp3.setMu(Mu); // 设置被样本点搜索其临近点的最远距离,为了适应点云密度的变化
gp3.setMaximumNearestNeighbors(MaximumNearestNeighbors); // 设置样本点可搜索的邻域个数
gp3.setMaximumSurfaceAngle(MaximumSurfaceAngle); // 设置某点法线方向偏离样本点法线方向的最大角度
gp3.setMinimumAngle(MinimumAngle); // 设置三角化后得到三角形内角的最小角度
gp3.setMaximumAngle(MaximumAngle); // 设置三角化后得到三角形内角的最大角度
gp3.setNormalConsistency(false); // 设置该参数保证法线朝向一致
gp3.setInputCloud(cloud_with_normals); // 设置输入点云为有向点云
gp3.setSearchMethod(tree2); // 设置搜索方式
gp3.reconstruct(*mesh); // 重建提取三角化 -- 这里会导致程序崩溃,可能存在内存泄露,
// DebugInfo("remesh over GP \n");
// return false;
size_t pointcount = PointCloudOperator::PointCloudCommon::mesh2vtk(*mesh, polydata);
DebugInfo("remesh over ,conver init %d \n", mesh->polygons.size());
//delete mesh;
return true;
}
bool PCLGPMesh::remeshtaskProcess() {
@ -358,19 +310,15 @@ namespace WBFZ {
DebugInfo("cellToPointFilter \n");
// 获取过滤后的 vtkPolyData
inpolyData = cellToPointFilter->GetOutput();
if(this->GP(inpolyData,polydata)){
if(PointCloudOperator::PointCloudMeshOperator::GP(inpolyData,polydata,_SearchRadius,_Mu,_MaximumNearestNeighbors,_MaximumSurfaceAngle,_MaximumAngle,_MinimumAngle)){
}else{
return false;
}
DebugInfo("outpolyData ");
//vtkDataSet* dataset = vtkDataSet::SafeDownCast(polydata); // dataset =vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
// outpolyData->Delete(); // 释放指针 ,
// 千万不能释放这个指针,不然程序回调时,会直接内存崩溃
DebugInfo("PCLGPMeshAlg successfully!! wait for writing file dataset : %d \n",nullptr==polydata);
// vtkDataSet*
// dataset=PCLGPMeshAlg(_componentIds,_SearchRadius,_Mu,_MaximumNearestNeighbors,_MaximumSurfaceAngle,_MaximumAngle,_MinimumAngle);
if(nullptr!=polydata){
DebugInfo("PCLGPMeshAlg successfully!! wait for writing file dataset : %d %d\n",polydata->GetNumberOfPoints(),polydata->GetNumberOfCells());
}
@ -414,11 +362,6 @@ namespace WBFZ {
}
}
// QFileInfo info(_fileName);
// QString name = info.fileName();
// QString path = info.filePath();
// QString suffix = info.suffix().toLower();
DebugInfo("dataset %d _fileName %s \n", nullptr==polydata, _fileName.toStdString().c_str());
if (nullptr == polydata) { } else {

View File

@ -52,7 +52,7 @@ namespace WBFZ{
void defaultMeshFinished();
void setThreadRunState(bool);
bool remeshtaskProcess();
bool GP(vtkSmartPointer<vtkPolyData>& inpolygon,vtkSmartPointer<vtkPolyData>& polydata);
// vtkDataSet* remesh() ;
// vtkDataSet* PCLGPMeshAlg(QString componentIds , double SearchRadius, double Mu,int MaximumNearestNeighbors,double MaximumSurfaceAngle,double MaximumAngle,double MinimumAngle);
private:

View File

@ -40,26 +40,28 @@
#include "ConfigOptions/MeshConfig.h"
#include "Common/DebugLogger.h"
//auto meshData = MeshData::MeshData::getInstance();
// auto meshData = MeshData::MeshData::getInstance();
namespace MainWidget {
DialogPCLGuassFilter::DialogPCLGuassFilter(GUI::MainWindow *parent)
: QFDialog(parent),
_ui(new Ui::DialogPCLGuassFilter),
_mw(parent),
_selectdlg(new DialogSelectComponents(parent))
DialogPCLGuassFilter::DialogPCLGuassFilter(GUI::MainWindow* parent)
: QFDialog(parent)
, _ui(new Ui::DialogPCLGuassFilter)
, _mw(parent)
, _selectdlg(new DialogSelectComponents(parent))
{
_ui->setupUi(this);
_ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
setWindowTitle(tr("Guass Filter"));
_ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
{ _selectdlg->clearSelectItems(); _selectdlg->exec(); });
connect(_selectdlg, SIGNAL(selectedComponentsSig(QList<MeshData::MeshSet *>)), this, SLOT(selectedComponentsSlot(QList<MeshData::MeshSet *>)));
connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]() {
_selectdlg->clearSelectItems();
_selectdlg->exec();
});
connect(_selectdlg, SIGNAL(selectedComponentsSig(QList<MeshData::MeshSet*>)), this,
SLOT(selectedComponentsSlot(QList<MeshData::MeshSet*>)));
connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this,
SLOT(customContextMenuRequestedSlot(const QPoint&)));
}
DialogPCLGuassFilter::~DialogPCLGuassFilter()
@ -69,31 +71,33 @@ namespace MainWidget {
delete _selectdlg;
_selectdlg = NULL;
}
void DialogPCLGuassFilter::accept()
{
if (_components.size() == 0)
if(_components.size() == 0)
return;
QString componentIds, rotate, moveLocation, scale;
for (auto component : _components)
for(auto component : _components)
componentIds.append(QString(",%1").arg(component->getID()));
componentIds.remove(0, 1);
double Sigma = _ui->Sigma->value();
double threshold = _ui->threshold->value();
double radius = _ui->radius->value();
double Sigma=_ui->Sigma->value();
double threshold=_ui->threshold->value();
double radius=_ui->radius->value();
QString outfilename="filter";
for (auto component : _components)
QString outfilename = "filter";
for(auto component : _components)
outfilename.append(QString("_%1").arg(component->getName()));
// 确定是否保存结果文件
QMessageBox::StandardButton result=QMessageBox::critical(this, "info","save as result ?");
QString filepath= JoinPath(Setting::BusAPI::instance()->getWorkingDir() ,outfilename+"_tmep.pcd");
QMessageBox::StandardButton result =
QMessageBox::critical(this, "info", "save as result ?");
QString filepath =
JoinPath(Setting::BusAPI::instance()->getWorkingDir(), outfilename + "_tmep.pcd");
QString AbFileName;
if(result==QMessageBox::StandardButton::Ok||result==QMessageBox::StandardButton::Yes){
if(result == QMessageBox::StandardButton::Ok
|| result == QMessageBox::StandardButton::Yes) {
QStringList suffixlist = IO::IOConfigure::getPclExporters();
if(suffixlist.isEmpty()) {
QMessageBox::warning(this, tr("Warning"), tr("The MeshPlugin is not installed !"));
@ -120,8 +124,8 @@ namespace MainWidget {
}
std::sort(list.begin(), list.end());
QString suffixes = list.join(";;");
QString workDir = Setting::BusAPI::instance()->getWorkingDir();
QString suffixes = list.join(";;");
QString workDir = Setting::BusAPI::instance()->getWorkingDir();
QFileDialog dlg(this, tr("Export Pcl"), workDir, suffixes);
dlg.setAcceptMode(QFileDialog::AcceptSave);
if(dlg.exec() != QFileDialog::FileName)
@ -129,72 +133,69 @@ namespace MainWidget {
QString aSuffix = dlg.selectedNameFilter();
QString aFileName = dlg.selectedFiles().join(",");
if(!(aFileName.isEmpty())){
filepath=aFileName;
if(!(aFileName.isEmpty())) {
filepath = aFileName;
}else{}
} else {
}
AbFileName=filepath;
QTextCodec *codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(filepath);
AbFileName = filepath;
QTextCodec* codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(filepath);
std::string outFileName=ba.data();
}else{ // 不保存成点云数据
std::string outFileName = ba.data();
} else { // 不保存成点云数据
}
// 启动线程
auto pclfilter = new WBFZ::PCLGuassFilter(
AbFileName,WBFZ::PointCloudOperation::POINTCLOUD_FILTER,_mainWindow,componentIds, Sigma, threshold,radius);
auto pclfilter =
new WBFZ::PCLGuassFilter(AbFileName, WBFZ::PointCloudOperation::POINTCLOUD_FILTER,
_mainWindow, componentIds, Sigma, threshold, radius);
ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclfilter);
emit tc->threadStart(); // emit MSHwriter->start();
QFDialog::accept();
}
void DialogPCLGuassFilter::selectedComponentsSlot(QList<MeshData::MeshSet *> components)
void DialogPCLGuassFilter::selectedComponentsSlot(QList<MeshData::MeshSet*> components)
{
for (MeshData::MeshSet *set : components)
{
if (_components.contains(set))
for(MeshData::MeshSet* set : components) {
if(_components.contains(set))
continue;
_components.append(set);
_ui->listWidget->addItem(set->getName());
}
}
void DialogPCLGuassFilter::customContextMenuRequestedSlot(const QPoint &point)
void DialogPCLGuassFilter::customContextMenuRequestedSlot(const QPoint& point)
{
QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
if (!curItem)
QListWidgetItem* curItem = _ui->listWidget->itemAt(point);
if(!curItem)
return;
QMenu *menu = new QMenu(this);
QAction *deleteItem = new QAction(tr("delete this item"));
QMenu* menu = new QMenu(this);
QAction* deleteItem = new QAction(tr("delete this item"));
menu->addAction(deleteItem);
connect(menu, &QMenu::triggered, [=]()
{ removeCurrentItem(curItem); });
connect(menu, &QMenu::triggered, [=]() { removeCurrentItem(curItem); });
menu->exec(QCursor::pos());
}
void DialogPCLGuassFilter::removeCurrentItem(QListWidgetItem *curItem)
void DialogPCLGuassFilter::removeCurrentItem(QListWidgetItem* curItem)
{
auto meshData = MeshData::MeshData::getInstance();
auto meshSet = meshData->getMeshSetByName(curItem->text());
if (!meshSet)
auto meshSet = meshData->getMeshSetByName(curItem->text());
if(!meshSet)
return;
_components.removeOne(meshSet);
_ui->listWidget->removeItemWidget(curItem);
delete curItem;
}
} // namespace MainWidget
WBFZ::PCLGuassFilter::PCLGuassFilter(const QString& fileName, WBFZ::PointCloudOperation operation,
GUI::MainWindow* mw, QString componentIds, double sigma,
double threshold,double radius)
double threshold, double radius)
: PointCloudThreadBase(fileName, operation, mw)
, _fileName(fileName)
, _operation(operation)
@ -206,36 +207,38 @@ WBFZ::PCLGuassFilter::PCLGuassFilter(const QString& fileName, WBFZ::PointCloudOp
}
bool WBFZ::PCLGuassFilter::filter()
{
bool flag=this->PCLGuassFilterAlg(_componentIds,_sigma,_threshold,_radius);
bool flag = this->PCLGuassFilterAlg(_componentIds, _sigma, _threshold, _radius);
qDebug("WBFZ::PCLGuassFilter::filter over!!!!");
return flag;
}
bool WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma,
double threshold,double radius)
bool WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma, double threshold,
double radius)
{
emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg");
emit _mainwindow->printMessage(Common::Message::Normal, "PCLGuassFilterAlg");
// 获取vtdataset
QStringList qCompontIds = QString(componentIds).split(',');
QStringList qCompontIds = QString(componentIds).split(',');
MeshData::MeshSet* meshSet = NULL;
MeshData::MeshKernal* meshKernal = NULL;
MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
MeshData::MeshSet* meshSet = NULL;
MeshData::MeshKernal* meshKernal = NULL;
MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
QString kernalName, transformedName, setType, ids;
// 筛选其中的点云数据
// 创建 vtkCellDataToPointData 过滤器
vtkSmartPointer<vtkGeometryFilter> cellToPointFilter = vtkSmartPointer<vtkGeometryFilter>::New();
vtkSmartPointer<vtkGeometryFilter> cellToPointFilter =
vtkSmartPointer<vtkGeometryFilter>::New();
QString outfilename;
for(QString compontId : qCompontIds) {
meshSet = meshData->getMeshSetByID(compontId.toInt());
DebugInfo("point count %d : %d \n",compontId.toInt(),meshSet==nullptr);
DebugInfo("point count %d : %d \n", compontId.toInt(), meshSet == nullptr);
if(!meshSet)
continue;
outfilename=meshSet->getName();
vtkPolyData* temppolyData=PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
outfilename = meshSet->getName();
vtkPolyData* temppolyData =
PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
cellToPointFilter->SetInputData(temppolyData);
DebugInfo("point count %d : %d \n",compontId.toInt(),temppolyData==nullptr);
DebugInfo("point count %d : %d \n", compontId.toInt(), temppolyData == nullptr);
}
// 执行过滤操作
@ -245,63 +248,60 @@ bool WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma,
vtkPolyData* outpolyData = cellToPointFilter->GetOutput();
DebugInfo("outpolyData \n");
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_with_rgba(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_filtered(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::io::vtkPolyDataToPointCloud(outpolyData,*cloud_with_rgba);
pcl::io::vtkPolyDataToPointCloud(outpolyData, *cloud_with_rgba);
// 创建滤波器对象
if(false) {
/*double radius = 0.02;*/
// Set up the Gaussian Kernel
pcl::filters::GaussianKernel<pcl::PointXYZRGBA, pcl::PointXYZRGBA>::Ptr kernel(
new pcl::filters::GaussianKernel<pcl::PointXYZRGBA, pcl::PointXYZRGBA>);
(*kernel).setSigma(sigma);
(*kernel).setThresholdRelativeToSigma(threshold);
emit _mainwindow->printMessage(Common::Message::Normal, "Kernel made");
// Set up the KDTree
pcl::search::KdTree<pcl::PointXYZRGBA>::Ptr kdtree(
new pcl::search::KdTree<pcl::PointXYZRGBA>);
(*kdtree).setInputCloud(cloud_with_rgba);
emit _mainwindow->printMessage(Common::Message::Normal, "KdTree made");
DebugInfo("KdTree made \n");
// Set up the Convolution Filter
pcl::filters::Convolution3D<
pcl::PointXYZRGBA, pcl::PointXYZRGBA,
pcl::filters::GaussianKernel<pcl::PointXYZRGBA, pcl::PointXYZRGBA>>
convolution;
convolution.setKernel(*kernel);
convolution.setInputCloud(cloud_with_rgba);
convolution.setSearchMethod(kdtree);
convolution.setRadiusSearch(radius);
convolution.setNumberOfThreads(10); // important! Set Thread number for openMP
emit _mainwindow->printMessage(Common::Message::Normal, "Convolution Start");
convolution.convolve(*cloud_filtered);
emit _mainwindow->printMessage(Common::Message::Normal, "Convoluted");
DebugInfo("Set up the Convolution Filter \n ");
// 转换处理结果
vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();
// polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
pcl::io::pointCloudTovtkPolyData(*cloud_filtered, polydata);
/*double radius = 0.02;*/
// Set up the Gaussian Kernel
pcl::filters::GaussianKernel<pcl::PointXYZRGBA, pcl::PointXYZRGBA>::Ptr kernel(
new pcl::filters::GaussianKernel<pcl::PointXYZRGBA, pcl::PointXYZRGBA>);
(*kernel).setSigma(sigma);
(*kernel).setThresholdRelativeToSigma(threshold);
emit _mainwindow->printMessage(Common::Message::Normal,"Kernel made" );
// Set up the KDTree
pcl::search::KdTree<pcl::PointXYZRGBA>::Ptr kdtree(
new pcl::search::KdTree<pcl::PointXYZRGBA>);
(*kdtree).setInputCloud(cloud_with_rgba);
emit _mainwindow->printMessage(Common::Message::Normal,"KdTree made" );
DebugInfo("KdTree made \n");
// Set up the Convolution Filter
pcl::filters::Convolution3D<
pcl::PointXYZRGBA,
pcl::PointXYZRGBA,
pcl::filters::GaussianKernel<pcl::PointXYZRGBA, pcl::PointXYZRGBA>>
convolution;
convolution.setKernel(*kernel);
convolution.setInputCloud(cloud_with_rgba);
convolution.setSearchMethod(kdtree);
convolution.setRadiusSearch(radius);
convolution.setNumberOfThreads(
10); // important! Set Thread number for openMP
emit _mainwindow->printMessage(Common::Message::Normal,"Convolution Start");
convolution.convolve(*cloud_filtered);
emit _mainwindow->printMessage(Common::Message::Normal,"Convoluted" );
DebugInfo("Set up the Convolution Filter \n ");
// 转换处理结果
vtkSmartPointer<vtkPolyData> polydata=vtkSmartPointer<vtkPolyData>::New();
// polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
vtkSmartPointer<vtkDataSet> dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
size_t pointCount = dataset->GetNumberOfPoints();
DebugInfo("vtkpolydata --> vtkdataset \n ");
if(pointCount==0){
//outpolyData->Delete(); // 释放指针
return false;
vtkSmartPointer<vtkDataSet> dataset =
vtkDataSet::SafeDownCast(outpolyData); // 默认完成 vtkpolydata --> vtkdataset
size_t pointCount = dataset->GetNumberOfPoints();
DebugInfo("vtkpolydata --> vtkdataset \n ");
if(pointCount == 0) {
// outpolyData->Delete(); // 释放指针
return false;
}
}
emit _mainwindow->printMessage(Common::Message::Normal, "PCLGuassFilterAlg successfully!!");
// outpolyData->Delete(); // 释放指针
emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg successfully!! Point Count : "+QString::number(pointCount));
//outpolyData->Delete(); // 释放指针
qDebug()<<"WBFZ::PCLGuassFilter::PCLGuassFilterAlg finish !!!";
bool saveflag=this->saveFilterResultFile(cloud_filtered);
qDebug()<<"saveFilterResultFile finish !!!";
qDebug() << "WBFZ::PCLGuassFilter::PCLGuassFilterAlg finish !!!";
bool saveflag = this->saveFilterResultFile(cloud_with_rgba);
qDebug() << "saveFilterResultFile finish !!!";
return saveflag;
}
WBFZ::PCLGuassFilter::~PCLGuassFilter() {}

View File

@ -23,7 +23,7 @@
</size>
</property>
<property name="windowTitle">
<string>DialogPCLGuassFilter</string>
<string>中值滤波</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">

View File

@ -32,6 +32,11 @@ EchoTableEditWindow::EchoTableEditWindow(QWidget* parent)
this->ui->tab_calibration->setEnabled(false);
this->ui->tabWidget->removeTab(1);// 删除定标常数界面
DebugInfo(" EchoTableEditWindow::EchoTableEditWindow has init finish\n");
connect(ui->actionOpen, SIGNAL(triggered()),this, SLOT(on_actionOpen_triggered()));
connect(ui->actionSave, SIGNAL(triggered()),this, SLOT(on_actionSave_triggered()));
connect(ui->actionSaveAs, SIGNAL(triggered()),this, SLOT(on_actionSaveAs_triggered()));
connect(ui->actionRCSExport ,SIGNAL(triggered()),this,SLOT(on_actionRCSExport()));
}
EchoTableEditWindow::~EchoTableEditWindow()
@ -442,6 +447,8 @@ int EchoTableEditWindow::OpenCSVDialog()
this->setTableViewAutoSort(true);
this->LockFileOpen();
this->ui->statusbar->showMessage(u8"文件打开结束");
QFileInfo fileinfo(tableFilepath);
this->setWindowTitle(fileinfo.fileName());
return -1;
}
@ -460,4 +467,58 @@ int EchoTableEditWindow::SaveAsDialog()
QString::fromUtf8(u8"csv文件 (*.csv)"));//多组扩展名用双分号";;"隔开
this->model->saveAsFilePath(filepath);
return 0;
}
void EchoTableEditWindow::on_actionRCSExport() {
// 检查是否远场回波
bool isfar=false;
bool isnear=false;
//this->model;
//判断指针
std::shared_ptr<FEKOResultCsvTableModel> echoTableModel(new FEKOResultCsvTableModel);
echoTableModel->loadCSVFilePath(this->model->getCSVPath());
if(echoTableModel->rowCount()<=0||echoTableModel->colCount()<=0){
QMessageBox::warning(this, u8"警告", u8"回波文件结构解析错误,请检查文件");
return ;
}else{}
if(echoTableModel){
QStringList colnames=echoTableModel->getColumnNames();
for(size_t i=0;i<colnames.count();i++){
if(colnames[i].toLower().contains("file type")||colnames[i]=="File Type"){
size_t colidx=echoTableModel->getColumnIdxByColumName(colnames[i]);
QString filetypeStr=echoTableModel->itemText(0,colidx);
if(filetypeStr.toLower().contains("far field")||filetypeStr.contains("Far Field")||filetypeStr=="Far Field"){
isfar=true;
}else{}
if(filetypeStr.toLower().contains("near field")||filetypeStr=="Electric near field"){
isnear= true;
}else{}
}
}
}else{
QMessageBox::warning(this, u8"警告", u8"回波文件结构解析错误,请检查文件");
return ;
}
// ---------------------- 远场结果 --------------------------------------------------
if(isfar){
QString filepath =
getSaveFilePath(this, QString::fromUtf8(u8"另存为"),
QString::fromUtf8(u8"RCS (*.csv)")); // 多组扩展名用双分号";;"隔开
FEKOBase::RCSEchoDataComputer rsccomputer;
rsccomputer.ComputerFromFile(this->model->getCSVPath());
rsccomputer.toCSV(filepath);
QMessageBox::information(this, u8"信息",QString(u8"保存至:%1").arg(filepath));
}else{
QMessageBox::warning(this, u8"警告",u8"请使用远场数据作为RCS计算输入");
};
}

View File

@ -51,7 +51,6 @@ public:
int loadTablemode(std::shared_ptr<AbstractTableModel> mode); // 加载tableview 使用的model
int setTableViewAutoSort(bool flag);
int setDragDropOverwriteMode(bool flag); // 是否禁用列调换
int setTablCalibrationTab(bool flag);
private:
@ -78,15 +77,13 @@ public slots:
void on_actionEchoSplitExport_triggered(); // 回波数据导出
void on_actionCalibrationConst_triggered(); // 计算定标常数
void on_actionRCSExport();
protected: // 重写函数
void closeEvent(QCloseEvent* event) override {
// 在窗口关闭事件中询问用户是否关闭
QMessageBox::StandardButton reply;
reply = QMessageBox::question(this, u8"Close", u8"您回波数据导出了吗", QMessageBox::Yes | QMessageBox::No);
reply = QMessageBox::question(this, u8"Close", u8"确定退出", QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes) {
// 用户点击了"Yes"按钮,关闭窗口

View File

@ -121,8 +121,8 @@
<property name="title">
<string>回波工具</string>
</property>
<addaction name="actionFEKOCheck"/>
<addaction name="actionEchoSplitExport"/>
<addaction name="actionRCSExport"/>
</widget>
<addaction name="menu"/>
<addaction name="menu_4"/>
@ -267,6 +267,11 @@
<string>导入定标常数表</string>
</property>
</action>
<action name="actionRCSExport">
<property name="text">
<string>RCS导出</string>
</property>
</action>
</widget>
<resources/>
<connections/>

File diff suppressed because it is too large Load Diff

View File

@ -188,7 +188,7 @@ namespace FEKOBase {
QString radiusStr;
QString thetaStr;
QString phiStr;
QString frequencyStr;
double radius;
double theta;
@ -200,6 +200,10 @@ namespace FEKOBase {
double imEtheta;
double reEphi;
double imEphi;
double RCS_Theta;
double RCS_Phi;
double RCS_Tatol;
QString configurationName;
QString requestName;
double frequency;
@ -228,7 +232,9 @@ namespace FEKOBase {
bool compareElectricFieldDataInFreq(const ElectricFieldData& a, const ElectricFieldData& b);
bool comparePRFPluseDataInPRFIdx(const PRFPluseData& a, const PRFPluseData& b);
ElectricFieldData NearField2FarField(ElectricFieldData indata); // 近场转远场
std::complex<double> NearElectricField2FarElectricField(std::complex<double> inEcho,double Radius,double freq);
double RCSFromEField(std::complex<double> EFile);
@ -295,6 +301,25 @@ namespace FEKOBase {
};
class RCSEchoDataComputer{
public:
RCSEchoDataComputer();
~RCSEchoDataComputer();
public:
std::vector<ElectricFieldData> dataList; // 电场数据
public:
bool toCSV(QString filepath);
bool loadCSV(QString filepath);
bool ComputerFromFile(QString filepath);
bool ComputerRCS();
};
@ -361,6 +386,7 @@ namespace FEKOBase {
{
NOWINDOWS,
HANMMING,
HANMMING1AXIS,
UNKONWWINDOW
};
@ -375,6 +401,8 @@ namespace FEKOBase {
{
TBP_TIME,
TBP_FREQ,
FAR_ISAR,
TBP_CIRCLESAR,
UNKONW // 必须为最后一个表示未知
};
@ -389,7 +417,15 @@ namespace FEKOBase {
bool BPImage_TIME(QString& restiffpath, Eigen::MatrixXcd& echoData, Eigen::MatrixXd& antPos, Eigen::MatrixXd& freqmatrix, Eigen::MatrixXd& X, Eigen::MatrixXd& Y, Eigen::MatrixXd& Z, ImageAlgWindowFun winfun = ImageAlgWindowFun::HANMMING,FEKOBase::FEKORESULTFIELDTYPE EchoMode=FEKOBase::FEKORESULTFIELDTYPE::NEARFIELD ); // BP成像
bool FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd& echoData, Eigen::MatrixXd& antPos, Eigen::MatrixXd& freqmatrix, Eigen::MatrixXd& X, Eigen::MatrixXd& Y, Eigen::MatrixXd& Z, ImageAlgWindowFun winfun = ImageAlgWindowFun::HANMMING,FEKOBase::FEKORESULTFIELDTYPE EchoMode=FEKOBase::FEKORESULTFIELDTYPE::NEARFIELD); // FBP成像
bool FBPImage_ISAR(QString& restiffpath, Eigen::MatrixXcd& echoData, Eigen::MatrixXd& antPos, Eigen::MatrixXd& freqmatrix, Eigen::MatrixXd& X, Eigen::MatrixXd& Y, Eigen::MatrixXd& Z, ImageAlgWindowFun winfun = ImageAlgWindowFun::HANMMING,FEKOBase::FEKORESULTFIELDTYPE EchoMode=FEKOBase::FEKORESULTFIELDTYPE::NEARFIELD);
bool FBPImage_CirCleSAR(QString& restiffpath, Eigen::MatrixXcd& echoData, Eigen::MatrixXd& antPos, Eigen::MatrixXd& freqmatrix, Eigen::MatrixXd& X, Eigen::MatrixXd& Y, Eigen::MatrixXd& Z, ImageAlgWindowFun winfun = ImageAlgWindowFun::HANMMING,FEKOBase::FEKORESULTFIELDTYPE EchoMode=FEKOBase::FEKORESULTFIELDTYPE::NEARFIELD);
bool FBPImage_ISARNEAR(QString& restiffpath, Eigen::MatrixXcd& echoData, Eigen::MatrixXd& antPos,
Eigen::MatrixXd& freqmatrix, Eigen::MatrixXd& X, Eigen::MatrixXd& Y, Eigen::MatrixXd& Z,
FEKOBase::ImageAlgWindowFun winfun,
FEKOBase::FEKORESULTFIELDTYPE EchoMode);
Eigen::MatrixXcd resampleEchoData(const std::vector<double>& image_points_freq, const std::vector<double>& image_points_ang, const Eigen::MatrixXcd& echoData, const std::vector<double>& freqlist, const std::vector<double>& anglelist) ;
}

View File

@ -291,15 +291,8 @@ void FEKOBase::FEKOSimulationSARClass::saveFEKOImageSettingXML() {
qDebug() << "finish save fekoSimulation xml file.";
}
QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfidx, size_t endprfidx) {
QProgressDialog progressDialog(u8"构建馈源设置脚本", u8"终止", 0, this->FEKOAntPoselist.size());
progressDialog.setWindowTitle("imaging...");
progressDialog.setModal(true);
progressDialog.setAutoClose(true);
progressDialog.setValue(0);
progressDialog.setMaximum(this->FEKOAntPoselist.size());
progressDialog.setMinimum(0);
progressDialog.show();
QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfidx, size_t endprfidx,QString cfxName) {
if (this->simulationparams->startfreq > 1e6) {
this->simulationparams->startfreq = this->simulationparams->startfreq / 1e9;
@ -309,7 +302,8 @@ QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfid
}
QString luascript = QString(u8"--- create feko task :%1\n--- mode:%2\n\n").arg(this->simulationparams->taskName).arg(FEKOBase::FEKOImageModeenumToString(this->simulationparams->imagemode));
luascript = luascript + QString(u8"-- create strip pulse \n");
luascript = luascript + QString(u8"--runbat example : cadfeko trihedral.cfx --non-interactive --run-script trihedral.lua \n");
luascript = luascript + QString(u8"-- create strip pulse \n");
luascript = luascript + QString(u8"-- LAMP \n\n");
luascript = luascript + QString(u8"-- warning:the configure's number of a feko project should be less than 600. if greater than 600,the program will very slow\n");
luascript = luascript + QString(u8"\n");
@ -392,15 +386,36 @@ QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfid
luascript = luascript + QString(u8" print(\"PRF_%1\")\n").arg(prf_id);
luascript = luascript + QString(u8" ---------------------\"PRF_%1\" end -------------------------------------------------\n").arg(prf_id);
luascript = luascript + QString(u8"\n");
progressDialog.setValue(i);
}
luascript = luascript + QString(u8"-- prf point setting over -------\n");
luascript = luascript + QString(u8" \n");
progressDialog.setWindowTitle(u8"馈源脚本生产成功");
progressDialog.setValue(this->FEKOAntPoselist.size());
progressDialog.close();
luascript = luascript + QString(u8"--------------------- \"remove not PRF configuration \"-----------------------------\n");
luascript = luascript + QString(u8"local configid = #(project.SolutionConfigurations)\n");
luascript = luascript + QString(u8"print(configid)\n");
luascript = luascript + QString(u8"local config_idx = 0;\n");
luascript = luascript + QString(u8"for idx = 1, configid do\n");
luascript = luascript + QString(u8" config_idx = configid - idx + 1\n");
luascript = luascript + QString(u8" temp_standardConfig = project.SolutionConfigurations:Item(config_idx)\n");
luascript = luascript + QString(u8" configlabel = temp_standardConfig.Label\n");
luascript = luascript + QString(u8" if string.find(configlabel, \"PRF\") then\n");
luascript = luascript + QString(u8" print(configlabel)\n");
luascript = luascript + QString(u8" else\n");
luascript = luascript + QString(u8" temp_standardConfig:Delete()\n");
luascript = luascript + QString(u8" end\n");
luascript = luascript + QString(u8"end\n");
luascript = luascript + QString(u8"--------------------- \"remove not PRF configuration \"-----------------------------\n");
luascript = luascript + QString(u8"\n");
luascript = luascript + QString(u8"-- Enable the parallel Solver\n");
luascript = luascript + QString(u8"project.Launcher.Settings.FEKO.Parallel.Enabled = true\n");
luascript = luascript + QString(u8"\n");
luascript = luascript + QString(u8"-- Save the *.cfx file\n");
luascript = luascript + QString(u8"results = project.Launcher:RunPREFEKO()\n");
luascript = luascript + QString(u8"app:SaveAs([[%1.cfx]])\n").arg(cfxName);
luascript = luascript + QString(u8"results = project.Launcher:RunPREFEKO()\n");
luascript = luascript + QString(u8"\n");
luascript = luascript + QString(u8"\n");
return luascript;
}
@ -471,6 +486,12 @@ bool FEKOBase::FEKOImageProcess(EchoDataClass &echodata, FEKOImageSettingParams
case FEKOBase::TBP_FREQ:
return FEKOBase::FBPImage_FREQ(outPath, echoData, antpos, freqmatrix, Image_X, Image_Y,
Image_Z, winfun, datafieldtype);
case FEKOBase::FEKOImageAlgorithm::FAR_ISAR:
return FEKOBase::FBPImage_ISARNEAR(outPath, echoData, antpos, freqmatrix, Image_X, Image_Y,
Image_Z, winfun, datafieldtype);
case FEKOImageAlgorithm::TBP_CIRCLESAR:
return FEKOBase::FBPImage_CirCleSAR(outPath, echoData, antpos, freqmatrix, Image_X, Image_Y,
Image_Z, winfun, datafieldtype);
default:
return false;
}

View File

@ -221,7 +221,7 @@ namespace FEKOBase {
public: // 初始化模型
void loadFEKOImageSettingXML(QString xmlpath);
void saveFEKOImageSettingXML();
QString createLuaSciptString(size_t startprfidx, size_t endprfidx);
QString createLuaSciptString(size_t startprfidx, size_t endprfidx,QString cfxName);
};
//==========================================================

View File

@ -119,6 +119,12 @@ void ImageShowDialogClass::load_double_MatrixX_data(Eigen::MatrixXd X, Eigen::Ma
}
}
// add a color scale:
QCPColorScale* m_colorScale = new QCPColorScale(m_plot);
m_plot->plotLayout()->addElement(0, 1, m_colorScale);
m_colorScale->setType(QCPAxis::atRight);
colorMap->setColorScale(m_colorScale);
colorMap->setGradient(QCPColorGradient::gpJet);
colorMap->rescaleDataRange(true);
ui->m_plot->rescaleAxes();

View File

@ -5,7 +5,7 @@
#include "AllHead.h"
#include <QDialog>
#include "TaskTreeClass.h"
#include "qwt_plot_spectrogram.h"
@ -97,7 +97,7 @@ protected:
// 1. 单纯的描述游标,主要用来展示坐标,还有当前数据信息
// 2. 区域性描述游标,通过线,等用来展示某一个区域的信息
//===========================
class ImageShowDialogClass : public QDialog
class ImageShowDialogClass : public QDialog
{
Q_OBJECT
private:
@ -133,6 +133,8 @@ private:
public slots:
void updateCursor(QMouseEvent* event);
public slots: // cursor
// void on_action_cursor_enable_trigged();
// void on_action_descursor_close_trigged();

View File

@ -8,18 +8,18 @@ LAMPDataShowClass::LAMPDataShowClass(QWidget *parent)
ui->setupUi(this);
// 添加菜单项
QMenu* FileOpenMenu = this->ui->menuFile->addMenu(u8"打开");
QAction* action_openfile_tiff = FileOpenMenu->addAction(u8"tiff文件"); // 添加菜单项
QObject::connect(action_openfile_tiff, SIGNAL(triggered()), this, SLOT(on_action_openfile_tiff_triggered()));
QMenu* FileOpenMenu = this->ui->menuFile->addMenu(u8"文件");
// QAction* action_openfile_tiff = FileOpenMenu->addAction(u8"tiff文件"); // 添加菜单项
// QObject::connect(action_openfile_tiff, SIGNAL(triggered()), this, SLOT(on_action_openfile_tiff_triggered()));
QMenu* ComplexFileOpenMenu = this->ui->menuFile->addMenu(u8"打开复数数据");
QAction* action_openfile_tiff_complex = ComplexFileOpenMenu->addAction(u8"tiff文件"); // 添加菜单项
QObject::connect(action_openfile_tiff_complex, SIGNAL(triggered()), this, SLOT(on_action_openfile_tiff_complex_triggered()));
QAction* action_openfile_envi_complex = ComplexFileOpenMenu->addAction(u8"envi文件"); // 添加菜单项
// QMenu* ComplexFileOpenMenu = this->ui->menuFile->addMenu(u8"打开复数数据");
// QAction* action_openfile_tiff_complex = ComplexFileOpenMenu->addAction(u8"tiff文件"); // 添加菜单项
// QObject::connect(action_openfile_tiff_complex, SIGNAL(triggered()), this, SLOT(on_action_openfile_tiff_complex_triggered()));
QAction* action_openfile_envi_complex = FileOpenMenu->addAction(u8"打开复数envi文件"); // 添加菜单项
QObject::connect(action_openfile_envi_complex, SIGNAL(triggered()), this, SLOT(on_action_openfile_envi_complex_triggered()));
this->setContextMenuPolicy(Qt::CustomContextMenu);
this->ui->listWidgetContent->clear();
this->ui->listWidgetContent->setContextMenuPolicy(Qt::CustomContextMenu);
}
@ -108,6 +108,7 @@ void LAMPDataShowClass::load_complex_data(QString path)
this->add_DataTree(node); DebugInfo("this->add_DataTree(node)\n");
node->ExcuteTask();
}
void LAMPDataShowClass::on_action_actionLoad_triggered() {
}

View File

@ -32,7 +32,7 @@ public slots: // 菜单action 槽函数
void on_action_openfile_envi_triggered();
void on_action_openfile_tiff_complex_triggered();
void on_action_openfile_envi_complex_triggered();
void on_action_actionLoad_triggered();
public:
void load_complex_data(QString path);
private:

View File

@ -16,7 +16,18 @@
<widget class="QWidget" name="centralWidget">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QListWidget" name="listWidgetContent"/>
<widget class="QListWidget" name="listWidgetContent">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<item>
<property name="text">
<string>fsada</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
@ -26,7 +37,7 @@
<x>0</x>
<y>0</y>
<width>285</width>
<height>22</height>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -50,6 +61,11 @@
<string>Open</string>
</property>
</action>
<action name="actionLoad">
<property name="text">
<string>actionOpen</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>

View File

@ -134,6 +134,12 @@ void LAMPImageCreateClass::on_pushButton_OK_clicked()
if (this->simulationparams && (this->simulationparams->imagemode == FEKOBase::FEKOImageMode::Strip || this->simulationparams->imagemode == FEKOBase::FEKOImageMode::Scane)) {
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath, FEKOBase::FEKOImageAlgorithm::TBP_FREQ, FEKOBase::ImageAlgWindowFun::HANMMING);
}
else if(this->simulationparams->imagemode == FEKOBase::FEKOImageMode::ISAR){
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::FAR_ISAR);
}else if(this->simulationparams->imagemode == FEKOBase::FEKOImageMode::CircleSAR){
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_CIRCLESAR,FEKOBase::ImageAlgWindowFun::HANMMING1AXIS);
}
else {
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_FREQ);
}

View File

@ -423,7 +423,9 @@ void LAMP_ScatterSettingClass::createFEKOLua()
// 复制天线方向图
for (map<std::string, QString>::iterator iter = AntffePathDict.begin(); iter != AntffePathDict.end(); ++iter) {
QString sourcepath = iter->second;
QString desPath= this->workpsace + u8"/" + getFileNameFromPath(sourcepath);
QString desPath= JoinPath(this->workpsace ,getFileNameFromPath(sourcepath));
qDebug()<<sourcepath;
qDebug()<<desPath;
copyFile(sourcepath, desPath);
progressDialog.setWindowTitle(u8"解析仿真天线方向图.....");
FEKOBase::FEKOFarFieldFileClass temp;

View File

@ -42,12 +42,6 @@ namespace WBFZ
{
if (_success)
{
// emit _mainwindow->updateMeshTreeSig();
// emit _mainwindow->updateSetTreeSig();
// emit _mainwindow->updateActionStatesSig();
// // emit _mainwindow->updateActionsStatesSig();
// emit _mainwindow->getSubWindowManager()->openPreWindowSig();
// emit _mainwindow->updatePreMeshActorSig();
information = QString("Successful Import Mesh From \"%1\"").arg(_fileName);
msg.type = Common::Message::Normal;
msg.message = information;
@ -70,14 +64,6 @@ namespace WBFZ
}
}
qDebug()<<"emit sign to windows ";
// 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
{
@ -98,7 +84,6 @@ namespace WBFZ
}
void PointCloudThreadBase::run() {
ModuleBase::ThreadTask::run();
bool result = false;
switch (_operation)

View File

@ -127,8 +127,9 @@ QtSARAntModelSettingClass::QtSARAntModelSettingClass(QWidget* parent)
DebugInfo(" FEKOImageSettingFun has init QtSARAntModelSettingClass init \n");
ui->setupUi(this);
DebugInfo(" FEKOImageSettingFun has init ui init \n");
this->simulationparams = new FEKOBase::FEKOSimulationDataparams; // std::make_shared<FEKOBase::FEKOSimulationDataparams>();
// // 参数初始化
this->simulationparams = new FEKOBase::
FEKOSimulationDataparams; // std::make_shared<FEKOBase::FEKOSimulationDataparams>();
// // 参数初始化
this->ui->lineEdit_TaskName->setText(this->simulationparams->taskName);
this->ui->lineEdit_farsourcePath->setText(this->simulationparams->AntennaRadiationFileName);
DebugInfo(" FEKOImageSettingFun has init lineEdit_farsourcePath init \n");
@ -150,6 +151,8 @@ QtSARAntModelSettingClass::QtSARAntModelSettingClass(QWidget* parent)
QObject::connect(this->Widgetfreqsetting, SIGNAL(OKClick()), this, SLOT(OKClickFreqSetting()));
QObject::connect(this->WidgetImageSetting, SIGNAL(OKClick()), this,
SLOT(OKClickImageSetting()));
connect(this->ui->horizontalSlider_PRF,SIGNAL(valueChanged(int)),this,SLOT(on_horizontalSliderPRF_valueChanged(int)));
// 添加频率
// this->Widgetfreqsetting->freqParams = this->freqSetting;
this->ui->tabWidget->removeTab(0);
@ -368,12 +371,12 @@ void QtSARAntModelSettingClass::on_comboBox_LookSide_currentIndexChanged(int ind
}
}
void QtSARAntModelSettingClass::on_horizontalSlider_PRF_valueChanged(int value)
void QtSARAntModelSettingClass::on_horizontalSliderPRF_valueChanged(int value)
{
if(this->FEKOAntPoselist.size() == 0) {
return;
}
if(m==nullptr){
if(m == nullptr) {
return;
}
this->ui->horizontalSlider_PRF->setMinimum(0);
@ -383,11 +386,6 @@ void QtSARAntModelSettingClass::on_horizontalSlider_PRF_valueChanged(int value)
// Handle(AIS_InteractiveObject) moveShapeold = this->antModel->get_antModelShow();
// this->myContext->Remove(moveShapeold,Standard_False);
// TopoDS_Shape *shape = new TopoDS_Shape;
int removeid = _geoData->getIndexByGeoometrySet(this->antModel->get_antModelset());
if(removeid == -1) {
return;
}
_geoData->removeGeometrySet(removeid);
// 增加新
FEKOBase::FEKOSatelliteParams temp = this->FEKOAntPoselist[value];
this->antModel->applyAntModel(
@ -396,12 +394,6 @@ void QtSARAntModelSettingClass::on_horizontalSlider_PRF_valueChanged(int value)
// Handle(AIS_InteractiveObject) moveShape = this->antModel->get_antModelShow();
// this->myContext->Display(moveShape, Standard_True);
_geoData->appendGeometrySet(this->antModel->get_antModelset());
emit m->updateGeometryTreeSig();
emit m->getSubWindowManager()->getPreWindow()->showGeoSet(this->antModel->get_antModelset(),
true);
if(this->simulationparams->imagemode == FEKOBase::FEKOImageMode::ISAR
|| this->simulationparams->imagemode == FEKOBase::FEKOImageMode::CircleSAR) {
@ -428,38 +420,92 @@ void QtSARAntModelSettingClass::on_pushButton_OK_clicked()
this->refreshFEKOSimulationParams(); // 最后更新下参数
this->saveFEKOImageSettingXML();
QString luatext = this->createLuaSciptString(0, this->FEKOAntPoselist.size());
QProgressDialog progressDialog(u8"构建馈源设置脚本", u8"终止", 0, this->FEKOAntPoselist.size());
progressDialog.setWindowTitle("imaging...");
progressDialog.setModal(true);
progressDialog.setAutoClose(true);
progressDialog.setValue(0);
progressDialog.setMaximum(this->FEKOAntPoselist.size());
progressDialog.setMinimum(0);
progressDialog.show();
// 写入文件
QString filePath =
this->workSpace + QDir::separator() + this->simulationparams->taskName
+ QString(u8"_%1.lua")
.arg(FEKOBase::FEKOImageModeenumToString(this->simulationparams->imagemode));
// 创建文件对象
QFile file(filePath);
QStringList lualist;
for(size_t start_prf_idx = 0; start_prf_idx < this->FEKOAntPoselist.size();) {
size_t end_prf_idx = start_prf_idx + 100;
if(end_prf_idx > this->FEKOAntPoselist.size()) {
end_prf_idx = this->FEKOAntPoselist.size();
} else {
}
QString cfxName =
QString("%1_%2_PRF_%3_T_%4")
.arg(this->simulationparams->taskName)
.arg(FEKOBase::FEKOImageModeenumToString(this->simulationparams->imagemode))
.arg(QString::number(start_prf_idx))
.arg(QString::number(end_prf_idx-1));
QString luatext = this->createLuaSciptString(start_prf_idx, end_prf_idx, cfxName);
// 写入文件
QString filePath = this->workSpace + QDir::separator() + QString(u8"%1.lua").arg(cfxName);
// 创建文件对象
QFile file(filePath);
// 打开文件以供写入,如果文件不存在将创建新文件
if(file.open(QIODevice::WriteOnly | QIODevice::Text)) {
// 创建文本流并设置编码为UTF-8
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream << luatext;
// 关闭文件
file.close();
// 提示文件写入成功
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入成功!\n%1").arg(filePath));
qDebug() << "File written successfully.";
} else {
qDebug() << "Could not open file for writing.";
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入失败"));
// 打开文件以供写入,如果文件不存在将创建新文件
if(file.open(QIODevice::WriteOnly | QIODevice::Text)) {
// 创建文本流并设置编码为UTF-8
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream << luatext;
// 关闭文件
file.close();
qDebug() << "File written successfully. "+ filePath;
} else {
qDebug() << "Could not open file for writing.";
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入失败"));
}
progressDialog.setValue(end_prf_idx);
start_prf_idx=end_prf_idx;
lualist.append(QString(u8" cadfeko 目标与场景模型.cfx --non-interactive --run-script %1.lua").arg(cfxName));
}
progressDialog.setWindowTitle(u8"馈源脚本生产成功");
progressDialog.setValue(this->FEKOAntPoselist.size());
progressDialog.close();
// 保存示例脚本
{
QString createluabat = "";
for(size_t i = 0; i < lualist.count(); i++) {
createluabat = createluabat + lualist[i] + "\n";
}
// 生成脚本
QString batfilePath = this->workSpace + QDir::separator()
+ QString(u8"%1_CADFEKO.bat").arg(this->simulationparams->taskName);
QFile file(batfilePath);
// 打开文件以供写入,如果文件不存在将创建新文件
if(file.open(QIODevice::WriteOnly | QIODevice::Text)) {
// 创建文本流并设置编码为UTF-8
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream << createluabat;
// 关闭文件
file.close();
qDebug() << "File written successfully." + batfilePath;
} else {
qDebug() << "Could not open file for writing.";
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入失败"));
}
}
// 提示文件写入成功
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入成功!\n%1\n%2").arg(this->workSpace).arg("参考指令 cadfeko trihedral.cfx --non-interactive --run-script trihedral.lua "));
// 询问用户是否关闭窗口
QMessageBox::StandardButton reply;
reply = QMessageBox::question(this, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"是否关闭窗口?"),
QMessageBox::Yes | QMessageBox::No);
reply = QMessageBox::question(
this, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"是否关闭窗口?\n"),
QMessageBox::Yes | QMessageBox::No);
if(reply == QMessageBox::Yes) {
this->close();
} else {

View File

@ -112,11 +112,11 @@ public slots:
void OKClickScane( );
void OKClickFreqSetting( );
void OKClickImageSetting( );
void on_comboBox_ImageMode_currentIndexChanged(int index);
void on_pushButton_ffe_clicked();
void on_comboBox_LookSide_currentIndexChanged(int index);
void on_horizontalSlider_PRF_valueChanged(int value);
void on_horizontalSliderPRF_valueChanged(int value);
void on_pushButton_OK_clicked();
void on_pushButton_Cancel_clicked();
void on_lineEdit_refRange_editingFinished();

View File

@ -7,33 +7,14 @@
<x>0</x>
<y>0</y>
<width>759</width>
<height>737</height>
<height>859</height>
</rect>
</property>
<property name="windowTitle">
<string>天线参数设置</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>成像模式</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="3">
<item row="11" column="0" colspan="3">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
@ -303,8 +284,8 @@
</widget>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_ImageMode">
<item row="3" column="1">
<widget class="QComboBox" name="comboBox_LookSide">
<property name="minimumSize">
<size>
<width>0</width>
@ -319,7 +300,74 @@
</property>
</widget>
</item>
<item row="8" column="0">
<item row="9" column="2">
<widget class="QPushButton" name="pushButton_ffe">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>打开</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_10">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>参考斜距m</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="lineEdit_incangle">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>任务名称</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
@ -338,103 +386,7 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEdit_refRange">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="lineEdit_farsourcePath">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_11">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>入射角</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QPushButton" name="pushButton_ffe">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>打开</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLineEdit" name="lineEdit_incangle">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_LookSide">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="11" column="0" colspan="2">
<item row="12" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
@ -506,51 +458,99 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_ImageMode">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="lineEdit_refRange">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_11">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>入射角</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="lineEdit_farsourcePath">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>成像模式</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>左右视</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_10">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>参考斜距m</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text">
<string>任务名称</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_TaskName">
<property name="minimumSize">
@ -567,6 +567,61 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_12">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<property name="text">
<string>天线极化:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QWidget" name="widget" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
</property>
<widget class="QRadioButton" name="radioButton_PolarAngle0">
<property name="geometry">
<rect>
<x>90</x>
<y>10</y>
<width>115</width>
<height>19</height>
</rect>
</property>
<property name="toolTip">
<string>极化角度与原始天线的极化角度不变,例如原天线是水平发射( H ),本工程也是水平发射( H )</string>
</property>
<property name="text">
<string>极化角度不变</string>
</property>
</widget>
<widget class="QRadioButton" name="radioButton_2">
<property name="geometry">
<rect>
<x>340</x>
<y>10</y>
<width>115</width>
<height>19</height>
</rect>
</property>
<property name="toolTip">
<string>极化角度与原始天线的极化角度相差90度例如原天线是水平发射( H ),本工程修改为垂直发射( V )</string>
</property>
<property name="text">
<string>极化角度+90</string>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>

View File

@ -90,49 +90,39 @@ void FEKOResultCsvTableModel::loadCSVFilePath(QString csvPath)
inFile.close();
}
this->SetData(datamap, colnames, rowIDlist);
QStringList tempColNames;
for(int i=0;i<colnames.size();i++){
if(colnames[i].indexOf("Re")>=0){
QString colname=colnames[i];
colname.replace("Re","");
colname.replace("(","");
colname.replace(")","");
tempColNames.append(colname);
}
}
for(int ii=0;ii<tempColNames.size();ii++) {
colnames.append(tempColNames[ii]);
for(size_t i = 0; i < datamap.size(); i++) {
QVector<QVariant> mapline = datamap[i];
double re = 0;
double im = 0;
for(int col = 1; col < mapline.size(); col++) {
if(colnames[col].contains("Re") && colnames[col].contains(tempColNames[ii])){
re=mapline[col].toDouble();
}else{}
if(colnames[col].contains("Im") && colnames[col].contains(tempColNames[ii])){
im=mapline[col].toDouble();
}else{}
}
double RCS=(re*re+im*im)*4*M_PI;
mapline.append(QString::number(RCS));
}
}
// this->SetData(datamap, colnames, rowIDlist);
// QStringList tempColNames;
// for(int i=0;i<colnames.size();i++){
// if(colnames[i].indexOf("Re")>=0){
// QString colname=colnames[i];
// colname.replace("Re","");
// colname.replace("(","");
// colname.replace(")","");
// tempColNames.append(colname);
// }
// }
//
//
// for(int ii=0;ii<tempColNames.size();ii++) {
// colnames.append(tempColNames[ii]);
// for(size_t i = 0; i < datamap.size(); i++) {
// QVector<QVariant> mapline = datamap[i];
// double re = 0;
// double im = 0;
// for(int col = 1; col < mapline.size(); col++) {
// if(colnames[col].contains("Re") && colnames[col].contains(tempColNames[ii])){
// re=mapline[col].toDouble();
// }else{}
// if(colnames[col].contains("Im") && colnames[col].contains(tempColNames[ii])){
// im=mapline[col].toDouble();
// }else{}
// }
// double RCS=(re*re+im*im)*4*M_PI;
// mapline.append(QString::number(RCS));
// }
// }
//
this->SetData(datamap, colnames, rowIDlist);
}
void FEKOResultCsvTableModel::saveCSVFilePath(QString csvpath)

View File

@ -10,6 +10,7 @@
#include "DialogPCLGuassFilter.h"
#include "DialogPCLBilateralFilter.h"
#include "DialogPCLGPMesh.h"
#include "DialogPCLPoissonMesh.h"
#include <QFileInfo>
#include "Common/DebugLogger.h"
@ -19,7 +20,7 @@
#include "EchoTableEditWindow.h"
#include "SqliteDBMainWindow.h"
#include "LAMPImageCreateClass.h"
//#include "dialogechodatashow.h"
namespace WBFZ {
GUI::MainWindow* WBFZ::WBFZExchangePlugin::_mainwindow = nullptr;
@ -38,6 +39,10 @@ namespace WBFZ {
SLOT(pclBilateralFilter(GUI::MainWindow*)));
connect(_mainwindow, SIGNAL(on_pclGPMesh(GUI::MainWindow*)), this,
SLOT(pclGPMesh(GUI::MainWindow*)));
connect(_mainwindow, SIGNAL(on_pclPoissonMesh(GUI::MainWindow*)), this,
SLOT(pclPoissonMesh(GUI::MainWindow*)));
// FEKO
connect(_mainwindow, SIGNAL(on_actionImageSetting(GUI::MainWindow*)), this,
SLOT(actionImageSetting(GUI::MainWindow*)));
@ -52,6 +57,9 @@ namespace WBFZ {
// 属性表
connect(_mainwindow, SIGNAL(on_actionAttriutionDBShow(GUI::MainWindow*)), this,
SLOT(actionAttriutionDBShow(GUI::MainWindow*)));
connect(_mainwindow,SIGNAL(on_actionImageShowToolTriggleSIGNAL(GUI::MainWindow* )),this,SLOT(actionImageShowToolShow(GUI::MainWindow*)));
connect(_mainwindow,SIGNAL(on_actionRCShowToolSIGNAL(GUI::MainWindow* )),this,SLOT(actionactionRCShowTool(GUI::MainWindow*)));
DebugInfo("WBFZExchangePlugin::WBFZExchangePlugin has init \n");
}
@ -141,6 +149,23 @@ namespace WBFZ {
SqliteDBMainWindow* w = new SqliteDBMainWindow(m);
w->show();
}
void WBFZExchangePlugin::actionImageShowToolShow(GUI::MainWindow* m) {
DebugInfo(" WBFZExchangePlugin::actionImageShowToolShow has init\n");
LAMPDataShowClass* w = new LAMPDataShowClass(m);
w->show();
}
void WBFZExchangePlugin::actionactionRCShowTool(GUI::MainWindow* m) {
// DebugInfo(" WBFZExchangePlugin::actionactionRCShowTool has init\n");
// WBCLFZ::DialogEchoDataShow* w = new WBCLFZ::DialogEchoDataShow(m);
// w->show();
}
void WBFZExchangePlugin::pclPoissonMesh(GUI::MainWindow* m) {
DebugInfo(" WBFZExchangePlugin::pclPoissonMesh has init\n");
MainWidget::DialogPCLPoissonMesh dlg(m);
dlg.exec();
}
} // namespace WBFZ

View File

@ -35,7 +35,8 @@ namespace WBFZ
void pclBilateralFilter(GUI::MainWindow* m);
// GP网格重建
void pclGPMesh(GUI::MainWindow* m);
// 泊松重建
void pclPoissonMesh(GUI::MainWindow* m);
// FEKO 成像模式参数设置
void actionImageSetting(GUI::MainWindow* m);
// FEKO 仿真结果抽取
@ -48,6 +49,10 @@ namespace WBFZ
void actionantScatteringFEKOSetting(GUI::MainWindow* m);
void actionAttriutionDBShow(GUI::MainWindow* m);
// 图像展示工具
void actionImageShowToolShow(GUI::MainWindow* m);
void actionactionRCShowTool(GUI::MainWindow* m);
private:
static GUI::MainWindow* _mainwindow;
};

View File

@ -4,7 +4,7 @@
#include <QtCore/QtGlobal>
// 定义 远场条件下的默认参考斜距
#define CIRCLESARREFRANGE 90000
#define CIRCLESARREFRANGE 0
#if defined(WBFZ_API)
#define WBFZAPI Q_DECL_EXPORT
@ -19,10 +19,10 @@
// ======================================================
#define __SHOWPROCESS
//#define __SHOWPROCESS
//#define __SHOWMATPLOTLIBCPPTEST // 局部绘制结果调试
//#define __IMAGEPARALLEL // 成像算法并行版本
#define __IMAGEPARALLEL // 成像算法并行版本
#define __IMAGEWINDOWSPROCESS // 成像算法使用加窗函数

View File

@ -101,7 +101,7 @@ add_library(PointCloudOperator
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
target_compile_definitions(PointCloudOperator PRIVATE "POINTCLOUDOPERATORAPI_API")
target_compile_definitions(PointCloudOperator PRIVATE "POINTCLOUDOPERATOR_API")
list(APPEND _depend_library Common MeshData DataProperty )

View File

@ -16,9 +16,9 @@
namespace MeshSurfaceSampling {
vtkSmartPointer<vtkPolyData> MeshSurfaceSampling(vtkSmartPointer<vtkPolyData> Inpoints) {
// 读取三维数据
vtkSmartPointer<vtkStructuredPointsReader> reader = vtkSmartPointer<vtkStructuredPointsReader>::New();
reader->SetFileName("input.vtk");
reader->Update();
// vtkSmartPointer<vtkStructuredPointsReader> reader = vtkSmartPointer<vtkStructuredPointsReader>::New();
// reader->SetFileName("input.vtk");
// reader->Update();
// 创建表面重建滤波器
vtkSmartPointer<vtkSurfaceReconstructionFilter> surfaceFilter = vtkSmartPointer<vtkSurfaceReconstructionFilter>::New();

View File

@ -27,6 +27,15 @@
#include "MeshData/meshSingleton.h"
#include <vtkSelectionNode.h>
#include <vtkExtractSelection.h>
#include <vtkUnstructuredGridWriter.h>
#include <QFileInfo>
#include <QTextCodec>
#include <vtkSTLWriter.h>
#include <QDebug>
#include <vtkGeometryFilter.h>
#include <vtkAppendFilter.h>
#include <vtkSTLReader.h>
#include <vtkDataSetReader.h>
// Support for VTK 7.1 upwards
#ifdef vtkGenericDataArray_h
@ -259,9 +268,80 @@ namespace PointCloudOperator {
Fliter->Update();
vtkPolyData* displayDataSet=vtkPolyData::New();
displayDataSet->DeepCopy(Fliter->GetOutput());
return displayDataSet;
}
bool PointCloudCommon::writeVTK(vtkSmartPointer<vtkDataSet> indataset, QString filepath) {
QFile infile(filepath);
if(infile.exists()){
infile.remove();
}
QTextCodec *codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(filepath);
vtkSmartPointer<vtkUnstructuredGrid> ungird = vtkUnstructuredGrid::New();
vtkSmartPointer<vtkAppendFilter> filter = vtkSmartPointer<vtkAppendFilter>::New();
if (nullptr!=indataset )
{filter->AddInputData(indataset);}
else{
return false;
}
vtkSmartPointer<vtkUnstructuredGridWriter> writer = vtkSmartPointer<vtkUnstructuredGridWriter>::New();
writer->SetInputData(ungird);
writer->SetFileTypeToBinary();
writer->SetFileName(ba);
writer->Write();
return QFile(filepath).exists();
}
bool PointCloudCommon::writeSTL(vtkSmartPointer<vtkDataSet> indataset, QString filepath)
{
QFile infile(filepath);
if(infile.exists()){
infile.remove();
}
QTextCodec *codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(filepath);
vtkSmartPointer<vtkGeometryFilter> cellToPointFilter = vtkSmartPointer<vtkGeometryFilter>::New();
cellToPointFilter->AddInputData(indataset);
cellToPointFilter->Update();
vtkSmartPointer<vtkSTLWriter> writer = vtkSmartPointer<vtkSTLWriter>::New();
writer->SetInputConnection(cellToPointFilter->GetOutputPort());
writer->SetFileTypeToBinary();
writer->SetFileName(ba);
writer->Write();
QFile outfile(filepath);
return outfile.exists();// 判断文件是否存在
}
vtkSmartPointer<vtkDataSet> PointCloudCommon::readVTK( QString filepath)
{
if(QFile(filepath).exists()){}else{return nullptr;}
QTextCodec *codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(filepath);
vtkSmartPointer<vtkDataSetReader> _vtkReader = vtkSmartPointer<vtkDataSetReader>::New();
_vtkReader->SetFileName(ba);
_vtkReader->SetReadAllColorScalars(false);
_vtkReader->SetReadAllScalars(false);
_vtkReader->SetReadAllVectors(false);
_vtkReader->SetReadAllFields(false);
_vtkReader->SetReadAllTensors(false);
_vtkReader->Update();
vtkSmartPointer<vtkDataSet> outdataset = _vtkReader->GetOutput();
return outdataset;
}
vtkSmartPointer<vtkDataSet> PointCloudCommon::readSTL( QString filepath)
{
if(QFile(filepath).exists()){}else{return nullptr;}
QTextCodec *codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(filepath);
vtkSmartPointer<vtkSTLReader> _stlReader = vtkSmartPointer<vtkSTLReader>::New();
_stlReader->SetFileName(ba);
_stlReader->SetMerging(true);
_stlReader->Update();
vtkSmartPointer<vtkDataSet> outdataset=_stlReader->GetOutput();
return outdataset;
}
} // namespace PointCloudOperator

View File

@ -115,7 +115,7 @@
namespace PointCloudOperator {
class POINTCLOUDOPERATORAPI PointCloudCommon:public QObject
class POINTCLOUDOPERATORAPI PointCloudCommon : public QObject
{
Q_OBJECT
public:
@ -132,6 +132,11 @@ namespace PointCloudOperator {
static vtkPolyData* meshSetToVtkDataset(MeshData::MeshSet* in_set);
static bool writeVTK(vtkSmartPointer<vtkDataSet> indataset,QString filepath);
static bool writeSTL(vtkSmartPointer<vtkDataSet> indataset,QString filepath);
static vtkSmartPointer<vtkDataSet> readVTK(QString filepath);
static vtkSmartPointer<vtkDataSet> readSTL(QString filepath);
};
} // namespace PointCloudOperator

View File

@ -0,0 +1,123 @@
/**
* @file PointCloudReMesh.cpp
* @brief None
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 2024/4/4
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#include <vtkPointSource.h>
#include "PointCloudMesh.h"
#include "PointCloudCommon.h"
#include "Common/DebugLogger.h"
namespace PointCloudOperator {
PointCloudMeshOperator::PointCloudMeshOperator(QObject* parent)
: QObject(parent)
{
}
bool PointCloudMeshOperator::GP(vtkSmartPointer<vtkPolyData>& inpolygon,
vtkSmartPointer<vtkPolyData>& polydata, double SearchRadius,
double Mu, int MaximumNearestNeighbors, double MaximumSurfaceAngle,
double MaximumAngle, double MinimumAngle)
{
// 点云处理模块
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_with_rgba(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_filtered( new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr output( new pcl::PointCloud<pcl::PointXYZRGBA>); // 输出结果
pcl::PointCloud<pcl::PointNormal>::Ptr cloud_with_normals(new pcl::PointCloud<pcl::PointNormal>); // 法线向量
pcl::search::KdTree<pcl::PointNormal>::Ptr tree2(new pcl::search::KdTree<pcl::PointNormal>);
pcl::io::vtkPolyDataToPointCloud(inpolygon, *cloud_with_rgba);
PointCloudOperator::PointCloudCommon::NormalEstimation(cloud_with_rgba, cloud_with_normals);
tree2->setInputCloud(cloud_with_normals); // 构建搜索树
std::shared_ptr<pcl::PolygonMesh> mesh (new pcl::PolygonMesh); // 非智能指针,需要释放
pcl::GreedyProjectionTriangulation<pcl::PointNormal> gp3; // 定义三角化对象
gp3.setSearchRadius(SearchRadius); // 设置连接点之间的最大距离(即三角形的最大边长)
gp3.setMu(Mu); // 设置被样本点搜索其临近点的最远距离,为了适应点云密度的变化
gp3.setMaximumNearestNeighbors(MaximumNearestNeighbors); // 设置样本点可搜索的邻域个数
gp3.setMaximumSurfaceAngle(MaximumSurfaceAngle); // 设置某点法线方向偏离样本点法线方向的最大角度
gp3.setMinimumAngle(MinimumAngle); // 设置三角化后得到三角形内角的最小角度
gp3.setMaximumAngle(MaximumAngle); // 设置三角化后得到三角形内角的最大角度
gp3.setNormalConsistency(false); // 设置该参数保证法线朝向一致
gp3.setInputCloud(cloud_with_normals); // 设置输入点云为有向点云
gp3.setSearchMethod(tree2); // 设置搜索方式
gp3.reconstruct(*mesh); // 重建提取三角化 -- 这里会导致程序崩溃,可能存在内存泄露,
// DebugInfo("remesh over GP \n");
// return false;
size_t pointcount = PointCloudOperator::PointCloudCommon::mesh2vtk(*mesh, polydata);
DebugInfo("remesh over ,conver init %d \n", mesh->polygons.size());
//delete mesh;
return true;
}
bool PointCloudMeshOperator::vtkPointSampling(vtkSmartPointer<vtkPolyData> surfaceMesh,vtkSmartPointer<vtkPolyData> uniformPointCloud,size_t pointCount,double radius)
{
vtkSmartPointer<vtkPointSource> pointSampler = vtkSmartPointer<vtkPointSource>::New();
pointSampler->SetCenter(surfaceMesh->GetCenter()); // 设置采样中心
pointSampler->SetNumberOfPoints(pointCount); // 设置生成点的数量
pointSampler->SetRadius(radius); // 设置采样半径
pointSampler->Update();
uniformPointCloud = pointSampler->GetOutput();
if(nullptr==uniformPointCloud){
return false;
}else{
return true;
}
return false;
}
bool PointCloudMeshOperator::PoissonMesh(vtkSmartPointer<vtkPolyData>& inpolygon,
vtkSmartPointer<vtkPolyData>& polydata,
bool Confidence, size_t Degree, size_t Depth,
size_t IsoDivide, bool Manifold, bool OutputPolygons,
double SamplesPerNode, double Scale,
size_t SolverDivide)
{
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_with_rgba(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_filtered( new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr output( new pcl::PointCloud<pcl::PointXYZRGBA>); // 输出结果
pcl::PointCloud<pcl::PointNormal>::Ptr cloud_with_normals(new pcl::PointCloud<pcl::PointNormal>); // 法线向量
pcl::search::KdTree<pcl::PointNormal>::Ptr tree2(new pcl::search::KdTree<pcl::PointNormal>);
pcl::io::vtkPolyDataToPointCloud(inpolygon, *cloud_with_rgba);
PointCloudOperator::PointCloudCommon::NormalEstimation(cloud_with_rgba, cloud_with_normals);
tree2->setInputCloud(cloud_with_normals); // 构建搜索树
std::shared_ptr<pcl::PolygonMesh> mesh (new pcl::PolygonMesh); // 非智能指针,需要释放
DebugInfo("pn init \n");
tree2->setInputCloud(cloud_with_normals) ;
//创建Poisson对象并设置参数
pcl::Poisson<pcl::PointNormal> pn ;
pn.setConfidence(Confidence); //是否使用法向量的大小作为置信信息。如果false所有法向量均归一化。
pn.setDegree(Degree); //设置参数degree[1,5],值越大越精细,耗时越久。
pn.setDepth(Depth); //树的最大深度求解2^d x 2^d x 2^d立方体元。由于八叉树自适应采样密度指定值仅为最大深度。
pn.setIsoDivide(IsoDivide); //用于提取ISO等值面的算法的深度
pn.setManifold(Manifold); //是否添加多边形的重心,当多边形三角化时。 设置流行标志如果设置为true则对多边形进行细分三角话时添加重心设置false则不添加
pn.setOutputPolygons(OutputPolygons); //是否输出多边形网格(而不是三角化移动立方体的结果)
pn.setSamplesPerNode(SamplesPerNode); //设置落入一个八叉树结点中的样本点的最小数量。无噪声,[1.0-5.0],有噪声[15.-20.]平滑
pn.setScale(Scale); //设置用于重构的立方体直径和样本边界立方体直径的比率。
pn.setSolverDivide(SolverDivide); //设置求解线性方程组的Gauss-Seidel迭代方法的深度
pn.setSearchMethod(tree2);
pn.setInputCloud(cloud_with_normals);
//执行重构
pn.performReconstruction(*mesh);
DebugInfo("remesh over ,conver init %d \n", mesh->polygons.size());
// DebugInfo("remesh over GP \n");
// return false;
size_t pointcount = PointCloudOperator::PointCloudCommon::mesh2vtk(*mesh, polydata);
DebugInfo("remesh over ,conver init %d \n", mesh->polygons.size());
//delete mesh;
return true;
}
} // namespace PointCloudOperator

View File

@ -7,8 +7,8 @@
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#ifndef LAMPCAE_POINTCLOUDREMESH_H
#define LAMPCAE_POINTCLOUDREMESH_H
#ifndef LAMPCAE_POINTCLOUDMESH_H
#define LAMPCAE_POINTCLOUDMESH_H
// qt 相关头文件
#include <QObject>
@ -113,16 +113,28 @@
namespace PointCloudOperator {
class PointCloudReMesh:public QObject {
class POINTCLOUDOPERATORAPI PointCloudMeshOperator:public QObject {
Q_OBJECT
public:
PointCloudReMesh(QObject* parent=nullptr);
~PointCloudReMesh()=default;
PointCloudMeshOperator(QObject* parent=nullptr);
~PointCloudMeshOperator()=default;
static bool GP(vtkSmartPointer<vtkPolyData>& inpolygon,
vtkSmartPointer<vtkPolyData>& polydata, double SearchRadius,
double Mu, int MaximumNearestNeighbors, double MaximumSurfaceAngle,
double MaximumAngle, double MinimumAngle);
static bool PoissonMesh(vtkSmartPointer<vtkPolyData>& inpolygon,
vtkSmartPointer<vtkPolyData>& polydata,
bool Confidence, size_t Degree,
size_t Depth, size_t IsoDivide, bool Manifold, bool OutputPolygons,
double SamplesPerNode, double Scale, size_t SolverDivide
);
static bool vtkPointSampling(vtkSmartPointer<vtkPolyData> surfaceMesh,vtkSmartPointer<vtkPolyData> uniformPointCloud,size_t pointCount,double radius);
};
} // namespace PointCloudOperator
#endif // LAMPCAE_POINTCLOUDREMESH_H
#endif // LAMPCAE_POINTCLOUDMESH_H

View File

@ -4,10 +4,10 @@
#include <QtCore/QtGlobal>
#if defined(POINTCLOUDOPERATORAPI_API)
#if defined(POINTCLOUDOPERATOR_API)
#define POINTCLOUDOPERATORAPI Q_DECL_EXPORT
#else
#define POINTCLOUDOPERATORAPI Q_DECL_IMPORT
#endif
#endif
#endif

View File

@ -1,17 +0,0 @@
/**
* @file PointCloudReMesh.cpp
* @brief None
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 2024/4/4
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#include "PointCloudReMesh.h"
namespace PointCloudOperator {
PointCloudReMesh::PointCloudReMesh(QObject* parent)
: QObject(parent)
{
}
} // namespace PointCloudOperator

View File

@ -0,0 +1,149 @@
#-----------------------------------------------------------------------------
# mesh
# -> mesh
# mesh->-> -> mesh
#
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
# boost
include_directories(D:/vcpkg/installed/x64-windows/include)
# pcl
include_directories(C:/PCL/3rdParty/FLANN/include)
include_directories(C:/PCL/3rdParty/VTK/include/vtk-9.3)
include_directories(C:/PCL/include/pcl-1.14)
# qt5
include_directories(C:/Qt/5.15.2/msvc2019_64/include/QtQml)
# lamptool
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../LAMPTool)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../LAMPTool/include)
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
# pcl
link_directories("C:/PCL/3rdParty/FLANN/lib")
link_directories("C:/VTK/lib")
link_directories("C:/PCL/lib")
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
# pcl
link_directories("C:/PCL/3rdParty/FLANN/lib")
link_directories("C:/VTK/lib")
link_directories("C:/PCL/lib")
find_package(Qt5 REQUIRED COMPONENTS Core Quick Sql Core Xml Opengl Gui Svg Xmlpatterns Uitools Widgets Qml Printsupport Sensors Quickwidgets Quick Concurrent Openglextensions Charts Datavisualization)
find_package(PCL )
# boost
include_directories(D:/vcpkg/installed/x64-windows/include)
# pcl
include_directories(C:/PCL/3rdParty/FLANN/include)
include_directories(C:/PCL/3rdParty/VTK/include/vtk-9.3)
include_directories(C:/PCL/include/pcl-1.14)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
#-----------------------------------------------------------------------------
# include
#-----------------------------------------------------------------------------
set(CMAKE_INCLUDE_CURRENT_DIR ON)
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
set(_qrc "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/WBCLFZSystemModule.qrc")
set(_qrc "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/qianfan.qrc")
set(_lang "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/translations.qrc")
qt5_add_resources(_resource ${_qrc} ${_lang})
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
file(GLOB_RECURSE _ui "*.ui")
file(GLOB_RECURSE _header "*.h" "*.hxx")
file(GLOB_RECURSE _source "*.cpp")
qt5_wrap_ui(_interface ${_ui})
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
#add_library(PointMeshAlgorithm
# ${_resource}
# ${_interface}
# ${_header}
# ${_source}
#
#)
add_executable(PointMeshAlgorithm
${_resource}
${_interface}
${_header}
${_source}
# ${CMAKE_CURRENT_SOURCE_DIR}/../qrc/qianfan.rc
)
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
target_compile_definitions(PointMeshAlgorithm PRIVATE "POINTMESHALGORITHMAPI_API")
list(APPEND _depend_library PointCloudOperator Common MeshData DataProperty )
list(APPEND _runtimes_libraries
VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersStatistics VTK::FiltersVerdict VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ParallelCore VTK::ParallelDIY VTK::doubleconversion VTK::expat VTK::lz4 VTK::lzma VTK::sys VTK::verdict VTK::zlib
)
list(APPEND _runtimes_libraries
Qt5::Widgets Qt5::Xml Qt5::DBus Qt5::Core Qt5::Xml Qt5::OpenGL Qt5::Gui Qt5::Svg Qt5::Widgets Qt5::Qml Qt5::DataVisualization Qt5::Charts Qt5::PrintSupport
)
list(APPEND _runtimes_libraries
OpenCASCADE::Freetype OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::TKBool OpenCASCADE::TKCAF OpenCASCADE::TKCDF OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKHLR OpenCASCADE::TKIGES OpenCASCADE::TKLCAF OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKPrim OpenCASCADE::TKSTEP OpenCASCADE::TKSTEP209 OpenCASCADE::TKSTEPAttr OpenCASCADE::TKSTEPBase OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKVCAF OpenCASCADE::TKXCAF OpenCASCADE::TKXDEIGES OpenCASCADE::TKXSBase OpenCASCADE::TKernel Qt5::Widgets Qt5::Xml VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::FiltersStatistics VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ImagingMath VTK::InteractionStyle VTK::ParallelCore VTK::ParallelDIY VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib VTK::IOGeometry
)
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
target_link_libraries(PointMeshAlgorithm PRIVATE
${_runtimes_libraries}
${_depend_library}
${PCL_LIBRARIES}
)
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
add_dependencies(PointMeshAlgorithm ${_depend_library} Common)
#-----------------------------------------------------------------------------
#
#-----------------------------------------------------------------------------
set(LAMPCAE_PointMeshAlgorithm_Runtimes_Libraries ${_runtimes_libraries} PARENT_SCOPE)

View File

@ -0,0 +1,38 @@
/**
* @file MeshResample.cpp
* @brief None
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 24-5-23
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#include <vtkStructuredPointsReader.h>
#include <vtkSurfaceReconstructionFilter.h>
#include <vtkDataSetSurfaceFilter.h>
#include <QDebug>
#include "MeshResample.h"
namespace PointMeshAlgorithm {
vtkSmartPointer<vtkDataSet>
MeshResample::MeshSurfaceSampling(vtkSmartPointer<vtkDataSet> Insurface)
{
// 读取三维数据
// vtkSmartPointer<vtkStructuredPointsReader> reader = vtkSmartPointer<vtkStructuredPointsReader>::New();
// reader->SetFileName("input.vtk");
// reader->Update();
// 创建表面重建滤波器
vtkSmartPointer<vtkSurfaceReconstructionFilter> surfaceFilter = vtkSmartPointer<vtkSurfaceReconstructionFilter>::New();
surfaceFilter->SetInputData(Insurface);
surfaceFilter->Update();
// 将结果转换为多边形数据
vtkSmartPointer<vtkDataSetSurfaceFilter> surface = vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
surface->SetInputConnection(surfaceFilter->GetOutputPort());
surface->Update();
// 返回结果
vtkSmartPointer<vtkDataSet> outsurface =surface->GetOutput();
return outsurface;
}
} // namespace PointCloudOperator

View File

@ -0,0 +1,23 @@
/**
* @file MeshResample.h
* @brief None
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 24-5-23
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#ifndef LAMPCAE_MESHRESAMPLE_H
#define LAMPCAE_MESHRESAMPLE_H
#include <vtkPolyData.h>
namespace PointMeshAlgorithm {
class MeshResample {
public:
static vtkSmartPointer<vtkDataSet> MeshSurfaceSampling(vtkSmartPointer<vtkDataSet> Insurface);
};
} // namespace PointCloudOperator
#endif // LAMPCAE_MESHRESAMPLE_H

View File

@ -0,0 +1,13 @@
#ifndef _POINTMESHALGORITHMAPI_H__
#define _POINTMESHALGORITHMAPI_H__
#include <QtCore/QtGlobal>
#if defined(POINTMESHALGORITHMAPI_API)
#define POINTMESHALGORITHMAPI Q_DECL_EXPORT
#else
#define POINTMESHALGORITHMAPI Q_DECL_IMPORT
#endif
#endif

View File

@ -0,0 +1,13 @@
/**
* @file PointResamplingOperator.cpp
* @brief None
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 24-5-23
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#include "PointResamplingOperator.h"
namespace PointMeshAlgorithm {
} // namespace PointCloudOperator

View File

@ -0,0 +1,22 @@
/**
* @file PointResamplingOperator.h
* @brief None
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 24-5-23
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#ifndef LAMPCAE_POINTRESAMPLINGOPERATOR_H
#define LAMPCAE_POINTRESAMPLINGOPERATOR_H
namespace PointMeshAlgorithm {
class PointResamplingOperator {
static bool PointResampling();
};
} // namespace PointCloudOperator
#endif // LAMPCAE_POINTRESAMPLINGOPERATOR_H

View File

@ -0,0 +1,33 @@
/**
* @file testmain.cpp
* @brief main
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 24-5-23
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#include <QString>
#include <QFile>
#include "PointMeshAlgorithmAPI.h"
#include "MeshResample.h"
#include "PointCloudOperator/PointCloudCommon.h"
#include <QDebug>
// 测试VTK 网格重采样效果
void TESTMeshVtkResample(){
QString infilepath="D:\\WBFZCPP\\fastCAETest\\sampling\\testSoilSurface20240521.stl";
QString outfilepath="D:\\WBFZCPP\\fastCAETest\\sampling\\testSoilSurface20240521_resampling.vtk";;
vtkPolyData::New();
vtkSmartPointer<vtkDataSet> indataSet=PointCloudOperator::PointCloudCommon::readSTL(infilepath);
qDebug()<<QString("point count :%1, cell count :%2 ").arg(indataSet->GetNumberOfPoints()).arg(indataSet->GetNumberOfCells());
vtkSmartPointer<vtkDataSet> outdataSet=PointMeshAlgorithm::MeshResample::MeshSurfaceSampling(indataSet);
qDebug()<<QString("point count :%1, cell count :%2 ").arg(outdataSet->GetNumberOfPoints()).arg(outdataSet->GetNumberOfCells());
qDebug()<<PointCloudOperator::PointCloudCommon::writeVTK(outdataSet,outfilepath);
}
int main(){
TESTMeshVtkResample();
return 0;
}

View File

@ -47,7 +47,7 @@ namespace Py {
std::string s = code.toStdString();
const char* c = s.c_str();
DebugInfo("Exec python script: %s\n", code.toStdString().c_str());
//DebugInfo("Exec python script: %s\n", code.toStdString().c_str());
int ok = PyRun_SimpleStringFlags(c, NULL);

View File

@ -1,15 +0,0 @@
<RCC>
<qresource prefix="/">
<file>images/themes/default/mActionAddGroup.png</file>
<file>images/themes/default/mActionCollapseTree.png</file>
<file>images/themes/default/mActionExpandTree.png</file>
<file>images/themes/default/mActionHideAllLayers.png</file>
<file>images/themes/default/mActionHideSelectedLayers.png</file>
<file>images/themes/default/mActionShowAllLayers.png</file>
<file>images/themes/default/mActionShowSelectedLayers.png</file>
<file>images/themes/default/mActionRemoveLayer.png</file>
<file>images/themes/default/labelingRuleBased.png</file>
<file>images/themes/default/labelingSingle.png</file>
<file>images/themes/default/mActionZoomActual.png</file>
</qresource>
</RCC>

View File

@ -35,7 +35,8 @@ include_directories(SYSTEM C:/PCL/3rdParty/FLANN/include)
include_directories(SYSTEM C:/PCL/3rdParty/VTK/include/vtk-9.3)
include_directories(SYSTEM C:/PCL/include/pcl-1.14)
# QGIS
find_package(QGIS REQUIRED)
#-----------------------------------------------------------------------------
#
@ -64,7 +65,7 @@ add_definitions(${PCL_DEFINITIONS})
#
#-----------------------------------------------------------------------------
set(_qrc "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/qianfan.qrc")
set(_lang "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/translations.qrc")
#set(_lang "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/translations.qrc")
qt5_add_resources(_resource ${_qrc} ${_lang})
#-----------------------------------------------------------------------------
@ -91,7 +92,10 @@ add_library(llqgisbaselib
target_compile_definitions(llqgisbaselib PRIVATE "LLQIGSBASELIB_API")
target_compile_definitions(llqgisbaselib PRIVATE "_USE_MATH_DEFINES")
list(APPEND _depend_library Common PythonModule Settings DataProperty MeshData Geometry ModelData SelfDefObject)
list(APPEND _depend_library
Common PythonModule DataProperty MeshData Material Geometry BCBase ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GeometryCommand GeometryWidgets IO MainWidgets MainWindow)
list(APPEND _runtimes_libraries
Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::DICOMParser VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersHybrid VTK::FiltersModeling VTK::FiltersSources VTK::FiltersStatistics VTK::GUISupportQt VTK::IOCore VTK::IOImage VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingColor VTK::ImagingCore VTK::ImagingFourier VTK::ImagingGeneral VTK::ImagingHybrid VTK::ImagingMath VTK::ImagingSources VTK::InteractionStyle VTK::InteractionWidgets VTK::ParallelCore VTK::ParallelDIY VTK::RenderingAnnotation VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::jpeg VTK::lz4 VTK::lzma VTK::metaio VTK::png VTK::pugixml VTK::sys VTK::tiff VTK::zlib

View File

@ -1,6 +1,7 @@
#include "ll_qgis_base_lib.h"
#include "MainWidgets/ControlPanel.h"
#include "MainWindow/SubWindowManager.h"
#include <QMainWindow>
#include <QColor>
#include <QAction>
#include <QToolButton>
@ -92,7 +93,7 @@ QString ll_qgis_base_lib::version()
return ver;
}
void ll_qgis_base_lib::initialize(QMainWindow *mainWindow)
void ll_qgis_base_lib::initialize(GUI::MainWindow *mainWindow)
{
mMainWindow = mainWindow;
@ -114,8 +115,10 @@ void ll_qgis_base_lib::cleanup()
delete mLayerTreeMapCanvasBridge;
mLayerTreeMapCanvasBridge = nullptr;
delete mLayerTreeDock;
mLayerTreeDock = nullptr;
if(nullptr!=mLayerTreeDock) {
delete mLayerTreeDock;
mLayerTreeDock = nullptr;
}
}
@ -145,9 +148,9 @@ void ll_qgis_base_lib::initSrs()
void ll_qgis_base_lib::initLayerTreeView()
{
//添加DockWidget作为图层树的容器
mLayerTreeDock = new QgsDockWidget(tr("Layer Tree"));
mLayerTreeDock->setObjectName( QStringLiteral( "Layers" ) );
mLayerTreeDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
// mLayerTreeDock = new QgsDockWidget(tr("Layer Tree"));
// mLayerTreeDock->setObjectName( QStringLiteral( "Layers" ) );
// mLayerTreeDock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
//创建Model
QgsLayerTreeModel* model = new QgsLayerTreeModel(QgsProject::instance()->layerTreeRoot(),this);
@ -235,7 +238,16 @@ void ll_qgis_base_lib::initLayerTreeView()
QWidget *w = new QWidget;
w->setLayout( vboxLayout );
mLayerTreeDock->setWidget( w );
// mLayerTreeDock->setWidget( w );
// banding map and tree in control and prewindows
GUI::SubWindowManager* subWindows=mMainWindow->getSubWindowManager();
MainWidget::ControlPanel* controlPanel= mMainWindow->getControlPanel();
}
void ll_qgis_base_lib::initMaptools()

View File

@ -21,7 +21,7 @@
// 这两个属于app库所以这里直接将源码拷贝到这里
#include "qgsstatusbarscalewidget.h"
#include "qgsstatusbarcoordinateswidget.h"
#include "MainWindow/MainWindow.h"
class QMainWindow;
class QDockWidget;
@ -60,7 +60,7 @@ public:
// getters
QgsLayerTreeView *layerTreeView() const;
QgsMapCanvas *mapCanvas() const;
QgsDockWidget *layerTreeDock() const;
QgsDockWidget *layerTreeDock() const;
QgsStatusBarScaleWidget *scaleWidget() const;
QgsStatusBarCoordinatesWidget *coordsEdit() const;
@ -72,7 +72,7 @@ public:
/// 4. 创建状态栏widget
/// \param mainWindow - 传入MainWindow指针
///
void initialize(QMainWindow *mainWindow);
void initialize(GUI::MainWindow *mainWindow);
///
/// \brief 程序退出时清理资源
///
@ -199,7 +199,7 @@ private:
void computeDataSources();
private:
QMainWindow *mMainWindow = nullptr;
GUI::MainWindow *mMainWindow = nullptr;
QgsMapCanvas *mMapCanvas = nullptr;
QgsDockWidget* mLayerTreeDock = nullptr;

View File

@ -9,6 +9,7 @@ set(QCUSTOMPLOT_SRC
)
set(QCUSTOMPLOT_HDR
)
set(QCUSTOMPLOT_MOC_HDR

View File

@ -1,16 +1,16 @@
<RCC>
<qresource prefix="/">
<file>images/themes/default/mActionAddGroup.png</file>
<file>images/themes/default/mActionCollapseTree.png</file>
<file>images/themes/default/mActionExpandTree.png</file>
<file>images/themes/default/mActionHideAllLayers.png</file>
<file>images/themes/default/mActionHideSelectedLayers.png</file>
<file>images/themes/default/mActionShowAllLayers.png</file>
<file>images/themes/default/mActionShowSelectedLayers.png</file>
<file>images/themes/default/mActionRemoveLayer.png</file>
<file>images/themes/default/labelingRuleBased.png</file>
<file>images/themes/default/labelingSingle.png</file>
<file>images/themes/default/mActionZoomActual.png</file>
<file>images/themes/default/mActionAddGroup.png</file>
<file>images/themes/default/mActionCollapseTree.png</file>
<file>images/themes/default/mActionExpandTree.png</file>
<file>images/themes/default/mActionHideAllLayers.png</file>
<file>images/themes/default/mActionHideSelectedLayers.png</file>
<file>images/themes/default/mActionShowAllLayers.png</file>
<file>images/themes/default/mActionShowSelectedLayers.png</file>
<file>images/themes/default/mActionRemoveLayer.png</file>
<file>images/themes/default/labelingRuleBased.png</file>
<file>images/themes/default/labelingSingle.png</file>
<file>images/themes/default/mActionZoomActual.png</file>
<file>QUI/main.ico</file>
<file>icons/application_go.png</file>
<file>icons/application_link.png</file>

View File

@ -184,6 +184,24 @@
<translation></translation>
</message>
</context>
<context>
<name>DialogSelectMeshDataComponents</name>
<message>
<location filename="../../MainWidgets/DialogSelectMeshDataComponents.ui" line="+14"/>
<source>DialogSelectMeshDataComponents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DialogVTKTransform</name>
<message>
@ -242,17 +260,17 @@
<translation>X</translation>
</message>
<message>
<location line="+38"/>
<location line="+41"/>
<source>Custom Y Axis : </source>
<translation>Y</translation>
</message>
<message>
<location line="+38"/>
<location line="+41"/>
<source>Custom Z Axis : </source>
<translation>Z</translation>
</message>
<message>
<location line="+66"/>
<location line="+69"/>
<source>Move Location</source>
<translation></translation>
</message>
@ -262,17 +280,17 @@
<translation>沿X</translation>
</message>
<message>
<location line="+38"/>
<location line="+41"/>
<source>Direction Of Y Axis : </source>
<translation>沿Y</translation>
</message>
<message>
<location line="+38"/>
<location line="+41"/>
<source>Direction Of Z Axis : </source>
<translation>沿Z</translation>
</message>
<message>
<location line="+41"/>
<location line="+44"/>
<source>Scale</source>
<translation></translation>
</message>
@ -282,12 +300,12 @@
<translation>X</translation>
</message>
<message>
<location line="+41"/>
<location line="+44"/>
<source>Scale Of Y Axis : </source>
<translation>Y</translation>
</message>
<message>
<location line="+41"/>
<location line="+44"/>
<source>Scale Of Z Axis : </source>
<translation>Z</translation>
</message>
@ -401,7 +419,7 @@
<context>
<name>MainWidget::CreateGeoComponentDialog</name>
<message>
<location filename="../../MainWidgets/DialogCreateGeoComponent.cpp" line="+20"/>
<location filename="../../MainWidgets/DialogCreateGeoComponent.cpp" line="+19"/>
<source>Ok</source>
<translation></translation>
</message>
@ -411,27 +429,27 @@
<translation></translation>
</message>
<message>
<location line="+23"/>
<location line="+24"/>
<source>Point</source>
<translation></translation>
</message>
<message>
<location line="+1"/>
<location line="+4"/>
<source>Line</source>
<translation>线</translation>
</message>
<message>
<location line="+1"/>
<location line="+4"/>
<source>Surface</source>
<translation></translation>
</message>
<message>
<location line="+1"/>
<location line="+4"/>
<source>Body</source>
<translation></translation>
</message>
<message>
<location line="+12"/>
<location line="+15"/>
<source>Warning</source>
<translation></translation>
</message>
@ -444,19 +462,19 @@
<context>
<name>MainWidget::CreateMaterialDialog</name>
<message>
<location filename="../../MainWidgets/DialogCreateMaterial.cpp" line="+50"/>
<location line="+22"/>
<location filename="../../MainWidgets/DialogCreateMaterial.cpp" line="+51"/>
<location line="+21"/>
<location line="+7"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location line="-29"/>
<location line="-28"/>
<source>Material name can not be empty!</source>
<translation></translation>
</message>
<message>
<location line="+21"/>
<location line="+20"/>
<source>Material &quot;%1&quot; has already existed !</source>
<translation>%1</translation>
</message>
@ -479,7 +497,7 @@
<translation></translation>
</message>
<message>
<location line="+82"/>
<location line="+85"/>
<source>Name can not be empty</source>
<translation></translation>
</message>
@ -510,7 +528,7 @@
<context>
<name>MainWidget::CreateSetDialog</name>
<message>
<location filename="../../MainWidgets/DialogCreateSet.cpp" line="+30"/>
<location filename="../../MainWidgets/DialogCreateSet.cpp" line="+29"/>
<source>OK</source>
<translation></translation>
</message>
@ -520,7 +538,7 @@
<translation></translation>
</message>
<message>
<location line="+24"/>
<location line="+25"/>
<source>PointId : </source>
<translation>Id : </translation>
</message>
@ -530,22 +548,22 @@
<translation>Id : </translation>
</message>
<message>
<location line="+173"/>
<location line="+184"/>
<location line="+12"/>
<location line="+16"/>
<location line="+29"/>
<location line="+31"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location line="-45"/>
<location line="-47"/>
<source>Open window first !</source>
<translation></translation>
</message>
<message>
<location line="-12"/>
<location line="+28"/>
<location line="+29"/>
<location line="+31"/>
<source>No Node or Element selected !</source>
<translation></translation>
</message>
@ -553,25 +571,37 @@
<context>
<name>MainWidget::DialogSelectComponents</name>
<message>
<location filename="../../MainWidgets/DialogVTKTransform.cpp" line="+118"/>
<location filename="../../MainWidgets/DialogVTKTransform.cpp" line="+122"/>
<source>Select Components</source>
<translation></translation>
</message>
</context>
<context>
<name>MainWidget::DialogSelectMeshDataComponents</name>
<message>
<location filename="../../MainWidgets/DialogSelectMeshDataComponents.cpp" line="+30"/>
<source>Select Components</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWidget::DialogVTKTransform</name>
<message>
<location line="-99"/>
<location filename="../../MainWidgets/DialogVTKTransform.cpp" line="-104"/>
<source>Clicked Button Selected Components</source>
<translation></translation>
</message>
<message>
<location line="+1"/>
<source>Mesh Modeling</source>
<translation></translation>
<source>Mesh Transform</source>
<translation></translation>
</message>
<message>
<location line="+78"/>
<source>Mesh Modeling</source>
<translation type="vanished"></translation>
</message>
<message>
<location line="+82"/>
<source>delete this item</source>
<translation></translation>
</message>
@ -579,7 +609,7 @@
<context>
<name>MainWidget::GeometryRenameDialog</name>
<message>
<location filename="../../MainWidgets/DialogGeometryRename.cpp" line="+33"/>
<location filename="../../MainWidgets/DialogGeometryRename.cpp" line="+35"/>
<source>Warning</source>
<translation></translation>
</message>
@ -593,37 +623,37 @@
<name>MainWidget::GeometryTreeWidget</name>
<message>
<location filename="../../MainWidgets/GeometryWidget.cpp" line="+35"/>
<location line="+49"/>
<location line="+57"/>
<source>Geometry</source>
<translation></translation>
</message>
<message>
<location line="-43"/>
<location line="+68"/>
<location line="-51"/>
<location line="+77"/>
<source>Datum</source>
<translation></translation>
</message>
<message>
<location line="-62"/>
<location line="+88"/>
<location line="-71"/>
<location line="+97"/>
<source>GeoComponent</source>
<translation></translation>
</message>
<message>
<location line="+74"/>
<location line="+86"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location line="+4"/>
<location line="+48"/>
<location line="+47"/>
<location line="+12"/>
<source>Rename</source>
<translation></translation>
</message>
<message>
<location line="-57"/>
<location line="+47"/>
<location line="-56"/>
<location line="+46"/>
<source>Delete</source>
<translation></translation>
</message>
@ -661,7 +691,7 @@
<context>
<name>MainWidget::MeshCheckingDialog</name>
<message>
<location filename="../../MainWidgets/DialogMeshChecking.cpp" line="+118"/>
<location filename="../../MainWidgets/DialogMeshChecking.cpp" line="+117"/>
<location line="+21"/>
<source>All Count</source>
<translation></translation>
@ -670,7 +700,7 @@
<context>
<name>MainWidget::MeshRenameDialog</name>
<message>
<location filename="../../MainWidgets/DialogMeshRename.cpp" line="+45"/>
<location filename="../../MainWidgets/DialogMeshRename.cpp" line="+47"/>
<source>Warning</source>
<translation></translation>
</message>
@ -718,7 +748,7 @@
<translation></translation>
</message>
<message>
<location line="+83"/>
<location line="+86"/>
<source>Edit</source>
<translation></translation>
</message>
@ -734,7 +764,7 @@
<translation></translation>
</message>
<message>
<location line="+9"/>
<location line="+7"/>
<source>Import</source>
<translation></translation>
</message>
@ -768,25 +798,25 @@
<name>MainWidget::PhysicsWidget</name>
<message>
<location filename="../../MainWidgets/PhysicsWidget.cpp" line="+41"/>
<location line="+270"/>
<location line="+286"/>
<location line="+274"/>
<location line="+290"/>
<source>Materials</source>
<translation></translation>
</message>
<message>
<location line="-349"/>
<location line="-352"/>
<source>Load From Material Lib</source>
<translation></translation>
</message>
<message>
<location line="-204"/>
<location line="+286"/>
<location line="+268"/>
<location line="-208"/>
<location line="+289"/>
<location line="+272"/>
<source>Case</source>
<translation></translation>
</message>
<message>
<location line="-348"/>
<location line="-351"/>
<source>Create Material</source>
<translation></translation>
</message>
@ -811,7 +841,7 @@
<translation></translation>
</message>
<message>
<location line="+7"/>
<location line="+6"/>
<source>Delete Case</source>
<translation></translation>
</message>
@ -846,10 +876,10 @@
<translation>INP</translation>
</message>
<message>
<location line="+111"/>
<location line="+158"/>
<location line="+115"/>
<location line="+161"/>
<location line="+6"/>
<location line="+27"/>
<location line="+24"/>
<source>Warning</source>
<translation></translation>
</message>
@ -859,12 +889,12 @@
<translation></translation>
</message>
<message>
<location line="+51"/>
<location line="+55"/>
<source>Template import successfully!</source>
<translation></translation>
</message>
<message>
<location line="+106"/>
<location line="+105"/>
<source>Name can not contains fellowing char: \/:*?&quot;&lt;&gt;|!</source>
<translation>\/:*?&quot;&lt;&gt;|!</translation>
</message>
@ -874,7 +904,7 @@
<translation></translation>
</message>
<message>
<location line="+28"/>
<location line="+25"/>
<source>Case &quot;%1&quot; has already exist!</source>
<translation>%1</translation>
</message>
@ -882,7 +912,7 @@
<context>
<name>MainWidget::PreWindow</name>
<message>
<location filename="../../MainWidgets/preWindow.cpp" line="+28"/>
<location filename="../../MainWidgets/preWindow.cpp" line="+30"/>
<source>Pre-Window</source>
<translation></translation>
</message>
@ -890,26 +920,26 @@
<context>
<name>MainWidget::PropertyTable</name>
<message>
<location filename="../../MainWidgets/PropertyTable.cpp" line="+26"/>
<location line="+35"/>
<location line="+12"/>
<location filename="../../MainWidgets/PropertyTable.cpp" line="+27"/>
<location line="+38"/>
<location line="+13"/>
<source>Name</source>
<translation></translation>
</message>
<message>
<location line="-47"/>
<location line="+35"/>
<location line="+12"/>
<location line="-51"/>
<location line="+38"/>
<location line="+13"/>
<source>Value</source>
<translation></translation>
</message>
<message>
<location line="+46"/>
<location line="+51"/>
<source>Basic Info</source>
<translation></translation>
</message>
<message>
<location line="+38"/>
<location line="+40"/>
<source>Parameters</source>
<translation></translation>
</message>
@ -917,12 +947,12 @@
<context>
<name>MainWidget::SavePictureDialog</name>
<message>
<location filename="../../MainWidgets/DialogSavePicture.cpp" line="+30"/>
<location filename="../../MainWidgets/DialogSavePicture.cpp" line="+31"/>
<source>Save Picture</source>
<translation></translation>
</message>
<message>
<location line="+21"/>
<location line="+22"/>
<source>Warning</source>
<translation></translation>
</message>
@ -935,7 +965,7 @@
<context>
<name>MainWidget::SketchViewProvider</name>
<message>
<location filename="../../MainWidgets/sketchViewProvider.cpp" line="+232"/>
<location filename="../../MainWidgets/sketchViewProvider.cpp" line="+251"/>
<source>Location: %1, %2</source>
<translation> %1 %2</translation>
</message>
@ -1267,18 +1297,18 @@
<context>
<name>QObject</name>
<message>
<location filename="../../MainWidgets/MainWidgetsPy.cpp" line="+178"/>
<location line="+32"/>
<location filename="../../MainWidgets/MainWidgetsPy.cpp" line="+186"/>
<location line="+31"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location line="-32"/>
<location line="-31"/>
<source>The material that you want to load from lib already exists!</source>
<translation></translation>
</message>
<message>
<location line="+32"/>
<location line="+31"/>
<source>Material create failed!</source>
<translation></translation>
</message>

View File

@ -9,7 +9,7 @@
<translation></translation>
</message>
<message>
<location line="+33"/>
<location line="+30"/>
<source>Copyright Reserved</source>
<translation></translation>
</message>
@ -42,7 +42,7 @@
<context>
<name>GUI::MainWindow</name>
<message>
<location filename="../../MainWindow/MainWindow.cpp" line="+453"/>
<location filename="../../MainWindow/MainWindow.cpp" line="+476"/>
<source>Save</source>
<translation></translation>
</message>
@ -69,7 +69,7 @@
<message>
<location line="+86"/>
<location line="+68"/>
<location line="+16"/>
<location line="+36"/>
<location line="+51"/>
<location line="+76"/>
<location line="+7"/>
@ -83,13 +83,13 @@
<translation></translation>
</message>
<message>
<location line="-797"/>
<location line="+604"/>
<location line="-817"/>
<location line="+624"/>
<source>Do you want to save current data ?</source>
<translation></translation>
</message>
<message>
<location line="-596"/>
<location line="-616"/>
<location line="+29"/>
<source>Project file(*.diso);;Project file(*.xml)</source>
<translation>(*.diso);;(*.xml)</translation>
@ -116,7 +116,7 @@
<translation></translation>
</message>
<message>
<location line="+16"/>
<location line="+36"/>
<location line="+51"/>
<location line="+83"/>
<location line="+46"/>
@ -131,7 +131,7 @@
<message>
<location line="+52"/>
<source>Import Point Cloud</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location line="+33"/>
@ -152,7 +152,7 @@
<message>
<location line="+52"/>
<source>Export Pcl</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location line="+48"/>
@ -170,8 +170,18 @@
<translation>退?</translation>
</message>
<message>
<location line="-688"/>
<location line="+599"/>
<location line="+204"/>
<source>Canvas %1m * %2m </source>
<translation>Canvas %1m * %2m </translation>
</message>
<message>
<location line="+167"/>
<source>model world position : %2m, %3m, %4m </source>
<translation> : %2m, %3m, %4m </translation>
</message>
<message>
<location line="-1079"/>
<location line="+619"/>
<source>Recent</source>
<translation></translation>
</message>
@ -213,7 +223,7 @@
<message>
<location line="+19"/>
<source>3DRender</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location line="+66"/>
@ -231,9 +241,8 @@
<translation>%1</translation>
</message>
<message>
<location line="+56"/>
<source>Canvas %1m * %2m </source>
<translation> %1m * %2m </translation>
<source>Canvas %1mm * %2mm </source>
<translation type="vanished"> %1mm * %2mm </translation>
</message>
</context>
<context>
@ -336,19 +345,19 @@
<context>
<name>MainWindow</name>
<message>
<location filename="../../MainWindow/MainWindow.ui" line="+777"/>
<location filename="../../MainWindow/MainWindow.ui" line="+2193"/>
<location filename="../../MainWindow/SARibbonMWUi.cpp" line="+1027"/>
<source>Solve</source>
<translation></translation>
</message>
<message>
<location line="-439"/>
<location line="-1851"/>
<location filename="../../MainWindow/SARibbonMWUi.cpp" line="-252"/>
<source>Language</source>
<translation></translation>
</message>
<message>
<location line="+298"/>
<location line="+1710"/>
<location line="+3"/>
<location filename="../../MainWindow/SARibbonMWUi.cpp" line="+206"/>
<location line="+2"/>
@ -390,7 +399,7 @@
<translation></translation>
</message>
<message>
<location line="-393"/>
<location line="-1805"/>
<source>&amp;File</source>
<translation>&amp;</translation>
</message>
@ -444,7 +453,7 @@
<translation></translation>
</message>
<message>
<location line="+566"/>
<location line="+1978"/>
<location filename="../../MainWindow/SARibbonMWUi.cpp" line="+2"/>
<source>Ctrl+S</source>
<translation></translation>
@ -456,7 +465,7 @@
<translation></translation>
</message>
<message>
<location line="-338"/>
<location line="-1750"/>
<source>&amp;Mesh</source>
<translation>&amp;</translation>
</message>
@ -503,13 +512,13 @@
<translation></translation>
</message>
<message>
<location line="-104"/>
<location line="-108"/>
<location filename="../../MainWindow/SARibbonMWUi.cpp" line="-26"/>
<source>WBCLFZ_CAE</source>
<translation>仿</translation>
</message>
<message>
<location line="+125"/>
<location line="+129"/>
<source>SetToolBar</source>
<translation></translation>
</message>
@ -523,26 +532,26 @@
<location line="+12"/>
<location line="+47"/>
<location line="+20"/>
<location line="+307"/>
<location line="+1719"/>
<location line="+15"/>
<location line="+12"/>
<source>toolBar</source>
<translation></translation>
</message>
<message>
<location line="-382"/>
<location line="+396"/>
<location line="-1794"/>
<location line="+1808"/>
<source>toolBar_2</source>
<translation></translation>
</message>
<message>
<location line="-382"/>
<location line="+397"/>
<location line="-1794"/>
<location line="+1809"/>
<source>toolBar_3</source>
<translation></translation>
</message>
<message>
<location line="-264"/>
<location line="-1676"/>
<location filename="../../MainWindow/SARibbonMWUi.cpp" line="-192"/>
<source>Style</source>
<translation></translation>
@ -572,13 +581,228 @@
<translation></translation>
</message>
<message>
<location line="+13"/>
<location line="+10"/>
<source>sampling</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>SimulationSetting</source>
<translatorcomment>FEKO仿</translatorcomment>
<translation>仿</translation>
</message>
<message>
<location line="+153"/>
<location line="+12"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+81"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+81"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+81"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+81"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+88"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+81"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+88"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+88"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+81"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+81"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+81"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+81"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+95"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>仿</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+169"/>
<location filename="../../MainWindow/SARibbonMWUi.cpp" line="+216"/>
<source>Ctrl+Q</source>
<translation></translation>
@ -1320,18 +1544,38 @@
<translation></translation>
</message>
<message>
<location line="-99"/>
<location line="+5"/>
<source>loadModel</source>
<translation></translation>
</message>
<message>
<location line="+5"/>
<source>vtkPointSamplor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>ImageShowTool</source>
<translation></translation>
</message>
<message>
<location line="+5"/>
<source>RCShowTool</source>
<translation>RCS</translation>
</message>
<message>
<location line="-119"/>
<location filename="../../MainWindow/SARibbonMWUi.cpp" line="-9"/>
<source>Load PointCloud</source>
<translation></translation>
</message>
<message>
<location line="-1390"/>
<location line="-2802"/>
<source>&amp;PointCloud</source>
<translation></translation>
</message>
<message>
<location line="+1399"/>
<location line="+2811"/>
<location filename="../../MainWindow/SARibbonMWUi.cpp" line="+1"/>
<source>Save PointCloud</source>
<translation></translation>
@ -1669,7 +1913,7 @@
<translation></translation>
</message>
<message>
<location filename="../../MainWindow/MainWindow.cpp" line="+70"/>
<location filename="../../MainWindow/MainWindow.cpp" line="+127"/>
<source>Customization</source>
<translation type="unfinished"></translation>
</message>