点云构网时,程序崩溃bug,经排查是pcl库问题,重新编译源代码,取消avx see 等CPU特异化指令,然后重新编译PCL。子线程调用主线程实例,子线程销毁时,销毁主线程实例调用函数栈,回调函数地址为nullptr,内存泄露,程序崩溃。
parent
2044867fe6
commit
6aec508c62
|
|
@ -1,7 +1,11 @@
|
|||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<option name="RIGHT_MARGIN" value="1000" />
|
||||
<clangFormatSettings>
|
||||
<option name="ENABLED" value="true" />
|
||||
</clangFormatSettings>
|
||||
<codeStyleSettings language="ObjectiveC">
|
||||
<option name="RIGHT_MARGIN" value="1000" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
|
|
@ -31,6 +31,25 @@ set(CMAKE_AUTOMOC ON)
|
|||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
#if(MSVC)
|
||||
## add_definitions(-DPCL_NO_PRECOMPILE)
|
||||
# # 如果是 Visual Studio 编译器
|
||||
# add_compile_options(/arch:AVX) # 启用 AVX 指令集
|
||||
# # 启用 SSE2
|
||||
## add_compile_options(/arch:SSE)
|
||||
#
|
||||
# # 启用 MARCH_NATIVE
|
||||
# add_compile_options(/arch:AVX)
|
||||
#elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
# # 如果是 GCC 或 Clang 编译器
|
||||
# add_compile_options(-mavx) # 启用 AVX 指令集
|
||||
# # 设置 SSE 选项
|
||||
## set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
|
||||
#
|
||||
# # 设置 MARCH_NATIVE 选项
|
||||
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
|
||||
#endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 检测操作系统
|
||||
|
|
@ -234,6 +253,8 @@ find_package(GDAL CONFIG REQUIRED)
|
|||
# sqlite3
|
||||
find_package(unofficial-sqlite3 CONFIG REQUIRED)
|
||||
|
||||
|
||||
|
||||
# QGIS 库 作为遥感数据操作,这个是插件库,如果不编译插件库,可以不用考虑这个库,注意这个库是由源代码构建,建议不要动
|
||||
find_package(QGIS REQUIRED)
|
||||
|
||||
|
|
@ -253,6 +274,7 @@ include_directories(SYSTEM C:/PCL/include/pcl-1.14)
|
|||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
find_package(Qt5 REQUIRED COMPONENTS Test Core Quick Sql Core Xml Opengl Gui Svg Xmlpatterns Uitools Widgets Qml Printsupport Sensors Quickwidgets Quick Concurrent Openglextensions Charts Datavisualization Network)
|
||||
# PCL
|
||||
find_package(PCL)
|
||||
include_directories(${PCL_INCLUDE_DIRS})
|
||||
include_directories(${VCGLIB_INCLUDE_DIRS})
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ namespace MainWidget {
|
|||
|
||||
DialogSelectMeshDataComponents::DialogSelectMeshDataComponents(GUI::MainWindow* parent)
|
||||
: QFDialog(parent)
|
||||
,_ui(new Ui::DialogSelectMeshDataComponents)
|
||||
{
|
||||
|
||||
_ui->setupUi(this);
|
||||
|
||||
setWindowTitle(tr("Select Components"));
|
||||
|
|
|
|||
|
|
@ -368,7 +368,9 @@ namespace GUI {
|
|||
connect(this, SIGNAL(openPlot()), _signalHandler, SLOT(openPlotFile()));
|
||||
|
||||
// 点云模块
|
||||
|
||||
connect(this, SIGNAL(importMeshSIGN(QString ,QString ,int )),this, SLOT(importMesh(QString ,QString ,int )));
|
||||
/// 导入点云
|
||||
connect(this, SIGNAL(importPclSIGN(QString ,QString ,int )),this, SLOT(importPcl(QString ,QString ,int )));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -616,6 +618,26 @@ namespace GUI {
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::importMesh(QString fileName,QString aSuffix,int modelID){
|
||||
if(fileName.isEmpty())
|
||||
return;
|
||||
QString pyCode = QString("MainWindow.importMesh(\"%1\",\"%2\",%3)")
|
||||
.arg(fileName)
|
||||
.arg(aSuffix)
|
||||
.arg(modelID);
|
||||
Py::PythonAgent::getInstance()->submit(pyCode);
|
||||
}
|
||||
|
||||
void MainWindow::importPcl(QString fileName,QString aSuffix,int modelID){
|
||||
if(fileName.isEmpty())
|
||||
return;
|
||||
QString pyCode = QString("MainWindow.importPcl(\"%1\",\"%2\",%3)")
|
||||
.arg(fileName)
|
||||
.arg(aSuffix)
|
||||
.arg(modelID);
|
||||
Py::PythonAgent::getInstance()->submit(pyCode);
|
||||
}
|
||||
|
||||
void MainWindow::on_importMesh()
|
||||
{
|
||||
QStringList suffixlist = IO::IOConfigure::getMeshImporters();
|
||||
|
|
|
|||
|
|
@ -153,6 +153,11 @@ namespace GUI {
|
|||
// Ribbon Customize
|
||||
SARibbonActionsManager* getActionManager();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
signals:
|
||||
/*更新注册接口*/
|
||||
void updateInterfaces();
|
||||
|
|
@ -322,6 +327,12 @@ namespace GUI {
|
|||
// Tool Show
|
||||
void on_actionAttriutionDBShow(GUI::MainWindow* m);
|
||||
|
||||
// 导入网格
|
||||
void importMeshSIGN(QString filepath,QString aSuffix,int modelID);
|
||||
/// 导入点云
|
||||
void importPclSIGN(QString filepath,QString aSuffix,int modelID);
|
||||
|
||||
|
||||
public slots:
|
||||
/*状态栏显示信息 */
|
||||
void setStatusBarInfo(QString);
|
||||
|
|
@ -373,6 +384,14 @@ namespace GUI {
|
|||
// feko 设置
|
||||
void on_AttriutionDBShow();
|
||||
|
||||
// 导入mesh
|
||||
void importMesh(QString filepath,QString aSuffix,int modelID);
|
||||
/// 导入点云
|
||||
void importPcl(QString filepath,QString aSuffix,int modelID);
|
||||
|
||||
|
||||
|
||||
|
||||
private slots:
|
||||
/*关闭主窗口 */
|
||||
void closeWindow();
|
||||
|
|
|
|||
|
|
@ -1648,6 +1648,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuCropTargetBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1657,6 +1659,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuGrasslandTargetBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1666,6 +1670,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuWaterBodyTargetBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1675,6 +1681,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuSoilTargetBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1684,6 +1692,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuDynamicWaterBodyTargetBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1693,6 +1703,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuRoadTargetBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1702,6 +1714,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuArtificialTargetBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1711,6 +1725,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuGeometricCorrectionSceneBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1720,6 +1736,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuRadiometricCorrectionSceneBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1729,6 +1747,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuLandSurfaceSceneBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1738,6 +1758,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuWaterBodySceneBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1747,6 +1769,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="MenuVegetationSceneBackscatteringCharacteristicsCalculationModule">
|
||||
<property name="title">
|
||||
|
|
@ -1756,6 +1780,8 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionFEKO2csv"/>
|
||||
<addaction name="actionScatterExport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAttriutionDBShow"/>
|
||||
</widget>
|
||||
<addaction name="MenuForestTargetBackscatteringCharacteristicsCalculationModule"/>
|
||||
<addaction name="MenuCropTargetBackscatteringCharacteristicsCalculationModule"/>
|
||||
|
|
|
|||
|
|
@ -1670,7 +1670,7 @@ namespace GUI {
|
|||
meshSet = meshData->getMeshSetByID(compontId.toInt());
|
||||
if(!meshSet)
|
||||
continue;
|
||||
|
||||
//meshSet->generateDisplayDataSet();
|
||||
vtkRela.SetData(meshSet->getDisplayDataSet());
|
||||
vtkSmartPointer<vtkDataSet> transformed = vtkRela.StartTransform();
|
||||
|
||||
|
|
@ -1679,7 +1679,7 @@ namespace GUI {
|
|||
meshKernal->setName(kernalName);
|
||||
meshKernal->setMeshData(transformed);
|
||||
meshData->appendMeshKernal(meshKernal);
|
||||
|
||||
qDebug()<<"transfrom kernalName :\t "<<kernalName;
|
||||
transformedName =
|
||||
QString(meshSet->getName() + "_transform%1").arg(meshSet->getMaxID() + 1);
|
||||
setType = MeshData::MeshSet::setTypeToString(meshSet->getSetType());
|
||||
|
|
|
|||
|
|
@ -35,6 +35,18 @@
|
|||
#include <vtkAreaPicker.h>
|
||||
#include <vtkProperty2D.h>
|
||||
#include <vtkAppendFilter.h>
|
||||
#include <vtkRenderer.h>
|
||||
#include <vtkRenderWindowInteractor.h>
|
||||
#include <vtkRenderWindow.h>
|
||||
#include <vtkSmartPointer.h>
|
||||
#include <vtkProperty.h>
|
||||
#include <vtkCubeAxesActor2D.h>
|
||||
#include <vtkInteractorStyleTrackballCamera.h>
|
||||
#include <vtkCubeAxesActor.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#include "PreWindowInteractorStyle.h"
|
||||
#include "MainWindow/MainWindow.h"
|
||||
#include "MeshData/meshSet.h"
|
||||
|
|
@ -86,8 +98,11 @@ namespace ModuleBase
|
|||
_renderWindow = _ui->qvtkWidget->renderWindow();
|
||||
#endif
|
||||
|
||||
_render = vtkSmartPointer<vtkRenderer>::New();
|
||||
_render = vtkSmartPointer<vtkOpenGLRenderer>::New();
|
||||
_render->SetGradientBackground(true);
|
||||
// 开启硬件加速特性
|
||||
_render->UseDepthPeelingOn();
|
||||
_render->SetUseFXAA(true);
|
||||
// _render->SetBackground2(0.0, 0.333, 1.0);
|
||||
// _render->SetBackground(1.0, 1.0, 1.0);
|
||||
_interactor = _renderWindow->GetInteractor();
|
||||
|
|
@ -98,6 +113,10 @@ namespace ModuleBase
|
|||
_viewer->setupInteractor(_interactor, _renderWindow);
|
||||
_viewer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, 3); // 初始化为点云颜色
|
||||
|
||||
// 创建立方体网格坐标系
|
||||
_cubeAxesActor = vtkSmartPointer<vtkCubeAxesActor>::New();
|
||||
createCubeAxes();
|
||||
|
||||
if (_graphWindowType == PreWindows)
|
||||
{
|
||||
PropPickerInteractionStyle *style = PropPickerInteractionStyle::New();
|
||||
|
|
@ -470,4 +489,63 @@ namespace ModuleBase
|
|||
double h = this->getWorldHight();
|
||||
emit showGraphRange(w, h);
|
||||
}
|
||||
void Graph3DWindow::createCubeAxes(double minx, double maxx, double miny, double maxy,
|
||||
double minz, double maxz)
|
||||
{
|
||||
|
||||
|
||||
_cubeAxesActor->SetCamera(_render->GetActiveCamera());
|
||||
//
|
||||
//轴的设置
|
||||
//设置x、y、z轴的起始和终止值
|
||||
_cubeAxesActor->SetXAxisRange(minx, maxx);
|
||||
_cubeAxesActor->SetYAxisRange(miny, maxy);
|
||||
_cubeAxesActor->SetZAxisRange(minz, maxz);
|
||||
//设置坐标轴线的宽度
|
||||
_cubeAxesActor->GetXAxesLinesProperty()->SetLineWidth(0.5);
|
||||
_cubeAxesActor->GetYAxesLinesProperty()->SetLineWidth(0.5);
|
||||
_cubeAxesActor->GetZAxesLinesProperty()->SetLineWidth(0.5);
|
||||
//设置标题和标签文本的屏幕大小。默认值为10.0。
|
||||
_cubeAxesActor->SetScreenSize(6);
|
||||
//指定标签与轴之间的距离。默认值为20.0。
|
||||
_cubeAxesActor->SetLabelOffset(5);
|
||||
//显示坐标轴
|
||||
_cubeAxesActor->SetVisibility(true);
|
||||
//指定一种模式来控制轴的绘制方式
|
||||
_cubeAxesActor->SetFlyMode(0);
|
||||
//设置惯性因子,该惯性因子控制轴切换位置的频率(从一个轴跳到另一个轴)
|
||||
//m_cubeAxesActor->SetInertia(1);
|
||||
//
|
||||
//网格设置
|
||||
//开启x、y、z轴的网格线绘制
|
||||
_cubeAxesActor->DrawXGridlinesOn();
|
||||
_cubeAxesActor->DrawYGridlinesOn();
|
||||
_cubeAxesActor->DrawZGridlinesOn();
|
||||
//设置x、y、z轴的内部网格线不绘制
|
||||
_cubeAxesActor->SetDrawXInnerGridlines(false);
|
||||
_cubeAxesActor->SetDrawYInnerGridlines(false);
|
||||
_cubeAxesActor->SetDrawZInnerGridlines(false);
|
||||
//设置x、y、z轴网格线的颜色
|
||||
_cubeAxesActor->GetXAxesGridlinesProperty()->SetColor(0.5, 0.5, 0.5);
|
||||
_cubeAxesActor->GetYAxesGridlinesProperty()->SetColor(0.5, 0.5, 0.5);
|
||||
_cubeAxesActor->GetZAxesGridlinesProperty()->SetColor(0.5, 0.5, 0.5);
|
||||
//指定网格线呈现的样式
|
||||
_cubeAxesActor->SetGridLineLocation(2);
|
||||
//
|
||||
//刻度的设置
|
||||
//不显示x、y、z轴的次刻度
|
||||
_cubeAxesActor->XAxisMinorTickVisibilityOff();
|
||||
_cubeAxesActor->YAxisMinorTickVisibilityOff();
|
||||
_cubeAxesActor->ZAxisMinorTickVisibilityOff();
|
||||
//设置刻度标签的显示方式(参数1为false,刻度标签按0-200000显示;为true时,按0-200显示)
|
||||
_cubeAxesActor->SetLabelScaling(false, 0, 0, 0);
|
||||
//设置刻度线显示的位置(内部、外部、两侧)
|
||||
_cubeAxesActor->SetTickLocation(1);
|
||||
//
|
||||
_render->AddActor(_cubeAxesActor);
|
||||
_render->ResetCamera();
|
||||
_render->ResetCameraClippingRange();
|
||||
_renderWindow->Render();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef _GRAPH3DWINDOW_H_
|
||||
#define _GRAPH3DWINDOW_H_
|
||||
|
||||
//#define PCL_NO_PRECOMPILE
|
||||
#include <QWidget>
|
||||
#include <vtkSmartPointer.h>
|
||||
#include <vtkAutoInit.h>
|
||||
|
|
@ -9,11 +9,12 @@
|
|||
#include "ModuleType.h"
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#include <vtkOpenGLRenderer.h>
|
||||
|
||||
// Point Cloud Library
|
||||
#include <QColorDialog>
|
||||
#include <iostream>
|
||||
|
||||
#include <pcl/common/common.h>
|
||||
#include <pcl/console/time.h> // TicToc
|
||||
#include <pcl/console/time.h>
|
||||
|
|
@ -34,29 +35,12 @@
|
|||
#include <iostream>
|
||||
#include <pcl/console/time.h> // TicToc
|
||||
#include <pcl/features/normal_3d.h>
|
||||
#include <pcl/filters/bilateral.h>
|
||||
#include <pcl/filters/extract_indices.h>
|
||||
#include <pcl/filters/fast_bilateral.h>
|
||||
#include <pcl/filters/fast_bilateral_omp.h>
|
||||
#include <pcl/filters/passthrough.h>
|
||||
#include <pcl/filters/voxel_grid.h>
|
||||
#include <pcl/io/pcd_io.h>
|
||||
#include <pcl/io/ply_io.h>
|
||||
#include <pcl/kdtree/kdtree.h>
|
||||
#include <pcl/kdtree/kdtree_flann.h>
|
||||
#include <pcl/point_cloud.h>
|
||||
#include <pcl/point_types.h>
|
||||
#include <pcl/registration/ia_fpcs.h> // 4PCS算法
|
||||
#include <pcl/registration/ia_kfpcs.h> //K4PCS算法头文件
|
||||
#include <pcl/registration/icp.h>
|
||||
#include <pcl/registration/registration.h>
|
||||
#include <pcl/search/flann_search.h>
|
||||
#include <pcl/surface/concave_hull.h>
|
||||
#include <pcl/surface/gp3.h> //贪婪投影三角化算法类定义的头文件
|
||||
#include <pcl/surface/marching_cubes_hoppe.h> //移动立方体
|
||||
#include <pcl/surface/marching_cubes_rbf.h>
|
||||
#include <pcl/surface/mls.h> //MLS
|
||||
#include <pcl/surface/poisson.h> //泊松重建
|
||||
|
||||
#include <pcl/visualization/cloud_viewer.h>
|
||||
#include <pcl/visualization/pcl_visualizer.h>
|
||||
#include <string>
|
||||
|
|
@ -64,15 +48,11 @@
|
|||
#include <vtkOutputWindow.h>
|
||||
|
||||
#include <pcl/console/time.h> // TicToc
|
||||
#include <pcl/filters/approximate_voxel_grid.h> // 体素滤波
|
||||
#include <pcl/filters/voxel_grid.h> // 体素滤波
|
||||
#include <vtkOutputWindow.h>
|
||||
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <pcl/ModelCoefficients.h>
|
||||
#include <pcl/filters/extract_indices.h>
|
||||
#include <pcl/io/pcd_io.h>
|
||||
#include <pcl/point_types.h>
|
||||
#include <pcl/sample_consensus/method_types.h> //随机参数估计方法
|
||||
#include <pcl/sample_consensus/model_types.h> //模型定义
|
||||
#include <pcl/segmentation/sac_segmentation.h> //RANSAC分割
|
||||
|
|
@ -89,7 +69,6 @@
|
|||
#include <pcl/common/common.h>
|
||||
#include <pcl/common/transforms.h>
|
||||
#include <pcl/features/moment_of_inertia_estimation.h>
|
||||
#include <pcl/filters/voxel_grid.h>
|
||||
#include <pcl/io/io.h>
|
||||
#include <pcl/io/pcd_io.h>
|
||||
#include <pcl/point_cloud.h>
|
||||
|
|
@ -111,10 +90,7 @@
|
|||
#include <vtkRenderer.h>
|
||||
// Boost
|
||||
#include <boost/math/special_functions/round.hpp>
|
||||
|
||||
|
||||
|
||||
|
||||
#include <vtkCubeAxesActor.h>
|
||||
|
||||
VTK_MODULE_INIT(vtkRenderingOpenGL2);
|
||||
VTK_MODULE_INIT(vtkInteractionStyle);
|
||||
|
|
@ -199,6 +175,9 @@ namespace ModuleBase
|
|||
double getWorldHight();
|
||||
//获取窗体世界坐标系下宽度
|
||||
double getWorldWidth();
|
||||
// 创建立方体网格坐标系
|
||||
void createCubeAxes(double minx=-1000,double maxx=1000,double miny=-1000,double maxy=1000,double minz=-1000,double maxz=1000);
|
||||
|
||||
|
||||
public slots:
|
||||
//重绘
|
||||
|
|
@ -249,7 +228,9 @@ namespace ModuleBase
|
|||
Ui::Graph3DWindow* _ui{};
|
||||
// QStringList m_ltFilePath = QStringList();
|
||||
|
||||
vtkSmartPointer<vtkRenderer> _render{};
|
||||
//vtkSmartPointer<vtkRenderer> _render{};
|
||||
vtkSmartPointer<vtkOpenGLRenderer> _render{};
|
||||
vtkSmartPointer<vtkCubeAxesActor> _cubeAxesActor{};
|
||||
vtkSmartPointer<vtkRenderWindow> _renderWindow{};
|
||||
vtkSmartPointer< vtkRenderWindowInteractor > _interactor{};
|
||||
|
||||
|
|
@ -266,8 +247,6 @@ namespace ModuleBase
|
|||
/*** 点云处理***/
|
||||
pcl::visualization::PCLVisualizer::Ptr _viewer; // 点云显示共享指针
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#ifndef ALLHEAD_H
|
||||
#define ALLHEAD_H
|
||||
|
||||
//#define PCL_NO_PRECOMPILE 1
|
||||
#include "WBFZExchangePluginAPI.h"
|
||||
#include "Common/DebugLogger.h"
|
||||
#include "Geometry/geometryData.h"
|
||||
|
|
@ -42,6 +42,7 @@
|
|||
#include "OCCTBase.h"
|
||||
#include "FEKOFarFieldFileClass.h"
|
||||
|
||||
|
||||
//=====================================================
|
||||
// 内部库 SharedModuleLib
|
||||
//=====================================================
|
||||
|
|
|
|||
|
|
@ -202,11 +202,11 @@ WBFZ::PCLBilateralFilter::PCLBilateralFilter(const QString& fileName,
|
|||
{
|
||||
|
||||
}
|
||||
vtkDataSet* WBFZ::PCLBilateralFilter::filter()
|
||||
bool WBFZ::PCLBilateralFilter::filter()
|
||||
{
|
||||
return PCLBilateralFilterAlg( _componentIds, _sigmaR, _sigmaS);
|
||||
}
|
||||
vtkDataSet* WBFZ::PCLBilateralFilter::PCLBilateralFilterAlg(QString componentIds, double sigmaR,
|
||||
bool WBFZ::PCLBilateralFilter::PCLBilateralFilterAlg(QString componentIds, double sigmaR,
|
||||
double sigmaS)
|
||||
{
|
||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLBilateralFilterAlg");
|
||||
|
|
@ -260,32 +260,12 @@ vtkDataSet* WBFZ::PCLBilateralFilter::PCLBilateralFilterAlg(QString componentIds
|
|||
vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
||||
size_t pointCount = dataset->GetNumberOfPoints();
|
||||
if(pointCount==0){
|
||||
return nullptr;
|
||||
return false;
|
||||
}
|
||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLBilateralFilterAlg successfully!! Point Count : "+QString::number(pointCount));
|
||||
outpolyData->Delete(); // 释放指针
|
||||
|
||||
QString filepath=_fileName;
|
||||
|
||||
// 加载文件
|
||||
QFileInfo info(filepath);
|
||||
QString name = info.fileName();
|
||||
QString path = info.filePath();
|
||||
QString suffix = info.suffix().toLower();
|
||||
QTextCodec *codec = QTextCodec::codecForName("GB18030");
|
||||
QByteArray ba = codec->fromUnicode(filepath);
|
||||
|
||||
std::string outFileName=ba.data();
|
||||
if (suffix == "pcd")
|
||||
{
|
||||
pcl::io::savePCDFileBinary(outFileName,*cloud_filtered);
|
||||
}
|
||||
else if (suffix == "ply")
|
||||
{
|
||||
pcl::io::savePLYFileBinary(outFileName,*cloud_filtered);
|
||||
}
|
||||
else{}
|
||||
return dataset;
|
||||
return this->saveFilterResultFile(cloud_filtered);
|
||||
|
||||
}
|
||||
WBFZ::PCLBilateralFilter::~PCLBilateralFilter() {}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ namespace WBFZ{
|
|||
PCLBilateralFilter(const QString &fileName, PointCloudOperation operation, GUI::MainWindow *mw, QString componentIds, double sigmaR,double sigmaS);
|
||||
~PCLBilateralFilter();
|
||||
private:
|
||||
vtkDataSet* filter() override;
|
||||
vtkDataSet* PCLBilateralFilterAlg(QString componentIds,double sigmaR,double sigmaS);
|
||||
bool filter() override;
|
||||
bool PCLBilateralFilterAlg(QString componentIds,double sigmaR,double sigmaS);
|
||||
private:
|
||||
QString _fileName;
|
||||
PointCloudOperation _operation;
|
||||
|
|
|
|||
|
|
@ -51,12 +51,8 @@
|
|||
// auto meshData = MeshData::MeshData::getInstance();
|
||||
|
||||
namespace MainWidget {
|
||||
DialogPCLGPMesh::DialogPCLGPMesh(GUI::MainWindow* parent)
|
||||
: QFDialog(parent)
|
||||
, _ui(new Ui::DialogPCLGPMesh)
|
||||
, _mw(parent)
|
||||
, _selectdlg(new DialogSelectComponents(parent))
|
||||
{
|
||||
DialogPCLGPMesh::DialogPCLGPMesh(GUI::MainWindow *parent)
|
||||
: QFDialog(parent), _ui(new Ui::DialogPCLGPMesh), _mw(parent), _selectdlg(new DialogSelectComponents(parent)) {
|
||||
_ui->setupUi(this);
|
||||
_ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
|
||||
setWindowTitle(tr("GP Meshing"));
|
||||
|
|
@ -66,27 +62,25 @@ namespace MainWidget {
|
|||
_selectdlg->clearSelectItems();
|
||||
_selectdlg->exec();
|
||||
});
|
||||
connect(_selectdlg, SIGNAL(selectedComponentsSig(QList<MeshData::MeshSet*>)), this,
|
||||
SLOT(selectedComponentsSlot(QList<MeshData::MeshSet*>)));
|
||||
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&)));
|
||||
}
|
||||
|
||||
DialogPCLGPMesh::~DialogPCLGPMesh()
|
||||
{
|
||||
DialogPCLGPMesh::~DialogPCLGPMesh() {
|
||||
delete _ui;
|
||||
_ui = NULL;
|
||||
delete _selectdlg;
|
||||
_selectdlg = NULL;
|
||||
}
|
||||
|
||||
void DialogPCLGPMesh::accept()
|
||||
{
|
||||
if(_components.size() == 0)
|
||||
void DialogPCLGPMesh::accept() {
|
||||
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);
|
||||
|
||||
|
|
@ -98,7 +92,7 @@ namespace MainWidget {
|
|||
double MinimumAngle = _ui->MinimumAngle->value();
|
||||
|
||||
QString outfilename = "filter";
|
||||
for(auto component : _components)
|
||||
for (auto component: _components)
|
||||
outfilename.append(QString("_%1").arg(component->getName()));
|
||||
|
||||
// 确定是否保存结果文件
|
||||
|
|
@ -107,11 +101,11 @@ namespace MainWidget {
|
|||
QString filepath =
|
||||
JoinPath(Setting::BusAPI::instance()->getWorkingDir(), outfilename + "_tmep.pcd");
|
||||
QString AbFileName = filepath;
|
||||
if(result == QMessageBox::StandardButton::Ok
|
||||
if (result == QMessageBox::StandardButton::Ok
|
||||
|| result == QMessageBox::StandardButton::Yes) {
|
||||
DebugInfo("outfilename ok ok \n");
|
||||
QStringList suffixlist = IO::IOConfigure::getMeshExporters();
|
||||
if(suffixlist.isEmpty()) {
|
||||
if (suffixlist.isEmpty()) {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("The MeshPlugin is not installed !"));
|
||||
return;
|
||||
}
|
||||
|
|
@ -122,10 +116,10 @@ namespace MainWidget {
|
|||
.split(";");
|
||||
QStringList list;
|
||||
|
||||
for(QString s : meshsuffix) {
|
||||
for(int i = 0; i < suffixlist.size(); i++) {
|
||||
for (QString s: meshsuffix) {
|
||||
for (int i = 0; i < suffixlist.size(); i++) {
|
||||
QString suffix = suffixlist.at(i);
|
||||
if(suffix.contains(s))
|
||||
if (suffix.contains(s))
|
||||
list.append(suffix);
|
||||
}
|
||||
}
|
||||
|
|
@ -136,12 +130,12 @@ namespace MainWidget {
|
|||
|
||||
QFileDialog dlg(this, tr("Export mesh"), workDir, suffixes);
|
||||
dlg.setAcceptMode(QFileDialog::AcceptSave);
|
||||
if(dlg.exec() != QFileDialog::FileName)
|
||||
if (dlg.exec() != QFileDialog::FileName)
|
||||
return;
|
||||
|
||||
QString aSuffix = dlg.selectedNameFilter();
|
||||
QString aFileName = dlg.selectedFiles().join(",");
|
||||
if(!(aFileName.isEmpty())) {
|
||||
if (!(aFileName.isEmpty())) {
|
||||
filepath = aFileName;
|
||||
|
||||
} else {
|
||||
|
|
@ -157,41 +151,38 @@ namespace MainWidget {
|
|||
new WBFZ::PCLGPMesh(AbFileName, WBFZ::PointCloudOperation::POINTCLOUD_MESH, _mainWindow,
|
||||
componentIds, SearchRadius, Mu, MaximumNearestNeighbors,
|
||||
MaximumSurfaceAngle, MaximumAngle, MinimumAngle);
|
||||
ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclremesh);
|
||||
ModuleBase::ThreadControl *tc = new ModuleBase::ThreadControl(pclremesh);
|
||||
emit tc->threadStart(); // emit MSHwriter->start();
|
||||
DebugInfo("tc overing %s \n", AbFileName.toStdString().c_str());
|
||||
QFDialog::accept();
|
||||
DebugInfo("QFDialog::accept() \n");
|
||||
}
|
||||
|
||||
void DialogPCLGPMesh::selectedComponentsSlot(QList<MeshData::MeshSet*> components)
|
||||
{
|
||||
for(MeshData::MeshSet* set : components) {
|
||||
if(_components.contains(set))
|
||||
void DialogPCLGPMesh::selectedComponentsSlot(QList<MeshData::MeshSet *> components) {
|
||||
for (MeshData::MeshSet *set: components) {
|
||||
if (_components.contains(set))
|
||||
continue;
|
||||
_components.append(set);
|
||||
_ui->listWidget->addItem(set->getName());
|
||||
}
|
||||
}
|
||||
|
||||
void DialogPCLGPMesh::customContextMenuRequestedSlot(const QPoint& point)
|
||||
{
|
||||
QListWidgetItem* curItem = _ui->listWidget->itemAt(point);
|
||||
if(!curItem)
|
||||
void DialogPCLGPMesh::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"));
|
||||
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());
|
||||
}
|
||||
|
||||
void DialogPCLGPMesh::removeCurrentItem(QListWidgetItem* curItem)
|
||||
{
|
||||
void DialogPCLGPMesh::removeCurrentItem(QListWidgetItem *curItem) {
|
||||
auto meshData = MeshData::MeshData::getInstance();
|
||||
auto meshSet = meshData->getMeshSetByName(curItem->text());
|
||||
if(!meshSet)
|
||||
if (!meshSet)
|
||||
return;
|
||||
_components.removeOne(meshSet);
|
||||
_ui->listWidget->removeItemWidget(curItem);
|
||||
|
|
@ -201,75 +192,83 @@ namespace MainWidget {
|
|||
} // namespace MainWidget
|
||||
|
||||
namespace WBFZ {
|
||||
PCLGPMesh::PCLGPMesh(const QString& fileName, WBFZ::PointCloudOperation operation,
|
||||
GUI::MainWindow* mw, QString componentIds, double SearchRadius, double Mu,
|
||||
PCLGPMesh::PCLGPMesh(const QString &fileName, WBFZ::PointCloudOperation operation,
|
||||
GUI::MainWindow *mw, QString componentIds, double SearchRadius, double Mu,
|
||||
int MaximumNearestNeighbors, double MaximumSurfaceAngle,
|
||||
double MaximumAngle, double MinimumAngle)
|
||||
: ModuleBase::ThreadTask(mw)
|
||||
, _operation(operation)
|
||||
, _fileName(fileName)
|
||||
, _componentIds(componentIds)
|
||||
, _SearchRadius(SearchRadius)
|
||||
, _Mu(Mu)
|
||||
, _MaximumNearestNeighbors(MaximumNearestNeighbors)
|
||||
, _MaximumSurfaceAngle(MaximumSurfaceAngle)
|
||||
, _MaximumAngle(MaximumAngle)
|
||||
, _MinimumAngle(MinimumAngle)
|
||||
{
|
||||
: ModuleBase::ThreadTask(mw), _operation(operation), _fileName(fileName), _componentIds(componentIds), _SearchRadius(SearchRadius), _Mu(Mu), _MaximumNearestNeighbors(MaximumNearestNeighbors), _MaximumSurfaceAngle(MaximumSurfaceAngle), _MaximumAngle(MaximumAngle), _MinimumAngle(MinimumAngle) {
|
||||
}
|
||||
|
||||
PCLGPMesh::~PCLGPMesh() {}
|
||||
|
||||
void PCLGPMesh::defaultMeshFinished()
|
||||
{
|
||||
if(_threadRuning) {
|
||||
void PCLGPMesh::defaultMeshFinished() {
|
||||
ModuleBase::ThreadTask::threadTaskFinished();
|
||||
Py::PythonAgent::getInstance()->unLock();
|
||||
if (_threadRuning) {
|
||||
QString information{};
|
||||
ModuleBase::Message msg;
|
||||
if(_operation == POINTCLOUD_FILTER || _operation == POINTCLOUD_MESH) {
|
||||
if(_success) {
|
||||
// emit _mainwindow->updateMeshTreeSig();
|
||||
// emit _mainwindow->updateSetTreeSig();
|
||||
// emit _mainwindow->updateActionStatesSig();
|
||||
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 Import Mesh From \"%1\"").arg(_fileName);
|
||||
// emit _mainwindow->getSubWindowManager()->openPreWindowSig();
|
||||
// emit _mainwindow->updatePreMeshActorSig();
|
||||
information = QString("Successful resurface Mesh From \"%1\"").arg(_fileName);
|
||||
msg.type = Common::Message::Normal;
|
||||
msg.message = information;
|
||||
qDebug()<<"Successful Import Mesh From "<<_fileName;
|
||||
// auto meshdata = MeshData::MeshData::getInstance();
|
||||
// // meshdata->generateDisplayDataSet();
|
||||
// const int nk = meshdata->getKernalCount();
|
||||
// if(nk <= 0)
|
||||
// return;
|
||||
// auto k = meshdata->getKernalAt(nk - 1);
|
||||
// if(k != nullptr)
|
||||
// k->setPath(_fileName);
|
||||
} else {
|
||||
qDebug() << "Successful Import Mesh From " << _fileName;
|
||||
|
||||
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() << "Failed Import Mesh From " << _fileName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
information = QString("Failed resurface From \"%1\"").arg(_fileName);
|
||||
msg.type = Common::Message::Error;
|
||||
msg.message = information;
|
||||
qDebug() << "Failed resurface Mesh From " << _fileName;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
emit showInformation(information);
|
||||
emit _mainwindow->printMessageToMessageWindow(msg);
|
||||
}
|
||||
// ModuleBase::ThreadTask::threadTaskFinished();
|
||||
this->threadTaskFinished();
|
||||
Py::PythonAgent::getInstance()->unLock();
|
||||
|
||||
qDebug()<<"PCLGPMesh::defaultMeshFinished ModuleBase::ThreadTask::threadTaskFinished";
|
||||
// Py::PythonAgent::getInstance()->unLock();
|
||||
}
|
||||
void PCLGPMesh::setThreadRunState(bool flag)
|
||||
{
|
||||
|
||||
void PCLGPMesh::setThreadRunState(bool flag) {
|
||||
_success = flag;
|
||||
}
|
||||
|
||||
void PCLGPMesh::run()
|
||||
{
|
||||
void PCLGPMesh::run() {
|
||||
ModuleBase::ThreadTask::run();
|
||||
bool result = false;
|
||||
switch(_operation) {
|
||||
switch (_operation) {
|
||||
case POINTCLOUD_MESH:
|
||||
emit showInformation(tr("POINTCLOUD_MESH From \"%1\"").arg(_fileName));
|
||||
result = remeshtaskProcess();
|
||||
|
|
@ -282,9 +281,9 @@ namespace WBFZ {
|
|||
defaultMeshFinished();
|
||||
}
|
||||
|
||||
bool PCLGPMesh::remeshtaskProcess()
|
||||
{
|
||||
QString componentIds = _componentIds;
|
||||
bool PCLGPMesh::GP(vtkSmartPointer<vtkPolyData>& inpolygon,vtkSmartPointer<vtkPolyData>& polydata) { // 点云处理模块
|
||||
|
||||
// 可用变量
|
||||
double SearchRadius = _SearchRadius;
|
||||
double Mu = _Mu;
|
||||
int MaximumNearestNeighbors = _MaximumNearestNeighbors;
|
||||
|
|
@ -292,6 +291,45 @@ namespace WBFZ {
|
|||
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() {
|
||||
QString componentIds = _componentIds;
|
||||
|
||||
|
||||
emit _mainwindow->printMessage(Common::Message::Normal, "PCLGPMeshAlg");
|
||||
// 获取vtdataset
|
||||
QStringList qCompontIds = QString(componentIds).split(',');
|
||||
|
|
@ -300,93 +338,51 @@ namespace WBFZ {
|
|||
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();
|
||||
vtkSmartPointer<vtkPolyData> inpolyData=vtkSmartPointer<vtkPolyData>::New();
|
||||
vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();
|
||||
|
||||
QString outfilename;
|
||||
for(QString compontId : qCompontIds) {
|
||||
for (QString compontId: qCompontIds) {
|
||||
meshSet = meshData->getMeshSetByID(compontId.toInt());
|
||||
DebugInfo("point count %d : %d \n", compontId.toInt(), meshSet == nullptr);
|
||||
if(!meshSet)
|
||||
if (!meshSet)
|
||||
continue;
|
||||
outfilename = meshSet->getName();
|
||||
vtkPolyData* temppolyData =
|
||||
PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
|
||||
cellToPointFilter->SetInputData(temppolyData);
|
||||
DebugInfo("point count %d : %d \n", compontId.toInt(), temppolyData == nullptr);
|
||||
QString outfilename = meshSet->getName();
|
||||
cellToPointFilter->SetInputData(PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet));
|
||||
DebugInfo("point count %d \n", compontId.toInt());
|
||||
}
|
||||
|
||||
// 执行过滤操作
|
||||
cellToPointFilter->Update();
|
||||
DebugInfo("cellToPointFilter \n");
|
||||
// 获取过滤后的 vtkPolyData
|
||||
vtkPolyData* outpolyData = cellToPointFilter->GetOutput();
|
||||
DebugInfo("outpolyData ");
|
||||
inpolyData = cellToPointFilter->GetOutput();
|
||||
if(this->GP(inpolyData,polydata)){
|
||||
|
||||
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::PointCloud<pcl::PointXYZRGBA>::Ptr output(
|
||||
new pcl::PointCloud<pcl::PointXYZRGBA>); // 输出结果
|
||||
pcl::PointCloud<pcl::PointNormal>::Ptr cloud_with_normals(
|
||||
new pcl::PointCloud<pcl::PointNormal>);
|
||||
pcl::PolygonMesh* mesh = new pcl::PolygonMesh;
|
||||
|
||||
// 估计法线
|
||||
PointCloudOperator::PointCloudCommon::NormalEstimation(cloud_with_rgba, cloud_with_normals);
|
||||
|
||||
//------------------定义搜索树对象------------------------
|
||||
pcl::search::KdTree<pcl::PointNormal>::Ptr tree2(new pcl::search::KdTree<pcl::PointNormal>);
|
||||
tree2->setInputCloud(cloud_with_normals);
|
||||
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); // 设置该参数保证法线朝向一致
|
||||
// qDebug() << "[GP] start reconstruct :" << cloud_in->points.size();
|
||||
// Get result
|
||||
DebugInfo("setInputCloud point count : %d \n", cloud_with_normals->size());
|
||||
gp3.setInputCloud(cloud_with_normals); // 设置输入点云为有向点云
|
||||
gp3.setSearchMethod(tree2); // 设置搜索方式
|
||||
gp3.reconstruct(*mesh); // 重建提取三角化
|
||||
emit _mainwindow->printMessageToMessageWindow(
|
||||
QString("edge count %1 ").arg(QString::number(mesh->polygons.size())));
|
||||
DebugInfo("remesh over ,conver init %d \n", mesh->polygons.size());
|
||||
// 转换处理结果
|
||||
vtkSmartPointer<vtkPolyData> polydata= vtkSmartPointer<vtkPolyData>::New();
|
||||
// vtkPolyData* polydata = vtkPolyData::New(); // 创建新的指针,智能指针会释放
|
||||
size_t pointcount = PointCloudOperator::PointCloudCommon::mesh2vtk(*mesh, polydata);
|
||||
DebugInfo("remesh over ,conver over polydata %d , pointcount %d\n", polydata == nullptr, pointcount);
|
||||
|
||||
vtkSmartPointer<vtkDataSet> dataset=vtkDataSet::SafeDownCast(polydata);
|
||||
// dataset =vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
||||
// outpolyData->Delete(); // 释放指针 ,
|
||||
// 千万不能释放这个指针,不然程序回调时,会直接内存崩溃
|
||||
DebugInfo("PCLGPMeshAlg successfully!! wait for writing file \n");
|
||||
|
||||
// vtkDataSet*
|
||||
// dataset=PCLGPMeshAlg(_componentIds,_SearchRadius,_Mu,_MaximumNearestNeighbors,_MaximumSurfaceAngle,_MaximumAngle,_MinimumAngle);
|
||||
DebugInfo("remesh \n");
|
||||
QString filepath = _fileName;
|
||||
|
||||
QFile outfile_presave(_fileName);
|
||||
if(outfile_presave.exists()){ // 如果存在文件,就删除
|
||||
outfile_presave.remove();
|
||||
}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());
|
||||
}
|
||||
QString filepath = _fileName;
|
||||
QFile outfile_presave(_fileName);
|
||||
if (outfile_presave.exists()) { // 如果存在文件,就删除
|
||||
outfile_presave.remove();
|
||||
}
|
||||
// 手动释放所有的变量
|
||||
|
||||
//return false;
|
||||
{ // 写出到文件中
|
||||
// 加载文件
|
||||
QFileInfo info(filepath);
|
||||
QString name = info.fileName();
|
||||
|
|
@ -400,7 +396,7 @@ namespace WBFZ {
|
|||
if(suffix == "vtk") {
|
||||
vtkSmartPointer<vtkUnstructuredGridWriter> writer =
|
||||
vtkSmartPointer<vtkUnstructuredGridWriter>::New();
|
||||
writer->SetInputData(dataset);
|
||||
writer->SetInputData(polydata);
|
||||
writer->SetFileTypeToBinary();
|
||||
writer->SetFileName(ba);
|
||||
writer->Write();
|
||||
|
|
@ -408,36 +404,36 @@ namespace WBFZ {
|
|||
} else if(suffix == "stl") {
|
||||
QTextCodec* codec = QTextCodec::codecForName("GB18030");
|
||||
QByteArray ba = codec->fromUnicode(_fileName);
|
||||
|
||||
vtkSmartPointer<vtkSTLWriter> writer = vtkSmartPointer<vtkSTLWriter>::New();
|
||||
|
||||
writer->SetInputData(dataset);
|
||||
writer->SetInputData(polydata);
|
||||
writer->SetFileTypeToBinary();
|
||||
writer->SetFileName(ba);
|
||||
writer->Write();
|
||||
DebugInfo("writing stl !! \n");
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
DebugInfo("writing finish !! %d \n", dataset == nullptr);
|
||||
// 回调函数
|
||||
DebugInfo("remeshtaskProcess !! %d \n", dataset == nullptr);
|
||||
|
||||
// QFileInfo info(_fileName);
|
||||
// QString name = info.fileName();
|
||||
// QString path = info.filePath();
|
||||
// QString suffix = info.suffix().toLower();
|
||||
DebugInfo("dataset %d _fileName %s \n", dataset == nullptr, _fileName.toStdString().c_str());
|
||||
DebugInfo("dataset %d _fileName %s \n", nullptr==polydata, _fileName.toStdString().c_str());
|
||||
|
||||
if(nullptr==dataset){
|
||||
}else{
|
||||
dataset=nullptr;
|
||||
if (nullptr == polydata) { } else {
|
||||
DebugInfo("GP variable start release !! \n");
|
||||
//dataset->Delete();
|
||||
//dataset=nullptr;
|
||||
|
||||
DebugInfo("GP variable finish release!! \n");
|
||||
}
|
||||
|
||||
QFile outfile(_fileName);
|
||||
if(outfile.exists()){
|
||||
if (outfile.exists()) {
|
||||
DebugInfo("GP main process sucessfully !! \n");
|
||||
return true;
|
||||
}else{
|
||||
} else {
|
||||
DebugInfo("GP main process fail !! \n");
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#ifndef LAMPCAE_DIALOGPCLGPMESH_H
|
||||
#define LAMPCAE_DIALOGPCLGPMESH_H
|
||||
|
||||
#include <vtkPolyData.h>
|
||||
#include "WBFZExchangePluginAPI.h"
|
||||
#include "SelfDefObject/QFDialog.h"
|
||||
#include "MainWidgets/DialogVTKTransform.h"
|
||||
|
|
@ -51,6 +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:
|
||||
|
|
|
|||
|
|
@ -204,11 +204,11 @@ WBFZ::PCLGuassFilter::PCLGuassFilter(const QString& fileName, WBFZ::PointCloudOp
|
|||
, _radius(radius)
|
||||
{
|
||||
}
|
||||
vtkDataSet* WBFZ::PCLGuassFilter::filter()
|
||||
bool WBFZ::PCLGuassFilter::filter()
|
||||
{
|
||||
return PointCloudThreadBase::filter();
|
||||
}
|
||||
vtkDataSet* WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma,
|
||||
bool WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma,
|
||||
double threshold,double radius)
|
||||
{
|
||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg");
|
||||
|
|
@ -290,32 +290,12 @@ vtkDataSet* WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double
|
|||
vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
||||
size_t pointCount = dataset->GetNumberOfPoints();
|
||||
if(pointCount==0){
|
||||
return nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg successfully!! Point Count : "+QString::number(pointCount));
|
||||
outpolyData->Delete(); // 释放指针
|
||||
|
||||
QString filepath=_fileName;
|
||||
|
||||
// 加载文件
|
||||
QFileInfo info(filepath);
|
||||
QString name = info.fileName();
|
||||
QString path = info.filePath();
|
||||
QString suffix = info.suffix().toLower();
|
||||
QTextCodec *codec = QTextCodec::codecForName("GB18030");
|
||||
QByteArray ba = codec->fromUnicode(filepath);
|
||||
|
||||
std::string outFileName=ba.data();
|
||||
if (suffix == "pcd")
|
||||
{
|
||||
pcl::io::savePCDFileBinary(outFileName,*cloud_filtered);
|
||||
}
|
||||
else if (suffix == "ply")
|
||||
{
|
||||
pcl::io::savePLYFileBinary(outFileName,*cloud_filtered);
|
||||
}
|
||||
else{}
|
||||
return dataset;
|
||||
return this->saveFilterResultFile(cloud_filtered);
|
||||
}
|
||||
WBFZ::PCLGuassFilter::~PCLGuassFilter() {}
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ namespace WBFZ{
|
|||
PCLGuassFilter(const QString &fileName, PointCloudOperation operation, GUI::MainWindow *mw, QString componentIds, double sigma,double threshold,double radius);
|
||||
~PCLGuassFilter();
|
||||
private:
|
||||
vtkDataSet* filter() override;
|
||||
vtkDataSet* PCLGuassFilterAlg(QString componentIds,double sigmaR,double sigmaS,double radius);
|
||||
bool filter() override;
|
||||
bool PCLGuassFilterAlg(QString componentIds,double sigmaR,double sigmaS,double radius);
|
||||
private:
|
||||
QString _fileName;
|
||||
PointCloudOperation _operation;
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ namespace WBFZ{
|
|||
|
||||
}
|
||||
|
||||
vtkDataSet* WBFZ::PCLRadiusOutlierRemoval::PCLRadiusOutlierRemovalAlg(QString componentIds, double RadiusSearch,
|
||||
bool WBFZ::PCLRadiusOutlierRemoval::PCLRadiusOutlierRemovalAlg(QString componentIds, double RadiusSearch,
|
||||
double MinNeighborsInRadius)
|
||||
{
|
||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLRadiusOutlierRemovalAlg");
|
||||
|
|
@ -259,35 +259,14 @@ namespace WBFZ{
|
|||
vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
||||
size_t pointCount = dataset->GetNumberOfPoints();
|
||||
if(pointCount==0){
|
||||
return nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLRadiusOutlierRemovalAlg successfully!! Point Count : "+QString::number(pointCount));
|
||||
outpolyData->Delete(); // 释放指针
|
||||
|
||||
QString filepath=_fileName;
|
||||
|
||||
// 加载文件
|
||||
QFileInfo info(filepath);
|
||||
QString name = info.fileName();
|
||||
QString path = info.filePath();
|
||||
QString suffix = info.suffix().toLower();
|
||||
QTextCodec *codec = QTextCodec::codecForName("GB18030");
|
||||
QByteArray ba = codec->fromUnicode(filepath);
|
||||
|
||||
std::string outFileName=ba.data();
|
||||
if (suffix == "pcd")
|
||||
{
|
||||
pcl::io::savePCDFileBinary(outFileName,*cloud_filtered);
|
||||
return this->saveFilterResultFile(cloud_filtered);
|
||||
}
|
||||
else if (suffix == "ply")
|
||||
{
|
||||
pcl::io::savePLYFileBinary(outFileName,*cloud_filtered);
|
||||
}
|
||||
else{}
|
||||
return dataset;
|
||||
}
|
||||
vtkDataSet* PCLRadiusOutlierRemoval::filter()
|
||||
bool PCLRadiusOutlierRemoval::filter()
|
||||
{
|
||||
return PCLRadiusOutlierRemovalAlg( _componentIds, _RadiusSearch,_MinNeighborsInRadius);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ namespace WBFZ{
|
|||
PCLRadiusOutlierRemoval(const QString &fileName, PointCloudOperation operation, GUI::MainWindow *mw, QString componentIds, double RadiusSearch,double MinNeighborsInRadius);
|
||||
~PCLRadiusOutlierRemoval();
|
||||
private:
|
||||
vtkDataSet* filter() override;
|
||||
vtkDataSet* PCLRadiusOutlierRemovalAlg(QString componentIds,double RadiusSearch,double MinNeighborsInRadius);
|
||||
bool filter() override;
|
||||
bool PCLRadiusOutlierRemovalAlg(QString componentIds,double RadiusSearch,double MinNeighborsInRadius);
|
||||
private:
|
||||
QString _fileName;
|
||||
PointCloudOperation _operation;
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ namespace WBFZ{
|
|||
|
||||
}
|
||||
|
||||
vtkDataSet* WBFZ::PCLStatisticalRemoveFilter::PCLStatisticalRemoveFilterAlg(QString componentIds, double MeanK,
|
||||
bool WBFZ::PCLStatisticalRemoveFilter::PCLStatisticalRemoveFilterAlg(QString componentIds, double MeanK,
|
||||
double StddevThresh)
|
||||
{
|
||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLStatisticalRemoveFilterAlg");
|
||||
|
|
@ -260,35 +260,15 @@ namespace WBFZ{
|
|||
vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
|
||||
size_t pointCount = dataset->GetNumberOfPoints();
|
||||
if(pointCount==0){
|
||||
return nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
emit _mainwindow->printMessage(Common::Message::Normal,"PCLStatisticalRemoveFilterAlg successfully!! Point Count : "+QString::number(pointCount));
|
||||
outpolyData->Delete(); // 释放指针
|
||||
|
||||
QString filepath=_fileName;
|
||||
|
||||
// 加载文件
|
||||
QFileInfo info(filepath);
|
||||
QString name = info.fileName();
|
||||
QString path = info.filePath();
|
||||
QString suffix = info.suffix().toLower();
|
||||
QTextCodec *codec = QTextCodec::codecForName("GB18030");
|
||||
QByteArray ba = codec->fromUnicode(filepath);
|
||||
|
||||
std::string outFileName=ba.data();
|
||||
if (suffix == "pcd")
|
||||
{
|
||||
pcl::io::savePCDFileBinary(outFileName,*cloud_filtered);
|
||||
return this->saveFilterResultFile(cloud_filtered);
|
||||
}
|
||||
else if (suffix == "ply")
|
||||
{
|
||||
pcl::io::savePLYFileBinary(outFileName,*cloud_filtered);
|
||||
}
|
||||
else{}
|
||||
return dataset;
|
||||
}
|
||||
vtkDataSet* PCLStatisticalRemoveFilter::filter()
|
||||
bool PCLStatisticalRemoveFilter::filter()
|
||||
{
|
||||
return PCLStatisticalRemoveFilterAlg( _componentIds, _MeanK,_StddevThresh);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ namespace WBFZ{
|
|||
PCLStatisticalRemoveFilter(const QString &fileName, PointCloudOperation operation, GUI::MainWindow *mw, QString componentIds, double MeanK,double StddevThresh);
|
||||
~PCLStatisticalRemoveFilter();
|
||||
private:
|
||||
vtkDataSet* filter() override;
|
||||
vtkDataSet* PCLStatisticalRemoveFilterAlg(QString componentIds,double MeanK,double stddev);
|
||||
bool filter() override;
|
||||
bool PCLStatisticalRemoveFilterAlg(QString componentIds,double MeanK,double stddev);
|
||||
private:
|
||||
QString _fileName;
|
||||
PointCloudOperation _operation;
|
||||
|
|
|
|||
|
|
@ -258,30 +258,94 @@ void EchoTableEditWindow::on_actionEchoSplitExport_triggered()
|
|||
this->ui->statusbar->showMessage(u8"正在分析回波文件");
|
||||
this->statusprogressBar->setRange(0,100);
|
||||
this->statusprogressBar->setValue(10);
|
||||
FEKOBase::NearFieldEchoCSVParser nearfilePraseclass;
|
||||
|
||||
// 检查是否远场回波
|
||||
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){
|
||||
FEKOBase::FarFieldEchoCSVParser farfilePraseclass;
|
||||
QString echocsvfilepath = this->model->getCSVPath();
|
||||
if (!nearfilePraseclass.parseCSV(echocsvfilepath)) {
|
||||
if(!farfilePraseclass.parseCSV(echocsvfilepath)) {
|
||||
QMessageBox::warning(this, u8"警告", u8"回波文件结构解析错误,请检查文件");
|
||||
return;
|
||||
}
|
||||
this->statusprogressBar->setValue(25);
|
||||
QMessageBox::information(this, u8"信息", u8"请分别为theta极化、phi极化、R极化分量回波指定保存路径");
|
||||
QMessageBox::information(this, u8"信息",
|
||||
u8"请分别为theta极化、phi极化、R极化分量回波指定保存路径");
|
||||
|
||||
QString thetafilepath = getSaveFilePath(
|
||||
this,
|
||||
QString::fromUtf8(u8"另存为"),
|
||||
QString::fromUtf8(u8"theta文件 (*.theta)"));//多组扩展名用双分号";;"隔开
|
||||
this, QString::fromUtf8(u8"另存为"),
|
||||
QString::fromUtf8(u8"theta文件 (*.theta)")); // 多组扩展名用双分号";;"隔开
|
||||
|
||||
QString phifilepath = getSaveFilePath(
|
||||
this,
|
||||
QString::fromUtf8(u8"另存为"),
|
||||
QString::fromUtf8(u8"phi文件 (*.phi)"));//多组扩展名用双分号";;"隔开
|
||||
QString phifilepath =
|
||||
getSaveFilePath(this, QString::fromUtf8(u8"另存为"),
|
||||
QString::fromUtf8(u8"phi文件 (*.phi)")); // 多组扩展名用双分号";;"隔开
|
||||
|
||||
QString Rfilepath = getSaveFilePath(
|
||||
this,
|
||||
QString::fromUtf8(u8"另存为"),
|
||||
QString::fromUtf8(u8"R文件 (*.R)"));//多组扩展名用双分号";;"隔开
|
||||
// QString Rfilepath =
|
||||
// getSaveFilePath(this, QString::fromUtf8(u8"另存为"),
|
||||
// QString::fromUtf8(u8"R文件 (*.R)")); // 多组扩展名用双分号";;"隔开
|
||||
|
||||
this->ui->statusbar->showMessage(u8"正在导出theta极化");
|
||||
farfilePraseclass.toThetapolar(thetafilepath);
|
||||
this->statusprogressBar->setValue(50);
|
||||
this->ui->statusbar->showMessage(u8"正在导出phi极化");
|
||||
farfilePraseclass.toPhiPolar(phifilepath);
|
||||
this->statusprogressBar->setValue(75);
|
||||
QMessageBox::information(this, u8"信息", u8"极化回波已经保存完毕");
|
||||
}else{};
|
||||
// ---------------------- 近场结果 --------------------------------------------------
|
||||
if(isnear) {
|
||||
FEKOBase::NearFieldEchoCSVParser nearfilePraseclass;
|
||||
QString echocsvfilepath = this->model->getCSVPath();
|
||||
if(!nearfilePraseclass.parseCSV(echocsvfilepath)) {
|
||||
QMessageBox::warning(this, u8"警告", u8"回波文件结构解析错误,请检查文件");
|
||||
return;
|
||||
}
|
||||
this->statusprogressBar->setValue(25);
|
||||
QMessageBox::information(this, u8"信息",
|
||||
u8"请分别为theta极化、phi极化、R极化分量回波指定保存路径");
|
||||
|
||||
QString thetafilepath = getSaveFilePath(
|
||||
this, QString::fromUtf8(u8"另存为"),
|
||||
QString::fromUtf8(u8"theta文件 (*.theta)")); // 多组扩展名用双分号";;"隔开
|
||||
|
||||
QString phifilepath =
|
||||
getSaveFilePath(this, QString::fromUtf8(u8"另存为"),
|
||||
QString::fromUtf8(u8"phi文件 (*.phi)")); // 多组扩展名用双分号";;"隔开
|
||||
|
||||
QString Rfilepath =
|
||||
getSaveFilePath(this, QString::fromUtf8(u8"另存为"),
|
||||
QString::fromUtf8(u8"R文件 (*.R)")); // 多组扩展名用双分号";;"隔开
|
||||
|
||||
this->ui->statusbar->showMessage(u8"正在导出theta极化");
|
||||
nearfilePraseclass.toThetapolar(thetafilepath);
|
||||
|
|
@ -294,22 +358,26 @@ void EchoTableEditWindow::on_actionEchoSplitExport_triggered()
|
|||
nearfilePraseclass.toRPolar(Rfilepath);
|
||||
this->statusprogressBar->setValue(99);
|
||||
QMessageBox::information(this, u8"信息", u8"极化回波已经保存完毕");
|
||||
|
||||
}else{}
|
||||
// 询问用户是否关闭窗口
|
||||
|
||||
reply = QMessageBox::question(this, u8"提示", u8"是否直接进行成像?",QMessageBox::Yes | QMessageBox::No);
|
||||
if (reply == QMessageBox::Yes) {
|
||||
this->statusprogressBar->setValue(100);
|
||||
if(isfar || isnear) {
|
||||
reply = QMessageBox::question(this, u8"提示", u8"是否直接进行成像?",
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if(reply == QMessageBox::Yes) {
|
||||
LAMPImageCreateClass* imagewindows = new LAMPImageCreateClass;
|
||||
imagewindows->show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
QMessageBox::information(this, u8"信息", u8"文件格式读取错误");
|
||||
}
|
||||
}
|
||||
|
||||
void EchoTableEditWindow::on_actionCalibrationConst_triggered()
|
||||
{
|
||||
|
||||
// 补充定标软件功能
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -43,6 +43,12 @@ namespace FEKOBase {
|
|||
FEKOBase::FEKOCoordinateSystem FEKOCoordinateSystemString2Enum(QString str);
|
||||
QString QString2FEKOCoordinateSystem(FEKOBase::FEKOCoordinateSystem mode);
|
||||
|
||||
enum FEKORESULTFIELDTYPE {
|
||||
NEARFIELD, // 球坐标系
|
||||
FARFIELD, // 笛卡尔坐标系
|
||||
UNKONWFIELD // 必须为最后一个表示未知
|
||||
};
|
||||
|
||||
|
||||
//==========================================================
|
||||
// FEKO成像模式枚举
|
||||
|
|
@ -179,9 +185,15 @@ namespace FEKOBase {
|
|||
QString fileFormat;
|
||||
QString source;
|
||||
QString date;
|
||||
QString radiusStr;
|
||||
QString thetaStr;
|
||||
QString phiStr;
|
||||
|
||||
|
||||
double radius;
|
||||
double theta;
|
||||
double phi;
|
||||
|
||||
double reEr;
|
||||
double imEr;
|
||||
double reEtheta;
|
||||
|
|
@ -208,7 +220,7 @@ namespace FEKOBase {
|
|||
size_t freqpoints;
|
||||
|
||||
double px, py, pz;
|
||||
//double theta, phi;
|
||||
double theta, phi;
|
||||
//double incidence, azangle;
|
||||
//std::vector<double> freqlist;
|
||||
std::vector<ElectricFieldData> electricFieldDataList; // 单频点信息
|
||||
|
|
@ -217,6 +229,13 @@ namespace FEKOBase {
|
|||
bool compareElectricFieldDataInFreq(const ElectricFieldData& a, const ElectricFieldData& b);
|
||||
bool comparePRFPluseDataInPRFIdx(const PRFPluseData& a, const PRFPluseData& b);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 近场
|
||||
class NearFieldEchoCSVParser {
|
||||
public:
|
||||
NearFieldEchoCSVParser();
|
||||
|
|
@ -246,11 +265,44 @@ namespace FEKOBase {
|
|||
};
|
||||
|
||||
|
||||
// 远场
|
||||
class FarFieldEchoCSVParser {
|
||||
public:
|
||||
FarFieldEchoCSVParser();
|
||||
~FarFieldEchoCSVParser();
|
||||
private:
|
||||
bool usePRFCountMode = true;
|
||||
//std::vector<ElectricFieldData> electricFieldDataList;
|
||||
QMap<QString, std::vector<ElectricFieldData>> electricFieldDataList; // 电场数据
|
||||
//QMap<QString, PRFPluseData> prfPluseMap;
|
||||
std::vector<PRFPluseData> prfData;
|
||||
size_t freqPoints;
|
||||
double freqStart;
|
||||
double freqEnd;
|
||||
// 频率参数
|
||||
private: // 内部检查函数
|
||||
bool checkPRFModel();
|
||||
bool resizePRFPluse(); //回波整理
|
||||
|
||||
public:
|
||||
bool parseCSV(const QString& filePath); // 读取回波数据文件
|
||||
void toThetapolar(const QString& filePath);// 输出theta 极化
|
||||
void toPhiPolar(const QString& filePath);// 输出phi 极化
|
||||
//void toRPolar(const QString& filePath);// 输出phi 极化
|
||||
void saveCSV(const QString& filePath);// 输出csv文件
|
||||
private:
|
||||
void toEchoData(const QString& filePath, size_t outDataName);// 输出回波数据
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//========================================================================
|
||||
// 成像回波格式
|
||||
// file type:
|
||||
// fieldtype 0: 近场,1:远场
|
||||
// freqStart,freqEnd,freqPoint,isRight,
|
||||
// PRF1,Pos,incidenceAngle,AzAngle,echoDatalist
|
||||
// PRF2,Pos,incidenceAngle,AzAngle,echoDatalist
|
||||
|
|
@ -266,7 +318,7 @@ namespace FEKOBase {
|
|||
double freqStart; // 起始频率
|
||||
double freqEnd; // 终止频率
|
||||
int freqpoints; // 频率点数
|
||||
|
||||
FEKOBase::FEKORESULTFIELDTYPE datafieldtype; // 判断是否为近远场
|
||||
public:
|
||||
EchoDataClass(const FEKOBase::EchoDataClass& inecho);
|
||||
EchoDataClass();
|
||||
|
|
@ -284,6 +336,9 @@ namespace FEKOBase {
|
|||
void setFreqpoints(int freqpoints);
|
||||
int getFreqpoints() const;
|
||||
|
||||
void setDataFieldType(FEKOBase::FEKORESULTFIELDTYPE fieldtype);
|
||||
FEKOBase::FEKORESULTFIELDTYPE getDataFieldType() const;
|
||||
|
||||
void loadEchoData(const QString& filePath); // 加载回波数据文件
|
||||
void SaveEchoData(const QString& filePath); // 保存回波数据文件
|
||||
};
|
||||
|
|
@ -332,11 +387,8 @@ namespace FEKOBase {
|
|||
ImageAlgWindowFun String2ImageAlgWindowFun(QString str);
|
||||
QString ImageAlgWindowFun2String(ImageAlgWindowFun alg);
|
||||
|
||||
|
||||
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); // 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); // FBP成像
|
||||
|
||||
|
||||
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成像
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,20 +10,11 @@
|
|||
#include <QtXml/qdom.h>
|
||||
#include "GeoOperator.h"
|
||||
|
||||
FEKOBase::FEKOSimulationSARClass::FEKOSimulationSARClass() {}
|
||||
|
||||
FEKOBase::FEKOSimulationSARClass::~FEKOSimulationSARClass() {}
|
||||
|
||||
|
||||
FEKOBase::FEKOSimulationSARClass::FEKOSimulationSARClass()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
FEKOBase::FEKOSimulationSARClass::~FEKOSimulationSARClass()
|
||||
{
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::generator_STRIP_FEKOSatelliteParams()
|
||||
{
|
||||
void FEKOBase::FEKOSimulationSARClass::generator_STRIP_FEKOSatelliteParams() {
|
||||
qDebug() << u8"计算 Strip...";
|
||||
double incAngle = this->simulationparams->incangle;
|
||||
double refRange = this->simulationparams->refRange;
|
||||
|
|
@ -35,7 +26,6 @@ void FEKOBase::FEKOSimulationSARClass::generator_STRIP_FEKOSatelliteParams()
|
|||
double end_z = this->simulationparams->end_z;
|
||||
size_t prfcount = this->simulationparams->prfcount;
|
||||
|
||||
|
||||
double AzAngle = 0;
|
||||
this->FEKOAntPoselist.clear();
|
||||
gp_Pnt apex(0, 0, 5); // 顶点在三维空间中的坐标
|
||||
|
|
@ -75,24 +65,22 @@ void FEKOBase::FEKOSimulationSARClass::generator_STRIP_FEKOSatelliteParams()
|
|||
|
||||
// 创建 SatelliteState
|
||||
FEKOBase::SatelliteState satepos{
|
||||
FEKOBase::SatellitePosition{Px,Py,Pz},
|
||||
FEKOBase::SatelliteVelocity{Vx,Vy,Vz},
|
||||
FEKOBase::SatellitePosition{Px, Py, Pz},
|
||||
FEKOBase::SatelliteVelocity{Vx, Vy, Vz},
|
||||
};
|
||||
|
||||
FEKOBase::FEKOantPitionDirect tempdir;
|
||||
TopoDS_Shape out_ds = SatellitePos2FEKOAntPos(satepos, incAngle, AzAngle, this->simulationparams->isRight, &tempdir, in_ds);
|
||||
FEKOBase::FEKOSatelliteParams temp = createFEKOSatelliteParams(satepos, incAngle, AzAngle, tempdir, i);
|
||||
TopoDS_Shape out_ds = SatellitePos2FEKOAntPos(
|
||||
satepos, incAngle, AzAngle, this->simulationparams->isRight, &tempdir, in_ds);
|
||||
FEKOBase::FEKOSatelliteParams temp =
|
||||
createFEKOSatelliteParams(satepos, incAngle, AzAngle, tempdir, i);
|
||||
this->FEKOAntPoselist.push_back(temp);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::generator_SCAN_FEKOSatelliteParams()
|
||||
{
|
||||
void FEKOBase::FEKOSimulationSARClass::generator_SCAN_FEKOSatelliteParams() {
|
||||
qDebug() << u8"计算 ScaneSAR...";
|
||||
|
||||
|
||||
double incAngle = this->simulationparams->incangle;
|
||||
double refRange = this->simulationparams->refRange;
|
||||
double startAzAngle = this->simulationparams->start_az_angle;
|
||||
|
|
@ -105,7 +93,6 @@ void FEKOBase::FEKOSimulationSARClass::generator_SCAN_FEKOSatelliteParams()
|
|||
double end_z = this->simulationparams->end_z;
|
||||
size_t prfcount = this->simulationparams->prfcount;
|
||||
|
||||
|
||||
this->FEKOAntPoselist.clear();
|
||||
TopoDS_Shape in_ds;
|
||||
for (size_t i = 0; i < prfcount; i++) {
|
||||
|
|
@ -119,20 +106,20 @@ void FEKOBase::FEKOSimulationSARClass::generator_SCAN_FEKOSatelliteParams()
|
|||
|
||||
// 创建 SatelliteState
|
||||
FEKOBase::SatelliteState satepos{
|
||||
FEKOBase::SatellitePosition{Px,Py,Pz},
|
||||
FEKOBase::SatelliteVelocity{Vx,Vy,Vz},
|
||||
FEKOBase::SatellitePosition{Px, Py, Pz},
|
||||
FEKOBase::SatelliteVelocity{Vx, Vy, Vz},
|
||||
};
|
||||
|
||||
FEKOBase::FEKOantPitionDirect tempdir;
|
||||
TopoDS_Shape out_ds = SatellitePos2FEKOAntPos(satepos, incAngle, AzAngle, this->simulationparams->isRight, &tempdir, in_ds);
|
||||
FEKOBase::FEKOSatelliteParams temp = createFEKOSatelliteParams(satepos, incAngle, AzAngle, tempdir, i);
|
||||
TopoDS_Shape out_ds = SatellitePos2FEKOAntPos(
|
||||
satepos, incAngle, AzAngle, this->simulationparams->isRight, &tempdir, in_ds);
|
||||
FEKOBase::FEKOSatelliteParams temp =
|
||||
createFEKOSatelliteParams(satepos, incAngle, AzAngle, tempdir, i);
|
||||
this->FEKOAntPoselist.push_back(temp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::generator_ISAR_FEKOSatelliteParams()
|
||||
{
|
||||
void FEKOBase::FEKOSimulationSARClass::generator_ISAR_FEKOSatelliteParams() {
|
||||
qDebug() << u8"计算 ISAR...";
|
||||
// 计算ISAR
|
||||
double iangle = this->simulationparams->incangle; // 入射角
|
||||
|
|
@ -144,16 +131,14 @@ void FEKOBase::FEKOSimulationSARClass::generator_ISAR_FEKOSatelliteParams()
|
|||
|
||||
double refRange = this->simulationparams->refRange;
|
||||
|
||||
|
||||
// 计算ISAR
|
||||
this->FEKOAntPoselist.clear();
|
||||
double mpi_delta = (deltaAngle) / abs(deltaAngle) * M_PI / 2;
|
||||
//double startangle = 0;
|
||||
//double endAngle = M_PI * 2;
|
||||
// double startangle = 0;
|
||||
// double endAngle = M_PI * 2;
|
||||
if (mpi_delta > 0) { // 逆时针旋转
|
||||
this->simulationparams->setIsRight(false);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this->simulationparams->setIsRight(true);
|
||||
endAngle = -1 * endAngle;
|
||||
}
|
||||
|
|
@ -174,26 +159,26 @@ void FEKOBase::FEKOSimulationSARClass::generator_ISAR_FEKOSatelliteParams()
|
|||
double Vy = fly_direct.Y();
|
||||
double Vz = fly_direct.Z();
|
||||
double theta = ZRotation_angle;
|
||||
double phi = (this->simulationparams->isRight) ? -1 * angle + M_PI / 2 : angle + M_PI; // 根据位置计算入射角
|
||||
double phi = (this->simulationparams->isRight) ? -1 * angle + M_PI / 2
|
||||
: angle + M_PI; // 根据位置计算入射角
|
||||
|
||||
theta = theta * 180 / M_PI;
|
||||
phi = phi * 180 / M_PI;
|
||||
FEKOBase::FEKOSatelliteParams temp = FEKOBase::createFEKOSatelliteParams(Px, Py, Pz, Vx, Vy, Vz, iangle, azAngle, theta, phi, this->simulationparams->isRight, PRFidx);
|
||||
FEKOBase::FEKOSatelliteParams temp =
|
||||
FEKOBase::createFEKOSatelliteParams(Px, Py, Pz, Vx, Vy, Vz, iangle, azAngle, theta, phi,
|
||||
this->simulationparams->isRight, PRFidx);
|
||||
this->FEKOAntPoselist.push_back(temp);
|
||||
PRFidx = PRFidx + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::generator_CircleSAR_FEKOSatelliteParams()
|
||||
{
|
||||
void FEKOBase::FEKOSimulationSARClass::generator_CircleSAR_FEKOSatelliteParams() {
|
||||
qDebug() << u8"计算 CircleSAR..."; // 飞行方向为 Y 轴,雷达指向为 Z 轴
|
||||
|
||||
double incAngle = this->simulationparams->incangle;
|
||||
double deltaAngle = this->simulationparams->delta_angle;
|
||||
double refRange = this->simulationparams->refRange;
|
||||
|
||||
|
||||
double iangle = incAngle; // 入射角
|
||||
double azAngle = 0; // 扫描角变化
|
||||
incAngle = incAngle * M_PI / 180;
|
||||
|
|
@ -204,12 +189,9 @@ void FEKOBase::FEKOSimulationSARClass::generator_CircleSAR_FEKOSatelliteParams()
|
|||
double startangle = 0;
|
||||
double endAngle = M_PI * 2;
|
||||
|
||||
|
||||
|
||||
if (mpi_delta > 0) { // 逆时针旋转
|
||||
this->simulationparams->isRight = false;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this->simulationparams->isRight = true;
|
||||
endAngle = -1 * endAngle;
|
||||
}
|
||||
|
|
@ -230,23 +212,21 @@ void FEKOBase::FEKOSimulationSARClass::generator_CircleSAR_FEKOSatelliteParams()
|
|||
double Vy = fly_direct.Y();
|
||||
double Vz = fly_direct.Z();
|
||||
double theta = ZRotation_angle;
|
||||
double phi = (this->simulationparams->isRight) ? -1 * angle + M_PI / 2 : angle + M_PI; // 根据位置计算入射角
|
||||
double phi = (this->simulationparams->isRight) ? -1 * angle + M_PI / 2
|
||||
: angle + M_PI; // 根据位置计算入射角
|
||||
|
||||
theta = theta * 180 / M_PI;
|
||||
phi = phi * 180 / M_PI;
|
||||
FEKOBase::FEKOSatelliteParams temp = FEKOBase::createFEKOSatelliteParams(Px, Py, Pz, Vx, Vy, Vz, iangle, azAngle, theta, phi, this->simulationparams->isRight, PRFidx);
|
||||
FEKOBase::FEKOSatelliteParams temp =
|
||||
FEKOBase::createFEKOSatelliteParams(Px, Py, Pz, Vx, Vy, Vz, iangle, azAngle, theta, phi,
|
||||
this->simulationparams->isRight, PRFidx);
|
||||
this->FEKOAntPoselist.push_back(temp);
|
||||
PRFidx = PRFidx + 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::generator_FEKOSatelliteParams()
|
||||
{
|
||||
|
||||
switch (this->simulationparams->imagemode)
|
||||
{
|
||||
void FEKOBase::FEKOSimulationSARClass::generator_FEKOSatelliteParams() {
|
||||
switch (this->simulationparams->imagemode) {
|
||||
case FEKOBase::FEKOImageMode::Strip:
|
||||
return this->generator_STRIP_FEKOSatelliteParams();
|
||||
case FEKOBase::FEKOImageMode::Scane:
|
||||
|
|
@ -261,27 +241,23 @@ void FEKOBase::FEKOSimulationSARClass::generator_FEKOSatelliteParams()
|
|||
}
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::refreshFEKOSimulationParams() {}
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::refreshFEKOSimulationParams() {
|
||||
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::setFEKOAntPoselist(std::vector<FEKOBase::FEKOSatelliteParams> FEKOAntPoselist)
|
||||
{
|
||||
void FEKOBase::FEKOSimulationSARClass::setFEKOAntPoselist(
|
||||
std::vector<FEKOBase::FEKOSatelliteParams> FEKOAntPoselist) {
|
||||
this->FEKOAntPoselist = FEKOAntPoselist;
|
||||
}
|
||||
|
||||
std::vector<FEKOBase::FEKOSatelliteParams> FEKOBase::FEKOSimulationSARClass::getFEKOAntPoselist()
|
||||
{
|
||||
std::vector<FEKOBase::FEKOSatelliteParams> FEKOBase::FEKOSimulationSARClass::getFEKOAntPoselist() {
|
||||
return this->FEKOAntPoselist;
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::loadFEKOImageSettingXML(QString xmlpath)
|
||||
{
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::loadFEKOImageSettingXML(QString xmlpath) {
|
||||
if (!isExists(xmlpath)) {
|
||||
// QString newName = QInputDialog::getText(nullptr, u8"命名", u8"成像任务名称", QLineEdit::Normal);
|
||||
QString newName = QInputDialog::getText(nullptr, "rename", "Image task Name", QLineEdit::Normal);
|
||||
// QString newName = QInputDialog::getText(nullptr, u8"命名", u8"成像任务名称",
|
||||
// QLineEdit::Normal);
|
||||
QString newName =
|
||||
QInputDialog::getText(nullptr, "rename", "Image task Name", QLineEdit::Normal);
|
||||
if (newName.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -305,19 +281,17 @@ void FEKOBase::FEKOSimulationSARClass::loadFEKOImageSettingXML(QString xmlpath)
|
|||
qDebug() << u8"finish load fekoSimulation xml file.";
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationSARClass::saveFEKOImageSettingXML()
|
||||
{
|
||||
void FEKOBase::FEKOSimulationSARClass::saveFEKOImageSettingXML() {
|
||||
// 为下列每个节点,附加一个TextNode
|
||||
if (isExists(this->xmlpath)) {
|
||||
removeFile(this->xmlpath);
|
||||
} else {
|
||||
}
|
||||
else {}
|
||||
this->simulationparams->saveXml(this->xmlpath);
|
||||
qDebug()<<"finish save fekoSimulation xml file.";
|
||||
qDebug() << "finish save fekoSimulation xml file.";
|
||||
}
|
||||
|
||||
QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfidx, size_t endprfidx)
|
||||
{
|
||||
QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfidx, size_t endprfidx) {
|
||||
QProgressDialog progressDialog(u8"构建馈源设置脚本", u8"终止", 0, this->FEKOAntPoselist.size());
|
||||
progressDialog.setWindowTitle("imaging...");
|
||||
progressDialog.setModal(true);
|
||||
|
|
@ -327,9 +301,12 @@ QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfid
|
|||
progressDialog.setMinimum(0);
|
||||
progressDialog.show();
|
||||
|
||||
if (this->simulationparams->startfreq > 1e6) { this->simulationparams->startfreq = this->simulationparams->startfreq / 1e9; } // ==> GHz
|
||||
if (this->simulationparams->endfreq > 1e6) { this->simulationparams->endfreq = this->simulationparams->endfreq / 1e9; }
|
||||
|
||||
if (this->simulationparams->startfreq > 1e6) {
|
||||
this->simulationparams->startfreq = this->simulationparams->startfreq / 1e9;
|
||||
} // ==> GHz
|
||||
if (this->simulationparams->endfreq > 1e6) {
|
||||
this->simulationparams->endfreq = this->simulationparams->endfreq / 1e9;
|
||||
}
|
||||
|
||||
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");
|
||||
|
|
@ -394,12 +371,7 @@ QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfid
|
|||
luascript = luascript + QString(u8" temp_farFieldSource_workplane.Origin.Z=0 \n");
|
||||
luascript = luascript + QString(u8"\n");
|
||||
luascript = luascript + QString(u8" -- set nearfield\n");
|
||||
luascript = luascript + QString(u8" temp_nearFieldRequest=temp_standardConfiguration.NearFields:AddSpherical(%1,%2,%3,%4,%5,%6,1,1,1) -- nearfield \n").arg(QString::number(0))
|
||||
.arg(QString::number(temp.antpos.theta))
|
||||
.arg(QString::number(temp.antpos.phi))
|
||||
.arg(QString::number(0))
|
||||
.arg(QString::number(temp.antpos.theta))
|
||||
.arg(QString::number(temp.antpos.phi)); // 设置接收点
|
||||
luascript = luascript + QString(u8" temp_nearFieldRequest=temp_standardConfiguration.NearFields:AddSpherical(%1,%2,%3,%4,%5,%6,1,1,1) -- nearfield \n").arg(QString::number(0)).arg(QString::number(temp.antpos.theta)).arg(QString::number(temp.antpos.phi)).arg(QString::number(0)).arg(QString::number(temp.antpos.theta)).arg(QString::number(temp.antpos.phi)); // 设置接收点
|
||||
luascript = luascript + QString(u8" temp_nearFieldRequest.Label=\"NearField_PRF_%1\"\n").arg(prf_id);
|
||||
luascript = luascript + QString(u8" temp_nearFieldRequest_workplane=temp_nearFieldRequest.LocalWorkplane\n");
|
||||
luascript = luascript + QString(u8" temp_nearFieldRequest_workplane.Origin.X=%1\n").arg(QString::number(temp.antpos.x));
|
||||
|
|
@ -425,32 +397,36 @@ QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfid
|
|||
luascript = luascript + QString(u8"-- prf point setting over -------\n");
|
||||
luascript = luascript + QString(u8" \n");
|
||||
|
||||
progressDialog.setWindowTitle(u8"馈源脚本生产成功" );
|
||||
progressDialog.setWindowTitle(u8"馈源脚本生产成功");
|
||||
progressDialog.setValue(this->FEKOAntPoselist.size());
|
||||
progressDialog.close();
|
||||
|
||||
return luascript;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool FEKOBase::FEKOImageProcess(EchoDataClass& echodata, FEKOImageSettingParams& imageSettingParams, QString& outPath, FEKOImageAlgorithm algmethod, ImageAlgWindowFun winfun)
|
||||
{
|
||||
bool FEKOBase::FEKOImageProcess(EchoDataClass &echodata, FEKOImageSettingParams &imageSettingParams,
|
||||
QString &outPath, FEKOImageAlgorithm algmethod,
|
||||
ImageAlgWindowFun winfun) {
|
||||
Eigen::MatrixXcd echoData = echodata.getEchoData();
|
||||
Eigen::MatrixXd antpos = echodata.getAntPos();
|
||||
Eigen::MatrixXd freqmatrix = Eigen::MatrixXd::Zero(1, echoData.cols());
|
||||
Eigen::MatrixXd Image_X = Eigen::MatrixXd::Zero(imageSettingParams.ImageHeight, imageSettingParams.ImageWidth);
|
||||
Eigen::MatrixXd Image_Y = Eigen::MatrixXd::Zero(imageSettingParams.ImageHeight, imageSettingParams.ImageWidth);
|
||||
Eigen::MatrixXd Image_Z = Eigen::MatrixXd::Zero(imageSettingParams.ImageHeight, imageSettingParams.ImageWidth);
|
||||
Eigen::MatrixXd Image_X =
|
||||
Eigen::MatrixXd::Zero(imageSettingParams.ImageHeight, imageSettingParams.ImageWidth);
|
||||
Eigen::MatrixXd Image_Y =
|
||||
Eigen::MatrixXd::Zero(imageSettingParams.ImageHeight, imageSettingParams.ImageWidth);
|
||||
Eigen::MatrixXd Image_Z =
|
||||
Eigen::MatrixXd::Zero(imageSettingParams.ImageHeight, imageSettingParams.ImageWidth);
|
||||
size_t prfcount = echoData.rows();
|
||||
size_t frepoints = echodata.getFreqpoints();
|
||||
FEKOBase::FEKORESULTFIELDTYPE datafieldtype = echodata.getDataFieldType();
|
||||
if (frepoints != echoData.cols() || prfcount != antpos.rows()) {
|
||||
QString infotip = u8"回波矩阵 大小不匹配:" + QString(u8"回波脉冲数:%1,实际:%2;回波频点数:%3,实际:%4")
|
||||
.arg(QString::number(prfcount)).
|
||||
arg(QString::number(antpos.rows()))
|
||||
QString infotip = u8"回波矩阵 大小不匹配:"
|
||||
+ QString(u8"回波脉冲数:%1,实际:%2;回波频点数:%3,实际:%4")
|
||||
.arg(QString::number(prfcount))
|
||||
.arg(QString::number(antpos.rows()))
|
||||
.arg(QString::number(echoData.cols()))
|
||||
.arg(QString::number(frepoints));
|
||||
# ifdef __SHOWPROCESS
|
||||
#ifdef __SHOWPROCESS
|
||||
QMessageBox::warning(nullptr, u8"错误", infotip);
|
||||
#endif // __SHOWPROCESS
|
||||
qWarning() << infotip;
|
||||
|
|
@ -460,58 +436,58 @@ bool FEKOBase::FEKOImageProcess(EchoDataClass& echodata, FEKOImageSettingParam
|
|||
// 构建频率矩阵
|
||||
double startfreq = echodata.getFreqStart();
|
||||
double endfreq = echodata.getFreqEnd();
|
||||
if (startfreq > 1e5) { startfreq = startfreq * 1e-9; } // 频率单位进行转换 Hz->GHz
|
||||
if (endfreq > 1e5) { endfreq = endfreq * 1e-9; }
|
||||
freqmatrix = Eigen::ArrayXd::LinSpaced(frepoints, startfreq, endfreq).array().reshaped(1, frepoints).array();
|
||||
if (startfreq > 1e5) {
|
||||
startfreq = startfreq * 1e-9;
|
||||
} // 频率单位进行转换 Hz->GHz
|
||||
if (endfreq > 1e5) {
|
||||
endfreq = endfreq * 1e-9;
|
||||
}
|
||||
freqmatrix = Eigen::ArrayXd::LinSpaced(frepoints, startfreq, endfreq)
|
||||
.array()
|
||||
.reshaped(1, frepoints)
|
||||
.array();
|
||||
|
||||
// 构建图像坐标矩阵
|
||||
size_t imageHeight = imageSettingParams.ImageHeight; // Y 方向
|
||||
size_t imageWidth = imageSettingParams.ImageWidth; // X 方向
|
||||
|
||||
|
||||
|
||||
|
||||
for (size_t i = 0; i < imageHeight; i++) {
|
||||
Image_X.row(i) = Eigen::ArrayXd::LinSpaced(imageWidth, imageSettingParams.min_x, imageSettingParams.max_x);
|
||||
Image_X.row(i) = Eigen::ArrayXd::LinSpaced(imageWidth, imageSettingParams.min_x,
|
||||
imageSettingParams.max_x);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < imageWidth; i++) {
|
||||
Image_Y.col(i) = Eigen::ArrayXd::LinSpaced(imageHeight, imageSettingParams.max_y, imageSettingParams.min_y);
|
||||
Image_Y.col(i) = Eigen::ArrayXd::LinSpaced(imageHeight, imageSettingParams.max_y,
|
||||
imageSettingParams.min_y);
|
||||
}
|
||||
Image_Z = Image_Z.array() * 0 + imageSettingParams.plane_z;
|
||||
|
||||
//std::cout << Image_X.row(0) << std::endl;
|
||||
//std::cout << Image_Y.col(0) << std::endl;
|
||||
switch (algmethod)
|
||||
{
|
||||
// std::cout << Image_X.row(0) << std::endl;
|
||||
// std::cout << Image_Y.col(0) << std::endl;
|
||||
switch (algmethod) {
|
||||
case FEKOBase::TBP_TIME:
|
||||
return FEKOBase::BPImage_TIME(outPath, echoData, antpos, freqmatrix, Image_X, Image_Y, Image_Z, winfun);
|
||||
return FEKOBase::BPImage_TIME(outPath, echoData, antpos, freqmatrix, Image_X, Image_Y,
|
||||
Image_Z, winfun);
|
||||
case FEKOBase::TBP_FREQ:
|
||||
return FEKOBase::FBPImage_FREQ(outPath, echoData, antpos, freqmatrix, Image_X, Image_Y, Image_Z, winfun);
|
||||
return FEKOBase::FBPImage_FREQ(outPath, echoData, antpos, freqmatrix, Image_X, Image_Y,
|
||||
Image_Z, winfun, datafieldtype);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
FEKOBase::FEKOImageProcessAbstractClass::FEKOImageProcessAbstractClass() {}
|
||||
|
||||
FEKOBase::FEKOImageProcessAbstractClass::FEKOImageProcessAbstractClass()
|
||||
{
|
||||
}
|
||||
FEKOBase::FEKOImageProcessAbstractClass::~FEKOImageProcessAbstractClass() {}
|
||||
|
||||
FEKOBase::FEKOImageProcessAbstractClass::~FEKOImageProcessAbstractClass()
|
||||
{
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOImageProcessAbstractClass::setEchoData(EchoDataClass echodata)
|
||||
{
|
||||
void FEKOBase::FEKOImageProcessAbstractClass::setEchoData(EchoDataClass echodata) {
|
||||
this->echodata = echodata;
|
||||
}
|
||||
|
||||
FEKOBase::EchoDataClass FEKOBase::FEKOImageProcessAbstractClass::getEchoData() const
|
||||
{
|
||||
FEKOBase::EchoDataClass FEKOBase::FEKOImageProcessAbstractClass::getEchoData() const {
|
||||
FEKOBase::EchoDataClass res;
|
||||
|
||||
FEKOBase::EchoDataClass res; ;
|
||||
res.setEchoData(this->echodata.getEchoData());
|
||||
res.setAntPos(this->echodata.getAntPos());
|
||||
res.setFreqStart(this->echodata.getFreqStart());
|
||||
|
|
@ -520,12 +496,11 @@ FEKOBase::EchoDataClass FEKOBase::FEKOImageProcessAbstractClass::getEchoData()
|
|||
return res;
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOImageProcessAbstractClass::setImageSettingParams(FEKOImageSettingParams imageSettingParams)
|
||||
{
|
||||
void FEKOBase::FEKOImageProcessAbstractClass::setImageSettingParams(
|
||||
FEKOImageSettingParams imageSettingParams) {
|
||||
}
|
||||
|
||||
FEKOBase::FEKOImageSettingParams FEKOBase::FEKOImageProcessAbstractClass::getImageSettingParams()
|
||||
{
|
||||
FEKOBase::FEKOImageSettingParams FEKOBase::FEKOImageProcessAbstractClass::getImageSettingParams() {
|
||||
return this->imageSettingParams;
|
||||
}
|
||||
|
||||
|
|
@ -533,37 +508,32 @@ void FEKOBase::FEKOImageProcessAbstractClass::setAlgmethod(FEKOImageAlgorithm al
|
|||
this->algmethod = algmethod;
|
||||
}
|
||||
|
||||
FEKOBase::FEKOImageAlgorithm FEKOBase::FEKOImageProcessAbstractClass::getAlgmethod()
|
||||
{
|
||||
FEKOBase::FEKOImageAlgorithm FEKOBase::FEKOImageProcessAbstractClass::getAlgmethod() {
|
||||
return this->algmethod;
|
||||
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOImageProcessAbstractClass::settiffPath(QString outtiffPath)
|
||||
{
|
||||
void FEKOBase::FEKOImageProcessAbstractClass::settiffPath(QString outtiffPath) {
|
||||
this->tiffPath = outtiffPath;
|
||||
}
|
||||
|
||||
QString FEKOBase::FEKOImageProcessAbstractClass::gettiffPath()
|
||||
{
|
||||
QString FEKOBase::FEKOImageProcessAbstractClass::gettiffPath() {
|
||||
return this->tiffPath;
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOImageProcessAbstractClass::LoadEchoDataPath(QString echoPath)
|
||||
{
|
||||
void FEKOBase::FEKOImageProcessAbstractClass::LoadEchoDataPath(QString echoPath) {
|
||||
EchoDataClass echodata;
|
||||
echodata.loadEchoData(echoPath);
|
||||
//this->setEchoData(echodata);
|
||||
// this->setEchoData(echodata);
|
||||
this->echodata = echodata;
|
||||
}
|
||||
|
||||
bool FEKOBase::FEKOImageProcessAbstractClass::Imageprocess()
|
||||
{
|
||||
return FEKOImageProcess(this->echodata, this->imageSettingParams, this->tiffPath, this->algmethod);
|
||||
bool FEKOBase::FEKOImageProcessAbstractClass::Imageprocess() {
|
||||
return FEKOImageProcess(this->echodata, this->imageSettingParams, this->tiffPath,
|
||||
this->algmethod);
|
||||
}
|
||||
|
||||
FEKOBase::FEKOSimulationDataparams::FEKOSimulationDataparams(QObject* parent ): QObject(parent)
|
||||
{ // 初始化成员变量
|
||||
FEKOBase::FEKOSimulationDataparams::FEKOSimulationDataparams(QObject *parent)
|
||||
: QObject(parent) { // 初始化成员变量
|
||||
this->taskName = u8"TaskName";
|
||||
this->imagemode = FEKOBase::FEKOImageMode::Strip;
|
||||
this->isRight = true;
|
||||
|
|
@ -571,7 +541,7 @@ FEKOBase::FEKOSimulationDataparams::FEKOSimulationDataparams(QObject* parent ):
|
|||
this->incangle = 0;
|
||||
this->centerFreq = 9.6;
|
||||
this->bandwidth = 0.8;
|
||||
this->rangeResolution = LIGHESPEEDGHZ/ this->bandwidth/2.0;
|
||||
this->rangeResolution = LIGHESPEEDGHZ / this->bandwidth / 2.0;
|
||||
|
||||
this->startfreq = 9.2;
|
||||
this->endfreq = 10;
|
||||
|
|
@ -600,10 +570,7 @@ FEKOBase::FEKOSimulationDataparams::FEKOSimulationDataparams(QObject* parent ):
|
|||
this->AntennaRadiationFileName = u8"TESTFarSource";
|
||||
}
|
||||
|
||||
FEKOBase::FEKOSimulationDataparams::~FEKOSimulationDataparams()
|
||||
{
|
||||
}
|
||||
|
||||
FEKOBase::FEKOSimulationDataparams::~FEKOSimulationDataparams() {}
|
||||
|
||||
QString FEKOBase::FEKOSimulationDataparams::getTaskName() {
|
||||
return taskName;
|
||||
|
|
@ -845,14 +812,14 @@ void FEKOBase::FEKOSimulationDataparams::setDelta_angle(double delta) {
|
|||
delta_angle = delta;
|
||||
}
|
||||
|
||||
|
||||
// 获取远程天线等效辐射方向图文件地址
|
||||
QString FEKOBase::FEKOSimulationDataparams::getAntennaRadiationFileName() {
|
||||
return AntennaRadiationFileName;
|
||||
}
|
||||
|
||||
// 设置远程天线等效辐射方向图文件地址
|
||||
void FEKOBase::FEKOSimulationDataparams::setAntennaRadiationFileName(QString AntennaRadiationFileName) {
|
||||
void FEKOBase::FEKOSimulationDataparams::setAntennaRadiationFileName(
|
||||
QString AntennaRadiationFileName) {
|
||||
AntennaRadiationFileName = AntennaRadiationFileName;
|
||||
}
|
||||
|
||||
|
|
@ -876,21 +843,22 @@ void FEKOBase::FEKOSimulationDataparams::setFarsourcePhiPoints(long phiPoints) {
|
|||
farsource_phiPoints = phiPoints;
|
||||
}
|
||||
|
||||
// 根据FEKOBase::FEKOSimulationDataparams 构建xml,并提供 loadxml,savexml 函数,copilot
|
||||
// 继续不要一行行,要全部出来,如果一次会话搞不定,就分多个会话
|
||||
|
||||
// 根据FEKOBase::FEKOSimulationDataparams 构建xml,并提供 loadxml,savexml 函数,copilot 继续不要一行行,要全部出来,如果一次会话搞不定,就分多个会话
|
||||
|
||||
void FEKOBase::FEKOSimulationDataparams::CalFEKOSimulationFreqParams(double centerFreq, double resolution, double bandWidth, double scenceRange, bool isResolution)
|
||||
{
|
||||
void FEKOBase::FEKOSimulationDataparams::CalFEKOSimulationFreqParams(
|
||||
double centerFreq, double resolution, double bandWidth, double scenceRange, bool isResolution) {
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationDataparams::updateFEKOSimulationFreqParams(double startfreq, double endfreq, size_t freqpoints)
|
||||
{
|
||||
void FEKOBase::FEKOSimulationDataparams::updateFEKOSimulationFreqParams(double startfreq,
|
||||
double endfreq,
|
||||
size_t freqpoints) {
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationDataparams::loadXml(const QString& fileName) {
|
||||
void FEKOBase::FEKOSimulationDataparams::loadXml(const QString &fileName) {
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
//QMessageBox::warning(nullptr, u8"警告", u8"无法打开文件");
|
||||
// QMessageBox::warning(nullptr, u8"警告", u8"无法打开文件");
|
||||
QMessageBox::warning(nullptr, tr("warning"), tr("File not found"));
|
||||
return;
|
||||
}
|
||||
|
|
@ -900,137 +868,105 @@ void FEKOBase::FEKOSimulationDataparams::loadXml(const QString& fileName) {
|
|||
while (!xmlReader.atEnd() && !xmlReader.hasError()) {
|
||||
xmlReader.readNext();
|
||||
|
||||
if (xmlReader.isStartElement()) {
|
||||
if (xmlReader.name() == "TaskName") {
|
||||
if(xmlReader.isStartElement()) {
|
||||
if(xmlReader.name() == "TaskName") {
|
||||
xmlReader.readNext();
|
||||
taskName = xmlReader.text().toString();
|
||||
}
|
||||
else if (xmlReader.name() == "ImageMode") {
|
||||
} else if(xmlReader.name() == "ImageMode") {
|
||||
xmlReader.readNext();
|
||||
imagemode = static_cast<FEKOImageMode>(xmlReader.text().toInt());
|
||||
}
|
||||
else if (xmlReader.name() == "IsRight") {
|
||||
} else if(xmlReader.name() == "IsRight") {
|
||||
xmlReader.readNext();
|
||||
|
||||
isRight = (xmlReader.text().toString().toLower().compare(u8"true") == 0);
|
||||
}
|
||||
else if (xmlReader.name() == "RefRange") {
|
||||
} else if(xmlReader.name() == "RefRange") {
|
||||
xmlReader.readNext();
|
||||
refRange = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "IncAngle") {
|
||||
} else if(xmlReader.name() == "IncAngle") {
|
||||
xmlReader.readNext();
|
||||
incangle = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "CenterFreq") {
|
||||
} else if(xmlReader.name() == "CenterFreq") {
|
||||
xmlReader.readNext();
|
||||
centerFreq = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "RangeResolution") {
|
||||
} else if(xmlReader.name() == "RangeResolution") {
|
||||
xmlReader.readNext();
|
||||
rangeResolution = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Bandwidth") {
|
||||
} else if(xmlReader.name() == "Bandwidth") {
|
||||
xmlReader.readNext();
|
||||
bandwidth = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Startfreq") {
|
||||
} else if(xmlReader.name() == "Startfreq") {
|
||||
xmlReader.readNext();
|
||||
startfreq = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Endfreq") {
|
||||
} else if(xmlReader.name() == "Endfreq") {
|
||||
xmlReader.readNext();
|
||||
endfreq = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Freqpoints") {
|
||||
} else if(xmlReader.name() == "Freqpoints") {
|
||||
xmlReader.readNext();
|
||||
freqpoints = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "X_min") {
|
||||
} else if(xmlReader.name() == "X_min") {
|
||||
xmlReader.readNext();
|
||||
x_min = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "X_max") {
|
||||
} else if(xmlReader.name() == "X_max") {
|
||||
xmlReader.readNext();
|
||||
x_max = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Y_min") {
|
||||
} else if(xmlReader.name() == "Y_min") {
|
||||
xmlReader.readNext();
|
||||
y_min = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Y_max") {
|
||||
} else if(xmlReader.name() == "Y_max") {
|
||||
xmlReader.readNext();
|
||||
y_max = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Z_plane") {
|
||||
} else if(xmlReader.name() == "Z_plane") {
|
||||
xmlReader.readNext();
|
||||
z_plane = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Imageheight") {
|
||||
} else if(xmlReader.name() == "Imageheight") {
|
||||
xmlReader.readNext();
|
||||
imageheight = xmlReader.text().toInt();
|
||||
}
|
||||
else if (xmlReader.name() == "Imagewidth") {
|
||||
} else if(xmlReader.name() == "Imagewidth") {
|
||||
xmlReader.readNext();
|
||||
imagewidth = xmlReader.text().toInt();
|
||||
}
|
||||
else if (xmlReader.name() == "PRFCount") {
|
||||
} else if(xmlReader.name() == "PRFCount") {
|
||||
xmlReader.readNext();
|
||||
prfcount = xmlReader.text().toInt();
|
||||
}
|
||||
else if (xmlReader.name() == "Start_x") {
|
||||
} else if(xmlReader.name() == "Start_x") {
|
||||
xmlReader.readNext();
|
||||
start_x = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "End_x") {
|
||||
} else if(xmlReader.name() == "End_x") {
|
||||
xmlReader.readNext();
|
||||
end_x = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Start_y") {
|
||||
} else if(xmlReader.name() == "Start_y") {
|
||||
xmlReader.readNext();
|
||||
start_y = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "End_y") {
|
||||
} else if(xmlReader.name() == "End_y") {
|
||||
xmlReader.readNext();
|
||||
end_y = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Start_z") {
|
||||
} else if(xmlReader.name() == "Start_z") {
|
||||
xmlReader.readNext();
|
||||
start_z = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "End_z") {
|
||||
} else if(xmlReader.name() == "End_z") {
|
||||
xmlReader.readNext();
|
||||
end_z = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Start_az_angle") {
|
||||
} else if(xmlReader.name() == "Start_az_angle") {
|
||||
xmlReader.readNext();
|
||||
start_az_angle = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "End_az_angle") {
|
||||
} else if(xmlReader.name() == "End_az_angle") {
|
||||
xmlReader.readNext();
|
||||
end_az_angle = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Start_circle_angle") {
|
||||
} else if(xmlReader.name() == "Start_circle_angle") {
|
||||
xmlReader.readNext();
|
||||
start_circle_angle = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "End_circle_angle") {
|
||||
} else if(xmlReader.name() == "End_circle_angle") {
|
||||
xmlReader.readNext();
|
||||
end_circle_angle = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "Delta_angle") {
|
||||
} else if(xmlReader.name() == "Delta_angle") {
|
||||
xmlReader.readNext();
|
||||
delta_angle = xmlReader.text().toDouble();
|
||||
}
|
||||
else if (xmlReader.name() == "AntennaRadiationFileName") {
|
||||
} else if(xmlReader.name() == "AntennaRadiationFileName") {
|
||||
xmlReader.readNext();
|
||||
AntennaRadiationFileName = xmlReader.text().toString();
|
||||
}
|
||||
else if (xmlReader.name() == "FarsourceThetaPoints") {
|
||||
} else if(xmlReader.name() == "FarsourceThetaPoints") {
|
||||
xmlReader.readNext();
|
||||
farsource_thetaPoints = xmlReader.text().toLong();
|
||||
}
|
||||
else if (xmlReader.name() == "FarsourcePhiPoints") {
|
||||
} else if(xmlReader.name() == "FarsourcePhiPoints") {
|
||||
xmlReader.readNext();
|
||||
farsource_phiPoints = xmlReader.text().toLong();
|
||||
}
|
||||
|
|
@ -1040,7 +976,7 @@ void FEKOBase::FEKOSimulationDataparams::loadXml(const QString& fileName) {
|
|||
file.close();
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationDataparams::saveXml(const QString& fileName) {
|
||||
void FEKOBase::FEKOSimulationDataparams::saveXml(const QString &fileName) {
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
QMessageBox::warning(nullptr, "warning", "File not open");
|
||||
|
|
@ -1086,40 +1022,25 @@ void FEKOBase::FEKOSimulationDataparams::saveXml(const QString& fileName) {
|
|||
xmlWriter.writeTextElement("FarsourceThetaPoints", QString::number(farsource_thetaPoints));
|
||||
xmlWriter.writeTextElement("FarsourcePhiPoints", QString::number(farsource_phiPoints));
|
||||
|
||||
|
||||
|
||||
xmlWriter.writeEndElement(); // 关闭FEKOSimulationDataparams元素
|
||||
xmlWriter.writeEndDocument();
|
||||
|
||||
file.close();
|
||||
|
||||
|
||||
}
|
||||
|
||||
FEKOBase::FEKOSimulationDataparamsHandler::FEKOSimulationDataparamsHandler()
|
||||
{
|
||||
FEKOBase::FEKOSimulationDataparamsHandler::FEKOSimulationDataparamsHandler() {}
|
||||
|
||||
}
|
||||
FEKOBase::FEKOSimulationDataparamsHandler::~FEKOSimulationDataparamsHandler() {}
|
||||
|
||||
FEKOBase::FEKOSimulationDataparamsHandler::~FEKOSimulationDataparamsHandler()
|
||||
{
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationDataparamsHandler::setFEKOSimulationDataparams(FEKOBase::FEKOSimulationDataparams* simulationparams)
|
||||
{
|
||||
void FEKOBase::FEKOSimulationDataparamsHandler::setFEKOSimulationDataparams(
|
||||
FEKOBase::FEKOSimulationDataparams *simulationparams) {
|
||||
this->simulationparams = simulationparams;
|
||||
this->bandingsetFEKOSimulationDataparams();
|
||||
}
|
||||
|
||||
FEKOBase::FEKOSimulationDataparams* FEKOBase::FEKOSimulationDataparamsHandler::getFEKOSimulationDataparams()
|
||||
{
|
||||
FEKOBase::FEKOSimulationDataparams *
|
||||
FEKOBase::FEKOSimulationDataparamsHandler::getFEKOSimulationDataparams() {
|
||||
return this->simulationparams;
|
||||
}
|
||||
|
||||
void FEKOBase::FEKOSimulationDataparamsHandler::bandingsetFEKOSimulationDataparams()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FEKOBase::FEKOSimulationDataparamsHandler::bandingsetFEKOSimulationDataparams() {}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ struct Landpoint // 点 SAR影像的像素坐标;
|
|||
double ati; // 高程z ati pixel_time
|
||||
};
|
||||
struct Point_3d {
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
double x=0;
|
||||
double y=0;
|
||||
double z=0;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
ImageShowDialogClass ::ImageShowDialogClass(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
ui=new Ui::ImageShowDialogClass;
|
||||
ui->setupUi(this);
|
||||
ui->m_plot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
|
||||
connect(this->ui->m_plot, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(updateCursor(QMouseEvent*)));
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ void LAMPDataShowClass::on_action_openfile_envi_complex_triggered()
|
|||
|
||||
void LAMPDataShowClass::load_complex_data(QString path)
|
||||
{
|
||||
DebugInfo("LAMPDataShowClass::load_complex_data");
|
||||
DebugInfo("LAMPDataShowClass::load_complex_data\n");
|
||||
ComplexDataShowNode* node = new ComplexDataShowNode();
|
||||
node->bangdindWindows(this);
|
||||
node->TaskXmlPath = path;
|
||||
|
|
@ -105,7 +105,7 @@ void LAMPDataShowClass::load_complex_data(QString path)
|
|||
}
|
||||
else {}
|
||||
node->OpenData(node->TaskXmlPath);
|
||||
this->add_DataTree(node);
|
||||
this->add_DataTree(node); DebugInfo("this->add_DataTree(node)\n");
|
||||
node->ExcuteTask();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,12 +107,14 @@ void LAMPImageCreateClass::on_pushButton_OK_clicked()
|
|||
QString theta_tiff_filepath=this->ui->lineEdit_thetaimagepath->text().trimmed();
|
||||
|
||||
FEKOBase::EchoDataClass data;
|
||||
qDebug()<<"theta EchoData loading start !!! EchoData File : "<<thetafileptah;
|
||||
data.loadEchoData(thetafileptah);
|
||||
qDebug()<<"theta EchoData loading finish !!! EchoData File : "<<thetafileptah;
|
||||
if (this->simulationparams&&(this->simulationparams->imagemode==FEKOBase::FEKOImageMode::Strip|| this->simulationparams->imagemode == FEKOBase::FEKOImageMode::Scane)) {
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, theta_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_FREQ,FEKOBase::ImageAlgWindowFun::HANMMING);
|
||||
}
|
||||
else {
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, theta_tiff_filepath);
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, theta_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_FREQ);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -125,13 +127,15 @@ void LAMPImageCreateClass::on_pushButton_OK_clicked()
|
|||
QString phi_tiff_filepath = this->ui->lineEdit_phiimagepath->text().trimmed();
|
||||
|
||||
FEKOBase::EchoDataClass data;
|
||||
qDebug()<<"theta EchoData loading start !!! EchoData File : "<<phifileptah;
|
||||
data.loadEchoData(phifileptah);
|
||||
qDebug()<<"phi EchoData loading finish !!! EchoData File : "<<phifileptah;
|
||||
//FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath);
|
||||
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 {
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath);
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_FREQ);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ namespace WBFZ
|
|||
|
||||
void PointCloudThreadBase::defaultMeshFinished()
|
||||
{
|
||||
ModuleBase::ThreadTask::threadTaskFinished();
|
||||
Py::PythonAgent::getInstance()->unLock();
|
||||
|
||||
if (_threadRuning)
|
||||
{
|
||||
|
|
@ -40,23 +42,42 @@ namespace WBFZ
|
|||
{
|
||||
if (_success)
|
||||
{
|
||||
emit _mainwindow->updateMeshTreeSig();
|
||||
emit _mainwindow->updateSetTreeSig();
|
||||
emit _mainwindow->updateActionStatesSig();
|
||||
// emit _mainwindow->updateActionsStatesSig();
|
||||
emit _mainwindow->getSubWindowManager()->openPreWindowSig();
|
||||
emit _mainwindow->updatePreMeshActorSig();
|
||||
// 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;
|
||||
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);
|
||||
|
||||
QFileInfo info(_fileName);
|
||||
QString name = info.fileName();
|
||||
QString path = info.filePath();
|
||||
QString suffix = info.suffix().toLower();
|
||||
if(info.exists()){
|
||||
if(suffix.toLower().contains("pcd")){
|
||||
suffix="Point Cloud Data(*.pcd)";
|
||||
emit _mainwindow->importPclSIGN(_fileName,suffix,-1);
|
||||
}else if(suffix.toLower().contains("ply")){
|
||||
suffix="Polygon File Format(*.ply)";
|
||||
emit _mainwindow->importPclSIGN(_fileName,suffix,-1);
|
||||
}else{
|
||||
information = QString("Failed Filter From \"%1\"").arg(_fileName);
|
||||
msg.type = Common::Message::Error;
|
||||
msg.message = information;
|
||||
}
|
||||
}
|
||||
|
||||
// auto meshdata = MeshData::MeshData::getInstance();
|
||||
// // meshdata->generateDisplayDataSet();
|
||||
// const int nk = meshdata->getKernalCount();
|
||||
// if (nk <= 0)
|
||||
// return;
|
||||
// auto k = meshdata->getKernalAt(nk - 1);
|
||||
// if (k != nullptr)
|
||||
// k->setPath(_fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -65,11 +86,11 @@ namespace WBFZ
|
|||
msg.message = information;
|
||||
}
|
||||
}else{}
|
||||
emit showInformation(information);
|
||||
emit _mainwindow->printMessageToMessageWindow(msg);
|
||||
}
|
||||
// emit showInformation(information);
|
||||
// emit _mainwindow->printMessageToMessageWindow(msg);
|
||||
ModuleBase::ThreadTask::threadTaskFinished();
|
||||
Py::PythonAgent::getInstance()->unLock();
|
||||
}
|
||||
void PointCloudThreadBase::setThreadRunState(bool flag){
|
||||
_success= flag;
|
||||
|
|
@ -100,39 +121,11 @@ namespace WBFZ
|
|||
}
|
||||
bool PointCloudThreadBase::filtertaskProcess()
|
||||
{
|
||||
vtkDataSet* dataset=filter();
|
||||
QFileInfo info(_fileName);
|
||||
QString name = info.fileName();
|
||||
QString path = info.filePath();
|
||||
QString suffix = info.suffix().toLower();
|
||||
DebugInfo("dataset %d \n",dataset== nullptr);
|
||||
// 保存流程文件
|
||||
if (dataset != nullptr) {
|
||||
MeshData::MeshKernal* k = new MeshData::MeshKernal;
|
||||
k->setName(name);
|
||||
k->setPath(path);
|
||||
auto meshData =MeshData::MeshData::getInstance();
|
||||
int nKernal = meshData->getKernalCount();
|
||||
for(int iKernal = 0; iKernal < nKernal; ++iKernal) {
|
||||
MeshData::MeshKernal* temp = meshData->getKernalAt(iKernal);
|
||||
if(temp->getPath() == path) { ///< MG same file update
|
||||
meshData->removeKernalAt(iKernal);
|
||||
break;
|
||||
return filter();
|
||||
}
|
||||
}
|
||||
|
||||
k->setMeshData(dataset);
|
||||
meshData->appendMeshKernal(k);
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
vtkDataSet* PointCloudThreadBase::filter()
|
||||
bool PointCloudThreadBase::filter()
|
||||
{
|
||||
return nullptr;
|
||||
return false;
|
||||
}
|
||||
vtkDataSet* PointCloudThreadBase::remesh()
|
||||
{
|
||||
|
|
@ -171,5 +164,38 @@ namespace WBFZ
|
|||
|
||||
return false;
|
||||
}
|
||||
bool PointCloudThreadBase::saveFilterResultFile(pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_filtered)
|
||||
{
|
||||
QString filepath=_fileName;
|
||||
// 加载文件
|
||||
QFile infile(_fileName);
|
||||
if(infile.exists()){
|
||||
infile.remove();
|
||||
}
|
||||
|
||||
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(filepath);
|
||||
|
||||
|
||||
std::string outFileName=ba.data();
|
||||
if (suffix == "pcd")
|
||||
{
|
||||
pcl::io::savePCDFileBinary(outFileName,*cloud_filtered);
|
||||
QFile outfile(filepath);
|
||||
return outfile.exists();
|
||||
}
|
||||
else if (suffix == "ply")
|
||||
{
|
||||
pcl::io::savePLYFileBinary(outFileName,*cloud_filtered);
|
||||
QFile outfile(filepath);
|
||||
return outfile.exists();
|
||||
}
|
||||
else{}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef _MESHTHREADBASE_H_
|
||||
#define _MESHTHREADBASE_H_
|
||||
|
||||
#include <pcl/point_cloud.h>
|
||||
#include <pcl/impl/point_types.hpp>
|
||||
#include "ModuleBase/ThreadTask.h"
|
||||
#include "WBFZExchangePluginAPI.h"
|
||||
#include "WBFZExchangePlugin.h"
|
||||
|
|
@ -30,8 +32,9 @@ namespace WBFZ
|
|||
virtual void run();
|
||||
void defaultMeshFinished();
|
||||
void setThreadRunState(bool);
|
||||
bool saveFilterResultFile(pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_filtered);
|
||||
public:
|
||||
virtual vtkDataSet* filter();
|
||||
virtual bool filter();
|
||||
virtual bool filtertaskProcess();
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -9,8 +9,20 @@
|
|||
#include <QDebug>
|
||||
#include "SharedModuleLib/ProcessOn.h"
|
||||
|
||||
|
||||
AbstractTableModel::AbstractTableModel(QObject* parent ):QAbstractTableModel(parent)
|
||||
{}
|
||||
|
||||
AbstractTableModel::~AbstractTableModel(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
FEKOResultCsvTableModel::FEKOResultCsvTableModel(QObject* parent)
|
||||
:AbstractTableModel(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
FEKOResultCsvTableModel::~FEKOResultCsvTableModel()
|
||||
|
|
|
|||
|
|
@ -8,8 +8,13 @@
|
|||
#include <QStringList>
|
||||
#include <QVector>
|
||||
|
||||
class AbstractTableModel :public QAbstractTableModel {
|
||||
class AbstractTableModel : public QAbstractTableModel {
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
AbstractTableModel(QObject* parent = nullptr);
|
||||
~AbstractTableModel();
|
||||
|
||||
public:
|
||||
virtual void loadFilePath(QString csvPath); // 加载csv数据
|
||||
virtual void saveFilePath();
|
||||
|
|
@ -17,22 +22,20 @@ public:
|
|||
virtual QString getCSVPath();
|
||||
};
|
||||
|
||||
|
||||
// FKEOResult.csv 表格对应类 2023.07.25 重写类
|
||||
class FEKOResultCsvTableModel :public AbstractTableModel {
|
||||
class FEKOResultCsvTableModel : public AbstractTableModel {
|
||||
Q_OBJECT;
|
||||
|
||||
private:
|
||||
QStringList m_hor_hedlbls; // headerlabels
|
||||
QStringList m_vec_hedlbls; // oids - map.keys()
|
||||
QVector<QVector<QVariant>> m_data_map;
|
||||
QVector<QPair<int, int> > m_highlight_indexs; // 背景高亮的indexs
|
||||
QVector<QPair<int, int>> m_highlight_indexs; // 背景高亮的indexs
|
||||
QVector<QVector<QColor>> colorData;
|
||||
QString csvPath;
|
||||
|
||||
public:
|
||||
|
||||
explicit FEKOResultCsvTableModel(QObject* parent = NULL);
|
||||
explicit FEKOResultCsvTableModel(QObject* parent = nullptr);
|
||||
~FEKOResultCsvTableModel();
|
||||
|
||||
virtual void loadFilePath(QString csvPath); // 加载csv数据
|
||||
|
|
@ -50,7 +53,7 @@ public:
|
|||
// tableview 表格模型操作
|
||||
void SetData(const QVector<QVector<QVariant>>& map, QStringList& colnames, QStringList& rowIds);
|
||||
|
||||
void setHignlightIndex(QVector< QPair<int, int> > vec_index);
|
||||
void setHignlightIndex(QVector<QPair<int, int>> vec_index);
|
||||
|
||||
virtual Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
|
|
@ -59,7 +62,7 @@ public:
|
|||
virtual int columnCount(const QModelIndex& parent) const;
|
||||
|
||||
virtual QVariant data(const QModelIndex& index, int role) const;
|
||||
virtual bool setData(const QModelIndex& index, const QVariant& value, int role=2);
|
||||
virtual bool setData(const QModelIndex& index, const QVariant& value, int role = 2);
|
||||
|
||||
QString itemText(int row, int column) const;
|
||||
QString itemText(const QModelIndex& index) const;
|
||||
|
|
@ -82,8 +85,6 @@ public:
|
|||
|
||||
signals:
|
||||
void itemChanged(const QModelIndex& index, const QVariant& value);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ namespace WBFZ {
|
|||
{
|
||||
_describe = "WBFZExchangePlugin Installed Successfully";
|
||||
_mainwindow = m;
|
||||
|
||||
// 点云操作
|
||||
connect(_mainwindow, SIGNAL(on_pclStatisticalRemoveFilter(GUI::MainWindow*)), this,
|
||||
SLOT(pclStatisticalRemoveFilter(GUI::MainWindow*)));
|
||||
connect(_mainwindow, SIGNAL(on_pclRadiusOutlierRemoval(GUI::MainWindow*)), this,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include <QtCore/QtGlobal>
|
||||
|
||||
// 定义 远场条件下的默认参考斜距
|
||||
#define CIRCLESARREFRANGE 90000
|
||||
|
||||
#if defined(WBFZ_API)
|
||||
#define WBFZAPI Q_DECL_EXPORT
|
||||
|
|
|
|||
Loading…
Reference in New Issue