diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index d3987a2..c132c9d 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -3,7 +3,5 @@
-
-
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4be9833..1395ad9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,9 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 默认编译动态库
set(BUILD_SHARED_LIBS ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
#-----------------------------------------------------------------------------
@@ -223,7 +226,8 @@ find_package(FFTW3 CONFIG REQUIRED)
find_package(GSL REQUIRED)
#GDAL
find_package(GDAL CONFIG REQUIRED)
-
+#
+find_package(unofficial-sqlite3 CONFIG REQUIRED)
@@ -242,7 +246,7 @@ include_directories(SYSTEM C:/PCL/3rdParty/VTK/include/vtk-9.3)
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)
+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)
find_package(PCL)
include_directories(${PCL_INCLUDE_DIRS})
include_directories(${VCGLIB_INCLUDE_DIRS})
diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake
index 7f5f5a9..e39708e 100644
--- a/cmake/FindPython.cmake
+++ b/cmake/FindPython.cmake
@@ -36,7 +36,7 @@ endif()
set(LAMPCAE_Python_ALREADY_INCLUDED 1)
set(Python_VERSION_MAJOR 3)
-set(Python_VERSION_MINOR 7)
+set(Python_VERSION_MINOR 9)
set(Python_VERSION_PATCH 0)
# find_path 搜索包含某个文件的路径
# 如果在某个路径下发现了该文件,该结果会被存储到该变量中;如果没有找到,存储的结果将会是-NOTFOUND
@@ -149,4 +149,5 @@ find_package_handle_standard_args(Python
Python_EXECUTABLE
VERSION_VAR
Python_VERSION
-)
\ No newline at end of file
+)
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e4f8a9d..7b03bf8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -6,8 +6,8 @@ set(SOVERSION ${PROJECT_VERSION} ${PROJECT_VERSION_MAJOR} ${PROJECT_VERSION_MINO
#-----------------------------------------------------------------------------
list(APPEND _libraries Common PythonModule SARibbonBar Settings DataProperty MeshData SelfDefObject Material Geometry BCBase ConfigOptions ParaClassFactory ModelData ModuleBase PostAlgorithm PostRenderData PostInterface PostCurveDataManager PostPlotWidget PostWidgets GeometryDataExchange ProjectTree ProjectTreeExtend GeometryCommand GeometryWidgets PluginManager GmshModule IO SolverControl MainWidgets UserGuidence)
list(APPEND _libraries PointCloudOperator )
-list(APPEND _libraries json qcustomplot qhexedit qscintilla2 LAMPTool WBCLFZSystemModule )
-list(APPEND _libraries PluginMotorBike )
+list(APPEND _libraries json qcustomplot qhexedit qscintilla2 )
+
#[[if(_WIN_)
list(APPEND _libraries XGenerateReport License)
endif()]]
@@ -29,8 +29,11 @@ file(TO_NATIVE_PATH "${_rpath}/${INSTALL_LIBDIR}" _lib_rpath)
# 遗漏两个,临时解决方案
list(APPEND LAMPCAE_Runtimes_Libraries VTK::loguru VTK::gl2ps Qt5::DBus VTK::IOChemistry )
-list(APPEND LAMPCAE_Runtimes_Libraries Qt5::Qml )
-
+list(APPEND LAMPCAE_Runtimes_Libraries Qt5::Qml Qt5::Network )
+list(APPEND LAMPCAE_Runtimes_Libraries
+ OpenCASCADE::TKOpenGl OpenCASCADE::TKOffset OpenCASCADE::TKSTL OpenCASCADE::Freetype OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::TKBool OpenCASCADE::TKCAF OpenCASCADE::TKCDF OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKHLR OpenCASCADE::TKIGES OpenCASCADE::TKLCAF OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKPrim OpenCASCADE::TKSTEP OpenCASCADE::TKSTEP209 OpenCASCADE::TKSTEPAttr OpenCASCADE::TKSTEPBase OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKVCAF OpenCASCADE::TKXCAF OpenCASCADE::TKXDEIGES OpenCASCADE::TKXSBase OpenCASCADE::TKernel Qt5::Widgets Qt5::Xml VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::FiltersStatistics VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ImagingMath VTK::InteractionStyle VTK::ParallelCore VTK::ParallelDIY VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib VTK::IOGeometry
+ VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::FiltersStatistics VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ImagingMath VTK::InteractionStyle VTK::ParallelCore VTK::ParallelDIY VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib VTK::IOGeometry
+)
foreach(_library ${_libraries})
@@ -66,7 +69,7 @@ install(
LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT lib
)
-list(APPEND _plugins PluginCustomizer PluginMeshDataExchange PluginWBFZExchangePlugin)
+list(APPEND _plugins PluginCustomizer PluginMeshDataExchange PluginWBFZExchangePlugin PluginMotorBike)
foreach(_plugin ${_plugins})
list(APPEND LAMPCAE_Runtimes_Libraries ${LAMPCAE_${_plugin}_Runtimes_Libraries})
diff --git a/src/LAMPCAE/CMakeLists.txt b/src/LAMPCAE/CMakeLists.txt
index 4a5c0aa..c9e1c2c 100644
--- a/src/LAMPCAE/CMakeLists.txt
+++ b/src/LAMPCAE/CMakeLists.txt
@@ -32,6 +32,8 @@ set_property(DIRECTORY ${CMAKE_SOURCE_DIR}
)
list(APPEND _depend_library Common PythonModule SARibbonBar Settings DataProperty MeshData Material Geometry ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GmshModule PostInterface PostWidgets ProjectTree GeometryCommand GeometryWidgets IO SolverControl MainWidgets UserGuidence MainWindow)
+list(APPEND _depend_library )
+
if(_WIN_)
#list(APPEND _depend_library XGenerateReport License)
endif()
diff --git a/src/LAMPTool/BackScatterModel.h b/src/LAMPTool/BackScatterModel.h
deleted file mode 100644
index 6fe85c3..0000000
--- a/src/LAMPTool/BackScatterModel.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#pragma once
-#ifndef _BACKSCATTERMODEL_H_
-#define _BACKSCATTERMODEL_H_
-
-
-#include "LAMPToolAPI.h"
-#include
-#include
-#include "LAMPToolAPI.h"
-
-double LAMPTOOLAPI MuhlemanSimulationBackScatter(double incidentAngle);
-Eigen::MatrixXd LAMPTOOLAPI MuhlemanSimulationBackScatter(Eigen::MatrixXd incidentAngle);
-
-
-#endif
-
-
-
-
-
diff --git a/src/LAMPTool/CMakeLists.txt b/src/LAMPTool/CMakeLists.txt
deleted file mode 100644
index 63de74e..0000000
--- a/src/LAMPTool/CMakeLists.txt
+++ /dev/null
@@ -1,147 +0,0 @@
-#-----------------------------------------------------------------------------
-# 头文件搜索路径
-#-----------------------------------------------------------------------------
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
-
-# boost
-include_directories(D:/vcpkg/installed/x64-windows/include)
-
-# pcl
-include_directories(C:/PCL/3rdParty/FLANN/include)
-include_directories(C:/PCL/3rdParty/VTK/include/vtk-9.3)
-include_directories(C:/PCL/include/pcl-1.14)
-
-# FindOpenCASCADE
-include_directories(${OpenCASCADE_INCLUDE_DIRS})
-
-# qt5
-include_directories(C:/Qt/5.15.2/msvc2019_64/include/QtQml)
-
-# json
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../json)
-
-# qscintilla2
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/lexers)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/include)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/lexlib)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/Qt4Qt5)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/src)
-
-# lamptool
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../LAMPTool)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../LAMPTool/include)
-
-# qcustomplot
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qcustomplot)
-
-# qhexedit
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qhexedit)
-
-
-# 内部结构
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/SqliteDBProcess/src)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/modelProcess)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/EchoShowProcess)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/OCCViewer)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/PointCloudProcess)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/SharedModuleLib)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/TableProcess)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/TaskXml)
-
-
-#-----------------------------------------------------------------------------
-# 链接库
-#-----------------------------------------------------------------------------
-
-# pcl
-link_directories("C:/PCL/3rdParty/FLANN/lib")
-link_directories("C:/VTK/lib")
-link_directories("C:/PCL/lib")
-
-#
-
-
-#-----------------------------------------------------------------------------
-# 自动添加include目录
-#-----------------------------------------------------------------------------
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-find_package(Qt5 REQUIRED COMPONENTS Core Quick Sql Core Xml Opengl Gui Svg Xmlpatterns Uitools Widgets Qml Printsupport Sensors Quickwidgets Quick Concurrent Openglextensions Charts Datavisualization)
-find_package(PCL)
-include_directories(${PCL_INCLUDE_DIRS})
-link_directories(${PCL_LIBRARY_DIRS})
-add_definitions(${PCL_DEFINITIONS})
-
-
-
-#-----------------------------------------------------------------------------
-# 添加资源文件
-#-----------------------------------------------------------------------------
-set(_qrc "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/WBCLFZSystemModule.qrc")
-set(_qrc "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/qianfan.qrc")
-set(_lang "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/translations.qrc")
-qt5_add_resources(_resource ${_qrc} ${_lang})
-
-#-----------------------------------------------------------------------------
-# 源码扫描
-#-----------------------------------------------------------------------------
-file(GLOB_RECURSE _ui "*.ui" )
-file(GLOB_RECURSE _header "*.h" )
-file(GLOB_RECURSE _source "*.cpp" )
-qt5_wrap_ui(_interface ${_ui})
-
-#-----------------------------------------------------------------------------
-# 添加动态库目标 -- 这是输出lib库,
-#-----------------------------------------------------------------------------
-add_library(LAMPTool STATIC
- ${_resource}
- ${_interface}
- ${_header}
- ${_source}
-)
-
-#-----------------------------------------------------------------------------
-# 添加接口声明宏
-#-----------------------------------------------------------------------------
-target_compile_definitions(LAMPTool PUBLIC LAMPTOOL_API)
-
-#-----------------------------------------------------------------------------
-# 安装Qt的依赖文件
-#-----------------------------------------------------------------------------
-get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
-get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
-
-
-
-list(APPEND _depend_library qcustomplot)
-
-list(APPEND _runtimes_libraries
- Qt5::Core Qt5::Gui Qt5::Widgets Qt5::DBus Qt5::Core Qt5::Xml Qt5::OpenGL Qt5::Gui Qt5::Svg Qt5::Widgets Qt5::Qml Qt5::DataVisualization Qt5::Charts Qt5::PrintSupport
-)
-
-list(APPEND _runtimes_libraries
- OpenCASCADE::TKOpenGl OpenCASCADE::Freetype OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::TKBool OpenCASCADE::TKCAF OpenCASCADE::TKCDF OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKHLR OpenCASCADE::TKIGES OpenCASCADE::TKLCAF OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKPrim OpenCASCADE::TKSTEP OpenCASCADE::TKSTEP209 OpenCASCADE::TKSTEPAttr OpenCASCADE::TKSTEPBase OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKVCAF OpenCASCADE::TKXCAF OpenCASCADE::TKXDEIGES OpenCASCADE::TKXSBase OpenCASCADE::TKernel Qt5::Widgets Qt5::Xml VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::FiltersStatistics VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ImagingMath VTK::InteractionStyle VTK::ParallelCore VTK::ParallelDIY VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib VTK::IOGeometry
-)
-
-target_include_directories(LAMPTool PRIVATE ${Qwt_INCLUDE_DIRS})
-
-#-----------------------------------------------------------------------------
-# 链接依赖库
-#-----------------------------------------------------------------------------
-target_link_libraries(LAMPTool PRIVATE
- ${_runtimes_libraries}
- ${_depend_library}
- ${PCL_LIBRARIES}
- FFTW3::fftw3
- GSL::gsl GSL::gslcblas
-)
-
-#-----------------------------------------------------------------------------
-# 添加依赖关系
-#-----------------------------------------------------------------------------
-add_dependencies(LAMPTool ${_depend_library})
-
-#-----------------------------------------------------------------------------
-# 添加运行时依赖关系
-#-----------------------------------------------------------------------------
-set(LAMPCAE_LAMPTool_Runtimes_Libraries ${_runtimes_libraries} PARENT_SCOPE)
diff --git a/src/LAMPTool/FileOperator.h b/src/LAMPTool/FileOperator.h
deleted file mode 100644
index ed76fd1..0000000
--- a/src/LAMPTool/FileOperator.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#pragma once
-
-#ifndef FILEOPERATOR_H
-#define FILEOPERATOR_H
-
-#include "../LAMPTool/referenceHeader.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-bool LAMPTOOLAPI isDirectory(const QString& path);
-bool LAMPTOOLAPI isExists(const QString& path);
-bool LAMPTOOLAPI isFile(const QString& path);
-void LAMPTOOLAPI removeFile(const QString& filePath);
-unsigned long LAMPTOOLAPI convertToULong(const QString& input);
-///
-/// 获取文件(绝对路径)
-///
-///
-///
-///
-std::vector LAMPTOOLAPI getFilelist(const QString& folderpath, const QString& FilenameExtension = ".*",int (*logfun)(QString logtext,int value)=nullptr);
-
-QString LAMPTOOLAPI getParantFolderNameFromPath(const QString& path);
-
-QString LAMPTOOLAPI getFileNameFromPath(const QString& path);
-
-int LAMPTOOLAPI write_binfile(char* filepath, char* data, size_t data_len);
-
-LAMPTOOLAPI char* read_textfile(char* text_path, int* length);
-
-bool LAMPTOOLAPI exists_test(const QString& name);
-
-size_t LAMPTOOLAPI fsize(FILE* fp);
-
-QString LAMPTOOLAPI getParantFromPath(const QString& path);
-void LAMPTOOLAPI copyFile(const QString& sourcePath, const QString& destinationPath);
-// QT FileOperator
-#endif
\ No newline at end of file
diff --git a/src/LAMPTool/GeoOperator.h b/src/LAMPTool/GeoOperator.h
deleted file mode 100644
index 6353971..0000000
--- a/src/LAMPTool/GeoOperator.h
+++ /dev/null
@@ -1,111 +0,0 @@
-#pragma once
-
-
-#ifndef _GEOOPERATOR_H
-#define _GEOOPERATOR_H
-#include "LAMPToolAPI.h"
-#include "BaseConstVariable.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-///
-/// 三维向量,坐标表达
-///
-struct Landpoint // 点 SAR影像的像素坐标;
-{
- ///
- /// 经度x
- ///
- double lon; // 经度x lon pixel_col
- ///
- /// 纬度y
- ///
- double lat; // 纬度y lat pixel_row
- ///
- /// 高度z
- ///
- double ati; // 高程z ati pixel_time
-};
-struct Point_3d {
- double x;
- double y;
- double z;
-};
-
-///
-/// 将经纬度转换为地固参心坐标系
-///
-/// 经纬度点--degree
-/// 投影坐标系点
-Landpoint LAMPTOOLAPI LLA2XYZ(const Landpoint& LLA);
-Eigen::MatrixXd LAMPTOOLAPI LLA2XYZ(Eigen::MatrixXd landpoint);
-
-///
-/// 将地固参心坐标系转换为经纬度
-///
-/// 固参心坐标系
-/// 经纬度--degree
-Landpoint LAMPTOOLAPI XYZ2LLA(const Landpoint& XYZ);
-
-
-Landpoint LAMPTOOLAPI operator +(const Landpoint& p1, const Landpoint& p2);
-
-Landpoint LAMPTOOLAPI operator -(const Landpoint& p1, const Landpoint& p2);
-
-bool LAMPTOOLAPI operator ==(const Landpoint& p1, const Landpoint& p2);
-
-Landpoint LAMPTOOLAPI operator *(const Landpoint& p, double scale);
-
-double LAMPTOOLAPI getAngle(const Landpoint& a, const Landpoint& b);
-
-double LAMPTOOLAPI dot(const Landpoint& p1, const Landpoint& p2);
-
-double LAMPTOOLAPI getlength(const Landpoint& p1);
-
-Landpoint LAMPTOOLAPI crossProduct(const Landpoint& a, const Landpoint& b);
-
-
-Landpoint LAMPTOOLAPI getSlopeVector(const Landpoint& p0, const Landpoint& p1, const Landpoint& p2, const Landpoint& p3, const Landpoint& p4);
-
-
-
-float LAMPTOOLAPI cross2d(Point_3d a, Point_3d b);
-
-Point_3d LAMPTOOLAPI operator -(Point_3d a, Point_3d b);
-
-Point_3d LAMPTOOLAPI operator +(Point_3d a, Point_3d b);
-
-double LAMPTOOLAPI operator /(Point_3d a, Point_3d b);
-
-
-
-// 矢量计算
-struct Vector3D {
- double x, y, z;
-};
-
-// 计算两点之间的距离
-double LAMPTOOLAPI distance(const Vector3D& p1, const Vector3D& p2);
-// 计算点到直线的最短距离
-double LAMPTOOLAPI pointToLineDistance(const Vector3D& point, const Vector3D& linePoint, const Vector3D& lineDirection);
-
-
-struct CartesianCoordinates {
- double x, y, z;
-};
-
-struct SphericalCoordinates {
- double r, theta, phi;
-};
-
-SphericalCoordinates LAMPTOOLAPI cartesianToSpherical(const CartesianCoordinates& cartesian);
-
-CartesianCoordinates LAMPTOOLAPI sphericalToCartesian(const SphericalCoordinates& spherical);
-
-
-#endif
\ No newline at end of file
diff --git a/src/LAMPTool/LAMPToolAPI.h b/src/LAMPTool/LAMPToolAPI.h
deleted file mode 100644
index f27183a..0000000
--- a/src/LAMPTool/LAMPToolAPI.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _LAMPTOOLAPI_H_
-#define _LAMPTOOLAPI_H_
-
-#include
-
-
-#if defined(LAMPTOOL_API)
-#define LAMPTOOLAPI Q_DECL_EXPORT
-#else
-#define LAMPTOOLAPI Q_DECL_IMPORT
-#endif
-
-#endif
diff --git a/src/LAMPTool/OCCTBase.h b/src/LAMPTool/OCCTBase.h
deleted file mode 100644
index 77bf026..0000000
--- a/src/LAMPTool/OCCTBase.h
+++ /dev/null
@@ -1,97 +0,0 @@
-#pragma once
-
-#ifndef OCCTBASELAMP_H
-#define OCCTBASELAMP_H
-#include "LAMPToolAPI.h"
-#include "referenceHeader.h"
-
-
-//====================
-// 系统支持的模型导出类型
-//=====================
-
-enum OCCTShapeType
-{
- STL,
- STEP,
- IGES,
- NoneType,
-};
-
-OCCTShapeType LAMPTOOLAPI str2OCCTShapeType(QString str);
-QStringList LAMPTOOLAPI getOCCTShapeTypeEmnu();
-QString LAMPTOOLAPI getOCCTShapeTypeFilterString();
-QString LAMPTOOLAPI get_STL_FilterString();
-QString LAMPTOOLAPI get_STEP_FilterString();
-QString LAMPTOOLAPI get_IGES_FilterString();
-QString LAMPTOOLAPI getOCCTShapeTypeFilterString(OCCTShapeType t);
-QString LAMPTOOLAPI getOCCTShapeTypeFilterString(QString str);
-
-// 常用静态函数
-bool LAMPTOOLAPI SaveTopoDs_Stl(QString FilePath, const TopoDS_Shape& shape);
-bool LAMPTOOLAPI SaveTopoDs_Step(QString FilePath, const TopoDS_Shape& shape);
-bool LAMPTOOLAPI SaveTopoDs_IGES(QString FilePath,const TopoDS_Shape& shape);
-bool LAMPTOOLAPI SaveTopoDs(QString FilePath,const TopoDS_Shape& shape, OCCTShapeType type);
-
-TopoDS_Shape LAMPTOOLAPI ReadTopoDs_IGES(QString Filepath);
-TopoDS_Shape LAMPTOOLAPI ReadTopoDs_Stl(QString Filepath);
-TopoDS_Shape LAMPTOOLAPI ReadTopoDs_Step(QString Filepath);
-
-OCCTShapeType LAMPTOOLAPI ReadTopoDs_Shape(QString FilePath, TopoDS_Shape& shape_TopoDs);
-
-
-// 模型合并
-TopoDS_Shape LAMPTOOLAPI MergedTopoShape(std::vector TopoDS_Shapelist);
-
-
-// 修改模型显示
-void LAMPTOOLAPI ChangeModelColor(Handle(AIS_Shape)& aisShape, Quantity_Color& redColor);
-
-//// 创建箭头
-TopoDS_Shape LAMPTOOLAPI CreateArrow(const gp_Dir& direction, Standard_Real length, Standard_Real radius);
-//
-
-
-// OCCT 根据向量A和B,计算变换矩阵
-gp_Trsf LAMPTOOLAPI GetTransFormFromVector(const gp_Vec& A, const gp_Vec& B);
-
-
-TopoDS_Shape LAMPTOOLAPI Process_RotationThetaPhi_MoveXYZ(TopoDS_Shape shape, double theta, double phi,double X,double Y,double Z);
-
-
-//TopoDS_Shape Createpyramid(double width=10.0,double depth=5.0, double mouthWidth=1.0, double mouthHeight=0.5, double height = 15.0);
-
-
-
-// 创建一个笛卡尔坐标系
-TopoDS_Shape LAMPTOOLAPI CreateCartesianCoordinatesAxis(double xlength,double ylength,double zlength);
-// 常见模型创建
-TopoDS_Shape LAMPTOOLAPI CreateBox(double x, double y, double z);
-TopoDS_Shape LAMPTOOLAPI CreateCylinder(double radius, double height);
-TopoDS_Shape LAMPTOOLAPI CreateCone(double radius_bottom, double radius_top, double height);
-TopoDS_Shape LAMPTOOLAPI CreateSphere(double radius);
-TopoDS_Shape LAMPTOOLAPI CreateTorus(double majorRadius, double minorRadius);
-
-// 常见模型操作
-TopoDS_Shape LAMPTOOLAPI Cut(TopoDS_Shape& shape1, TopoDS_Shape& shape2);
-TopoDS_Shape LAMPTOOLAPI Fuse(TopoDS_Shape& shape1, TopoDS_Shape& shape2);
-// 常见操作 -- 模型旋转、平移、缩放
-TopoDS_Shape LAMPTOOLAPI Rotate(TopoDS_Shape& shape, gp_Ax1 axis, double angle);
-TopoDS_Shape LAMPTOOLAPI Translate(TopoDS_Shape& shape, gp_Vec move_vec);
-TopoDS_Shape LAMPTOOLAPI Scale(TopoDS_Shape& shape, gp_Pnt refrenceCenter, double scale);
-
-
-// 创建散射体雷达
-// 创建一个坐标原点为圆心的
-TopoDS_Shape LAMPTOOLAPI createConicalHorn(double bottomRadius,double bottomHeight,double topRadius,double topHeight);
-TopoDS_Shape LAMPTOOLAPI createPyramidalHorn(double bottomWidth, double bottomHeight, double bottomAtl, double topWidth, double topHeight, double topAtl);
-
-
-
-
-
-#endif // OCCTBASELAMP_H
-
-
-
-
diff --git a/src/LAMPTool/main.cpp b/src/LAMPTool/main.cpp
deleted file mode 100644
index e0ce4cc..0000000
--- a/src/LAMPTool/main.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-
-#define __TEST_IMAGEPROCESS
-//#define __TESTMATHGL
-//#define __TEST_FARFIELDFILEREADPROCESS
-
-#ifdef __TESTMATHGL
-#include
-int main()
-{
- mglGraph gr;
- gr.FPlot("sin(pi*x)");
- gr.WriteFrame("D:\\codestorage\\LAMPSARtool\\CPluseCpluse\\WBCLFZProgram\\WBCLFZProgram\\test.png");
-}
-
-#endif
-
-
-
-
-#ifdef __TEST_IMAGEPROCESS
-
-
-#include "LAMPTool.h"
-#include
-#include "LampToolTest.h"
-#include "FEKOSimulationSARClass.h"
-#include
-
-
-
-int main(int argc, char* argv[])
-{
-
- QApplication a(argc, argv);
- //LAMPTool w;
- //w.show();
- //a.exec();
- //TestImageBP_main(argc, argv);
-
-
- //====================================
- // 测试FEKO模型加载结果
- //====================================
-
-
- //QString antXmlPath = "D:\\codestorage\\LAMPSARtool\\CPluseCpluse\\WBCLFZProgram\\WBCLFZProgram\\help\\FEKOImageSettingTask.xml";
- //QString echocsvpath = u8"D:\\德清研究院加密\\项目\\项目文档归档\\FEKO知识库\\模型\\远场条带\\ball_001\\ball001_X_strip.csv";
- //QString thetafilepath = "";
- QString phifilepath = u8"D:/codestorage/LAMPSARtool/tmp/antSpace/TESTIMageProject.phi";
- QString tifffilepath = u8"D:/codestorage/LAMPSARtool/tmp/antSpace/TESTIMageProjectImage_phi.dat";
- FEKOBase::FEKOImageSettingParams imageparams{ -2.0, 2.0, -2.0, 2.0, 0.0, 201, 201 };
-
- //FEKOBase::NearFieldEchoCSVParser nearfilePraseclass;
- //nearfilePraseclass.parseCSV(echocsvpath);
- //nearfilePraseclass.toPhiPolar(phifilepath);
-
- FEKOBase::EchoDataClass data;
- data.loadEchoData(phifilepath);
- FEKOBase::FEKOImageProcess(data, imageparams, tifffilepath);
- return 0;
-}
-
-
-
-#endif
-
-
-#ifdef __TEST_FARFIELDFILEREADPROCESS
-#include "LAMPTool.h"
-#include "FEKOBaseToolClass.h"
-#include "FEKOFarFieldFileClass.h"
-#include "FEKOSimulationSARClass.h"
-int main() {
- QString ffe_filepath = u8"D:\\德清研究院加密\\项目\\项目文档归档\\FEKO知识库\\模型\\条带脉冲模型\\trihedral\\ant_SAR_new\\ant_SAR_Move\\ant_SAR_new_Horn_conical1_FarField.ffe";
- FEKOBase::FEKOFarFieldFileClass ffefile;
- std::cout << ffe_filepath.toLocal8Bit().constData()<< std::endl;
- ffefile.parseFarFieldFile(ffe_filepath);
- std::cout << "__TEST_FARFIELDFILEREADPROCESS" << std::endl;
-}
-#endif
\ No newline at end of file
diff --git a/src/LAMPTool/readme.md b/src/LAMPTool/readme.md
deleted file mode 100644
index 671e01a..0000000
--- a/src/LAMPTool/readme.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# 说明
-此模块主要是通用基础模块
\ No newline at end of file
diff --git a/src/MainWidgets/DialogPCLBilateralFilter.cpp b/src/MainWidgets/DialogPCLBilateralFilter.cpp
deleted file mode 100644
index 7afa5ce..0000000
--- a/src/MainWidgets/DialogPCLBilateralFilter.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * @file DialogPCLBilateralFilter.cpp
- * @brief None
- * @author 陈增辉 (3045316072@qq.com)
- * @version 2.5.0
- * @date 2024/4/5
- * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
- */
-
-// You may need to build the project (run Qt uic code generator) to get
-// "ui_DialogPCLBilateralFilter.h" resolved
-
-#include "DialogPCLBilateralFilter.h"
-#include "ui_DialogPCLBilateralFilter.h"
-
-#include "PythonModule/PyAgent.h"
-#include "MeshData/meshSingleton.h"
-#include "MeshData/meshSet.h"
-#include
-#include
-
-
-//auto meshData = MeshData::MeshData::getInstance();
-
-namespace MainWidget {
- DialogPCLBilateralFilter::DialogPCLBilateralFilter(GUI::MainWindow *parent)
- : QFDialog(parent),
- _ui(new Ui::DialogPCLBilateralFilter),
- _mw(parent),
- _selectdlg(new DialogSelectComponents(parent))
- {
- _ui->setupUi(this);
- _ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
- setWindowTitle(tr("Fast Bilateral Filter"));
- _ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
-
-
- connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
- { _selectdlg->clearSelectItems(); _selectdlg->exec(); });
- connect(_selectdlg, SIGNAL(selectedComponentsSig(QList)), this, SLOT(selectedComponentsSlot(QList)));
- connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
-
- }
-
- DialogPCLBilateralFilter::~DialogPCLBilateralFilter()
- {
- delete _ui;
- _ui = NULL;
- delete _selectdlg;
- _selectdlg = NULL;
- }
-
- void DialogPCLBilateralFilter::accept()
- {
- if (_components.size() == 0)
- return;
-
- QString componentIds;
- for (auto component : _components)
- componentIds.append(QString(",%1").arg(component->getID()));
- componentIds.remove(0, 1);
-
- double sigmaS=_ui->SigmaS->value();
- double sigmaR=_ui->SigmaR->value();
-
- emit excuteAlg( componentIds, sigmaR, sigmaS);
-
- QFDialog::accept();
- }
-
- void DialogPCLBilateralFilter::selectedComponentsSlot(QList components)
- {
- for (MeshData::MeshSet *set : components)
- {
- if (_components.contains(set))
- continue;
- _components.append(set);
- _ui->listWidget->addItem(set->getName());
- }
- }
-
- void DialogPCLBilateralFilter::customContextMenuRequestedSlot(const QPoint &point)
- {
- QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
- if (!curItem)
- return;
-
- QMenu *menu = new QMenu(this);
- QAction *deleteItem = new QAction(tr("delete this item"));
- menu->addAction(deleteItem);
- connect(menu, &QMenu::triggered, [=]()
- { removeCurrentItem(curItem); });
- menu->exec(QCursor::pos());
- }
-
- void DialogPCLBilateralFilter::removeCurrentItem(QListWidgetItem *curItem)
- {
- auto meshData = MeshData::MeshData::getInstance();
- auto meshSet = meshData->getMeshSetByName(curItem->text());
- if (!meshSet)
- return;
- _components.removeOne(meshSet);
- _ui->listWidget->removeItemWidget(curItem);
- delete curItem;
- }
-
-
-} // namespace MainWidget
diff --git a/src/MainWidgets/DialogPCLGPMesh.cpp b/src/MainWidgets/DialogPCLGPMesh.cpp
deleted file mode 100644
index 6f90416..0000000
--- a/src/MainWidgets/DialogPCLGPMesh.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * @file DialogPCLGPMesh.cpp
- * @brief None
- * @author 陈增辉 (3045316072@qq.com)
- * @version 2.5.0
- * @date 2024/4/5
- * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
- */
-
-// You may need to build the project (run Qt uic code generator) to get "ui_DialogPCLGPMesh.h"
-// resolved
-
-#include "DialogPCLGPMesh.h"
-#include "ui_DialogPCLGPMesh.h"
-
-#include "PythonModule/PyAgent.h"
-#include "MeshData/meshSingleton.h"
-#include "MeshData/meshSet.h"
-#include
-#include
-
-
-//auto meshData = MeshData::MeshData::getInstance();
-
-namespace MainWidget {
- 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"));
- _ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
-
-
- connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
- { _selectdlg->clearSelectItems(); _selectdlg->exec(); });
- connect(_selectdlg, SIGNAL(selectedComponentsSig(QList)), this, SLOT(selectedComponentsSlot(QList)));
- connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
-
- }
-
- DialogPCLGPMesh::~DialogPCLGPMesh()
- {
- delete _ui;
- _ui = NULL;
- delete _selectdlg;
- _selectdlg = NULL;
- }
-
- void DialogPCLGPMesh::accept()
- {
- if (_components.size() == 0)
- return;
-
- QString componentIds;
- for (auto component : _components)
- componentIds.append(QString(",%1").arg(component->getID()));
- componentIds.remove(0, 1);
-
- double SearchRadius=_ui->SearchRadius->value();
- double Mu=_ui->Mu->value();
- int MaximumNearestNeighbors=_ui->MaximumNearestNeighbors->value();
- double MaximumSurfaceAngle=_ui->MaximumSurfaceAngle->value();
- double MaximumAngle=_ui->MaximumAngle->value();
- double MinimumAngle=_ui->MinimumAngle->value();
-
- // excuteAlg( QString componentIds , double SearchRadius, double Mu,int MaximumNearestNeighbors,double MaximumSurfaceAngle,double MaximumAngle,double MinimumAngle);
- emit excuteAlg( componentIds , SearchRadius, Mu, MaximumNearestNeighbors, MaximumSurfaceAngle, MaximumAngle, MinimumAngle);
-
- QFDialog::accept();
- }
-
- void DialogPCLGPMesh::selectedComponentsSlot(QList 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)
- return;
-
- QMenu *menu = new QMenu(this);
- QAction *deleteItem = new QAction(tr("delete this item"));
- menu->addAction(deleteItem);
- connect(menu, &QMenu::triggered, [=]()
- { removeCurrentItem(curItem); });
- menu->exec(QCursor::pos());
- }
-
- void DialogPCLGPMesh::removeCurrentItem(QListWidgetItem *curItem)
- {
- auto meshData = MeshData::MeshData::getInstance();
- auto meshSet = meshData->getMeshSetByName(curItem->text());
- if (!meshSet)
- return;
- _components.removeOne(meshSet);
- _ui->listWidget->removeItemWidget(curItem);
- delete curItem;
- }
-
-
-} // namespace MainWidget
diff --git a/src/MainWidgets/DialogPCLGuassFilter.cpp b/src/MainWidgets/DialogPCLGuassFilter.cpp
deleted file mode 100644
index 424551b..0000000
--- a/src/MainWidgets/DialogPCLGuassFilter.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * @file DialogPCLGuassFilter.cpp
- * @brief None
- * @author 陈增辉 (3045316072@qq.com)
- * @version 2.5.0
- * @date 2024/4/5
- * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
- */
-
-// You may need to build the project (run Qt uic code generator) to get "ui_DialogPCLGuassFilter.h"
-// resolved
-
-#include "DialogPCLGuassFilter.h"
-#include "ui_DialogPCLGuassFilter.h"
-
-#include "PythonModule/PyAgent.h"
-#include "MeshData/meshSingleton.h"
-#include "MeshData/meshSet.h"
-#include
-#include
-
-
-//auto meshData = MeshData::MeshData::getInstance();
-
-namespace MainWidget {
- DialogPCLGuassFilter::DialogPCLGuassFilter(GUI::MainWindow *parent)
- : QFDialog(parent),
- _ui(new Ui::DialogPCLGuassFilter),
- _mw(parent),
- _selectdlg(new DialogSelectComponents(parent))
- {
- _ui->setupUi(this);
- _ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
- setWindowTitle(tr("Guass Filter"));
- _ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
-
-
- connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
- { _selectdlg->clearSelectItems(); _selectdlg->exec(); });
- connect(_selectdlg, SIGNAL(selectedComponentsSig(QList)), this, SLOT(selectedComponentsSlot(QList)));
- connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
-
- }
-
- DialogPCLGuassFilter::~DialogPCLGuassFilter()
- {
- delete _ui;
- _ui = NULL;
- delete _selectdlg;
- _selectdlg = NULL;
- }
-
- void DialogPCLGuassFilter::accept()
- {
- if (_components.size() == 0)
- return;
-
- QString componentIds, rotate, moveLocation, scale;
- for (auto component : _components)
- componentIds.append(QString(",%1").arg(component->getID()));
- componentIds.remove(0, 1);
-
-
- double Sigma=_ui->Sigma->value();
- double threshold=_ui->threshold->value();
-
-
- emit excuteAlg( componentIds, Sigma, threshold);
-
- QString code = QString("MainWindow.createVTKTransform(\"%1\",\"%2\",\"%3\",\"%4\")").arg(componentIds).arg(rotate).arg(moveLocation).arg(scale);
- Py::PythonAgent::getInstance()->submit(code);
- QFDialog::accept();
- }
-
- void DialogPCLGuassFilter::selectedComponentsSlot(QList components)
- {
- for (MeshData::MeshSet *set : components)
- {
- if (_components.contains(set))
- continue;
- _components.append(set);
- _ui->listWidget->addItem(set->getName());
- }
- }
-
- void DialogPCLGuassFilter::customContextMenuRequestedSlot(const QPoint &point)
- {
- QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
- if (!curItem)
- return;
-
- QMenu *menu = new QMenu(this);
- QAction *deleteItem = new QAction(tr("delete this item"));
- menu->addAction(deleteItem);
- connect(menu, &QMenu::triggered, [=]()
- { removeCurrentItem(curItem); });
- menu->exec(QCursor::pos());
- }
-
- void DialogPCLGuassFilter::removeCurrentItem(QListWidgetItem *curItem)
- {
- auto meshData = MeshData::MeshData::getInstance();
- auto meshSet = meshData->getMeshSetByName(curItem->text());
- if (!meshSet)
- return;
- _components.removeOne(meshSet);
- _ui->listWidget->removeItemWidget(curItem);
- delete curItem;
- }
-
-
-} // namespace MainWidget
diff --git a/src/MainWidgets/DialogPCLRadiusOutlierRemoval.cpp b/src/MainWidgets/DialogPCLRadiusOutlierRemoval.cpp
deleted file mode 100644
index 95f6207..0000000
--- a/src/MainWidgets/DialogPCLRadiusOutlierRemoval.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * @file DialogPCLStatisticalRemoveFilter.cpp
- * @brief None
- * @author 陈增辉 (3045316072@qq.com)
- * @version 2.5.0
- * @date 2024/4/5
- * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
- */
-
-// You may need to build the project (run Qt uic code generator) to get
-// "ui_DialogPCLStatisticalRemoveFilter.h" resolved
-
-#include "DialogPCLRadiusOutlierRemoval.h"
-#include "ui_DialogPCLRadiusOutlierRemoval.h"
-
-#include "PythonModule/PyAgent.h"
-#include "MeshData/meshSingleton.h"
-#include "MeshData/meshSet.h"
-#include
-#include
-
-
-
-
-
-namespace MainWidget {
- DialogPCLRadiusOutlierRemoval::DialogPCLRadiusOutlierRemoval(GUI::MainWindow *parent)
- : QFDialog(parent),
- _ui(new Ui::DialogPCLRadiusOutlierRemoval),
- _mw(parent),
- _selectdlg(new DialogSelectComponents(parent))
- {
- _ui->setupUi(this);
- _ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
- setWindowTitle(tr("Radius Outlier Removal"));
- _ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
-
-
- connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
- { _selectdlg->clearSelectItems(); _selectdlg->exec(); });
- connect(_selectdlg, SIGNAL(selectedComponentsSig(QList)), this, SLOT(selectedComponentsSlot(QList)));
- connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
-
- }
-
- DialogPCLRadiusOutlierRemoval::~DialogPCLRadiusOutlierRemoval()
- {
- delete _ui;
- _ui = NULL;
- delete _selectdlg;
- _selectdlg = NULL;
- }
-
- void DialogPCLRadiusOutlierRemoval::accept()
- {
- if (_components.size() == 0)
- return;
-
- QString componentIds, rotate, moveLocation, scale;
- for (auto component : _components)
- componentIds.append(QString(",%1").arg(component->getID()));
- componentIds.remove(0, 1);
-
-
-
- double RadiusSearch=_ui->RadiusSearch->value();
- double MinNeighborsInRadius=_ui->MinNeighborsInRadius->value();
-
- emit excuteAlg(componentIds,RadiusSearch, MinNeighborsInRadius);
-
-
- QFDialog::accept();
- }
-
- void DialogPCLRadiusOutlierRemoval::selectedComponentsSlot(QList components)
- {
- for (MeshData::MeshSet *set : components)
- {
- if (_components.contains(set))
- continue;
- _components.append(set);
- _ui->listWidget->addItem(set->getName());
- }
- }
-
- void DialogPCLRadiusOutlierRemoval::customContextMenuRequestedSlot(const QPoint &point)
- {
- QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
- if (!curItem)
- return;
-
- QMenu *menu = new QMenu(this);
- QAction *deleteItem = new QAction(tr("delete this item"));
- menu->addAction(deleteItem);
- connect(menu, &QMenu::triggered, [=]()
- { removeCurrentItem(curItem); });
- menu->exec(QCursor::pos());
- }
-
- void DialogPCLRadiusOutlierRemoval::removeCurrentItem(QListWidgetItem *curItem)
- {
- auto meshData = MeshData::MeshData::getInstance();
- auto meshSet = meshData->getMeshSetByName(curItem->text());
- if (!meshSet)
- return;
- _components.removeOne(meshSet);
- _ui->listWidget->removeItemWidget(curItem);
- delete curItem;
- }
-
-
-} // namespace MainWidget
diff --git a/src/MainWidgets/DialogPCLStatisticalRemoveFilter.cpp b/src/MainWidgets/DialogPCLStatisticalRemoveFilter.cpp
deleted file mode 100644
index 3f70131..0000000
--- a/src/MainWidgets/DialogPCLStatisticalRemoveFilter.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * @file DialogPCLStatisticalRemoveFilter.cpp
- * @brief None
- * @author 陈增辉 (3045316072@qq.com)
- * @version 2.5.0
- * @date 2024/4/5
- * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
- */
-
-// You may need to build the project (run Qt uic code generator) to get
-// "ui_DialogPCLStatisticalRemoveFilter.h" resolved
-
-#include "DialogPCLStatisticalRemoveFilter.h"
-#include "ui_DialogPCLStatisticalRemoveFilter.h"
-
-#include "PythonModule/PyAgent.h"
-#include "MeshData/meshSingleton.h"
-#include "MeshData/meshSet.h"
-#include
-#include
-
-
-//auto meshData = MeshData::MeshData::getInstance();
-
-
-namespace MainWidget {
- DialogPCLStatisticalRemoveFilter::DialogPCLStatisticalRemoveFilter(GUI::MainWindow *parent)
- : QFDialog(parent),
- _ui(new Ui::DialogPCLStatisticalRemoveFilter),
- _mw(parent),
- _selectdlg(new DialogSelectComponents(parent))
- {
- _ui->setupUi(this);
- _ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
- setWindowTitle(tr("Statistical Remove Filter"));
- _ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
-
-
- connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
- { _selectdlg->clearSelectItems(); _selectdlg->exec(); });
- connect(_selectdlg, SIGNAL(selectedComponentsSig(QList)), this, SLOT(selectedComponentsSlot(QList)));
- connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
- }
-
- DialogPCLStatisticalRemoveFilter::~DialogPCLStatisticalRemoveFilter()
- {
- delete _ui;
- _ui = NULL;
- delete _selectdlg;
- _selectdlg = NULL;
- }
-
-
-
-
- void DialogPCLStatisticalRemoveFilter::accept()
- {
- if (_components.size() == 0)
- return;
-
- QString componentIds, rotate, moveLocation, scale;
- for (auto component : _components)
- componentIds.append(QString(",%1").arg(component->getID()));
- componentIds.remove(0, 1);
-
- double MeanK=_ui->MeanK->value();
- double stddev=_ui->Stddev->value();
-
- emit excuteAlg(componentIds,MeanK,stddev);
-
- QFDialog::accept();
- }
-
- void DialogPCLStatisticalRemoveFilter::selectedComponentsSlot(QList components)
- {
- for (MeshData::MeshSet *set : components)
- {
- if (_components.contains(set))
- continue;
- _components.append(set);
- _ui->listWidget->addItem(set->getName());
- }
- }
-
- void DialogPCLStatisticalRemoveFilter::customContextMenuRequestedSlot(const QPoint &point)
- {
- QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
- if (!curItem)
- return;
-
- QMenu *menu = new QMenu(this);
- QAction *deleteItem = new QAction(tr("delete this item"));
- menu->addAction(deleteItem);
- connect(menu, &QMenu::triggered, [=]()
- { removeCurrentItem(curItem); });
- menu->exec(QCursor::pos());
- }
-
- void DialogPCLStatisticalRemoveFilter::removeCurrentItem(QListWidgetItem *curItem)
- {
- auto meshData = MeshData::MeshData::getInstance();
- auto meshSet = meshData->getMeshSetByName(curItem->text());
- if (!meshSet)
- return;
- _components.removeOne(meshSet);
- _ui->listWidget->removeItemWidget(curItem);
- delete curItem;
- }
-
-
-
-
-} // namespace MainWidget
diff --git a/src/MainWidgets/GeometryWidget.cpp b/src/MainWidgets/GeometryWidget.cpp
index 4ba07b7..faf536d 100644
--- a/src/MainWidgets/GeometryWidget.cpp
+++ b/src/MainWidgets/GeometryWidget.cpp
@@ -49,6 +49,13 @@ namespace MainWidget
this->addTopLevelItem(_gcroot);
_gcroot->setExpanded(true);
+// _antroot = new QTreeWidgetItem(this, TreeItemType::GeoComponentRoot);
+// _antroot->setText(0, tr("antModel"));
+// _antroot->setIcon(0, QIcon(":/QUI/icon/geometry.png"));
+// this->addTopLevelItem(_antroot);
+// _antroot->setExpanded(true);
+
+
connect(_mainWindow, SIGNAL(updateGeometryTreeSig()), this, SLOT(updateTree()));
// connect(_mainWindow, SIGNAL(updateGeometryTreeSig()), this, SLOT(updateTree()));
connect(this, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(singleClicked(QTreeWidgetItem *, int)));
diff --git a/src/MainWidgets/GeometryWidget.h b/src/MainWidgets/GeometryWidget.h
index 0498632..caa6bb5 100644
--- a/src/MainWidgets/GeometryWidget.h
+++ b/src/MainWidgets/GeometryWidget.h
@@ -107,6 +107,7 @@ namespace MainWidget
QTreeWidgetItem* _root{};
QTreeWidgetItem* _datumroot{};
QTreeWidgetItem* _gcroot{};
+ QTreeWidgetItem* _antroot{};
Geometry::GeometryData* _data{};
QTreeWidgetItem* _currentItem{};
diff --git a/src/MainWindow/CMakeLists.txt b/src/MainWindow/CMakeLists.txt
index 8f66fe2..2d344f5 100644
--- a/src/MainWindow/CMakeLists.txt
+++ b/src/MainWindow/CMakeLists.txt
@@ -2,6 +2,9 @@
# 头文件搜索路径
#-----------------------------------------------------------------------------
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
+# FindOpenCASCADE
+include_directories(${OpenCASCADE_INCLUDE_DIRS})
+message("OpenCASCADE_INCLUDE_DIRS ${OpenCASCADE_INCLUDE_DIRS}")
#-----------------------------------------------------------------------------
# 自动添加include目录
@@ -38,7 +41,7 @@ add_library(MainWindow
#-----------------------------------------------------------------------------
target_compile_definitions(MainWindow PRIVATE "MAINWINDOW_API")
-list(APPEND _depend_library Common LAMPTool WBCLFZSystemModule PythonModule SARibbonBar Settings DataProperty MeshData Material Geometry ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GmshModule PostInterface PostRenderData PostWidgets ProjectTree GeometryCommand GeometryWidgets IO SolverControl MainWidgets UserGuidence Common)
+list(APPEND _depend_library Common PythonModule SARibbonBar Settings DataProperty MeshData Material Geometry ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GmshModule PostInterface PostRenderData PostWidgets ProjectTree GeometryCommand GeometryWidgets IO SolverControl MainWidgets UserGuidence Common)
if(_WIN_)
list(APPEND _depend_library XGenerateReport)
endif()
@@ -47,6 +50,13 @@ list(APPEND _runtimes_libraries
Qt5::Core Qt5::Gui Qt5::Widgets VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::FiltersStatistics VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ImagingMath VTK::InteractionStyle VTK::ParallelCore VTK::ParallelDIY VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib
)
+list(APPEND _runtimes_libraries
+ OpenCASCADE::TKOffset OpenCASCADE::TKSTL OpenCASCADE::TKOpenGl OpenCASCADE::Freetype OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::Freetype OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::TKFillet OpenCASCADE::TKBool OpenCASCADE::TKCAF OpenCASCADE::TKCDF OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKHLR OpenCASCADE::TKIGES OpenCASCADE::TKLCAF OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKPrim OpenCASCADE::TKSTEP OpenCASCADE::TKSTEP209 OpenCASCADE::TKSTEPAttr OpenCASCADE::TKSTEPBase OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKVCAF OpenCASCADE::TKXCAF OpenCASCADE::TKXDEIGES OpenCASCADE::TKXSBase OpenCASCADE::TKernel Qt5::Widgets Qt5::Xml
+ VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::FiltersStatistics VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ImagingMath VTK::InteractionStyle VTK::ParallelCore VTK::ParallelDIY VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib VTK::IOGeometry
+)
+
+
+
target_include_directories(MainWindow PRIVATE ${Qwt_INCLUDE_DIRS})
#-----------------------------------------------------------------------------
diff --git a/src/MainWindow/CustomizerHelper.cpp b/src/MainWindow/CustomizerHelper.cpp
index cc49707..110022c 100644
--- a/src/MainWindow/CustomizerHelper.cpp
+++ b/src/MainWindow/CustomizerHelper.cpp
@@ -39,6 +39,7 @@ namespace GUI {
_menuList.append(_ui->menuView);
_menuList.append(_ui->menuGeometry);
_menuList.append(_ui->menuMesher);
+ _menuList.append(_ui->menuPointCloud);
_menuList.append(_ui->menuSolve);
_menuList.append(_ui->menuWindows);
_menuList.append(_ui->menuSettings);
@@ -186,8 +187,6 @@ namespace GUI {
this->enableMeshCheck(ok);
-
-
_ui->SetToolBar->setVisible(ok || meshOption->isComponentEnabled());
ok = meshOption->isFilterMeshEnabled();
_ui->actionFilterMesh->setVisible(ok);
diff --git a/src/MainWindow/MainWindow.cpp b/src/MainWindow/MainWindow.cpp
index 7a5df31..e818873 100644
--- a/src/MainWindow/MainWindow.cpp
+++ b/src/MainWindow/MainWindow.cpp
@@ -86,13 +86,12 @@
#include "PostInterface/AnimationToolBar.h"
#include "PostInterface/RenderDirector.h"
// pcl
-#include "MainWidgets/DialogPCLBilateralFilter.h"
-#include "MainWidgets/DialogPCLGPMesh.h"
-#include "MainWidgets/DialogPCLGuassFilter.h"
-#include "MainWidgets/DialogPCLRadiusOutlierRemoval.h"
-#include "MainWidgets/DialogPCLStatisticalRemoveFilter.h"
+#include "PluginWBFZExchangePlugin/DialogPCLBilateralFilter.h"
+#include "PluginWBFZExchangePlugin/DialogPCLGPMesh.h"
+#include "PluginWBFZExchangePlugin/DialogPCLGuassFilter.h"
+#include "PluginWBFZExchangePlugin/DialogPCLRadiusOutlierRemoval.h"
+#include "PluginWBFZExchangePlugin/DialogPCLStatisticalRemoveFilter.h"
#include "IO/vtkDataRelated.h"
-#include "LAMPTool/BaseTool.h"
// logger
#include "Common/DebugLogger.h"
@@ -255,7 +254,21 @@ namespace GUI {
connect(_ui->actionVTKTranslation, SIGNAL(triggered()), this, SLOT(on_VTKTranslation()));
// 点云
+ connect(_ui->actionPCLStatisticalRemoveFilter,SIGNAL(triggered()),this,SLOT(on_pclStatisticalRemoveFilter()));
+ connect(_ui->actionPCLRadiusOutlierRemoval,SIGNAL(triggered()),this,SLOT(on_pclRadiusOutlierRemoval()));
+ connect(_ui->actionPCLGuassFilter,SIGNAL(triggered()),this,SLOT(on_pclGuassFilter()));
+ connect(_ui->actionPCLBilateralFilter,SIGNAL(triggered()),this,SLOT(on_pclBilateralFilter()));
+ connect(_ui->actionPCLGPMesh,SIGNAL(triggered()),this,SLOT(on_pclGPMesh()));
+ // feko 参数
+ connect(_ui->actionImageSetting,SIGNAL(triggered()),this,SLOT(on_actionImageSetting()));
+ connect(_ui->actionFEKO2csv,SIGNAL(triggered()),this,SLOT(on_actionFEKO2csv()));
+ connect(_ui->actionScatterExport,SIGNAL(triggered()),this,SLOT(on_actionScatterExport()));
+ connect(_ui->actionFEKOImage,SIGNAL(triggered()),this,SLOT(on_actionFEKOImage()));
+ connect(_ui->actionantScatteringFEKOSetting,SIGNAL(triggered()),this,SLOT(on_actionantScatteringFEKOSetting()));
+
+ // 属性表
+ connect(_ui->actionAttriutionDBShow,SIGNAL(triggered()),this,SLOT(on_AttriutionDBShow()));
// 设置视角
@@ -732,6 +745,13 @@ namespace GUI {
void MainWindow::on_exportMesh()
{
+
+
+ if(MeshData::MeshData::getInstance()->getKernalCount() == 0) {
+ QMessageBox::warning(this, tr("Warning"), tr("No one has any grid!"));
+ return;
+ }
+
QStringList suffixlist = IO::IOConfigure::getMeshExporters();
// QStringList list = IO::IOConfigure::getMeshImporters();
if(suffixlist.isEmpty()) {
@@ -739,11 +759,6 @@ namespace GUI {
return;
}
- if(MeshData::MeshData::getInstance()->getKernalCount() == 0) {
- QMessageBox::warning(this, tr("Warning"), tr("No one has any grid!"));
- return;
- }
-
QStringList meshsuffix =
ConfigOption::ConfigOption::getInstance()->getMeshConfig()->getExportSuffix().split(
";");
@@ -1479,73 +1494,61 @@ namespace GUI {
{
return m_ribbonActionMgr;
}
-
-
- void MainWindow::on_pclStatisticalRemoveFilter() {
- MainWidget::DialogPCLStatisticalRemoveFilter dlg(this);
- connect(&dlg, SIGNAL(excuteAlg(QString ,double,double )),this,SLOT(PCLStatisticalRemoveFilterAlg(QString ,double ,double )));
- dlg.exec();
-
- }
- void MainWindow::on_pclRadiusOutlierRemoval() {
- MainWidget::DialogPCLRadiusOutlierRemoval dlg(this);
- connect(&dlg, SIGNAL(excuteAlg(QString ,double ,double )),this,SLOT(PCLStatisticalRemoveFilterAlg(QString ,double ,double )));
- dlg.exec();
- }
- void MainWindow::on_pclGuassFilter() {
- MainWidget::DialogPCLGuassFilter dlg(this);
- connect(&dlg, SIGNAL(excuteAlg(QString ,double ,double )),this,SLOT(PCLStatisticalRemoveFilterAlg(QString ,double ,double )));
- dlg.exec();
-
- }
- void MainWindow::on_pclBilateralFilter() {
- MainWidget::DialogPCLBilateralFilter dlg(this);
- connect(&dlg, SIGNAL(excuteAlg(QString ,double ,double )),this,SLOT(PCLStatisticalRemoveFilterAlg(QString ,double ,double )));
- dlg.exec();
-
- }
- void MainWindow::on_pclGPMesh() {
- MainWidget::DialogPCLGPMesh dlg(this);
- connect(&dlg, SIGNAL(excuteAlg( QString , double , double ,int ,double ,double ,double )),this,SLOT(PCLStatisticalRemoveFilterAlg( QString , double , double ,int ,double ,double ,double )));
- dlg.exec();
-
- }
-
- void MainWindow::PCLStatisticalRemoveFilterAlg(QString componentIds, double MeanK,double StddevThresh) {
-
-
- }
- void MainWindow::PCLRadiusOutlierRemovalFilterAlg(QString componentIds, double RadiusSearch,
- double MinNeighborsInRadius)
+ // 点云
+ void MainWindow::on_pclStatisticalRemoveFilter()
{
- emit this->printMessage(Common::Message::Normal,"PCLRadiusOutlierRemovalFilterAlg");
-
-
-
-
-
-
+ DebugInfo("on_pclStatisticalRemoveFilter\n");
+ emit this->on_pclStatisticalRemoveFilter(this);
}
- void MainWindow::PCLGuassFilterAlg(QString componentIds, double sigma, double threshold) {
- emit this->printMessage(Common::Message::Normal,"PCLGuassFilterAlg");
-
-
- }
- void MainWindow::PCLGPMeshAlg(QString componentIds, double SearchRadius, double Mu,
- int MaximumNearestNeighbors, double MaximumSurfaceAngle,
- double MaximumAngle, double MinimumAngle)
+ void MainWindow::on_pclRadiusOutlierRemoval()
{
- emit this->printMessage(Common::Message::Normal,"PCLGPMeshAlg");
-
-
-
-
-
-
+ DebugInfo("on_pclRadiusOutlierRemoval\n");
+ emit this->on_pclRadiusOutlierRemoval(this);
+ }
+ void MainWindow::on_pclGuassFilter()
+ {
+ DebugInfo("on_pclGuassFilter\n");
+ emit this->on_pclGuassFilter(this);
+ }
+ void MainWindow::on_pclBilateralFilter()
+ {
+ DebugInfo("on_pclBilateralFilter\n");
+ emit this->on_pclBilateralFilter(this);
+ }
+ void MainWindow::on_pclGPMesh()
+ {
+ DebugInfo("on_pclGPMesh\n");
+ emit this->on_pclGPMesh(this);
}
- void MainWindow::PCLBilateralFilterAlg(QString componentIds, double sigmaR, double sigmaS) {
- emit this->printMessage(Common::Message::Normal,"PCLBilateralFilterAlg");
+ // FEKO
+ void MainWindow::on_actionImageSetting() {
+ DebugInfo("on_actionImageSetting\n");
+ emit this->on_actionImageSetting(this);
+ }
+
+ void MainWindow::on_actionFEKO2csv() {
+ DebugInfo("on_actionFEKO2csv\n");
+ emit this->on_actionFEKO2csv(this);
+ }
+
+ void MainWindow::on_actionScatterExport() {
+ DebugInfo("on_actionScatterExport\n");
+ emit this->on_actionScatterExport(this);
+ }
+
+ void MainWindow::on_actionFEKOImage() {
+ DebugInfo("on_actionFEKOImage\n");
+ emit this->on_actionFEKOImage(this);
+ }
+
+ void MainWindow::on_actionantScatteringFEKOSetting() {
+ DebugInfo("on_actionantScatteringFEKOSetting\n");
+ emit this->on_actionantScatteringFEKOSetting(this);
+ }
+ void MainWindow::on_AttriutionDBShow() {
+ DebugInfo("on_AttriutionDBShow\n");
+ emit this->on_actionAttriutionDBShow(this);
}
diff --git a/src/MainWindow/MainWindow.h b/src/MainWindow/MainWindow.h
index ffdce0c..5724abb 100644
--- a/src/MainWindow/MainWindow.h
+++ b/src/MainWindow/MainWindow.h
@@ -299,6 +299,29 @@ namespace GUI {
// 打开二维曲线绘制信号
void openPlot();
+
+ // 点云处理信号
+ // 统计滤波
+ void on_pclStatisticalRemoveFilter(GUI::MainWindow* m);
+ // 半径滤波
+ void on_pclRadiusOutlierRemoval(GUI::MainWindow* m);
+ // 高斯滤波
+ void on_pclGuassFilter(GUI::MainWindow* m);
+ // 双边滤波
+ void on_pclBilateralFilter(GUI::MainWindow* m);
+ // GP网格重建
+ void on_pclGPMesh(GUI::MainWindow* m);
+
+ // FEKO仿真参数的
+ void on_actionImageSetting(GUI::MainWindow* m);
+ void on_actionFEKO2csv(GUI::MainWindow* m);
+ void on_actionScatterExport(GUI::MainWindow* m);
+ void on_actionFEKOImage(GUI::MainWindow* m);
+ void on_actionantScatteringFEKOSetting(GUI::MainWindow* m);
+
+ // Tool Show
+ void on_actionAttriutionDBShow(GUI::MainWindow* m);
+
public slots:
/*状态栏显示信息 */
void setStatusBarInfo(QString);
@@ -347,8 +370,8 @@ namespace GUI {
void on_pclBilateralFilter();
// GP网格重建
void on_pclGPMesh();
-
-
+ // feko 设置
+ void on_AttriutionDBShow();
private slots:
/*关闭主窗口 */
@@ -411,17 +434,17 @@ namespace GUI {
// 创建VTK空间变换窗口
void on_VTKTranslation();
- // StatisticalRemoveFilter
- void PCLStatisticalRemoveFilterAlg(QString componentIds,double MeanK,double stddev);
- // PCLRadiusOutlierRemoval
- void PCLRadiusOutlierRemovalFilterAlg(QString componentIds,double RadiusSearch,double MinNeighborsInRadius);
- // PCLGuassFilter
- void PCLGuassFilterAlg(QString componentIds,double sigma,double threshold);
- // PCLGPMesh
- void PCLGPMeshAlg( QString componentIds , double SearchRadius, double Mu,int MaximumNearestNeighbors,double MaximumSurfaceAngle,double MaximumAngle,double MinimumAngle);
- // PCLBilateralFilter
- void PCLBilateralFilterAlg(QString componentIds,double sigmaR,double sigmaS);
-
+ // FEKO仿真参数的
+ // FEKO 成像模式参数设置
+ void on_actionImageSetting();
+ // FEKO 仿真结果抽取
+ void on_actionFEKO2csv();
+ // FEKO 仿真结果导出
+ void on_actionScatterExport();
+ // 成像
+ void on_actionFEKOImage();
+ // 散射界面设置
+ void on_actionantScatteringFEKOSetting();
private:
diff --git a/src/MainWindow/MainWindow.ui b/src/MainWindow/MainWindow.ui
index 701eaae..a2b201a 100644
--- a/src/MainWindow/MainWindow.ui
+++ b/src/MainWindow/MainWindow.ui
@@ -268,7 +268,7 @@
0
0
1678
- 26
+ 22
+
+
@@ -1950,6 +1963,36 @@
LoadFile
+
+
+ Image FEKO Simulation Setting
+
+
+
+
+ Feko Result Image
+
+
+
+
+ LAMP Scattering Ant Setting
+
+
+
+
+ FEKO Result Import
+
+
+
+
+ FEKO Scatter Data Export
+
+
+
+
+ Attriution DB Show
+
+
diff --git a/src/PluginMotorBike/PluginOpenFoamExtend.h b/src/PluginMotorBike/PluginOpenFoamExtend.h
index b7b18d0..cc222f4 100644
--- a/src/PluginMotorBike/PluginOpenFoamExtend.h
+++ b/src/PluginMotorBike/PluginOpenFoamExtend.h
@@ -46,9 +46,6 @@ namespace Plugins
signals:
void treePrintMessageToMessageWindowSignal(ModuleBase::Message message);
};
-
-
-
}
diff --git a/src/WBCLFZSystemModule/.command_history.lst b/src/PluginWBFZExchangePlugin/.command_history.lst
similarity index 100%
rename from src/WBCLFZSystemModule/.command_history.lst
rename to src/PluginWBFZExchangePlugin/.command_history.lst
diff --git a/src/WBCLFZSystemModule/AllHead.cpp b/src/PluginWBFZExchangePlugin/AllHead.cpp
similarity index 51%
rename from src/WBCLFZSystemModule/AllHead.cpp
rename to src/PluginWBFZExchangePlugin/AllHead.cpp
index 2157fc9..79a8cea 100644
--- a/src/WBCLFZSystemModule/AllHead.cpp
+++ b/src/PluginWBFZExchangePlugin/AllHead.cpp
@@ -1,9 +1,9 @@
#include "AllHead.h"
-WBCLFZSYSTEMMODULEAPI QSettings* getQSetting()
+ QSettings* getQSetting()
{
- QString fileName = QCoreApplication::applicationDirPath() + "/Config.ini";
+ QString fileName = QCoreApplication::applicationDirPath() + "/WBCLFZConfig.ini";
QSettings* setting = new QSettings(fileName, QSettings::IniFormat);
setting->setIniCodec(QTextCodec::codecForName("UTF-8"));
@@ -19,7 +19,7 @@ WBCLFZSYSTEMMODULEAPI QSettings* getQSetting()
return setting;
}
-QString WBCLFZSYSTEMMODULEAPI getOpenFilePath(QWidget* parent, const QString& caption, const QString& filter)
+QString getOpenFilePath(QWidget* parent, const QString& caption, const QString& filter)
{
QSettings* setting = getQSetting();
QString curpath = u8".";
@@ -38,7 +38,7 @@ QString WBCLFZSYSTEMMODULEAPI getOpenFilePath(QWidget* parent, const QString& ca
return filepath;
}
-QString WBCLFZSYSTEMMODULEAPI getSaveFilePath(QWidget* parent, const QString& caption, const QString& filter)
+QString getSaveFilePath(QWidget* parent, const QString& caption, const QString& filter)
{
QSettings* setting = getQSetting();
QString curpath = u8".";
@@ -56,3 +56,34 @@ QString WBCLFZSYSTEMMODULEAPI getSaveFilePath(QWidget* parent, const QString& ca
}
return filepath;
}
+bool AddOrRemoveScatterAntModel(GUI::MainWindow* _mainWindows, Geometry::GeometryData* _geoData,
+ Geometry::GeometrySet* set, bool flag)
+{
+ if(_mainWindows==nullptr || _geoData==nullptr|| set== nullptr){
+ return false;
+ }else{}
+ MainWidget::PreWindow* pre = _mainWindows->getSubWindowManager()->getPreWindow();
+
+ if(flag){
+ Geometry::GeometryData::getInstance()->appendGeometrySet(set);
+ emit _mainWindows->updateActionStatesSig();
+ emit pre->showGeoSet(set, true);
+ emit _mainWindows->updateGeometryTreeSig();
+ return true;
+ }
+ else {
+ int id=Geometry::GeometryData::getInstance()->getIndexByGeoometrySet(set);
+ //auto geo = Geometry::GeometryData::getInstance()->getGeometrySetByID(set);
+ Geometry::GeometryData::getInstance()->removeGeometrySet(id);
+ emit _mainWindows->updateActionStatesSig();
+ emit pre->showGeoSet(set, false);
+ if(pre != nullptr)
+ emit pre->removeGemoActors(set);
+ emit _mainWindows->updateGeometryTreeSig();
+ emit _mainWindows->updateActionStatesSig();
+ emit _mainWindows->updateGraphOptionsSig();
+ emit _mainWindows->updateGeometryTreeSig();
+ return true;
+ }
+ return false;
+}
diff --git a/src/WBCLFZSystemModule/AllHead.h b/src/PluginWBFZExchangePlugin/AllHead.h
similarity index 89%
rename from src/WBCLFZSystemModule/AllHead.h
rename to src/PluginWBFZExchangePlugin/AllHead.h
index df349c7..7a602de 100644
--- a/src/WBCLFZSystemModule/AllHead.h
+++ b/src/PluginWBFZExchangePlugin/AllHead.h
@@ -2,8 +2,13 @@
#ifndef ALLHEAD_H
#define ALLHEAD_H
-#include "WBCLFZSystemModuleAPI.h"
-
+#include "WBFZExchangePluginAPI.h"
+#include "Common/DebugLogger.h"
+#include "Geometry/geometryData.h"
+#include "Geometry/geometrySet.h"
+#include "MainWindow/MainWindow.h"
+#include "MainWindow/SubWindowManager.h"
+#include "MainWidgets/preWindow.h"
//==================================
// 线性计算库优化
//===============================
@@ -14,8 +19,8 @@
// 内部库 LAMPTool
//=====================================================
-#include "../LAMPTool/referenceHeader.h"
-#include "BaseConstVariable.h"
+#include "referenceHeader.h"
+//#include "BaseConstVariable.h"
// Basetoollib
#include "BaseConstVariable.h"
#include "BaseTool.h"
@@ -28,14 +33,14 @@
//#include "BackScatterModel.h"
//#include "SARBaseTool.h"
//#include "SARCalibration.h"
-#include "LAMPTool/SARImageBase.h"
+#include "SARImageBase.h"
// SARImage
-#include "LAMPTool/FEKOBaseToolClass.h"
-#include "LAMPTool/FEKONearBPBasic.h"
-#include "LAMPTool/FEKOSimulationSARClass.h"
-#include "LAMPTool/OCCTBase.h"
-#include "LAMPTool/FEKOFarFieldFileClass.h"
+#include "FEKOBaseToolClass.h"
+#include "FEKONearBPBasic.h"
+#include "FEKOSimulationSARClass.h"
+#include "OCCTBase.h"
+#include "FEKOFarFieldFileClass.h"
//=====================================================
// 内部库 SharedModuleLib
@@ -304,15 +309,21 @@
// Visualization Toolkit (VTK)
#include
-#include "inputdialog.h"
+#include "PointCloudProcess/inputdialog.h"
#include "BasePCL.h"
#include "ToolDialog.h"
#include "PointManagerClass.h"
-#include "WBCLFZSystemModuleAPI.h"
-
+#include "WBFZExchangePluginAPI.h"
+enum TaskStatusEnum {
+ wait,
+ success,
+ fail,
+ excuting,
+ finish,
+};
class QObject;
@@ -342,11 +353,11 @@ class QObject;
//=======================================================
// 常用基础函数
//======================================================= ]
-WBCLFZSYSTEMMODULEAPI QSettings* getQSetting();
+ QSettings* getQSetting();
-QString WBCLFZSYSTEMMODULEAPI getOpenFilePath(QWidget* parent = nullptr, const QString& caption = QString(), const QString& filter = QString());
+QString getOpenFilePath(QWidget* parent = nullptr, const QString& caption = QString(), const QString& filter = QString());
-QString WBCLFZSYSTEMMODULEAPI getSaveFilePath(QWidget* parent = nullptr, const QString& caption = QString(), const QString& filter = QString());
+QString getSaveFilePath(QWidget* parent = nullptr, const QString& caption = QString(), const QString& filter = QString());
/*
@@ -356,11 +367,10 @@ QString WBCLFZSYSTEMMODULEAPI getSaveFilePath(QWidget* parent = nullptr, const Q
".",
QString::fromUtf8(u8"STL Files (*.stl);;STL Files (*.stla);;step Files (*.stp);;step Files (*.step);;IGES Files (*.iges);;IGES Files (*.igs)"));
-
+GUI::MainWindow* _mainWindows;
+Geometry::GeometryData * _geoData;
*/
-
-
-
+bool AddOrRemoveScatterAntModel(GUI::MainWindow* _mainWindows,Geometry::GeometryData * _geoData,Geometry::GeometrySet * set,bool flag);
#endif // ! ALLHEAD_H
\ No newline at end of file
diff --git a/src/LAMPTool/BackScatterModel.cpp b/src/PluginWBFZExchangePlugin/BackScatterModel.cpp
similarity index 61%
rename from src/LAMPTool/BackScatterModel.cpp
rename to src/PluginWBFZExchangePlugin/BackScatterModel.cpp
index deab8bf..2b14a8c 100644
--- a/src/LAMPTool/BackScatterModel.cpp
+++ b/src/PluginWBFZExchangePlugin/BackScatterModel.cpp
@@ -1,15 +1,15 @@
-#include "LAMPToolAPI.h"
+#include "WBFZExchangePluginAPI.h"
#include "BackScatterModel.h"
#include
#include
-double LAMPTOOLAPI MuhlemanSimulationBackScatter(double incidentAngle)
+double MuhlemanSimulationBackScatter(double incidentAngle)
{
return 0.0133*cos(incidentAngle)/pow(sin(incidentAngle)+0.1*cos(incidentAngle), 3);
}
-Eigen::MatrixXd LAMPTOOLAPI MuhlemanSimulationBackScatter(Eigen::MatrixXd incidentAngle)
+Eigen::MatrixXd MuhlemanSimulationBackScatter(Eigen::MatrixXd incidentAngle)
{
return 0.0133 * (incidentAngle.array().cos()) / ((incidentAngle.array().sin()) + cos(incidentAngle.array().cos()*0.1).pow(3));
}
diff --git a/src/PluginWBFZExchangePlugin/BackScatterModel.h b/src/PluginWBFZExchangePlugin/BackScatterModel.h
new file mode 100644
index 0000000..7d7d227
--- /dev/null
+++ b/src/PluginWBFZExchangePlugin/BackScatterModel.h
@@ -0,0 +1,20 @@
+#pragma once
+#ifndef _BACKSCATTERMODEL_H_
+#define _BACKSCATTERMODEL_H_
+
+
+#include "WBFZExchangePluginAPI.h"
+#include
+#include
+#include "WBFZExchangePluginAPI.h"
+
+double MuhlemanSimulationBackScatter(double incidentAngle);
+Eigen::MatrixXd MuhlemanSimulationBackScatter(Eigen::MatrixXd incidentAngle);
+
+
+#endif
+
+
+
+
+
diff --git a/src/LAMPTool/BaseConstVariable.h b/src/PluginWBFZExchangePlugin/BaseConstVariable.h
similarity index 96%
rename from src/LAMPTool/BaseConstVariable.h
rename to src/PluginWBFZExchangePlugin/BaseConstVariable.h
index 1aa9b4e..d50f5f5 100644
--- a/src/LAMPTool/BaseConstVariable.h
+++ b/src/PluginWBFZExchangePlugin/BaseConstVariable.h
@@ -2,7 +2,7 @@
#ifndef BASECONSTVARIABLE_H
#define BASECONSTVARIABLE_H
-#include "LAMPToolAPI.h"
+#include "WBFZExchangePluginAPI.h"
#include
#include
diff --git a/src/LAMPTool/BaseTool.cpp b/src/PluginWBFZExchangePlugin/BaseTool.cpp
similarity index 85%
rename from src/LAMPTool/BaseTool.cpp
rename to src/PluginWBFZExchangePlugin/BaseTool.cpp
index 05045a1..66f32de 100644
--- a/src/LAMPTool/BaseTool.cpp
+++ b/src/PluginWBFZExchangePlugin/BaseTool.cpp
@@ -36,7 +36,7 @@ using namespace Eigen;
-QString LAMPTOOLAPI getCurrentTimeString() {
+QString getCurrentTimeString() {
struct tm ConversionTime;
std::time_t t = std::time(NULL);
char mbstr[100];
@@ -46,7 +46,7 @@ QString LAMPTOOLAPI getCurrentTimeString() {
return strTime;
}
-QString LAMPTOOLAPI getCurrentShortTimeString() {
+QString getCurrentShortTimeString() {
struct tm ConversionTime;
std::time_t t = std::time(NULL);
char mbstr[100];
@@ -56,14 +56,14 @@ QString LAMPTOOLAPI getCurrentShortTimeString() {
return strTime;
}
-std::vector LAMPTOOLAPI splitString(const QString& str, char delimiter)
+std::vector splitString(const QString& str, char delimiter)
{
QStringList tokens = str.split(delimiter);
return convertQStringListToStdVector(tokens);
}
-complex LAMPTOOLAPI Cubic_Convolution_interpolation(double u, double v, Eigen::MatrixX> img)
+complex Cubic_Convolution_interpolation(double u, double v, Eigen::MatrixX> img)
{
if (img.rows() != 4 || img.cols() != 4) {
throw exception("the size of img's block is not right");
@@ -80,7 +80,7 @@ complex LAMPTOOLAPI Cubic_Convolution_interpolation(double u, double v,
return interValue(0, 0);
}
-complex LAMPTOOLAPI Cubic_kernel_weight(double s)
+complex Cubic_kernel_weight(double s)
{
s = abs(s);
if (s <= 1) {
@@ -111,7 +111,7 @@ complex LAMPTOOLAPI Cubic_kernel_weight(double s)
/// x,y,z
/// x,y,z
///
-double LAMPTOOLAPI Bilinear_interpolation(Landpoint p0, Landpoint p11, Landpoint p21, Landpoint p12, Landpoint p22)
+double Bilinear_interpolation(Landpoint p0, Landpoint p11, Landpoint p21, Landpoint p12, Landpoint p22)
{
return p11.ati * (1 - p0.lon) * (1 - p0.lat) +
@@ -122,7 +122,7 @@ double LAMPTOOLAPI Bilinear_interpolation(Landpoint p0, Landpoint p11, Landpoint
-bool LAMPTOOLAPI onSegment(Point_3d Pi, Point_3d Pj, Point_3d Q)
+bool onSegment(Point_3d Pi, Point_3d Pj, Point_3d Q)
{
if ((Q.x - Pi.x) * (Pj.y - Pi.y) == (Pj.x - Pi.x) * (Q.y - Pi.y) //叉乘
//保证Q点坐标在pi,pj之间
@@ -133,7 +133,7 @@ bool LAMPTOOLAPI onSegment(Point_3d Pi, Point_3d Pj, Point_3d Q)
return false;
}
-Point_3d LAMPTOOLAPI invBilinear(Point_3d p, Point_3d a, Point_3d b, Point_3d c, Point_3d d)
+Point_3d invBilinear(Point_3d p, Point_3d a, Point_3d b, Point_3d c, Point_3d d)
{
Point_3d res;
@@ -215,18 +215,18 @@ Point_3d LAMPTOOLAPI invBilinear(Point_3d p, Point_3d a, Point_3d b, Point_3d c,
return p;
}
-double LAMPTOOLAPI sind(double degree)
+double sind(double degree)
{
return sin(degree * d2r);
}
-double LAMPTOOLAPI cosd(double d)
+double cosd(double d)
{
return cos(d * d2r);
}
-string LAMPTOOLAPI Convert(float Num)
+string Convert(float Num)
{
ostringstream oss;
oss << Num;
@@ -234,7 +234,7 @@ string LAMPTOOLAPI Convert(float Num)
return str;
}
-QString LAMPTOOLAPI JoinPath(const QString& path, const QString& filename)
+QString JoinPath(const QString& path, const QString& filename)
{
QDir dir(path);
@@ -244,7 +244,7 @@ QString LAMPTOOLAPI JoinPath(const QString& path, const QString& filename)
return dir.filePath(filename);
}
-std::vector LAMPTOOLAPI convertQStringListToStdVector(const QStringList& qStringList)
+std::vector convertQStringListToStdVector(const QStringList& qStringList)
{
std::vector stdVector;
diff --git a/src/LAMPTool/BaseTool.h b/src/PluginWBFZExchangePlugin/BaseTool.h
similarity index 71%
rename from src/LAMPTool/BaseTool.h
rename to src/PluginWBFZExchangePlugin/BaseTool.h
index 54d76a0..422b438 100644
--- a/src/LAMPTool/BaseTool.h
+++ b/src/PluginWBFZExchangePlugin/BaseTool.h
@@ -36,17 +36,17 @@ using namespace Eigen;
///////////////////////////////////// 运行时间打印 //////////////////////////////////////////////////////////
-QString LAMPTOOLAPI getCurrentTimeString();
-QString LAMPTOOLAPI getCurrentShortTimeString();
+QString getCurrentTimeString();
+QString getCurrentShortTimeString();
-std::vector LAMPTOOLAPI splitString(const QString& str, char delimiter);
+std::vector splitString(const QString& str, char delimiter);
/////////////////////////////// 基本图像类 结束 //////////////////////////////////////////////////////////
-string LAMPTOOLAPI Convert(float Num);
-QString LAMPTOOLAPI JoinPath(const QString& path, const QString& filename);
+string Convert(float Num);
+QString JoinPath(const QString& path, const QString& filename);
////////////////////////////// 坐标部分基本方法 //////////////////////////////////////////
@@ -56,15 +56,15 @@ QString LAMPTOOLAPI JoinPath(const QString& path, const QString& filename);
////////////////////////////// 插值 ////////////////////////////////////////////
-complex LAMPTOOLAPI Cubic_Convolution_interpolation(double u, double v, Eigen::MatrixX> img);
+complex Cubic_Convolution_interpolation(double u, double v, Eigen::MatrixX> img);
-complex LAMPTOOLAPI Cubic_kernel_weight(double s);
+complex Cubic_kernel_weight(double s);
-double LAMPTOOLAPI Bilinear_interpolation(Landpoint p0, Landpoint p11, Landpoint p21, Landpoint p12, Landpoint p22);
+double Bilinear_interpolation(Landpoint p0, Landpoint p11, Landpoint p21, Landpoint p12, Landpoint p22);
-bool LAMPTOOLAPI onSegment(Point_3d Pi, Point_3d Pj, Point_3d Q);
+bool onSegment(Point_3d Pi, Point_3d Pj, Point_3d Q);
-Point_3d LAMPTOOLAPI invBilinear(Point_3d p, Point_3d a, Point_3d b, Point_3d c, Point_3d d);
+Point_3d invBilinear(Point_3d p, Point_3d a, Point_3d b, Point_3d c, Point_3d d);
@@ -87,8 +87,8 @@ step 5: 瞬时平天球坐标系转换为协议天球坐标系(J2000)
**/
-double LAMPTOOLAPI sind(double degree);
+double sind(double degree);
-double LAMPTOOLAPI cosd(double d);
+double cosd(double d);
#endif
\ No newline at end of file
diff --git a/src/PluginWBFZExchangePlugin/CMakeLists.txt b/src/PluginWBFZExchangePlugin/CMakeLists.txt
index 40fe298..39bd384 100644
--- a/src/PluginWBFZExchangePlugin/CMakeLists.txt
+++ b/src/PluginWBFZExchangePlugin/CMakeLists.txt
@@ -21,6 +21,38 @@ include_directories(C:/PCL/include/pcl-1.14)
# qt5
include_directories(C:/Qt/5.15.2/msvc2019_64/include/QtQml)
+# json
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../json)
+
+# qscintilla2
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/lexers)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/include)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/lexlib)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/Qt4Qt5)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/src)
+
+
+# qcustomplot
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qcustomplot)
+
+# qhexedit
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qhexedit)
+
+
+# 内部结构
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/SqliteDBProcess/src)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/modelProcess)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/EchoShowProcess)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/OCCViewer)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/PointCloudProcess)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/SharedModuleLib)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/TableProcess)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/TaskXml)
+
+
+
+
#-----------------------------------------------------------------------------
# 链接库
#-----------------------------------------------------------------------------
@@ -35,7 +67,9 @@ link_directories("C:/PCL/lib")
# 自动添加include目录
#-----------------------------------------------------------------------------
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
@@ -49,11 +83,14 @@ qt5_add_resources(_resource ${_qrc} ${_lang})
#-----------------------------------------------------------------------------
# 源码扫描
#-----------------------------------------------------------------------------
-file(GLOB _ui "*.ui")
-file(GLOB _header "*.h")
-file(GLOB _source "*.cpp")
+file(GLOB_RECURSE _ui "*.ui")
+file(GLOB_RECURSE _header "*.h" )
+file(GLOB_RECURSE _source "*.cpp")
qt5_wrap_ui(_interface ${_ui})
+qt5_wrap_cpp(MOC_SOURCES ${_header})
+# 将生成的 MOC 文件添加到源文件列表中
+list(APPEND SOURCES ${MOC_SOURCES})
#-----------------------------------------------------------------------------
# 添加动态库目标
#-----------------------------------------------------------------------------
@@ -62,6 +99,7 @@ add_library(PluginWBFZExchangePlugin
${_interface}
${_header}
${_source}
+ ${SOURCES}
)
@@ -77,6 +115,7 @@ link_directories("C:/PCL/lib")
find_package(Qt5 REQUIRED COMPONENTS Core Quick Sql Core Xml Opengl Gui Svg Xmlpatterns Uitools Widgets Qml Printsupport Sensors Quickwidgets Quick Concurrent Openglextensions Charts Datavisualization)
find_package(PCL )
+
# boost
include_directories(D:/vcpkg/installed/x64-windows/include)
@@ -97,29 +136,43 @@ add_definitions(${PCL_DEFINITIONS})
#-----------------------------------------------------------------------------
target_compile_definitions(PluginWBFZExchangePlugin PRIVATE "NOMINMAX") # 禁用vc++ 中的min max 定义,避免与 pcl 的中 std::min,pcl::max 函数冲突
target_compile_definitions(PluginWBFZExchangePlugin PRIVATE "WBFZ_API")
+target_compile_definitions(PluginWBFZExchangePlugin PRIVATE "WBCLFZSYSTEMMODULE_API")
+target_compile_definitions(PluginWBFZExchangePlugin PRIVATE "LAMPTOOL_API")
+
+#-----------------------------------------------------------------------------
+# 安装Qt的依赖文件
+#-----------------------------------------------------------------------------
+get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
+get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
+
+
+
list(APPEND _depend_library
- LAMPTool WBCLFZSystemModule Common PointCloudOperator PythonModule DataProperty MeshData Material Geometry BCBase ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GeometryCommand GeometryWidgets IO MainWidgets MainWindow
+ qcustomplot qhexedit qscintilla2 Common PointCloudOperator Settings PythonModule DataProperty MeshData Material Geometry BCBase ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GeometryCommand GeometryWidgets IO MainWidgets MainWindow
)
-
-
list(APPEND _runtimes_libraries
LAMPCAE::CGNS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml
)
-# 添加 点云 pcl
+
list(APPEND _runtimes_libraries
-
+ Qt5::Network Qt5::Core Qt5::Gui Qt5::Widgets Qt5::DBus Qt5::Core Qt5::Xml Qt5::OpenGL Qt5::Gui Qt5::Svg Qt5::Widgets Qt5::Qml Qt5::DataVisualization Qt5::Charts Qt5::PrintSupport Qt5::Test
)
+list(APPEND _runtimes_libraries
+ OpenCASCADE::TKOpenGl OpenCASCADE::TKOffset OpenCASCADE::TKSTL OpenCASCADE::TKFillet OpenCASCADE::Freetype OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::TKBool OpenCASCADE::TKCAF OpenCASCADE::TKCDF OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKHLR OpenCASCADE::TKIGES OpenCASCADE::TKLCAF OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKPrim OpenCASCADE::TKSTEP OpenCASCADE::TKSTEP209 OpenCASCADE::TKSTEPAttr OpenCASCADE::TKSTEPBase OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKVCAF OpenCASCADE::TKXCAF OpenCASCADE::TKXDEIGES OpenCASCADE::TKXSBase OpenCASCADE::TKernel Qt5::Widgets Qt5::Xml VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::FiltersStatistics VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ImagingMath VTK::InteractionStyle VTK::ParallelCore VTK::ParallelDIY VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib VTK::IOGeometry
+)
-# 添加 VTK
list(APPEND _runtimes_libraries
VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::DICOMParser VTK::FiltersCore VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersHybrid VTK::FiltersModeling VTK::FiltersSources VTK::IOCore VTK::IOChemistry VTK::IOGeometry VTK::IOImage VTK::IOLegacy VTK::ImagingCore VTK::ImagingSources VTK::RenderingCore VTK::RenderingLOD VTK::doubleconversion VTK::jpeg VTK::jsoncpp VTK::lz4 VTK::lzma VTK::metaio VTK::png VTK::pugixml VTK::sys VTK::tiff VTK::zlib
)
+
+
+target_include_directories(PluginWBFZExchangePlugin PRIVATE ${Qwt_INCLUDE_DIRS})
#-----------------------------------------------------------------------------
# 链接依赖库
#-----------------------------------------------------------------------------
@@ -127,6 +180,11 @@ target_link_libraries(PluginWBFZExchangePlugin PRIVATE
${_runtimes_libraries}
${_depend_library}
${PCL_LIBRARIES}
+ unofficial::sqlite3::sqlite3
+ GDAL::GDAL
+ FFTW3::fftw3
+ GSL::gsl GSL::gslcblas
+
)
#-----------------------------------------------------------------------------
diff --git a/src/WBCLFZSystemModule/DialogBatchExport.ui b/src/PluginWBFZExchangePlugin/DialogBatchExport.ui
similarity index 100%
rename from src/WBCLFZSystemModule/DialogBatchExport.ui
rename to src/PluginWBFZExchangePlugin/DialogBatchExport.ui
diff --git a/src/PluginWBFZExchangePlugin/DialogPCLBilateralFilter.cpp b/src/PluginWBFZExchangePlugin/DialogPCLBilateralFilter.cpp
new file mode 100644
index 0000000..52ca7d5
--- /dev/null
+++ b/src/PluginWBFZExchangePlugin/DialogPCLBilateralFilter.cpp
@@ -0,0 +1,291 @@
+/**
+ * @file DialogPCLBilateralFilter.cpp
+ * @brief None
+ * @author 陈增辉 (3045316072@qq.com)
+ * @version 2.5.0
+ * @date 2024/4/5
+ * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
+ */
+
+// You may need to build the project (run Qt uic code generator) to get
+// "ui_DialogPCLBilateralFilter.h" resolved
+
+#include "DialogPCLBilateralFilter.h"
+#include "ui_DialogPCLBilateralFilter.h"
+
+#include "PythonModule/PyAgent.h"
+#include "MeshData/meshSingleton.h"
+#include "MeshData/meshSet.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include "MeshData/meshKernal.h"
+#include "PointCloudOperator/PointCloudCommon.h"
+#include "Settings/BusAPI.h"
+#include "BaseTool.h"
+#include "IO/IOConfig.h"
+#include "ModuleBase/ThreadControl.h"
+#include "ConfigOptions/ConfigOptions.h"
+#include "ConfigOptions/MeshConfig.h"
+#include "Common/DebugLogger.h"
+
+
+
+
+
+
+//auto meshData = MeshData::MeshData::getInstance();
+
+namespace MainWidget {
+ DialogPCLBilateralFilter::DialogPCLBilateralFilter(GUI::MainWindow *parent)
+ : QFDialog(parent),
+ _ui(new Ui::DialogPCLBilateralFilter),
+ _mw(parent),
+ _selectdlg(new DialogSelectComponents(parent))
+ {
+ _ui->setupUi(this);
+ _ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
+ setWindowTitle(tr("Fast Bilateral Filter"));
+ _ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
+
+
+ connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
+ { _selectdlg->clearSelectItems(); _selectdlg->exec(); });
+ connect(_selectdlg, SIGNAL(selectedComponentsSig(QList)), this, SLOT(selectedComponentsSlot(QList)));
+ connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
+
+ }
+
+ DialogPCLBilateralFilter::~DialogPCLBilateralFilter()
+ {
+ delete _ui;
+ _ui = NULL;
+ delete _selectdlg;
+ _selectdlg = NULL;
+ }
+
+ void DialogPCLBilateralFilter::accept()
+ {
+ if (_components.size() == 0)
+ return;
+
+ QString componentIds;
+ for (auto component : _components)
+ componentIds.append(QString(",%1").arg(component->getID()));
+ componentIds.remove(0, 1);
+
+ double sigmaS=_ui->SigmaS->value();
+ double sigmaR=_ui->SigmaR->value();
+
+
+
+ QString outfilename="filter";
+ for (auto component : _components)
+ outfilename.append(QString("_%1").arg(component->getName()));
+
+ // 确定是否保存结果文件
+ QMessageBox::StandardButton result=QMessageBox::critical(this, "info","save as result ?");
+ QString filepath= JoinPath(Setting::BusAPI::instance()->getWorkingDir() ,outfilename+"_tmep.pcd");
+ QString AbFileName;
+ if(result==QMessageBox::StandardButton::Ok||result==QMessageBox::StandardButton::Yes){
+ QStringList suffixlist = IO::IOConfigure::getPclExporters();
+ if(suffixlist.isEmpty()) {
+ QMessageBox::warning(this, tr("Warning"), tr("The MeshPlugin is not installed !"));
+ return;
+ }
+
+ if(MeshData::MeshData::getInstance()->getKernalCount() == 0) {
+ QMessageBox::warning(this, tr("Warning"), tr("No one has any grid!"));
+ return;
+ }
+
+ QStringList meshsuffix = ConfigOption::ConfigOption::getInstance()
+ ->getMeshConfig()
+ ->getExportSuffix(ConfigOption::MeshDataType::PointCloud)
+ .split(";");
+ QStringList list;
+
+ for(QString s : meshsuffix) {
+ for(int i = 0; i < suffixlist.size(); i++) {
+ QString suffix = suffixlist.at(i);
+ if(suffix.contains(s))
+ list.append(suffix);
+ }
+ }
+
+ std::sort(list.begin(), list.end());
+ QString suffixes = list.join(";;");
+ QString workDir = Setting::BusAPI::instance()->getWorkingDir();
+ QFileDialog dlg(this, tr("Export Pcl"), workDir, suffixes);
+ dlg.setAcceptMode(QFileDialog::AcceptSave);
+ if(dlg.exec() != QFileDialog::FileName)
+ return;
+
+ QString aSuffix = dlg.selectedNameFilter();
+ QString aFileName = dlg.selectedFiles().join(",");
+ if(!(aFileName.isEmpty())){
+ filepath=aFileName;
+
+ }else{}
+
+ AbFileName=filepath;
+ QTextCodec *codec = QTextCodec::codecForName("GB18030");
+ QByteArray ba = codec->fromUnicode(filepath);
+
+ std::string outFileName=ba.data();
+
+ }else{ // 不保存成点云数据
+
+ }
+
+ // 启动线程
+ auto pclfilter = new WBFZ::PCLBilateralFilter(
+ AbFileName,WBFZ::PointCloudOperation::POINTCLOUD_FILTER,_mainWindow,componentIds, sigmaR, sigmaS);
+ ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclfilter);
+ emit tc->threadStart(); // emit MSHwriter->start();
+
+
+ QFDialog::accept();
+ }
+
+ void DialogPCLBilateralFilter::selectedComponentsSlot(QList components)
+ {
+ for (MeshData::MeshSet *set : components)
+ {
+ if (_components.contains(set))
+ continue;
+ _components.append(set);
+ _ui->listWidget->addItem(set->getName());
+ }
+ }
+
+ void DialogPCLBilateralFilter::customContextMenuRequestedSlot(const QPoint &point)
+ {
+ QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
+ if (!curItem)
+ return;
+
+ QMenu *menu = new QMenu(this);
+ QAction *deleteItem = new QAction(tr("delete this item"));
+ menu->addAction(deleteItem);
+ connect(menu, &QMenu::triggered, [=]()
+ { removeCurrentItem(curItem); });
+ menu->exec(QCursor::pos());
+ }
+
+ void DialogPCLBilateralFilter::removeCurrentItem(QListWidgetItem *curItem)
+ {
+ auto meshData = MeshData::MeshData::getInstance();
+ auto meshSet = meshData->getMeshSetByName(curItem->text());
+ if (!meshSet)
+ return;
+ _components.removeOne(meshSet);
+ _ui->listWidget->removeItemWidget(curItem);
+ delete curItem;
+ }
+
+
+} // namespace MainWidget
+WBFZ::PCLBilateralFilter::PCLBilateralFilter(const QString& fileName,
+ WBFZ::PointCloudOperation operation,
+ GUI::MainWindow* mw, QString componentIds,
+ double sigmaR, double sigmaS)
+ : PointCloudThreadBase(fileName, operation, mw)
+ , _fileName(fileName)
+ , _operation(operation)
+ , _componentIds(componentIds)
+ , _sigmaR(sigmaR)
+ , _sigmaS(sigmaS)
+{
+
+}
+vtkDataSet* WBFZ::PCLBilateralFilter::filter()
+{
+ return PCLBilateralFilterAlg( _componentIds, _sigmaR, _sigmaS);
+}
+vtkDataSet* WBFZ::PCLBilateralFilter::PCLBilateralFilterAlg(QString componentIds, double sigmaR,
+ double sigmaS)
+{
+ emit _mainwindow->printMessage(Common::Message::Normal,"PCLBilateralFilterAlg");
+ // 获取vtdataset
+ QStringList qCompontIds = QString(componentIds).split(',');
+
+ MeshData::MeshSet* meshSet = NULL;
+ MeshData::MeshKernal* meshKernal = NULL;
+ MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
+ QString kernalName, transformedName, setType, ids;
+
+ // 筛选其中的点云数据
+ // 创建 vtkCellDataToPointData 过滤器
+ vtkSmartPointer cellToPointFilter = vtkSmartPointer::New();
+
+ QString outfilename;
+ for(QString compontId : qCompontIds) {
+ meshSet = meshData->getMeshSetByID(compontId.toInt());
+ DebugInfo("point count %d : %d ",compontId.toInt(),meshSet==nullptr);
+ if(!meshSet)
+ continue;
+ outfilename=meshSet->getName();
+ vtkPolyData* temppolyData=PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
+ cellToPointFilter->SetInputData(temppolyData);
+ DebugInfo("point count %d : %d ",compontId.toInt(),temppolyData==nullptr);
+ }
+
+ // 执行过滤操作
+ cellToPointFilter->Update();
+ DebugInfo("cellToPointFilter ");
+ // 获取过滤后的 vtkPolyData
+ vtkPolyData* outpolyData = cellToPointFilter->GetOutput();
+ DebugInfo("outpolyData ");
+
+
+ pcl::PointCloud::Ptr cloud_with_rgba(new pcl::PointCloud);
+ pcl::PointCloud::Ptr cloud_filtered(new pcl::PointCloud);
+ pcl::io::vtkPolyDataToPointCloud(outpolyData,*cloud_with_rgba);
+ // 创建滤波器对象
+
+ pcl::FastBilateralFilter fbf;
+ fbf.setInputCloud(cloud_with_rgba);
+ fbf.setSigmaS(sigmaS);
+ fbf.setSigmaR(sigmaR);
+ fbf.filter(*cloud_filtered);
+
+ // 转换处理结果
+ vtkPolyData* polydata=nullptr;
+ polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
+ pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
+ vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
+ size_t pointCount = dataset->GetNumberOfPoints();
+ if(pointCount==0){
+ return nullptr;
+ }
+ 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;
+
+}
+WBFZ::PCLBilateralFilter::~PCLBilateralFilter() {}
diff --git a/src/MainWidgets/DialogPCLBilateralFilter.h b/src/PluginWBFZExchangePlugin/DialogPCLBilateralFilter.h
similarity index 62%
rename from src/MainWidgets/DialogPCLBilateralFilter.h
rename to src/PluginWBFZExchangePlugin/DialogPCLBilateralFilter.h
index 14809b4..114367f 100644
--- a/src/MainWidgets/DialogPCLBilateralFilter.h
+++ b/src/PluginWBFZExchangePlugin/DialogPCLBilateralFilter.h
@@ -9,9 +9,17 @@
#ifndef LAMPCAE_DIALOGPCLBILATERALFILTER_H
#define LAMPCAE_DIALOGPCLBILATERALFILTER_H
-#include "mainWidgetsAPI.h"
+#include "WBFZExchangePluginAPI.h"
#include "SelfDefObject/QFDialog.h"
-#include "DialogVTKTransform.h"
+#include "MainWidgets/DialogVTKTransform.h"
+#include "PointCloudThreadBase.h"
+
+
+
+namespace WBFZ{
+ class PointCloudThreadBase;
+}
+
class QListWidgetItem;
@@ -26,9 +34,32 @@ namespace MeshData
}
+namespace WBFZ{
+ class PCLBilateralFilter : public PointCloudThreadBase
+ {
+ public:
+ 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);
+ private:
+ QString _fileName;
+ PointCloudOperation _operation;
+ QString _componentIds;
+ double _sigmaR;
+ double _sigmaS;
+
+ };
+}
+
+
+
+
+
namespace MainWidget {
class DialogSelectComponents;
- class MAINWIDGETSAPI DialogPCLBilateralFilter : public QFDialog {
+ class DialogPCLBilateralFilter : public QFDialog {
Q_OBJECT
public:
@@ -55,6 +86,14 @@ namespace MainWidget {
private:
Ui::DialogPCLBilateralFilter* _ui;
};
+
+
+
+
+
+
+
+
} // namespace MainWidget
#endif // LAMPCAE_DIALOGPCLBILATERALFILTER_H
diff --git a/src/MainWidgets/DialogPCLBilateralFilter.ui b/src/PluginWBFZExchangePlugin/DialogPCLBilateralFilter.ui
similarity index 100%
rename from src/MainWidgets/DialogPCLBilateralFilter.ui
rename to src/PluginWBFZExchangePlugin/DialogPCLBilateralFilter.ui
diff --git a/src/PluginWBFZExchangePlugin/DialogPCLGPMesh.cpp b/src/PluginWBFZExchangePlugin/DialogPCLGPMesh.cpp
new file mode 100644
index 0000000..cfd8b98
--- /dev/null
+++ b/src/PluginWBFZExchangePlugin/DialogPCLGPMesh.cpp
@@ -0,0 +1,449 @@
+/**
+ * @file DialogPCLGPMesh.cpp
+ * @brief None
+ * @author 陈增辉 (3045316072@qq.com)
+ * @version 2.5.0
+ * @date 2024/4/5
+ * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
+ */
+
+// You may need to build the project (run Qt uic code generator) to get "ui_DialogPCLGPMesh.h"
+// resolved
+
+#include "DialogPCLGPMesh.h"
+#include "ui_DialogPCLGPMesh.h"
+#include "ModuleBase/ThreadTask.h"
+#include "PythonModule/PyAgent.h"
+#include "MeshData/meshSingleton.h"
+#include "MeshData/meshSet.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include "MeshData/meshKernal.h"
+#include "PointCloudOperator/PointCloudCommon.h"
+#include "Settings/BusAPI.h"
+#include "BaseTool.h"
+#include "IO/IOConfig.h"
+#include "ModuleBase/ThreadControl.h"
+#include "ConfigOptions/ConfigOptions.h"
+#include "ConfigOptions/MeshConfig.h"
+
+#include "MeshData/meshSingleton.h"
+#include "MeshData/meshKernal.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "Common/DebugLogger.h"
+
+// auto meshData = MeshData::MeshData::getInstance();
+
+namespace MainWidget {
+ 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"));
+ _ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
+
+ connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]() {
+ _selectdlg->clearSelectItems();
+ _selectdlg->exec();
+ });
+ connect(_selectdlg, SIGNAL(selectedComponentsSig(QList)), this,
+ SLOT(selectedComponentsSlot(QList)));
+ connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this,
+ SLOT(customContextMenuRequestedSlot(const QPoint&)));
+ }
+
+ DialogPCLGPMesh::~DialogPCLGPMesh()
+ {
+ delete _ui;
+ _ui = NULL;
+ delete _selectdlg;
+ _selectdlg = NULL;
+ }
+
+ void DialogPCLGPMesh::accept()
+ {
+ if(_components.size() == 0)
+ return;
+
+ QString componentIds;
+ for(auto component : _components)
+ componentIds.append(QString(",%1").arg(component->getID()));
+ componentIds.remove(0, 1);
+
+ double SearchRadius = _ui->SearchRadius->value();
+ double Mu = _ui->Mu->value();
+ int MaximumNearestNeighbors = _ui->MaximumNearestNeighbors->value();
+ double MaximumSurfaceAngle = _ui->MaximumSurfaceAngle->value();
+ double MaximumAngle = _ui->MaximumAngle->value();
+ double MinimumAngle = _ui->MinimumAngle->value();
+
+ QString outfilename = "filter";
+ for(auto component : _components)
+ outfilename.append(QString("_%1").arg(component->getName()));
+
+ // 确定是否保存结果文件
+ QMessageBox::StandardButton result =
+ QMessageBox::critical(this, "info", "save as result ?");
+ QString filepath =
+ JoinPath(Setting::BusAPI::instance()->getWorkingDir(), outfilename + "_tmep.pcd");
+ QString AbFileName = filepath;
+ if(result == QMessageBox::StandardButton::Ok
+ || result == QMessageBox::StandardButton::Yes) {
+ DebugInfo("outfilename ok ok \n");
+ QStringList suffixlist = IO::IOConfigure::getMeshExporters();
+ if(suffixlist.isEmpty()) {
+ QMessageBox::warning(this, tr("Warning"), tr("The MeshPlugin is not installed !"));
+ return;
+ }
+
+ QStringList meshsuffix = ConfigOption::ConfigOption::getInstance()
+ ->getMeshConfig()
+ ->getExportSuffix(ConfigOption::MeshDataType::vtkMesh)
+ .split(";");
+ QStringList list;
+
+ for(QString s : meshsuffix) {
+ for(int i = 0; i < suffixlist.size(); i++) {
+ QString suffix = suffixlist.at(i);
+ if(suffix.contains(s))
+ list.append(suffix);
+ }
+ }
+
+ std::sort(list.begin(), list.end());
+ QString suffixes = list.join(";;");
+ QString workDir = Setting::BusAPI::instance()->getWorkingDir();
+
+ QFileDialog dlg(this, tr("Export mesh"), workDir, suffixes);
+ dlg.setAcceptMode(QFileDialog::AcceptSave);
+ if(dlg.exec() != QFileDialog::FileName)
+ return;
+
+ QString aSuffix = dlg.selectedNameFilter();
+ QString aFileName = dlg.selectedFiles().join(",");
+ if(!(aFileName.isEmpty())) {
+ filepath = aFileName;
+
+ } else {
+ }
+
+ AbFileName = filepath;
+
+ } else { // 不保存成点云数据
+ }
+ DebugInfo("outfilename %s \n", AbFileName.toStdString().c_str());
+ // 启动线程
+ auto pclremesh =
+ new WBFZ::PCLGPMesh(AbFileName, WBFZ::PointCloudOperation::POINTCLOUD_MESH, _mainWindow,
+ componentIds, SearchRadius, Mu, MaximumNearestNeighbors,
+ MaximumSurfaceAngle, MaximumAngle, MinimumAngle);
+ ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclremesh);
+ emit tc->threadStart(); // emit MSHwriter->start();
+
+ QFDialog::accept();
+ }
+
+ void DialogPCLGPMesh::selectedComponentsSlot(QList 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)
+ return;
+
+ QMenu* menu = new QMenu(this);
+ QAction* deleteItem = new QAction(tr("delete this item"));
+ menu->addAction(deleteItem);
+ connect(menu, &QMenu::triggered, [=]() { removeCurrentItem(curItem); });
+ menu->exec(QCursor::pos());
+ }
+
+ void DialogPCLGPMesh::removeCurrentItem(QListWidgetItem* curItem)
+ {
+ auto meshData = MeshData::MeshData::getInstance();
+ auto meshSet = meshData->getMeshSetByName(curItem->text());
+ if(!meshSet)
+ return;
+ _components.removeOne(meshSet);
+ _ui->listWidget->removeItemWidget(curItem);
+ delete curItem;
+ }
+
+} // namespace MainWidget
+
+namespace WBFZ {
+ 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)
+ {
+ }
+
+ PCLGPMesh::~PCLGPMesh() {}
+
+ void PCLGPMesh::defaultMeshFinished()
+ {
+ 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();
+ // 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);
+ } else {
+ information = QString("Failed Filter From \"%1\"").arg(_fileName);
+ msg.type = Common::Message::Error;
+ msg.message = information;
+ }
+ } else {
+ }
+ }
+ // emit showInformation(information);
+ // emit _mainwindow->printMessageToMessageWindow(msg);
+ ModuleBase::ThreadTask::threadTaskFinished();
+ Py::PythonAgent::getInstance()->unLock();
+ }
+ void PCLGPMesh::setThreadRunState(bool flag)
+ {
+ _success = flag;
+ }
+
+ void PCLGPMesh::run()
+ {
+ ModuleBase::ThreadTask::run();
+ bool result = false;
+ switch(_operation) {
+ case POINTCLOUD_MESH:
+ emit showInformation(tr("POINTCLOUD_MESH From \"%1\"").arg(_fileName));
+ result = remeshtaskProcess();
+ setThreadRunState(result);
+ break;
+ default:
+ break;
+ }
+ DebugInfo("run ok _success %d _threadRuning %d \n", _success, _threadRuning);
+ defaultMeshFinished();
+ }
+
+ bool PCLGPMesh::remeshtaskProcess()
+ {
+ QString componentIds = _componentIds;
+ double SearchRadius = _SearchRadius;
+ double Mu = _Mu;
+ int MaximumNearestNeighbors = _MaximumNearestNeighbors;
+ double MaximumSurfaceAngle = _MaximumSurfaceAngle;
+ double MaximumAngle = _MaximumAngle;
+ double MinimumAngle = _MinimumAngle;
+
+ emit _mainwindow->printMessage(Common::Message::Normal, "PCLGPMeshAlg");
+ // 获取vtdataset
+ QStringList qCompontIds = QString(componentIds).split(',');
+
+ MeshData::MeshSet* meshSet = NULL;
+ MeshData::MeshKernal* meshKernal = NULL;
+ MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
+ QString kernalName, transformedName, setType, ids;
+
+ // 筛选其中的点云数据
+ // 创建 vtkCellDataToPointData 过滤器
+ vtkSmartPointer cellToPointFilter =
+ vtkSmartPointer::New();
+
+ QString outfilename;
+ for(QString compontId : qCompontIds) {
+ meshSet = meshData->getMeshSetByID(compontId.toInt());
+ DebugInfo("point count %d : %d \n", compontId.toInt(), meshSet == nullptr);
+ 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);
+ }
+
+ // 执行过滤操作
+ cellToPointFilter->Update();
+ DebugInfo("cellToPointFilter \n");
+ // 获取过滤后的 vtkPolyData
+ vtkPolyData* outpolyData = cellToPointFilter->GetOutput();
+ DebugInfo("outpolyData ");
+
+ pcl::PointCloud::Ptr cloud_with_rgba(
+ new pcl::PointCloud);
+ pcl::PointCloud::Ptr cloud_filtered(
+ new pcl::PointCloud);
+ pcl::io::vtkPolyDataToPointCloud(outpolyData, *cloud_with_rgba);
+ // 创建滤波器对象
+
+ // 计算点云滤波结果
+ pcl::PointCloud::Ptr output(
+ new pcl::PointCloud); // 输出结果
+ pcl::PointCloud::Ptr cloud_with_normals(
+ new pcl::PointCloud);
+ pcl::PolygonMesh* mesh = new pcl::PolygonMesh;
+
+ // 估计法线
+ PointCloudOperator::PointCloudCommon::NormalEstimation(cloud_with_rgba, cloud_with_normals);
+
+ //------------------定义搜索树对象------------------------
+ pcl::search::KdTree::Ptr tree2(new pcl::search::KdTree);
+ tree2->setInputCloud(cloud_with_normals);
+ pcl::GreedyProjectionTriangulation 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());
+ // 转换处理结果
+ vtkPolyData* polydata = vtkPolyData::New(); // 创建新的指针,智能指针会释放
+ size_t pointcount = PointCloudOperator::PointCloudCommon::mesh2vtk(*mesh, polydata);
+ DebugInfo("remesh over ,conver over polydata %d , pointcount %d\n", polydata == nullptr,
+ pointcount);
+ vtkDataSet* dataset =
+ vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
+ // 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;
+
+ // 加载文件
+ 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();
+ DebugInfo("writing %s suffix %s !! \n", ba.data(), suffix.toStdString().c_str());
+ if(suffix == "vtk") {
+ vtkSmartPointer writer =
+ vtkSmartPointer::New();
+ writer->SetInputData(dataset);
+ writer->SetFileTypeToBinary();
+ writer->SetFileName(ba);
+ writer->Write();
+ DebugInfo("writing vtk !! \n");
+ } else if(suffix == "stl") {
+ QTextCodec* codec = QTextCodec::codecForName("GB18030");
+ QByteArray ba = codec->fromUnicode(_fileName);
+
+ vtkSmartPointer writer = vtkSmartPointer::New();
+ writer->SetInputData(dataset);
+ 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());
+ // 保存流程文件
+ if(dataset != nullptr) {
+ DebugInfo("load result in meshKernal \n");
+ auto* k = new MeshData::MeshKernal;
+ k->setName(name);
+ k->setPath(path);
+ auto meshData = MeshData::MeshData::getInstance();
+ int nKernal = meshData->getKernalCount();
+ for(int iKernal = 0; iKernal < nKernal; ++iKernal) {
+ MeshData::MeshKernal* temp = meshData->getKernalAt(iKernal);
+ if(temp->getPath() == path) { ///< MG same file update
+ meshData->removeKernalAt(iKernal);
+ break;
+ }
+ }
+
+ k->setMeshData(dataset);
+ meshData->appendMeshKernal(k);
+ DebugInfo("load result in meshKernal \n");
+
+ return true;
+ } else {
+ return false;
+ }
+
+ return false;
+ }
+} // namespace WBFZ
\ No newline at end of file
diff --git a/src/MainWidgets/DialogPCLGPMesh.h b/src/PluginWBFZExchangePlugin/DialogPCLGPMesh.h
similarity index 50%
rename from src/MainWidgets/DialogPCLGPMesh.h
rename to src/PluginWBFZExchangePlugin/DialogPCLGPMesh.h
index 1bfa4cd..1bc7b02 100644
--- a/src/MainWidgets/DialogPCLGPMesh.h
+++ b/src/PluginWBFZExchangePlugin/DialogPCLGPMesh.h
@@ -10,9 +10,16 @@
#ifndef LAMPCAE_DIALOGPCLGPMESH_H
#define LAMPCAE_DIALOGPCLGPMESH_H
-#include "mainWidgetsAPI.h"
+#include "WBFZExchangePluginAPI.h"
#include "SelfDefObject/QFDialog.h"
-#include "DialogVTKTransform.h"
+#include "MainWidgets/DialogVTKTransform.h"
+#include "PointCloudThreadBase.h"
+#include "MainWindow/MainWindow.h"
+#include "MainWindow/SubWindowManager.h"
+
+namespace WBFZ{
+ class PointCloudThreadBase;
+}
class QListWidgetItem;
@@ -27,9 +34,45 @@ namespace MeshData
class MeshSet;
}
+namespace GUI
+{
+ class MainWindow;
+ class SubWindowManager;
+}
+
+namespace WBFZ{
+ class PCLGPMesh : public ModuleBase::ThreadTask
+ {
+ public:
+ PCLGPMesh(const QString &fileName, PointCloudOperation operation, GUI::MainWindow *mw, QString componentIds , double SearchRadius, double Mu,int MaximumNearestNeighbors,double MaximumSurfaceAngle,double MaximumAngle,double MinimumAngle);
+ ~PCLGPMesh();
+ public:
+ virtual void run();
+ void defaultMeshFinished();
+ void setThreadRunState(bool);
+ bool remeshtaskProcess();
+// vtkDataSet* remesh() ;
+// vtkDataSet* PCLGPMeshAlg(QString componentIds , double SearchRadius, double Mu,int MaximumNearestNeighbors,double MaximumSurfaceAngle,double MaximumAngle,double MinimumAngle);
+ private:
+ bool _success{false};
+ QString _fileName;
+ PointCloudOperation _operation;
+ QString _componentIds;
+ double _SearchRadius;
+ double _Mu;
+ int _MaximumNearestNeighbors;
+ double _MaximumSurfaceAngle;
+ double _MaximumAngle;
+ double _MinimumAngle;
+
+ };
+}
+
+
+
namespace MainWidget {
class DialogSelectComponents;
- class MAINWIDGETSAPI DialogPCLGPMesh : public QFDialog {
+ class DialogPCLGPMesh : public QFDialog {
Q_OBJECT
public:
diff --git a/src/MainWidgets/DialogPCLGPMesh.ui b/src/PluginWBFZExchangePlugin/DialogPCLGPMesh.ui
similarity index 93%
rename from src/MainWidgets/DialogPCLGPMesh.ui
rename to src/PluginWBFZExchangePlugin/DialogPCLGPMesh.ui
index 844d5c9..75c57d9 100644
--- a/src/MainWidgets/DialogPCLGPMesh.ui
+++ b/src/PluginWBFZExchangePlugin/DialogPCLGPMesh.ui
@@ -69,7 +69,7 @@
- Search Radius:
+ Triangle edge:
@@ -93,6 +93,9 @@
360.000000000000000
+
+ 1.000000000000000
+
-
@@ -134,6 +137,12 @@
360.000000000000000
+
+ 1.000000000000000
+
+
+ 2.500000000000000
+
-
@@ -169,6 +178,15 @@
25
+
+ 1000000
+
+
+ QAbstractSpinBox::DefaultStepType
+
+
+ 10000
+
-
@@ -210,6 +228,9 @@
360.000000000000000
+
+ 360.000000000000000
+
-
@@ -251,6 +272,9 @@
360.000000000000000
+
+ 360.000000000000000
+
-
diff --git a/src/PluginWBFZExchangePlugin/DialogPCLGuassFilter.cpp b/src/PluginWBFZExchangePlugin/DialogPCLGuassFilter.cpp
new file mode 100644
index 0000000..90f4240
--- /dev/null
+++ b/src/PluginWBFZExchangePlugin/DialogPCLGuassFilter.cpp
@@ -0,0 +1,321 @@
+/**
+ * @file DialogPCLGuassFilter.cpp
+ * @brief None
+ * @author 陈增辉 (3045316072@qq.com)
+ * @version 2.5.0
+ * @date 2024/4/5
+ * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
+ */
+
+// You may need to build the project (run Qt uic code generator) to get "ui_DialogPCLGuassFilter.h"
+// resolved
+
+#include "DialogPCLGuassFilter.h"
+#include "ui_DialogPCLGuassFilter.h"
+
+#include "PythonModule/PyAgent.h"
+#include "MeshData/meshSingleton.h"
+#include "MeshData/meshSet.h"
+#include
+#include
+#include
+#include
+#include
+#include "MeshData/meshKernal.h"
+#include "PointCloudOperator/PointCloudCommon.h"
+#include "Settings/BusAPI.h"
+#include "BaseTool.h"
+#include "IO/IOConfig.h"
+#include
+#include
+#include
+#include
+#include "MeshData/meshKernal.h"
+#include "PointCloudOperator/PointCloudCommon.h"
+#include "Settings/BusAPI.h"
+#include "BaseTool.h"
+#include "IO/IOConfig.h"
+#include "ModuleBase/ThreadControl.h"
+#include "ConfigOptions/ConfigOptions.h"
+#include "ConfigOptions/MeshConfig.h"
+#include "Common/DebugLogger.h"
+
+//auto meshData = MeshData::MeshData::getInstance();
+
+namespace MainWidget {
+ DialogPCLGuassFilter::DialogPCLGuassFilter(GUI::MainWindow *parent)
+ : QFDialog(parent),
+ _ui(new Ui::DialogPCLGuassFilter),
+ _mw(parent),
+ _selectdlg(new DialogSelectComponents(parent))
+ {
+ _ui->setupUi(this);
+ _ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
+ setWindowTitle(tr("Guass Filter"));
+ _ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
+
+
+ connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
+ { _selectdlg->clearSelectItems(); _selectdlg->exec(); });
+ connect(_selectdlg, SIGNAL(selectedComponentsSig(QList)), this, SLOT(selectedComponentsSlot(QList)));
+ connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
+
+ }
+
+ DialogPCLGuassFilter::~DialogPCLGuassFilter()
+ {
+ delete _ui;
+ _ui = NULL;
+ delete _selectdlg;
+ _selectdlg = NULL;
+ }
+
+ void DialogPCLGuassFilter::accept()
+ {
+ if (_components.size() == 0)
+ return;
+
+ QString componentIds, rotate, moveLocation, scale;
+ for (auto component : _components)
+ componentIds.append(QString(",%1").arg(component->getID()));
+ componentIds.remove(0, 1);
+
+
+ double Sigma=_ui->Sigma->value();
+ double threshold=_ui->threshold->value();
+ double radius=_ui->radius->value();
+
+ QString outfilename="filter";
+ for (auto component : _components)
+ outfilename.append(QString("_%1").arg(component->getName()));
+
+ // 确定是否保存结果文件
+ QMessageBox::StandardButton result=QMessageBox::critical(this, "info","save as result ?");
+ QString filepath= JoinPath(Setting::BusAPI::instance()->getWorkingDir() ,outfilename+"_tmep.pcd");
+ QString AbFileName;
+ if(result==QMessageBox::StandardButton::Ok||result==QMessageBox::StandardButton::Yes){
+ QStringList suffixlist = IO::IOConfigure::getPclExporters();
+ if(suffixlist.isEmpty()) {
+ QMessageBox::warning(this, tr("Warning"), tr("The MeshPlugin is not installed !"));
+ return;
+ }
+
+ if(MeshData::MeshData::getInstance()->getKernalCount() == 0) {
+ QMessageBox::warning(this, tr("Warning"), tr("No one has any grid!"));
+ return;
+ }
+
+ QStringList meshsuffix = ConfigOption::ConfigOption::getInstance()
+ ->getMeshConfig()
+ ->getExportSuffix(ConfigOption::MeshDataType::PointCloud)
+ .split(";");
+ QStringList list;
+
+ for(QString s : meshsuffix) {
+ for(int i = 0; i < suffixlist.size(); i++) {
+ QString suffix = suffixlist.at(i);
+ if(suffix.contains(s))
+ list.append(suffix);
+ }
+ }
+
+ std::sort(list.begin(), list.end());
+ QString suffixes = list.join(";;");
+ QString workDir = Setting::BusAPI::instance()->getWorkingDir();
+ QFileDialog dlg(this, tr("Export Pcl"), workDir, suffixes);
+ dlg.setAcceptMode(QFileDialog::AcceptSave);
+ if(dlg.exec() != QFileDialog::FileName)
+ return;
+
+ QString aSuffix = dlg.selectedNameFilter();
+ QString aFileName = dlg.selectedFiles().join(",");
+ if(!(aFileName.isEmpty())){
+ filepath=aFileName;
+
+ }else{}
+
+ AbFileName=filepath;
+ QTextCodec *codec = QTextCodec::codecForName("GB18030");
+ QByteArray ba = codec->fromUnicode(filepath);
+
+ std::string outFileName=ba.data();
+
+ }else{ // 不保存成点云数据
+
+ }
+
+ // 启动线程
+ auto pclfilter = new WBFZ::PCLGuassFilter(
+ AbFileName,WBFZ::PointCloudOperation::POINTCLOUD_FILTER,_mainWindow,componentIds, Sigma, threshold,radius);
+ ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclfilter);
+ emit tc->threadStart(); // emit MSHwriter->start();
+
+
+ QFDialog::accept();
+ }
+
+ void DialogPCLGuassFilter::selectedComponentsSlot(QList components)
+ {
+ for (MeshData::MeshSet *set : components)
+ {
+ if (_components.contains(set))
+ continue;
+ _components.append(set);
+ _ui->listWidget->addItem(set->getName());
+ }
+ }
+
+ void DialogPCLGuassFilter::customContextMenuRequestedSlot(const QPoint &point)
+ {
+ QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
+ if (!curItem)
+ return;
+
+ QMenu *menu = new QMenu(this);
+ QAction *deleteItem = new QAction(tr("delete this item"));
+ menu->addAction(deleteItem);
+ connect(menu, &QMenu::triggered, [=]()
+ { removeCurrentItem(curItem); });
+ menu->exec(QCursor::pos());
+ }
+
+ void DialogPCLGuassFilter::removeCurrentItem(QListWidgetItem *curItem)
+ {
+ auto meshData = MeshData::MeshData::getInstance();
+ auto meshSet = meshData->getMeshSetByName(curItem->text());
+ if (!meshSet)
+ return;
+ _components.removeOne(meshSet);
+ _ui->listWidget->removeItemWidget(curItem);
+ delete curItem;
+ }
+
+
+} // namespace MainWidget
+WBFZ::PCLGuassFilter::PCLGuassFilter(const QString& fileName, WBFZ::PointCloudOperation operation,
+ GUI::MainWindow* mw, QString componentIds, double sigma,
+ double threshold,double radius)
+ : PointCloudThreadBase(fileName, operation, mw)
+ , _fileName(fileName)
+ , _operation(operation)
+ , _componentIds(componentIds)
+ , _sigma(sigma)
+ , _threshold(threshold)
+ , _radius(radius)
+{
+}
+vtkDataSet* WBFZ::PCLGuassFilter::filter()
+{
+ return PointCloudThreadBase::filter();
+}
+vtkDataSet* WBFZ::PCLGuassFilter::PCLGuassFilterAlg(QString componentIds, double sigma,
+ double threshold,double radius)
+{
+ emit _mainwindow->printMessage(Common::Message::Normal,"PCLGuassFilterAlg");
+ // 获取vtdataset
+ QStringList qCompontIds = QString(componentIds).split(',');
+
+ MeshData::MeshSet* meshSet = NULL;
+ MeshData::MeshKernal* meshKernal = NULL;
+ MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
+ QString kernalName, transformedName, setType, ids;
+
+ // 筛选其中的点云数据
+ // 创建 vtkCellDataToPointData 过滤器
+ vtkSmartPointer cellToPointFilter = vtkSmartPointer::New();
+
+ QString outfilename;
+ for(QString compontId : qCompontIds) {
+ meshSet = meshData->getMeshSetByID(compontId.toInt());
+ DebugInfo("point count %d : %d ",compontId.toInt(),meshSet==nullptr);
+ if(!meshSet)
+ continue;
+ outfilename=meshSet->getName();
+ vtkPolyData* temppolyData=PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
+ cellToPointFilter->SetInputData(temppolyData);
+ DebugInfo("point count %d : %d ",compontId.toInt(),temppolyData==nullptr);
+ }
+
+ // 执行过滤操作
+ cellToPointFilter->Update();
+ DebugInfo("cellToPointFilter ");
+ // 获取过滤后的 vtkPolyData
+ vtkPolyData* outpolyData = cellToPointFilter->GetOutput();
+ DebugInfo("outpolyData ");
+
+
+ pcl::PointCloud::Ptr cloud_with_rgba(new pcl::PointCloud);
+ pcl::PointCloud::Ptr cloud_filtered(new pcl::PointCloud);
+ pcl::io::vtkPolyDataToPointCloud(outpolyData,*cloud_with_rgba);
+ // 创建滤波器对象
+
+
+
+ /*double radius = 0.02;*/
+ // Set up the Gaussian Kernel
+ pcl::filters::GaussianKernel::Ptr kernel(
+ new pcl::filters::GaussianKernel);
+ (*kernel).setSigma(sigma);
+ (*kernel).setThresholdRelativeToSigma(threshold);
+ emit _mainwindow->printMessage(Common::Message::Normal,"Kernel made" );
+
+ // Set up the KDTree
+ pcl::search::KdTree::Ptr kdtree(
+ new pcl::search::KdTree);
+ (*kdtree).setInputCloud(cloud_with_rgba);
+ emit _mainwindow->printMessage(Common::Message::Normal,"KdTree made" );
+
+ // Set up the Convolution Filter
+ pcl::filters::Convolution3D<
+ pcl::PointXYZRGBA,
+ pcl::PointXYZRGBA,
+ pcl::filters::GaussianKernel>
+ convolution;
+ convolution.setKernel(*kernel);
+ convolution.setInputCloud(cloud_with_rgba);
+ convolution.setSearchMethod(kdtree);
+ convolution.setRadiusSearch(radius);
+ convolution.setNumberOfThreads(
+ 10); // important! Set Thread number for openMP
+ emit _mainwindow->printMessage(Common::Message::Normal,"Convolution Start");
+ convolution.convolve(*cloud_filtered);
+ emit _mainwindow->printMessage(Common::Message::Normal,"Convoluted" );
+
+
+
+ // 转换处理结果
+ vtkPolyData* polydata=nullptr;
+ polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
+ pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
+ vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
+ size_t pointCount = dataset->GetNumberOfPoints();
+ if(pointCount==0){
+ return nullptr;
+ }
+
+ 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;
+}
+WBFZ::PCLGuassFilter::~PCLGuassFilter() {}
diff --git a/src/MainWidgets/DialogPCLGuassFilter.h b/src/PluginWBFZExchangePlugin/DialogPCLGuassFilter.h
similarity index 60%
rename from src/MainWidgets/DialogPCLGuassFilter.h
rename to src/PluginWBFZExchangePlugin/DialogPCLGuassFilter.h
index 0ffe40c..b84a2d8 100644
--- a/src/MainWidgets/DialogPCLGuassFilter.h
+++ b/src/PluginWBFZExchangePlugin/DialogPCLGuassFilter.h
@@ -10,9 +10,13 @@
#ifndef LAMPCAE_DIALOGPCLGUASSFILTER_H
#define LAMPCAE_DIALOGPCLGUASSFILTER_H
-#include "mainWidgetsAPI.h"
+#include "WBFZExchangePluginAPI.h"
#include "SelfDefObject/QFDialog.h"
-#include "DialogVTKTransform.h"
+#include "MainWidgets/DialogVTKTransform.h"
+#include "PointCloudThreadBase.h"
+namespace WBFZ{
+ class PointCloudThreadBase;
+}
class QListWidgetItem;
@@ -25,10 +29,38 @@ namespace MeshData
{
class MeshSet;
}
+
+
+
+namespace WBFZ{
+ class PCLGuassFilter : public PointCloudThreadBase
+ {
+ public:
+ 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);
+ private:
+ QString _fileName;
+ PointCloudOperation _operation;
+ QString _componentIds;
+ double _sigma;
+ double _threshold;
+ double _radius;
+
+ };
+}
+
+
+
+
+
+
namespace MainWidget {
class DialogSelectComponents;
- class MAINWIDGETSAPI DialogPCLGuassFilter : public QFDialog {
+ class DialogPCLGuassFilter : public QFDialog {
Q_OBJECT
public:
@@ -37,7 +69,7 @@ namespace MainWidget {
private:
void removeCurrentItem(QListWidgetItem* curItem);
signals: // 这里采用信号来直接与 主界面通信,避免参数浪费
- void excuteAlg(QString componentIds,double sigma,double threshold);
+ void excuteAlg(QString componentIds,double sigma,double threshold,double radius);
private slots:
virtual void accept();
diff --git a/src/MainWidgets/DialogPCLGuassFilter.ui b/src/PluginWBFZExchangePlugin/DialogPCLGuassFilter.ui
similarity index 85%
rename from src/MainWidgets/DialogPCLGuassFilter.ui
rename to src/PluginWBFZExchangePlugin/DialogPCLGuassFilter.ui
index 4490332..b3f16f6 100644
--- a/src/MainWidgets/DialogPCLGuassFilter.ui
+++ b/src/PluginWBFZExchangePlugin/DialogPCLGuassFilter.ui
@@ -7,7 +7,7 @@
0
0
600
- 446
+ 601
@@ -128,35 +128,13 @@
600
- 120
+ 200
params
-
-
-
-
-
- 238
- 25
-
-
-
-
- 238
- 25
-
-
-
- -360.000000000000000
-
-
- 360.000000000000000
-
-
-
-
@@ -176,8 +154,8 @@
- -
-
+
-
+
238
@@ -217,6 +195,69 @@
+ -
+
+
+
+ 238
+ 25
+
+
+
+
+ 238
+ 25
+
+
+
+ -360.000000000000000
+
+
+ 360.000000000000000
+
+
+
+ -
+
+
+
+ 91
+ 25
+
+
+
+
+ 220
+ 25
+
+
+
+ search radius :
+
+
+
+ -
+
+
+
+ 238
+ 25
+
+
+
+
+ 238
+ 25
+
+
+
+ -360.000000000000000
+
+
+ 360.000000000000000
+
+
+
diff --git a/src/PluginWBFZExchangePlugin/DialogPCLRadiusOutlierRemoval.cpp b/src/PluginWBFZExchangePlugin/DialogPCLRadiusOutlierRemoval.cpp
new file mode 100644
index 0000000..7f7f727
--- /dev/null
+++ b/src/PluginWBFZExchangePlugin/DialogPCLRadiusOutlierRemoval.cpp
@@ -0,0 +1,296 @@
+/**
+ * @file DialogPCLStatisticalRemoveFilter.cpp
+ * @brief None
+ * @author 陈增辉 (3045316072@qq.com)
+ * @version 2.5.0
+ * @date 2024/4/5
+ * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
+ */
+
+// You may need to build the project (run Qt uic code generator) to get
+// "ui_DialogPCLStatisticalRemoveFilter.h" resolved
+
+#include "DialogPCLRadiusOutlierRemoval.h"
+#include "ui_DialogPCLRadiusOutlierRemoval.h"
+
+#include "PythonModule/PyAgent.h"
+#include "MeshData/meshSingleton.h"
+#include "MeshData/meshSet.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "MeshData/meshKernal.h"
+#include "PointCloudOperator/PointCloudCommon.h"
+#include "Settings/BusAPI.h"
+#include "BaseTool.h"
+#include "IO/IOConfig.h"
+#include "ModuleBase/ThreadControl.h"
+#include "ConfigOptions/ConfigOptions.h"
+#include "ConfigOptions/MeshConfig.h"
+#include "Common/DebugLogger.h"
+
+namespace MainWidget {
+ DialogPCLRadiusOutlierRemoval::DialogPCLRadiusOutlierRemoval(GUI::MainWindow *parent)
+ : QFDialog(parent),
+ _ui(new Ui::DialogPCLRadiusOutlierRemoval),
+ _mw(parent),
+ _selectdlg(new DialogSelectComponents(parent))
+ {
+ _ui->setupUi(this);
+ _ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
+ setWindowTitle(tr("Radius Outlier Removal"));
+ _ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
+
+
+ connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
+ { _selectdlg->clearSelectItems(); _selectdlg->exec(); });
+ connect(_selectdlg, SIGNAL(selectedComponentsSig(QList)), this, SLOT(selectedComponentsSlot(QList)));
+ connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
+
+ }
+
+ DialogPCLRadiusOutlierRemoval::~DialogPCLRadiusOutlierRemoval()
+ {
+ delete _ui;
+ _ui = NULL;
+ delete _selectdlg;
+ _selectdlg = NULL;
+ }
+
+ void DialogPCLRadiusOutlierRemoval::accept()
+ {
+ if (_components.size() == 0)
+ return;
+
+ QString componentIds, rotate, moveLocation, scale;
+ for (auto component : _components)
+ componentIds.append(QString(",%1").arg(component->getID()));
+ componentIds.remove(0, 1);
+
+
+
+ double RadiusSearch=_ui->RadiusSearch->value();
+ double MinNeighborsInRadius=_ui->MinNeighborsInRadius->value();
+
+
+ QString outfilename="filter";
+ for (auto component : _components)
+ outfilename.append(QString("_%1").arg(component->getName()));
+
+ // 确定是否保存结果文件
+ QMessageBox::StandardButton result=QMessageBox::critical(this, "info","save as result ?");
+ QString filepath= JoinPath(Setting::BusAPI::instance()->getWorkingDir() ,outfilename+"_tmep.pcd");
+ QString AbFileName;
+ if(result==QMessageBox::StandardButton::Ok||result==QMessageBox::StandardButton::Yes){
+ QStringList suffixlist = IO::IOConfigure::getPclExporters();
+ if(suffixlist.isEmpty()) {
+ QMessageBox::warning(this, tr("Warning"), tr("The MeshPlugin is not installed !"));
+ return;
+ }
+
+ if(MeshData::MeshData::getInstance()->getKernalCount() == 0) {
+ QMessageBox::warning(this, tr("Warning"), tr("No one has any grid!"));
+ return;
+ }
+
+ QStringList meshsuffix = ConfigOption::ConfigOption::getInstance()
+ ->getMeshConfig()
+ ->getExportSuffix(ConfigOption::MeshDataType::PointCloud)
+ .split(";");
+ QStringList list;
+
+ for(QString s : meshsuffix) {
+ for(int i = 0; i < suffixlist.size(); i++) {
+ QString suffix = suffixlist.at(i);
+ if(suffix.contains(s))
+ list.append(suffix);
+ }
+ }
+
+ std::sort(list.begin(), list.end());
+ QString suffixes = list.join(";;");
+ QString workDir = Setting::BusAPI::instance()->getWorkingDir();
+ QFileDialog dlg(this, tr("Export Pcl"), workDir, suffixes);
+ dlg.setAcceptMode(QFileDialog::AcceptSave);
+ if(dlg.exec() != QFileDialog::FileName)
+ return;
+
+ QString aSuffix = dlg.selectedNameFilter();
+ QString aFileName = dlg.selectedFiles().join(",");
+ if(!(aFileName.isEmpty())){
+ filepath=aFileName;
+
+ }else{}
+
+ AbFileName=filepath;
+ QTextCodec *codec = QTextCodec::codecForName("GB18030");
+ QByteArray ba = codec->fromUnicode(filepath);
+
+ std::string outFileName=ba.data();
+
+ }else{ // 不保存成点云数据
+
+ }
+
+ // 启动线程
+ auto pclfilter = new WBFZ::PCLRadiusOutlierRemoval(
+ AbFileName,WBFZ::PointCloudOperation::POINTCLOUD_FILTER,_mainWindow,componentIds, RadiusSearch,MinNeighborsInRadius);
+ ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclfilter);
+ emit tc->threadStart(); // emit MSHwriter->start();
+
+
+
+ QFDialog::accept();
+ }
+
+ void DialogPCLRadiusOutlierRemoval::selectedComponentsSlot(QList components)
+ {
+ for (MeshData::MeshSet *set : components)
+ {
+ if (_components.contains(set))
+ continue;
+ _components.append(set);
+ _ui->listWidget->addItem(set->getName());
+ }
+ }
+
+ void DialogPCLRadiusOutlierRemoval::customContextMenuRequestedSlot(const QPoint &point)
+ {
+ QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
+ if (!curItem)
+ return;
+
+ QMenu *menu = new QMenu(this);
+ QAction *deleteItem = new QAction(tr("delete this item"));
+ menu->addAction(deleteItem);
+ connect(menu, &QMenu::triggered, [=]()
+ { removeCurrentItem(curItem); });
+ menu->exec(QCursor::pos());
+ }
+
+ void DialogPCLRadiusOutlierRemoval::removeCurrentItem(QListWidgetItem *curItem)
+ {
+ auto meshData = MeshData::MeshData::getInstance();
+ auto meshSet = meshData->getMeshSetByName(curItem->text());
+ if (!meshSet)
+ return;
+ _components.removeOne(meshSet);
+ _ui->listWidget->removeItemWidget(curItem);
+ delete curItem;
+ }
+
+
+} // namespace MainWidget
+
+
+
+namespace WBFZ{
+ WBFZ::PCLRadiusOutlierRemoval::PCLRadiusOutlierRemoval(const QString &fileName, WBFZ::PointCloudOperation operation,
+ GUI::MainWindow* mw, QString componentIds,
+ double RadiusSearch,double MinNeighborsInRadius)
+ : PointCloudThreadBase(fileName, operation, mw)
+ , _fileName(fileName)
+ , _operation(operation)
+ , _componentIds(componentIds)
+ , _RadiusSearch(RadiusSearch)
+ , _MinNeighborsInRadius(MinNeighborsInRadius)
+
+ {
+
+ }
+
+ vtkDataSet* WBFZ::PCLRadiusOutlierRemoval::PCLRadiusOutlierRemovalAlg(QString componentIds, double RadiusSearch,
+ double MinNeighborsInRadius)
+ {
+ emit _mainwindow->printMessage(Common::Message::Normal,"PCLRadiusOutlierRemovalAlg");
+ // 获取vtdataset
+ QStringList qCompontIds = QString(componentIds).split(',');
+
+ MeshData::MeshSet* meshSet = NULL;
+ MeshData::MeshKernal* meshKernal = NULL;
+ MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
+ QString kernalName, transformedName, setType, ids;
+
+ // 筛选其中的点云数据
+ // 创建 vtkCellDataToPointData 过滤器
+ vtkSmartPointer cellToPointFilter = vtkSmartPointer::New();
+
+ QString outfilename;
+ for(QString compontId : qCompontIds) {
+ meshSet = meshData->getMeshSetByID(compontId.toInt());
+ DebugInfo("point count %d : %d ",compontId.toInt(),meshSet==nullptr);
+ if(!meshSet)
+ continue;
+ outfilename=meshSet->getName();
+ vtkPolyData* temppolyData=PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
+ cellToPointFilter->SetInputData(temppolyData);
+ DebugInfo("point count %d : %d ",compontId.toInt(),temppolyData==nullptr);
+ }
+
+ // 执行过滤操作
+ cellToPointFilter->Update();
+ DebugInfo("cellToPointFilter ");
+ // 获取过滤后的 vtkPolyData
+ vtkPolyData* outpolyData = cellToPointFilter->GetOutput();
+ DebugInfo("outpolyData ");
+
+
+
+ pcl::PointCloud::Ptr cloud_with_rgba(new pcl::PointCloud);
+ pcl::PointCloud::Ptr cloud_filtered(new pcl::PointCloud);
+ pcl::io::vtkPolyDataToPointCloud(outpolyData,*cloud_with_rgba);
+
+
+ // 创建滤波器对象
+ pcl::RadiusOutlierRemoval sor;
+ sor.setInputCloud(cloud_with_rgba); //设置待滤波的点云
+ sor.setRadiusSearch(RadiusSearch); //设置在进行统计时考虑查询点邻居点数,K个最近邻点
+ sor.setMinNeighborsInRadius(MinNeighborsInRadius); //设置判断是否为离群点的阈值
+ sor.filter(*cloud_filtered); //将滤波结果保存在cloud_filtered中
+
+ // 转换处理结果
+ vtkPolyData* polydata=nullptr;
+ polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
+ pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
+ vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
+ size_t pointCount = dataset->GetNumberOfPoints();
+ if(pointCount==0){
+ return nullptr;
+ }
+
+ 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);
+ }
+ else if (suffix == "ply")
+ {
+ pcl::io::savePLYFileBinary(outFileName,*cloud_filtered);
+ }
+ else{}
+ return dataset;
+ }
+ vtkDataSet* PCLRadiusOutlierRemoval::filter()
+ {
+ return PCLRadiusOutlierRemovalAlg( _componentIds, _RadiusSearch,_MinNeighborsInRadius);
+ }
+ PCLRadiusOutlierRemoval::~PCLRadiusOutlierRemoval() {}
+
+}
\ No newline at end of file
diff --git a/src/MainWidgets/DialogPCLRadiusOutlierRemoval.h b/src/PluginWBFZExchangePlugin/DialogPCLRadiusOutlierRemoval.h
similarity index 61%
rename from src/MainWidgets/DialogPCLRadiusOutlierRemoval.h
rename to src/PluginWBFZExchangePlugin/DialogPCLRadiusOutlierRemoval.h
index c730b26..842f181 100644
--- a/src/MainWidgets/DialogPCLRadiusOutlierRemoval.h
+++ b/src/PluginWBFZExchangePlugin/DialogPCLRadiusOutlierRemoval.h
@@ -10,9 +10,13 @@
#ifndef LAMPCAE_DIALOGPCLRADIUSOUTLIERREMOVAL_H
#define LAMPCAE_DIALOGPCLRADIUSOUTLIERREMOVAL_H
-#include "mainWidgetsAPI.h"
+#include "WBFZExchangePluginAPI.h"
#include "SelfDefObject/QFDialog.h"
-#include "DialogVTKTransform.h"
+#include "MainWidgets/DialogVTKTransform.h"
+#include "PointCloudThreadBase.h"
+namespace WBFZ{
+ class PointCloudThreadBase;
+}
class QListWidgetItem;
@@ -25,10 +29,32 @@ namespace MeshData
{
class MeshSet;
}
+
+
+namespace WBFZ{
+ class PCLRadiusOutlierRemoval : public PointCloudThreadBase
+ {
+ public:
+ 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);
+ private:
+ QString _fileName;
+ PointCloudOperation _operation;
+ QString _componentIds;
+ double _RadiusSearch;
+ double _MinNeighborsInRadius;
+ };
+}
+
+
+
namespace MainWidget {
class DialogSelectComponents;
- class MAINWIDGETSAPI DialogPCLRadiusOutlierRemoval : public QFDialog {
+ class DialogPCLRadiusOutlierRemoval : public QFDialog {
Q_OBJECT
public:
diff --git a/src/MainWidgets/DialogPCLRadiusOutlierRemoval.ui b/src/PluginWBFZExchangePlugin/DialogPCLRadiusOutlierRemoval.ui
similarity index 100%
rename from src/MainWidgets/DialogPCLRadiusOutlierRemoval.ui
rename to src/PluginWBFZExchangePlugin/DialogPCLRadiusOutlierRemoval.ui
diff --git a/src/PluginWBFZExchangePlugin/DialogPCLStatisticalRemoveFilter.cpp b/src/PluginWBFZExchangePlugin/DialogPCLStatisticalRemoveFilter.cpp
new file mode 100644
index 0000000..eda4897
--- /dev/null
+++ b/src/PluginWBFZExchangePlugin/DialogPCLStatisticalRemoveFilter.cpp
@@ -0,0 +1,297 @@
+/**
+ * @file DialogPCLStatisticalRemoveFilter.cpp
+ * @brief None
+ * @author 陈增辉 (3045316072@qq.com)
+ * @version 2.5.0
+ * @date 2024/4/5
+ * @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
+ */
+
+// You may need to build the project (run Qt uic code generator) to get
+// "ui_DialogPCLStatisticalRemoveFilter.h" resolved
+
+#include "DialogPCLStatisticalRemoveFilter.h"
+#include "ui_DialogPCLStatisticalRemoveFilter.h"
+
+#include "PythonModule/PyAgent.h"
+#include "MeshData/meshSingleton.h"
+#include "MeshData/meshSet.h"
+#include "Settings/BusAPI.h"
+#include "BaseTool.h"
+#include "DialogPCLBilateralFilter.h"
+#include "ModuleBase/ThreadControl.h"
+#include "IO/IOConfig.h"
+#include
+#include
+#include "ConfigOptions/ConfigOptions.h"
+#include "ConfigOptions/MeshConfig.h"
+#include
+#include
+#include
+#include
+#include "MeshData/meshKernal.h"
+#include "PointCloudOperator/PointCloudCommon.h"
+#include "Settings/BusAPI.h"
+#include "BaseTool.h"
+#include "IO/IOConfig.h"
+#include "Common/DebugLogger.h"
+//auto meshData = MeshData::MeshData::getInstance();
+
+
+namespace MainWidget {
+ DialogPCLStatisticalRemoveFilter::DialogPCLStatisticalRemoveFilter(GUI::MainWindow *parent)
+ : QFDialog(parent),
+ _ui(new Ui::DialogPCLStatisticalRemoveFilter),
+ _mw(parent),
+ _selectdlg(new DialogSelectComponents(parent))
+ {
+ _ui->setupUi(this);
+ _ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
+ setWindowTitle(tr("Statistical Remove Filter"));
+ _ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
+
+
+ connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]()
+ { _selectdlg->clearSelectItems(); _selectdlg->exec(); });
+ connect(_selectdlg, SIGNAL(selectedComponentsSig(QList)), this, SLOT(selectedComponentsSlot(QList)));
+ connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequestedSlot(const QPoint &)));
+ }
+
+ DialogPCLStatisticalRemoveFilter::~DialogPCLStatisticalRemoveFilter()
+ {
+ delete _ui;
+ _ui = NULL;
+ delete _selectdlg;
+ _selectdlg = NULL;
+ }
+
+
+
+
+ void DialogPCLStatisticalRemoveFilter::accept()
+ {
+ if (_components.size() == 0)
+ return;
+
+ QString componentIds, rotate, moveLocation, scale;
+ for (auto component : _components) {
+ componentIds.append(QString(",%1").arg(component->getID()));
+ }
+ componentIds.remove(0, 1);
+
+ double MeanK=_ui->MeanK->value();
+ double stddev=_ui->Stddev->value();
+
+ QString outfilename="filter";
+ for (auto component : _components)
+ outfilename.append(QString("_%1").arg(component->getName()));
+
+ // 确定是否保存结果文件
+ QMessageBox::StandardButton result=QMessageBox::critical(this, "info","save as result ?");
+ QString filepath= JoinPath(Setting::BusAPI::instance()->getWorkingDir() ,outfilename+"_tmep.pcd");
+ QString AbFileName;
+ if(result==QMessageBox::StandardButton::Ok||result==QMessageBox::StandardButton::Yes){
+ QStringList suffixlist = IO::IOConfigure::getPclExporters();
+ if(suffixlist.isEmpty()) {
+ QMessageBox::warning(this, tr("Warning"), tr("The MeshPlugin is not installed !"));
+ return;
+ }
+
+ if(MeshData::MeshData::getInstance()->getKernalCount() == 0) {
+ QMessageBox::warning(this, tr("Warning"), tr("No one has any grid!"));
+ return;
+ }
+
+ QStringList meshsuffix = ConfigOption::ConfigOption::getInstance()
+ ->getMeshConfig()
+ ->getExportSuffix(ConfigOption::MeshDataType::PointCloud)
+ .split(";");
+ QStringList list;
+
+ for(QString s : meshsuffix) {
+ for(int i = 0; i < suffixlist.size(); i++) {
+ QString suffix = suffixlist.at(i);
+ if(suffix.contains(s))
+ list.append(suffix);
+ }
+ }
+
+ std::sort(list.begin(), list.end());
+ QString suffixes = list.join(";;");
+ QString workDir = Setting::BusAPI::instance()->getWorkingDir();
+ QFileDialog dlg(this, tr("Export Pcl"), workDir, suffixes);
+ dlg.setAcceptMode(QFileDialog::AcceptSave);
+ if(dlg.exec() != QFileDialog::FileName)
+ return;
+
+ QString aSuffix = dlg.selectedNameFilter();
+ QString aFileName = dlg.selectedFiles().join(",");
+ if(!(aFileName.isEmpty())){
+ filepath=aFileName;
+
+ }else{}
+
+ AbFileName=filepath;
+ QTextCodec *codec = QTextCodec::codecForName("GB18030");
+ QByteArray ba = codec->fromUnicode(filepath);
+
+ std::string outFileName=ba.data();
+
+ }else{ // 不保存成点云数据
+
+ }
+
+ // 启动线程
+ auto pclfilter = new WBFZ::PCLStatisticalRemoveFilter(
+ AbFileName,WBFZ::PointCloudOperation::POINTCLOUD_FILTER,_mainWindow,componentIds, MeanK,stddev);
+ ModuleBase::ThreadControl* tc = new ModuleBase::ThreadControl(pclfilter);
+ emit tc->threadStart(); // emit MSHwriter->start();
+
+ QFDialog::accept();
+ }
+
+ void DialogPCLStatisticalRemoveFilter::selectedComponentsSlot(QList components)
+ {
+ for (MeshData::MeshSet *set : components)
+ {
+ if (_components.contains(set))
+ continue;
+ _components.append(set);
+ _ui->listWidget->addItem(set->getName());
+ }
+ }
+
+ void DialogPCLStatisticalRemoveFilter::customContextMenuRequestedSlot(const QPoint &point)
+ {
+ QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
+ if (!curItem)
+ return;
+
+ QMenu *menu = new QMenu(this);
+ QAction *deleteItem = new QAction(tr("delete this item"));
+ menu->addAction(deleteItem);
+ connect(menu, &QMenu::triggered, [=]()
+ { removeCurrentItem(curItem); });
+ menu->exec(QCursor::pos());
+ }
+
+ void DialogPCLStatisticalRemoveFilter::removeCurrentItem(QListWidgetItem *curItem)
+ {
+ auto meshData = MeshData::MeshData::getInstance();
+ auto meshSet = meshData->getMeshSetByName(curItem->text());
+ if (!meshSet)
+ return;
+ _components.removeOne(meshSet);
+ _ui->listWidget->removeItemWidget(curItem);
+ delete curItem;
+ }
+
+
+
+
+} // namespace MainWidget
+
+
+namespace WBFZ{
+ WBFZ::PCLStatisticalRemoveFilter::PCLStatisticalRemoveFilter(const QString &fileName, WBFZ::PointCloudOperation operation,
+ GUI::MainWindow* mw, QString componentIds,
+ double MeanK, double StddevThresh)
+ : PointCloudThreadBase(fileName, operation, mw)
+ , _fileName(fileName)
+ , _operation(operation)
+ , _componentIds(componentIds)
+ , _MeanK(MeanK)
+ , _StddevThresh(StddevThresh)
+
+ {
+
+ }
+
+ vtkDataSet* WBFZ::PCLStatisticalRemoveFilter::PCLStatisticalRemoveFilterAlg(QString componentIds, double MeanK,
+ double StddevThresh)
+ {
+ emit _mainwindow->printMessage(Common::Message::Normal,"PCLStatisticalRemoveFilterAlg");
+ // 获取vtdataset
+ QStringList qCompontIds = QString(componentIds).split(',');
+
+ MeshData::MeshSet* meshSet = NULL;
+ MeshData::MeshKernal* meshKernal = NULL;
+ MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
+ QString kernalName, transformedName, setType, ids;
+
+ // 筛选其中的点云数据
+ // 创建 vtkCellDataToPointData 过滤器
+ vtkSmartPointer cellToPointFilter = vtkSmartPointer::New();
+
+ QString outfilename;
+ for(QString compontId : qCompontIds) {
+ meshSet = meshData->getMeshSetByID(compontId.toInt());
+ DebugInfo("point count %d : %d ",compontId.toInt(),meshSet==nullptr);
+ if(!meshSet)
+ continue;
+ outfilename=meshSet->getName();
+ vtkPolyData* temppolyData=PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet);
+ cellToPointFilter->SetInputData(temppolyData);
+ DebugInfo("point count %d : %d ",compontId.toInt(),temppolyData==nullptr);
+ }
+
+ // 执行过滤操作
+ cellToPointFilter->Update();
+ DebugInfo("cellToPointFilter ");
+ // 获取过滤后的 vtkPolyData
+ vtkPolyData* outpolyData = cellToPointFilter->GetOutput();
+ DebugInfo("outpolyData ");
+
+
+ pcl::PointCloud::Ptr cloud_with_rgba(new pcl::PointCloud);
+ pcl::PointCloud::Ptr cloud_filtered(new pcl::PointCloud);
+ pcl::io::vtkPolyDataToPointCloud(outpolyData,*cloud_with_rgba);
+ // 创建滤波器对象
+ pcl::StatisticalOutlierRemoval sor;
+ sor.setInputCloud(cloud_with_rgba); //设置待滤波的点云
+ sor.setMeanK(MeanK); //设置在进行统计时考虑查询点邻居点数,K个最近邻点
+ sor.setStddevMulThresh(StddevThresh); //设置判断是否为离群点的阈值
+ sor.filter(*cloud_filtered); //将滤波结果保存在cloud_filtered中
+
+ // 转换处理结果
+ vtkPolyData* polydata=nullptr;
+ polydata=vtkPolyData::New(); // 创建新的指针,智能指针会释放
+ pcl::io::pointCloudTovtkPolyData(*cloud_filtered,polydata);
+ vtkDataSet* dataset= vtkDataSet::SafeDownCast(polydata); // 默认完成 vtkpolydata --> vtkdataset
+ size_t pointCount = dataset->GetNumberOfPoints();
+ if(pointCount==0){
+ return nullptr;
+ }
+
+ 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);
+ }
+ else if (suffix == "ply")
+ {
+ pcl::io::savePLYFileBinary(outFileName,*cloud_filtered);
+ }
+ else{}
+ return dataset;
+ }
+ vtkDataSet* PCLStatisticalRemoveFilter::filter()
+ {
+ return PCLStatisticalRemoveFilterAlg( _componentIds, _MeanK,_StddevThresh);
+ }
+ PCLStatisticalRemoveFilter::~PCLStatisticalRemoveFilter() {}
+
+}
\ No newline at end of file
diff --git a/src/MainWidgets/DialogPCLStatisticalRemoveFilter.h b/src/PluginWBFZExchangePlugin/DialogPCLStatisticalRemoveFilter.h
similarity index 59%
rename from src/MainWidgets/DialogPCLStatisticalRemoveFilter.h
rename to src/PluginWBFZExchangePlugin/DialogPCLStatisticalRemoveFilter.h
index 245f9d9..7f57a02 100644
--- a/src/MainWidgets/DialogPCLStatisticalRemoveFilter.h
+++ b/src/PluginWBFZExchangePlugin/DialogPCLStatisticalRemoveFilter.h
@@ -10,9 +10,13 @@
#ifndef LAMPCAE_DIALOGPCLSTATISTICALREMOVEFILTER_H
#define LAMPCAE_DIALOGPCLSTATISTICALREMOVEFILTER_H
-#include "mainWidgetsAPI.h"
+#include "WBFZExchangePluginAPI.h"
#include "SelfDefObject/QFDialog.h"
-#include "DialogVTKTransform.h"
+#include "MainWidgets/DialogVTKTransform.h"
+#include "PointCloudThreadBase.h"
+namespace WBFZ{
+ class PointCloudThreadBase;
+}
class QListWidgetItem;
@@ -25,10 +29,31 @@ namespace MeshData
{
class MeshSet;
}
+
+namespace WBFZ{
+ class PCLStatisticalRemoveFilter : public PointCloudThreadBase
+ {
+ public:
+ 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);
+ private:
+ QString _fileName;
+ PointCloudOperation _operation;
+ QString _componentIds;
+ double _MeanK;
+ double _StddevThresh;
+
+ };
+}
+
+
namespace MainWidget {
class DialogSelectComponents;
- class MAINWIDGETSAPI DialogPCLStatisticalRemoveFilter : public QFDialog {
+ class DialogPCLStatisticalRemoveFilter : public QFDialog {
Q_OBJECT
public:
@@ -36,8 +61,7 @@ namespace MainWidget {
~DialogPCLStatisticalRemoveFilter();
private:
void removeCurrentItem(QListWidgetItem* curItem);
- signals: // 这里采用信号来直接与 主界面通信,避免参数浪费
- void excuteAlg(QString componentIds,double MeanK,double stddev);
+
private slots:
virtual void accept();
diff --git a/src/MainWidgets/DialogPCLStatisticalRemoveFilter.ui b/src/PluginWBFZExchangePlugin/DialogPCLStatisticalRemoveFilter.ui
similarity index 100%
rename from src/MainWidgets/DialogPCLStatisticalRemoveFilter.ui
rename to src/PluginWBFZExchangePlugin/DialogPCLStatisticalRemoveFilter.ui
diff --git a/src/LAMPTool/FEKOBaseToolClass.cpp b/src/PluginWBFZExchangePlugin/FEKOBaseToolClass.cpp
similarity index 86%
rename from src/LAMPTool/FEKOBaseToolClass.cpp
rename to src/PluginWBFZExchangePlugin/FEKOBaseToolClass.cpp
index 934fe3c..5cc0915 100644
--- a/src/LAMPTool/FEKOBaseToolClass.cpp
+++ b/src/PluginWBFZExchangePlugin/FEKOBaseToolClass.cpp
@@ -1,4 +1,5 @@
-#include "FEKOBaseToolClass.h"
+#include "WBFZExchangePluginAPI.h"
+#include "FEKOBaseToolClass.h"
#include
#include "BaseConstVariable.h"
#include
@@ -14,11 +15,7 @@
-
-
-
-
-QString LAMPTOOLAPI FEKOBase::FEKOImageModeenumToString(FEKOBase::FEKOImageMode mode)
+QString FEKOBase::FEKOImageModeenumToString(FEKOBase::FEKOImageMode mode)
{
switch (mode) {
case Strip:
@@ -34,7 +31,7 @@ QString LAMPTOOLAPI FEKOBase::FEKOImageModeenumToString(FEKOBase::FEKOImageMode
return "UNKNOW"; // 默认返回Unknown
}
-FEKOBase::FEKOCoordinateSystem LAMPTOOLAPI FEKOBase::FEKOCoordinateSystemString2Enum(QString str)
+FEKOBase::FEKOCoordinateSystem FEKOBase::FEKOCoordinateSystemString2Enum(QString str)
{
if (str.toUpper() == "SPHERICAL") { return FEKOBase::Spherical; }
else if (str.toUpper() == "CARTESIAN") { return FEKOBase::Cartesian; }
@@ -44,7 +41,7 @@ FEKOBase::FEKOCoordinateSystem LAMPTOOLAPI FEKOBase::FEKOCoordinateSystemString2
}
-QString LAMPTOOLAPI FEKOBase::QString2FEKOCoordinateSystem(FEKOBase::FEKOCoordinateSystem mode)
+QString FEKOBase::QString2FEKOCoordinateSystem(FEKOBase::FEKOCoordinateSystem mode)
{
switch (mode) {
case FEKOBase::Spherical:
@@ -57,7 +54,7 @@ QString LAMPTOOLAPI FEKOBase::QString2FEKOCoordinateSystem(FEKOBase::FEKOCoordin
}
}
-FEKOBase::FEKOImageMode LAMPTOOLAPI FEKOBase::FEKOImageModeString2Enum(QString str)
+FEKOBase::FEKOImageMode FEKOBase::FEKOImageModeString2Enum(QString str)
{
if (str.toUpper() == "STRIP") {
return FEKOBase::FEKOImageMode::Strip;
@@ -75,7 +72,7 @@ FEKOBase::FEKOImageMode LAMPTOOLAPI FEKOBase::FEKOImageModeString2Enum(QString s
return FEKOBase::FEKOImageMode::UNKNOW; // 默认返回UNKNOW
}
-FEKOBase::freqParams LAMPTOOLAPI FEKOBase::getFreqSetting(double centerFreq, double resolution, double bandWidth, double scenceRange, bool isResolution) {
+FEKOBase::freqParams FEKOBase::getFreqSetting(double centerFreq, double resolution, double bandWidth, double scenceRange, bool isResolution) {
FEKOBase::freqParams result{ 0,0,0 };
{
@@ -93,7 +90,7 @@ FEKOBase::freqParams LAMPTOOLAPI FEKOBase::getFreqSetting(double centerFreq, dou
return result;
}
-FEKOBase::FEKOSatelliteParams LAMPTOOLAPI FEKOBase::createFEKOSatelliteParams(double Px, double Py, double Pz, double Vx, double Vy, double Vz, double incidenceAngle, double AzAngle, double theta, double phi, bool isRight, size_t PRFIdx)
+FEKOBase::FEKOSatelliteParams FEKOBase::createFEKOSatelliteParams(double Px, double Py, double Pz, double Vx, double Vy, double Vz, double incidenceAngle, double AzAngle, double theta, double phi, bool isRight, size_t PRFIdx)
{
FEKOBase::FEKOSatelliteParams result{
PRFIdx,
@@ -108,7 +105,7 @@ FEKOBase::FEKOSatelliteParams LAMPTOOLAPI FEKOBase::createFEKOSatelliteParams(do
return result;
}
-FEKOBase::FEKOSatelliteParams LAMPTOOLAPI FEKOBase::createFEKOSatelliteParams(SatelliteState pose, double incidenceAngle, double AzAngle, FEKOantPitionDirect antpos, size_t PRFIdx)
+FEKOBase::FEKOSatelliteParams FEKOBase::createFEKOSatelliteParams(SatelliteState pose, double incidenceAngle, double AzAngle, FEKOantPitionDirect antpos, size_t PRFIdx)
{
FEKOBase::FEKOSatelliteParams result{
PRFIdx,pose,incidenceAngle,AzAngle,antpos
@@ -116,17 +113,17 @@ FEKOBase::FEKOSatelliteParams LAMPTOOLAPI FEKOBase::createFEKOSatelliteParams(Sa
return result;
}
-FEKOBase::SatelliteState LAMPTOOLAPI FEKOBase::FEKOSatelliteParams2SatelliteState(FEKOSatelliteParams parmas)
+FEKOBase::SatelliteState FEKOBase::FEKOSatelliteParams2SatelliteState(FEKOSatelliteParams parmas)
{
return parmas.pose;
}
-FEKOBase::FEKOantPitionDirect LAMPTOOLAPI FEKOBase::FEKOSatelliteParams2FEKOantPitionDirect(FEKOSatelliteParams parmas)
+FEKOBase::FEKOantPitionDirect FEKOBase::FEKOSatelliteParams2FEKOantPitionDirect(FEKOSatelliteParams parmas)
{
return parmas.antpos;
}
-TopoDS_Shape LAMPTOOLAPI FEKOBase::SatellitePos2FEKOAntPos(SatelliteState satepos, double incidenceAngle, double AzAngle, bool isRIGHT, FEKOantPitionDirect* antposition_Direct, TopoDS_Shape antModel)
+TopoDS_Shape FEKOBase::SatellitePos2FEKOAntPos(SatelliteState satepos, double incidenceAngle, double AzAngle, bool isRIGHT, FEKOantPitionDirect* antposition_Direct, TopoDS_Shape antModel)
{
incidenceAngle = incidenceAngle * M_PI / 180; // 转换为弧度
AzAngle = AzAngle * M_PI / 180; // 扫描角度转换为弧度
@@ -267,25 +264,25 @@ TopoDS_Shape LAMPTOOLAPI FEKOBase::SatellitePos2FEKOAntPos(SatelliteState satepo
return tempShape;
}
-bool LAMPTOOLAPI FEKOBase::compareElectricFieldDataInFreq(const ElectricFieldData& a, const ElectricFieldData& b)
+bool FEKOBase::compareElectricFieldDataInFreq(const ElectricFieldData& a, const ElectricFieldData& b)
{
return a.frequency < b.frequency;
}
-bool LAMPTOOLAPI FEKOBase::comparePRFPluseDataInPRFIdx(const PRFPluseData& a, const PRFPluseData& b)
+bool FEKOBase::comparePRFPluseDataInPRFIdx(const PRFPluseData& a, const PRFPluseData& b)
{
return a.prfidx < b.prfidx;
}
-LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::NearFieldEchoCSVParser()
+ FEKOBase::NearFieldEchoCSVParser::NearFieldEchoCSVParser()
{
}
-LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::~NearFieldEchoCSVParser()
+ FEKOBase::NearFieldEchoCSVParser::~NearFieldEchoCSVParser()
{
}
-bool LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::checkPRFModel()
+bool FEKOBase::NearFieldEchoCSVParser::checkPRFModel()
{
qDebug() << u8"正在检查是否可以采用脉冲计数模式 configuration Name :PRF_{脉冲计数}";
@@ -351,7 +348,7 @@ bool LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::checkPRFModel()
return true;
}
-bool LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::resizePRFPluse()
+bool FEKOBase::NearFieldEchoCSVParser::resizePRFPluse()
{
qDebug() << u8"根据数据文件,重新整理成脉冲形式";
@@ -441,7 +438,7 @@ bool LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::resizePRFPluse()
}
-bool LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::parseCSV(const QString& filePath)
+bool FEKOBase::NearFieldEchoCSVParser::parseCSV(const QString& filePath)
{
std::vector dataList;
@@ -607,23 +604,23 @@ bool LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::parseCSV(const QString& fileP
}
-void LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::toThetapolar(const QString& filePath)
+void FEKOBase::NearFieldEchoCSVParser::toThetapolar(const QString& filePath)
{
this->toEchoData(filePath, 2);
}
-void LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::toPhiPolar(const QString& filePath)
+void FEKOBase::NearFieldEchoCSVParser::toPhiPolar(const QString& filePath)
{
this->toEchoData(filePath, 1);
}
-void LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::toRPolar(const QString& filePath)
+void FEKOBase::NearFieldEchoCSVParser::toRPolar(const QString& filePath)
{
this->toEchoData(filePath, 0);
}
-void LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::saveCSV(const QString& filePath)
+void FEKOBase::NearFieldEchoCSVParser::saveCSV(const QString& filePath)
{
}
@@ -632,7 +629,7 @@ void LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::saveCSV(const QString& filePa
///
/// 文件路径
/// 0: R,1: phi,2: theta
-void LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::toEchoData(const QString& filePath, size_t outDataName)
+void FEKOBase::NearFieldEchoCSVParser::toEchoData(const QString& filePath, size_t outDataName)
{
// 脉冲整理
Eigen::MatrixXcd echoData = Eigen::MatrixXcd::Zero(this->prfData.size(), this->freqPoints);
@@ -667,7 +664,7 @@ void LAMPTOOLAPI FEKOBase::NearFieldEchoCSVParser::toEchoData(const QString& fil
echodataTemp.SaveEchoData(filePath);
}
-LAMPTOOLAPI FEKOBase::EchoDataClass::EchoDataClass(const FEKOBase::EchoDataClass& inecho)
+ FEKOBase::EchoDataClass::EchoDataClass(const FEKOBase::EchoDataClass& inecho)
{
this->echoData = inecho.getEchoData();
@@ -679,69 +676,69 @@ LAMPTOOLAPI FEKOBase::EchoDataClass::EchoDataClass(const FEKOBase::EchoDataClass
-LAMPTOOLAPI FEKOBase::EchoDataClass::EchoDataClass()
+ FEKOBase::EchoDataClass::EchoDataClass()
{
}
-LAMPTOOLAPI FEKOBase::EchoDataClass::~EchoDataClass()
+ FEKOBase::EchoDataClass::~EchoDataClass()
{
}
-void LAMPTOOLAPI FEKOBase::EchoDataClass::setEchoData(Eigen::MatrixXcd echoData)
+void FEKOBase::EchoDataClass::setEchoData(Eigen::MatrixXcd echoData)
{
this->echoData = echoData;
}
-Eigen::MatrixXcd LAMPTOOLAPI FEKOBase::EchoDataClass::getEchoData() const
+Eigen::MatrixXcd FEKOBase::EchoDataClass::getEchoData() const
{
return this->echoData;
}
-void LAMPTOOLAPI FEKOBase::EchoDataClass::setAntPos(Eigen::MatrixXd antPos)
+void FEKOBase::EchoDataClass::setAntPos(Eigen::MatrixXd antPos)
{
this->antPos = antPos;
}
-Eigen::MatrixXd LAMPTOOLAPI FEKOBase::EchoDataClass::getAntPos() const
+Eigen::MatrixXd FEKOBase::EchoDataClass::getAntPos() const
{
return this->antPos;
}
-void LAMPTOOLAPI FEKOBase::EchoDataClass::setFreqStart(double freqStart)
+void FEKOBase::EchoDataClass::setFreqStart(double freqStart)
{
this->freqStart = freqStart;
}
-double LAMPTOOLAPI FEKOBase::EchoDataClass::getFreqStart() const
+double FEKOBase::EchoDataClass::getFreqStart() const
{
return this->freqStart;
}
-void LAMPTOOLAPI FEKOBase::EchoDataClass::setFreqEnd(double freqEnd)
+void FEKOBase::EchoDataClass::setFreqEnd(double freqEnd)
{
this->freqEnd = freqEnd;
}
-double LAMPTOOLAPI FEKOBase::EchoDataClass::getFreqEnd() const
+double FEKOBase::EchoDataClass::getFreqEnd() const
{
return this->freqEnd;
}
-void LAMPTOOLAPI FEKOBase::EchoDataClass::setFreqpoints(int freqpoints)
+void FEKOBase::EchoDataClass::setFreqpoints(int freqpoints)
{
this->freqpoints = freqpoints;
}
-int LAMPTOOLAPI FEKOBase::EchoDataClass::getFreqpoints() const
+int FEKOBase::EchoDataClass::getFreqpoints() const
{
return this->freqpoints;
}
-void LAMPTOOLAPI FEKOBase::EchoDataClass::loadEchoData(const QString& filePath)
+void FEKOBase::EchoDataClass::loadEchoData(const QString& filePath)
{
std::ifstream file(reinterpret_cast(filePath.utf16()), std::ios::binary);
@@ -773,7 +770,7 @@ void LAMPTOOLAPI FEKOBase::EchoDataClass::loadEchoData(const QString& filePath)
}
}
-void LAMPTOOLAPI FEKOBase::EchoDataClass::SaveEchoData(const QString& filePath)
+void FEKOBase::EchoDataClass::SaveEchoData(const QString& filePath)
{
if (echoData.rows() != antPos.rows() || antPos.cols() != 5) {
qDebug() << "Error: antPos.size()!=echoData.rows()*5"
@@ -809,7 +806,7 @@ void LAMPTOOLAPI FEKOBase::EchoDataClass::SaveEchoData(const QString& filePath)
-Eigen::MatrixXd LAMPTOOLAPI FEKOBase::WINDOWFun(Eigen::MatrixXcd& echo, ImageAlgWindowFun winfun)
+Eigen::MatrixXd FEKOBase::WINDOWFun(Eigen::MatrixXcd& echo, ImageAlgWindowFun winfun)
{
size_t Nxa = echo.rows();
size_t Nf = echo.cols();
@@ -826,7 +823,7 @@ Eigen::MatrixXd LAMPTOOLAPI FEKOBase::WINDOWFun(Eigen::MatrixXcd& echo, ImageAlg
return normw;
}
-QList LAMPTOOLAPI FEKOBase::getFEKOImageAlgorithmList()
+QList FEKOBase::getFEKOImageAlgorithmList()
{
QList list;
FEKOImageAlgorithm alg;
@@ -836,7 +833,7 @@ QList LAMPTOOLAPI FEKOBase::getFEKOImageAlgorithmList()
return list;
}
-FEKOBase::FEKOImageAlgorithm LAMPTOOLAPI FEKOBase::String2FEKOImageAlgorithm(QString str)
+FEKOBase::FEKOImageAlgorithm FEKOBase::String2FEKOImageAlgorithm(QString str)
{
FEKOImageAlgorithm alg;
for (alg = FEKOImageAlgorithm::TBP_TIME; alg < FEKOImageAlgorithm::UNKONW; alg = (FEKOImageAlgorithm)(alg + 1)) {
@@ -848,7 +845,7 @@ FEKOBase::FEKOImageAlgorithm LAMPTOOLAPI FEKOBase::String2FEKOImageAlgorithm(QSt
return alg;
}
-QString LAMPTOOLAPI FEKOBase::FEKOImageAlgorithm2String(FEKOImageAlgorithm alg)
+QString FEKOBase::FEKOImageAlgorithm2String(FEKOImageAlgorithm alg)
{
// 将FEKOImageAlgorithm 枚举转换为字符串
switch (alg)
@@ -864,7 +861,7 @@ QString LAMPTOOLAPI FEKOBase::FEKOImageAlgorithm2String(FEKOImageAlgorithm alg)
// 请仿照FEKOImageAlgorithm枚举的写法,构建QString 与 ImageAlgWindowFun 的转换函数
-QList LAMPTOOLAPI FEKOBase::getImageAlgWindowFunList()
+QList FEKOBase::getImageAlgWindowFunList()
{
QList list;
ImageAlgWindowFun alg;
@@ -874,7 +871,7 @@ QList LAMPTOOLAPI FEKOBase::getImageAlgWindowFunList()
return list;
}
-FEKOBase::ImageAlgWindowFun LAMPTOOLAPI FEKOBase::String2ImageAlgWindowFun(QString str)
+FEKOBase::ImageAlgWindowFun FEKOBase::String2ImageAlgWindowFun(QString str)
{
ImageAlgWindowFun alg;
for (alg = ImageAlgWindowFun::UNKONWWINDOW; alg < ImageAlgWindowFun::UNKONWWINDOW; alg = (ImageAlgWindowFun)(alg + 1)) {
@@ -886,7 +883,7 @@ FEKOBase::ImageAlgWindowFun LAMPTOOLAPI FEKOBase::String2ImageAlgWindowFun(QStri
return alg;
}
-QString LAMPTOOLAPI FEKOBase::ImageAlgWindowFun2String(FEKOBase::ImageAlgWindowFun alg)
+QString FEKOBase::ImageAlgWindowFun2String(FEKOBase::ImageAlgWindowFun alg)
{
switch (alg)
{
@@ -900,7 +897,7 @@ QString LAMPTOOLAPI FEKOBase::ImageAlgWindowFun2String(FEKOBase::ImageAlgWindowF
}
-bool LAMPTOOLAPI FEKOBase::BPImage_TIME(QString& restiffpath, Eigen::MatrixXcd& echoData, Eigen::MatrixXd& antPos, Eigen::MatrixXd& freqmatrix, Eigen::MatrixXd& X, Eigen::MatrixXd& Y, Eigen::MatrixXd& Z, ImageAlgWindowFun winfun)
+bool FEKOBase::BPImage_TIME(QString& restiffpath, Eigen::MatrixXcd& echoData, Eigen::MatrixXd& antPos, Eigen::MatrixXd& freqmatrix, Eigen::MatrixXd& X, Eigen::MatrixXd& Y, Eigen::MatrixXd& Z, ImageAlgWindowFun winfun)
{
// BP成像算法
const double c = 0.299792458; // 光速
@@ -908,7 +905,7 @@ bool LAMPTOOLAPI FEKOBase::BPImage_TIME(QString& restiffpath, Eigen::MatrixXcd&
return true;
}
-bool LAMPTOOLAPI FEKOBase::FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd& echoData, Eigen::MatrixXd& antPos, Eigen::MatrixXd& freqmatrix, Eigen::MatrixXd& X, Eigen::MatrixXd& Y, Eigen::MatrixXd& Z, ImageAlgWindowFun winfun)
+bool FEKOBase::FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd& echoData, Eigen::MatrixXd& antPos, Eigen::MatrixXd& freqmatrix, Eigen::MatrixXd& X, Eigen::MatrixXd& Y, Eigen::MatrixXd& Z, ImageAlgWindowFun winfun)
{
// BP成像算法
@@ -937,7 +934,7 @@ bool LAMPTOOLAPI FEKOBase::FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd&
-#ifdef __SHOWIMAGEPROCESSRESULT // 加窗处理
+#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
Eigen::MatrixXd normw = WINDOWFun(echoData, winfun);
#endif
diff --git a/src/LAMPTool/FEKOBaseToolClass.h b/src/PluginWBFZExchangePlugin/FEKOBaseToolClass.h
similarity index 77%
rename from src/LAMPTool/FEKOBaseToolClass.h
rename to src/PluginWBFZExchangePlugin/FEKOBaseToolClass.h
index ddbe460..47c4626 100644
--- a/src/LAMPTool/FEKOBaseToolClass.h
+++ b/src/PluginWBFZExchangePlugin/FEKOBaseToolClass.h
@@ -40,8 +40,8 @@ namespace FEKOBase {
Cartesian, // 笛卡尔坐标系
UNKONWFEKOCOORDINATESYSTEM // 必须为最后一个表示未知
};
- FEKOBase::FEKOCoordinateSystem LAMPTOOLAPI FEKOCoordinateSystemString2Enum(QString str);
- QString LAMPTOOLAPI QString2FEKOCoordinateSystem(FEKOBase::FEKOCoordinateSystem mode);
+ FEKOBase::FEKOCoordinateSystem FEKOCoordinateSystemString2Enum(QString str);
+ QString QString2FEKOCoordinateSystem(FEKOBase::FEKOCoordinateSystem mode);
//==========================================================
@@ -56,8 +56,8 @@ namespace FEKOBase {
UNKNOW
};
- FEKOImageMode LAMPTOOLAPI FEKOImageModeString2Enum(QString str);
- QString LAMPTOOLAPI FEKOImageModeenumToString(FEKOImageMode mode);
+ FEKOImageMode FEKOImageModeString2Enum(QString str);
+ QString FEKOImageModeenumToString(FEKOImageMode mode);
@@ -147,13 +147,13 @@ namespace FEKOBase {
/// 分辨率 米
///
///
- freqParams LAMPTOOLAPI getFreqSetting(double centerFreq, double resolution, double bandWidth, double scenceRange, bool isResolution = false);
+ freqParams getFreqSetting(double centerFreq, double resolution, double bandWidth, double scenceRange, bool isResolution = false);
- FEKOSatelliteParams LAMPTOOLAPI createFEKOSatelliteParams(double Px, double Py, double Pz, double Vx, double Vy, double Vz, double incidenceAngle, double AzAngle, double theta, double phi, bool isRight, size_t PRFIdx = 0);
- FEKOSatelliteParams LAMPTOOLAPI createFEKOSatelliteParams(SatelliteState pose, double incidenceAngle, double AzAngle, FEKOantPitionDirect antpos, size_t PRFIdx = 0);
+ FEKOSatelliteParams createFEKOSatelliteParams(double Px, double Py, double Pz, double Vx, double Vy, double Vz, double incidenceAngle, double AzAngle, double theta, double phi, bool isRight, size_t PRFIdx = 0);
+ FEKOSatelliteParams createFEKOSatelliteParams(SatelliteState pose, double incidenceAngle, double AzAngle, FEKOantPitionDirect antpos, size_t PRFIdx = 0);
- SatelliteState LAMPTOOLAPI FEKOSatelliteParams2SatelliteState(FEKOSatelliteParams parmas);
- FEKOantPitionDirect LAMPTOOLAPI FEKOSatelliteParams2FEKOantPitionDirect(FEKOSatelliteParams parmas);
+ SatelliteState FEKOSatelliteParams2SatelliteState(FEKOSatelliteParams parmas);
+ FEKOantPitionDirect FEKOSatelliteParams2FEKOantPitionDirect(FEKOSatelliteParams parmas);
///
/// 将卫星姿态转换为 FEKO 天线坐标,
@@ -166,7 +166,7 @@ namespace FEKOBase {
/// 结果文件
/// 输入模型
///
- TopoDS_Shape LAMPTOOLAPI SatellitePos2FEKOAntPos(SatelliteState satepos, double incidenceAngle, double AzAngle, bool isRIGHT, FEKOantPitionDirect* antposition_Direct, TopoDS_Shape inDs);
+ TopoDS_Shape SatellitePos2FEKOAntPos(SatelliteState satepos, double incidenceAngle, double AzAngle, bool isRIGHT, FEKOantPitionDirect* antposition_Direct, TopoDS_Shape inDs);
@@ -214,10 +214,10 @@ namespace FEKOBase {
std::vector electricFieldDataList; // 单频点信息
};
- bool LAMPTOOLAPI compareElectricFieldDataInFreq(const ElectricFieldData& a, const ElectricFieldData& b);
- bool LAMPTOOLAPI comparePRFPluseDataInPRFIdx(const PRFPluseData& a, const PRFPluseData& b);
+ bool compareElectricFieldDataInFreq(const ElectricFieldData& a, const ElectricFieldData& b);
+ bool comparePRFPluseDataInPRFIdx(const PRFPluseData& a, const PRFPluseData& b);
- class LAMPTOOLAPI NearFieldEchoCSVParser {
+ class NearFieldEchoCSVParser {
public:
NearFieldEchoCSVParser();
~NearFieldEchoCSVParser();
@@ -259,7 +259,7 @@ namespace FEKOBase {
// 。
// 注意Bp并不关心脉冲的顺序,只是关注脉冲的坐标位置,默认按照脉冲的解析顺序进行组织
//========================================================================
- class LAMPTOOLAPI EchoDataClass {
+ class EchoDataClass {
private: // 成像变量
Eigen::MatrixXcd echoData; // 回波数据
Eigen::MatrixXd antPos;// 每个脉冲的坐标
@@ -314,7 +314,7 @@ namespace FEKOBase {
///
/// 行:脉冲,列:频点
///
- Eigen::MatrixXd LAMPTOOLAPI WINDOWFun(Eigen::MatrixXcd& echo, ImageAlgWindowFun winfun = ImageAlgWindowFun::HANMMING);
+ Eigen::MatrixXd WINDOWFun(Eigen::MatrixXcd& echo, ImageAlgWindowFun winfun = ImageAlgWindowFun::HANMMING);
enum FEKOImageAlgorithm
{
@@ -323,18 +323,18 @@ namespace FEKOBase {
UNKONW // 必须为最后一个表示未知
};
- QList LAMPTOOLAPI getFEKOImageAlgorithmList();
- FEKOImageAlgorithm LAMPTOOLAPI String2FEKOImageAlgorithm(QString str);
- QString LAMPTOOLAPI FEKOImageAlgorithm2String(FEKOImageAlgorithm alg);
+ QList getFEKOImageAlgorithmList();
+ FEKOImageAlgorithm String2FEKOImageAlgorithm(QString str);
+ QString FEKOImageAlgorithm2String(FEKOImageAlgorithm alg);
// 请仿照FEKOImageAlgorithm枚举的写法,构建QString 与 ImageAlgWindowFun 的转换函数
- QList LAMPTOOLAPI getImageAlgWindowFunList();
- ImageAlgWindowFun LAMPTOOLAPI String2ImageAlgWindowFun(QString str);
- QString LAMPTOOLAPI ImageAlgWindowFun2String(ImageAlgWindowFun alg);
+ QList getImageAlgWindowFunList();
+ ImageAlgWindowFun String2ImageAlgWindowFun(QString str);
+ QString ImageAlgWindowFun2String(ImageAlgWindowFun alg);
- bool LAMPTOOLAPI 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 LAMPTOOLAPI 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); // 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成像
diff --git a/src/LAMPTool/FEKOFarFieldFileClass.cpp b/src/PluginWBFZExchangePlugin/FEKOFarFieldFileClass.cpp
similarity index 90%
rename from src/LAMPTool/FEKOFarFieldFileClass.cpp
rename to src/PluginWBFZExchangePlugin/FEKOFarFieldFileClass.cpp
index 445cad9..18e9cc3 100644
--- a/src/LAMPTool/FEKOFarFieldFileClass.cpp
+++ b/src/PluginWBFZExchangePlugin/FEKOFarFieldFileClass.cpp
@@ -1,16 +1,16 @@
#include "FEKOFarFieldFileClass.h"
-LAMPTOOLAPI FEKOBase::FEKOFarFieldFileClass::FEKOFarFieldFileClass()
+ FEKOBase::FEKOFarFieldFileClass::FEKOFarFieldFileClass()
{
}
-LAMPTOOLAPI FEKOBase::FEKOFarFieldFileClass::~FEKOFarFieldFileClass()
+ FEKOBase::FEKOFarFieldFileClass::~FEKOFarFieldFileClass()
{
}
-void LAMPTOOLAPI FEKOBase::FEKOFarFieldFileClass::parseFarFieldFile(const QString& fileName)
+void FEKOBase::FEKOFarFieldFileClass::parseFarFieldFile(const QString& fileName)
{
QFile file(fileName);
// 加载文本文件中的所有数据到一个 QString 中
@@ -76,7 +76,7 @@ void LAMPTOOLAPI FEKOBase::FEKOFarFieldFileClass::parseFarFieldFile(const QStrin
file.close();
}
-void LAMPTOOLAPI FEKOBase::FEKOFarFieldFileClass::outputToFile(const QString& fileName)
+void FEKOBase::FEKOFarFieldFileClass::outputToFile(const QString& fileName)
{
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
@@ -91,7 +91,7 @@ void LAMPTOOLAPI FEKOBase::FEKOFarFieldFileClass::outputToFile(const QString& fi
}
- FEKOBase::FEKOFARFIELDRESULTTYPE LAMPTOOLAPI FEKOBase::FEKOFARFIELDRESULTTYPEString2Enum(QString str)
+ FEKOBase::FEKOFARFIELDRESULTTYPE FEKOBase::FEKOFARFIELDRESULTTYPEString2Enum(QString str)
{
if (str.toUpper() == "GAIN") { return FEKOBase::GAIN; }
else if (str.toUpper() == "DIRECTIVITY") { return FEKOBase::DIRECTIVITY; }
@@ -103,7 +103,7 @@ void LAMPTOOLAPI FEKOBase::FEKOFarFieldFileClass::outputToFile(const QString& fi
return FEKOBase::FEKOFARFIELDRESULTTYPE();
}
-QString LAMPTOOLAPI FEKOBase::QString2FEKOFARFIELDRESULTTYPE(FEKOBase::FEKOFARFIELDRESULTTYPE mode)
+QString FEKOBase::QString2FEKOFARFIELDRESULTTYPE(FEKOBase::FEKOFARFIELDRESULTTYPE mode)
{
switch (mode) {
case FEKOBase::GAIN:
@@ -120,7 +120,7 @@ QString LAMPTOOLAPI FEKOBase::QString2FEKOFARFIELDRESULTTYPE(FEKOBase::FEKOFARFI
}
}
-LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::FEKOFARFIELDFEKODATABLOCK()
+ FEKOBase::FEKOFARFIELDFEKODATABLOCK::FEKOFARFIELDFEKODATABLOCK()
{
this->dataList.clear();
this->thetaSamples = 0;
@@ -136,12 +136,12 @@ LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::FEKOFARFIELDFEKODATABLOCK()
this->resultType = FEKOBase::FEKOFARFIELDRESULTTYPEUNKOWN;
}
-LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::~FEKOFARFIELDFEKODATABLOCK()
+ FEKOBase::FEKOFARFIELDFEKODATABLOCK::~FEKOFARFIELDFEKODATABLOCK()
{
}
-int LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::paraseFEKOFarFieldDataBlock(const QString& blockstr)
+int FEKOBase::FEKOFARFIELDFEKODATABLOCK::paraseFEKOFarFieldDataBlock(const QString& blockstr)
{
// 按行进行解析
QList lines= blockstr.split("\n");
@@ -150,7 +150,7 @@ int LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::paraseFEKOFarFieldDataBlock
}
-int LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::paraseFEKOFarFieldDataBlockFromList(QList& lines)
+int FEKOBase::FEKOFARFIELDFEKODATABLOCK::paraseFEKOFarFieldDataBlockFromList(QList& lines)
{
bool in_readHeaderState = false;
size_t headerlineCount = 0;
@@ -267,7 +267,7 @@ int LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::paraseFEKOFarFieldDataBlock
return 0;
}
-QString LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::normalizationHeaderString(QString headerstr)
+QString FEKOBase::FEKOFARFIELDFEKODATABLOCK::normalizationHeaderString(QString headerstr)
{
headerstr = headerstr.replace("'", "").replace(u8"\"",u8"");
if(headerstr.indexOf("#Configuration Name") != -1)
@@ -408,7 +408,7 @@ QString LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::normalizationHeaderStri
;
}
-QString LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlock()
+QString FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlock()
{
switch (this->resultType) {
@@ -425,22 +425,22 @@ QString LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlo
}
}
-QString LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlock_Gain()
+QString FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlock_Gain()
{
return QString();
}
-QString LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlock_Directivity()
+QString FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlock_Directivity()
{
return QString();
}
-QString LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlock_RCS()
+QString FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlock_RCS()
{
return QString();
}
-QString LAMPTOOLAPI FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlock_FarFieldValues()
+QString FEKOBase::FEKOFARFIELDFEKODATABLOCK::saveFEKOFarFieldDataBlock_FarFieldValues()
{
return QString();
}
diff --git a/src/LAMPTool/FEKOFarFieldFileClass.h b/src/PluginWBFZExchangePlugin/FEKOFarFieldFileClass.h
similarity index 91%
rename from src/LAMPTool/FEKOFarFieldFileClass.h
rename to src/PluginWBFZExchangePlugin/FEKOFarFieldFileClass.h
index 7188352..9029143 100644
--- a/src/LAMPTool/FEKOFarFieldFileClass.h
+++ b/src/PluginWBFZExchangePlugin/FEKOFarFieldFileClass.h
@@ -21,8 +21,8 @@ namespace FEKOBase {
FARFIELDVALUES,// 远场值
FEKOFARFIELDRESULTTYPEUNKOWN
};
- FEKOBase::FEKOFARFIELDRESULTTYPE LAMPTOOLAPI FEKOFARFIELDRESULTTYPEString2Enum(QString str);
- QString LAMPTOOLAPI QString2FEKOFARFIELDRESULTTYPE(FEKOBase::FEKOFARFIELDRESULTTYPE mode);
+ FEKOBase::FEKOFARFIELDRESULTTYPE FEKOFARFIELDRESULTTYPEString2Enum(QString str);
+ QString QString2FEKOFARFIELDRESULTTYPE(FEKOBase::FEKOFARFIELDRESULTTYPE mode);
@@ -63,7 +63,7 @@ namespace FEKOBase {
double RCS_total = 0;
};
- class LAMPTOOLAPI FEKOFARFIELDFEKODATABLOCK { // 数据块
+ class FEKOFARFIELDFEKODATABLOCK { // 数据块
public:
FEKOFARFIELDFEKODATABLOCK();
~FEKOFARFIELDFEKODATABLOCK();
@@ -100,9 +100,9 @@ namespace FEKOBase {
-class LAMPTOOLAPI FEKOFarFieldFileClass: public QObject
+class FEKOFarFieldFileClass: public QObject
{
- Q_OBJECT
+ // Q_OBJECT
public:
FEKOFarFieldFileClass();
~FEKOFarFieldFileClass();
diff --git a/src/LAMPTool/FEKONearBPBasic.cpp b/src/PluginWBFZExchangePlugin/FEKONearBPBasic.cpp
similarity index 95%
rename from src/LAMPTool/FEKONearBPBasic.cpp
rename to src/PluginWBFZExchangePlugin/FEKONearBPBasic.cpp
index d373bb6..08be2d3 100644
--- a/src/LAMPTool/FEKONearBPBasic.cpp
+++ b/src/PluginWBFZExchangePlugin/FEKONearBPBasic.cpp
@@ -26,7 +26,7 @@
// 定义插值函数,以处理复数值
-std::complex LAMPTOOLAPI InterpolateComplex(Eigen::MatrixXd& xi, Eigen::MatrixXd& yi, Eigen::MatrixXcd& data, double x, double y) {
+std::complex InterpolateComplex(Eigen::MatrixXd& xi, Eigen::MatrixXd& yi, Eigen::MatrixXcd& data, double x, double y) {
int m = xi.rows();
int n = xi.cols();
@@ -69,7 +69,7 @@ std::complex LAMPTOOLAPI InterpolateComplex(Eigen::MatrixXd& xi, Eigen::
}
-Eigen::MatrixXd LAMPTOOLAPI Cartesian2Spherical(Eigen::MatrixXd CartesianPoint)
+Eigen::MatrixXd Cartesian2Spherical(Eigen::MatrixXd CartesianPoint)
{
Eigen::MatrixXd result = CartesianPoint;
size_t rows = result.rows();
@@ -100,7 +100,7 @@ Eigen::MatrixXd LAMPTOOLAPI Cartesian2Spherical(Eigen::MatrixXd CartesianPoint)
return result;
}
-int LAMPTOOLAPI BP2DProcess(QString in_path, QString out_path, double Rref, double minX, double maxX, double minY, double maxY, double PlaneZ, int ImageHeight, int ImageWidth)
+int BP2DProcess(QString in_path, QString out_path, double Rref, double minX, double maxX, double minY, double maxY, double PlaneZ, int ImageHeight, int ImageWidth)
{
BP2DProcessClass process;
process.initProcess(in_path, out_path, Rref, minX, maxX, minY, maxY, PlaneZ, ImageHeight, ImageWidth);
@@ -109,7 +109,7 @@ int LAMPTOOLAPI BP2DProcess(QString in_path, QString out_path, double Rref, doub
}
-int LAMPTOOLAPI FBP2DProcess(QString in_path, QString out_path, double Rref, double minX, double maxX, double minY, double maxY, double PlaneZ, int ImageHeight, int ImageWidth)
+int FBP2DProcess(QString in_path, QString out_path, double Rref, double minX, double maxX, double minY, double maxY, double PlaneZ, int ImageHeight, int ImageWidth)
{
FBP2DProcessClass process;
process.initProcess(in_path, out_path, Rref, minX, maxX, minY, maxY, PlaneZ, ImageHeight, ImageWidth);
@@ -117,7 +117,7 @@ int LAMPTOOLAPI FBP2DProcess(QString in_path, QString out_path, double Rref, dou
return -1;
}
-int LAMPTOOLAPI build2Bin(QString path, int width, int height, std::vector& freqs, Eigen::MatrixXd AntPostion, Eigen::MatrixXcd echo)
+int build2Bin(QString path, int width, int height, std::vector& freqs, Eigen::MatrixXd AntPostion, Eigen::MatrixXcd echo)
{
/*
* % 构建回波结果
@@ -173,7 +173,7 @@ fclose(fid);
}
template
-Eigen::MatrixXcd LAMPTOOLAPI BP2DImageByPluse(Eigen::MatrixXcd timeEcho, Eigen::MatrixXd AntPosition, double minX, double maxX, double minY, double maxY, double PlaneZ, double Rref, size_t ImageWidth, size_t ImageHeight, double startfreq, size_t timefreqnum, double timeFreqBandWidth, T* logclss)
+Eigen::MatrixXcd BP2DImageByPluse(Eigen::MatrixXcd timeEcho, Eigen::MatrixXd AntPosition, double minX, double maxX, double minY, double maxY, double PlaneZ, double Rref, size_t ImageWidth, size_t ImageHeight, double startfreq, size_t timefreqnum, double timeFreqBandWidth, T* logclss)
{
bool logfun = !(nullptr == logclss); // 空指针
double delta_x = (maxX - minX) / (ImageWidth - 1);
@@ -242,7 +242,7 @@ Eigen::MatrixXcd LAMPTOOLAPI BP2DImageByPluse(Eigen::MatrixXcd timeEcho, Eigen::
template
-Eigen::MatrixXcd LAMPTOOLAPI BP2DImageByPixel(Eigen::MatrixXcd timeEcho, Eigen::MatrixXd AntPosition, double minX, double maxX, double minY, double maxY, double PlaneZ, double Rref, size_t ImageWidth, size_t ImageHeight, double startfreq, size_t timefreqnum, double timeFreqBandWidth, T* logclss)
+Eigen::MatrixXcd BP2DImageByPixel(Eigen::MatrixXcd timeEcho, Eigen::MatrixXd AntPosition, double minX, double maxX, double minY, double maxY, double PlaneZ, double Rref, size_t ImageWidth, size_t ImageHeight, double startfreq, size_t timefreqnum, double timeFreqBandWidth, T* logclss)
{
bool logfun = !(nullptr == logclss);
double delta_x = (maxX - minX) / (ImageWidth - 1);
@@ -430,7 +430,7 @@ Eigen::MatrixXcd LAMPTOOLAPI BP2DImageByPixel(Eigen::MatrixXcd timeEcho, Eigen::
}
-int LAMPTOOLAPI BP2DProcessClass::initProcess(QString in_path, QString out_path, double Rref, double minX, double maxX, double minY, double maxY, double PlaneZ, int ImageHeight, int ImageWidth)
+int BP2DProcessClass::initProcess(QString in_path, QString out_path, double Rref, double minX, double maxX, double minY, double maxY, double PlaneZ, int ImageHeight, int ImageWidth)
{
// 初始化参数
this->readEchoFile(in_path);
@@ -456,7 +456,7 @@ int LAMPTOOLAPI BP2DProcessClass::initProcess(QString in_path, QString out_path,
return -1;
}
-int LAMPTOOLAPI BP2DProcessClass::readEchoFile(QString in_path)
+int BP2DProcessClass::readEchoFile(QString in_path)
{
std::ifstream fin(in_path.toUtf8().constData(), std::ios::in | std::ios::binary);
if (!fin.is_open()) exit(2);
@@ -501,7 +501,7 @@ int LAMPTOOLAPI BP2DProcessClass::readEchoFile(QString in_path)
return -1;
}
-int LAMPTOOLAPI BP2DProcessClass::saveTiFF(Eigen::MatrixXcd m)
+int BP2DProcessClass::saveTiFF(Eigen::MatrixXcd m)
{
return saveMatrixXcd2TiFF(m, this->out_path);
}
@@ -510,7 +510,7 @@ int LAMPTOOLAPI BP2DProcessClass::saveTiFF(Eigen::MatrixXcd m)
/// 成像工作流,注意存在大量的内存浪费,后期可以根据情况进行优化
///
///
-int LAMPTOOLAPI BP2DProcessClass::start()
+int BP2DProcessClass::start()
{
// step 0 生成文件夹路径,为中间临时文件输出,构建临时环境,正式版需要注释相关代码
QString parantPath = getParantFolderNameFromPath(this->out_path);
@@ -573,7 +573,7 @@ int LAMPTOOLAPI BP2DProcessClass::start()
return -1;
}
-int LAMPTOOLAPI BP2DProcessClass::logFUN(int percent, QString logtext) {
+int BP2DProcessClass::logFUN(int percent, QString logtext) {
qDebug() << "\rBPProcess [" << percent << "%]\t" << logtext;
if (percent < 100) {
qDebug()<<"\n";
diff --git a/src/LAMPTool/FEKONearBPBasic.h b/src/PluginWBFZExchangePlugin/FEKONearBPBasic.h
similarity index 70%
rename from src/LAMPTool/FEKONearBPBasic.h
rename to src/PluginWBFZExchangePlugin/FEKONearBPBasic.h
index 8a634fd..60dddb1 100644
--- a/src/LAMPTool/FEKONearBPBasic.h
+++ b/src/PluginWBFZExchangePlugin/FEKONearBPBasic.h
@@ -6,7 +6,7 @@
* 适用于FEKO的近场结果的 BP 成像算法
*
**/
-#include "LAMPToolAPI.h"
+#include "WBFZExchangePluginAPI.h"
#include
#include
#include
@@ -25,12 +25,12 @@
///
/// [X,Y,Z;X1,Y1,Z1]
///
-Eigen::MatrixXd LAMPTOOLAPI Cartesian2Spherical(Eigen::MatrixXd CartesianPoint);
+Eigen::MatrixXd Cartesian2Spherical(Eigen::MatrixXd CartesianPoint);
///
/// 时域BP
///
-class LAMPTOOLAPI BP2DProcessClass {
+class BP2DProcessClass {
public:
size_t height;
size_t width;
@@ -60,15 +60,15 @@ public:
};
-int LAMPTOOLAPI BP2DProcess(QString in_path, QString out_path, double Rref, double minX, double maxX, double minY, double maxY, double PlaneZ,int ImageHeight,int ImageWidth);
+int BP2DProcess(QString in_path, QString out_path, double Rref, double minX, double maxX, double minY, double maxY, double PlaneZ,int ImageHeight,int ImageWidth);
// BP 成像时,逐像素点计算,计算速度慢,回波(PRFNUM,freqNUM)
template
-Eigen::MatrixXcd LAMPTOOLAPI BP2DImageByPixel(Eigen::MatrixXcd timeEcho,Eigen::MatrixXd AntPosition,double minX,double maxX,double minY,double maxY,double PlaneZ ,double Rref,size_t ImageWidth,size_t ImageHeight,double startfreq,size_t timefreqnum,double timeFreqBandWidth, T* logclss=nullptr);
+Eigen::MatrixXcd BP2DImageByPixel(Eigen::MatrixXcd timeEcho,Eigen::MatrixXd AntPosition,double minX,double maxX,double minY,double maxY,double PlaneZ ,double Rref,size_t ImageWidth,size_t ImageHeight,double startfreq,size_t timefreqnum,double timeFreqBandWidth, T* logclss=nullptr);
///
/// 时域BP --- FBP
///
-class LAMPTOOLAPI FBP2DProcessClass:public BP2DProcessClass {
+class FBP2DProcessClass:public BP2DProcessClass {
public:
size_t height;
size_t width;
@@ -99,23 +99,23 @@ public:
// BP 成像时,逐脉冲计算,回波(PRFNUM,freqNUM)
template
-Eigen::MatrixXcd LAMPTOOLAPI BP2DImageByPluse(Eigen::MatrixXcd timeEcho, Eigen::MatrixXd AntPosition, double minX, double maxX, double minY, double maxY, double PlaneZ, double Rref, size_t ImageWidth, size_t ImageHeight, double startfreq, size_t timefreqnum, double timeFreqBandWidth, T* logclss = nullptr);
+Eigen::MatrixXcd BP2DImageByPluse(Eigen::MatrixXcd timeEcho, Eigen::MatrixXd AntPosition, double minX, double maxX, double minY, double maxY, double PlaneZ, double Rref, size_t ImageWidth, size_t ImageHeight, double startfreq, size_t timefreqnum, double timeFreqBandWidth, T* logclss = nullptr);
-int LAMPTOOLAPI FBP2DProcess(QString in_path, QString out_path, double Rref, double minX, double maxX, double minY, double maxY, double PlaneZ, int ImageHeight, int ImageWidth);
+int FBP2DProcess(QString in_path, QString out_path, double Rref, double minX, double maxX, double minY, double maxY, double PlaneZ, int ImageHeight, int ImageWidth);
// 生成成像的数据文件
-int LAMPTOOLAPI build2Bin(QString path,int width,int height,std::vector &freqs,Eigen::MatrixXd AntPositions,Eigen::MatrixXcd echo);
+int build2Bin(QString path,int width,int height,std::vector &freqs,Eigen::MatrixXd AntPositions,Eigen::MatrixXcd echo);
// 定义插值函数,以处理复数值
-std::complex LAMPTOOLAPI InterpolateComplex(Eigen::MatrixXd& xi, Eigen::MatrixXd& yi, Eigen::MatrixXcd& data, double x, double y);
+std::complex InterpolateComplex(Eigen::MatrixXd& xi, Eigen::MatrixXd& yi, Eigen::MatrixXcd& data, double x, double y);
///
/// 远场成像
///
-class LAMPTOOLAPI FEKOFarFieldProcessClass :public BP2DProcessClass {
+class FEKOFarFieldProcessClass :public BP2DProcessClass {
public:
size_t height;
size_t width;
diff --git a/src/LAMPTool/FEKONearBpBaseImage.cpp b/src/PluginWBFZExchangePlugin/FEKONearBpBaseImage.cpp
similarity index 100%
rename from src/LAMPTool/FEKONearBpBaseImage.cpp
rename to src/PluginWBFZExchangePlugin/FEKONearBpBaseImage.cpp
diff --git a/src/LAMPTool/FEKOSimulationSARClass.cpp b/src/PluginWBFZExchangePlugin/FEKOSimulationSARClass.cpp
similarity index 99%
rename from src/LAMPTool/FEKOSimulationSARClass.cpp
rename to src/PluginWBFZExchangePlugin/FEKOSimulationSARClass.cpp
index cca7185..2299de0 100644
--- a/src/LAMPTool/FEKOSimulationSARClass.cpp
+++ b/src/PluginWBFZExchangePlugin/FEKOSimulationSARClass.cpp
@@ -434,7 +434,7 @@ QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfid
-bool LAMPTOOLAPI 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();
@@ -1105,13 +1105,13 @@ FEKOBase::FEKOSimulationDataparamsHandler::~FEKOSimulationDataparamsHandler()
{
}
-void FEKOBase::FEKOSimulationDataparamsHandler::setFEKOSimulationDataparams(std::shared_ptr simulationparams)
+void FEKOBase::FEKOSimulationDataparamsHandler::setFEKOSimulationDataparams(FEKOBase::FEKOSimulationDataparams* simulationparams)
{
this->simulationparams = simulationparams;
this->bandingsetFEKOSimulationDataparams();
}
-std::shared_ptr FEKOBase::FEKOSimulationDataparamsHandler::getFEKOSimulationDataparams()
+FEKOBase::FEKOSimulationDataparams* FEKOBase::FEKOSimulationDataparamsHandler::getFEKOSimulationDataparams()
{
return this->simulationparams;
}
diff --git a/src/LAMPTool/FEKOSimulationSARClass.h b/src/PluginWBFZExchangePlugin/FEKOSimulationSARClass.h
similarity index 92%
rename from src/LAMPTool/FEKOSimulationSARClass.h
rename to src/PluginWBFZExchangePlugin/FEKOSimulationSARClass.h
index ffe856a..bb3bcee 100644
--- a/src/LAMPTool/FEKOSimulationSARClass.h
+++ b/src/PluginWBFZExchangePlugin/FEKOSimulationSARClass.h
@@ -6,23 +6,23 @@
*/
#ifndef _FEKO_SIMULATION_SAR_CLASS_H
#define _FEKO_SIMULATION_SAR_CLASS_H
-
+#include "WBFZExchangePluginAPI.h"
+#include
#include "referenceHeader.h"
#include "OCCTBase.h"
#include "GeoOperator.h"
#include "FEKOBaseToolClass.h"
#include "SARImageBase.h"
-#include
+
namespace FEKOBase {
//==========================================================
// FEKO成像仿真参数类
//==========================================================
- class LAMPTOOLAPI FEKOSimulationDataparams : public QObject { // 仿真参数类
+ class FEKOSimulationDataparams : public QObject { // 仿真参数类
Q_OBJECT
-
public:
FEKOSimulationDataparams(QObject* parent = nullptr);
~FEKOSimulationDataparams();
@@ -169,16 +169,21 @@ namespace FEKOBase {
void setFarsourcePhiPoints(long phiPoints);
};
- class LAMPTOOLAPI FEKOSimulationDataparamsHandler {
+
+
+ //
+ class FEKOSimulationDataparamsHandler {
+
public:
FEKOSimulationDataparamsHandler();
~FEKOSimulationDataparamsHandler();
public:
- std::shared_ptr simulationparams;
+ FEKOBase::FEKOSimulationDataparams* simulationparams;
+ FEKOBase::FEKOSimulationDataparams* getFEKOSimulationDataparams();
void setFEKOSimulationDataparams(
- std::shared_ptr simulationparams);
- std::shared_ptr getFEKOSimulationDataparams();
+ FEKOBase::FEKOSimulationDataparams* simulationparams);
+
public:
virtual void bandingsetFEKOSimulationDataparams();
@@ -188,14 +193,14 @@ namespace FEKOBase {
// FEKO仿真成像参数类
// 解析成像参数xml
//==========================================================
- class LAMPTOOLAPI FEKOSimulationSARClass : public FEKOSimulationDataparamsHandler {
+ class FEKOSimulationSARClass : public FEKOSimulationDataparamsHandler {
public:
FEKOSimulationSARClass();
~FEKOSimulationSARClass();
public:
std::vector FEKOAntPoselist; // FEKO的天线参数设置
- void setFEKOAntPoselist(
+ void setFEKOAntPoselist(
std::vector FEKOAntPoselist); // FEKO的天线参数设置
std::vector getFEKOAntPoselist();
@@ -223,12 +228,12 @@ namespace FEKOBase {
// FEKO成像
//==========================================================
- bool LAMPTOOLAPI FEKOImageProcess(EchoDataClass& echodata,
+ bool FEKOImageProcess(EchoDataClass& echodata,
FEKOImageSettingParams& imageSettingParams, QString& outPath,
FEKOImageAlgorithm algmethod = FEKOImageAlgorithm::TBP_FREQ,
ImageAlgWindowFun winfun = ImageAlgWindowFun::HANMMING);
- class LAMPTOOLAPI FEKOImageProcessAbstractClass {
+ class FEKOImageProcessAbstractClass {
public:
FEKOImageProcessAbstractClass();
~FEKOImageProcessAbstractClass();
diff --git a/src/LAMPTool/FileOperator.cpp b/src/PluginWBFZExchangePlugin/FileOperator.cpp
similarity index 79%
rename from src/LAMPTool/FileOperator.cpp
rename to src/PluginWBFZExchangePlugin/FileOperator.cpp
index 8aac6f7..0059d18 100644
--- a/src/LAMPTool/FileOperator.cpp
+++ b/src/PluginWBFZExchangePlugin/FileOperator.cpp
@@ -10,7 +10,7 @@
#include
#include
-std::vector LAMPTOOLAPI getFilelist(const QString& folderpath, const QString& filenameExtension, int (*logfun)(QString logtext, int value))
+std::vector getFilelist(const QString& folderpath, const QString& filenameExtension, int (*logfun)(QString logtext, int value))
{
QString filenameExtensionStr = filenameExtension;
filenameExtensionStr = filenameExtensionStr.remove(0, 1);
@@ -40,7 +40,7 @@ std::vector LAMPTOOLAPI getFilelist(const QString& folderpath, const Q
}
-QString LAMPTOOLAPI getParantFolderNameFromPath(const QString& path)
+QString getParantFolderNameFromPath(const QString& path)
{
QDir directory(path);
directory.cdUp();
@@ -48,7 +48,7 @@ QString LAMPTOOLAPI getParantFolderNameFromPath(const QString& path)
return directory.dirName();
}
-QString LAMPTOOLAPI getParantFromPath(const QString& path)
+QString getParantFromPath(const QString& path)
{
//qDebug() << path;
QDir directory(path);
@@ -58,31 +58,31 @@ QString LAMPTOOLAPI getParantFromPath(const QString& path)
return parentPath;
}
-QString LAMPTOOLAPI getFileNameFromPath(const QString& path)
+QString getFileNameFromPath(const QString& path)
{
QFileInfo fileInfo(path);
return fileInfo.fileName();
}
-bool LAMPTOOLAPI isDirectory(const QString& path)
+bool isDirectory(const QString& path)
{
QFileInfo fileinfo(path);
return fileinfo.isDir();
}
-bool LAMPTOOLAPI isExists(const QString& path)
+bool isExists(const QString& path)
{
QFileInfo fileinfo(path);
return fileinfo.exists();
}
-bool LAMPTOOLAPI isFile(const QString& path)
+bool isFile(const QString& path)
{
QFileInfo fileinfo(path);
return fileinfo.isFile();
}
-int LAMPTOOLAPI write_binfile(char* filepath, char* data, size_t data_len)
+int write_binfile(char* filepath, char* data, size_t data_len)
{
FILE* pd = fopen(filepath, "w");
if (NULL == pd) {
@@ -94,7 +94,7 @@ int LAMPTOOLAPI write_binfile(char* filepath, char* data, size_t data_len)
return -1;
}
-LAMPTOOLAPI char* read_textfile(char* text_path, int* length)
+ char* read_textfile(char* text_path, int* length)
{
char* data = NULL;
FILE* fp1 = fopen(text_path, "r");
@@ -120,12 +120,12 @@ LAMPTOOLAPI char* read_textfile(char* text_path, int* length)
return data;
}
-bool LAMPTOOLAPI exists_test(const QString& name)
+bool exists_test(const QString& name)
{
return isExists(name);
}
-size_t LAMPTOOLAPI fsize(FILE* fp)
+size_t fsize(FILE* fp)
{
size_t n;
fpos_t fpos; // 当前位置
@@ -137,7 +137,7 @@ size_t LAMPTOOLAPI fsize(FILE* fp)
}
-void LAMPTOOLAPI removeFile(const QString& filePath)
+void removeFile(const QString& filePath)
{
QFile file(filePath);
@@ -154,7 +154,7 @@ void LAMPTOOLAPI removeFile(const QString& filePath)
}
}
-unsigned long LAMPTOOLAPI convertToULong(const QString& input) {
+unsigned long convertToULong(const QString& input) {
bool ok; // Used to check if the conversion was successful
unsigned long result = input.toULong(&ok);
@@ -167,7 +167,7 @@ unsigned long LAMPTOOLAPI convertToULong(const QString& input) {
-void LAMPTOOLAPI copyFile(const QString& sourcePath, const QString& destinationPath) {
+void copyFile(const QString& sourcePath, const QString& destinationPath) {
QFile sourceFile(sourcePath);
QFile destinationFile(destinationPath);
diff --git a/src/PluginWBFZExchangePlugin/FileOperator.h b/src/PluginWBFZExchangePlugin/FileOperator.h
new file mode 100644
index 0000000..9dc383a
--- /dev/null
+++ b/src/PluginWBFZExchangePlugin/FileOperator.h
@@ -0,0 +1,50 @@
+#pragma once
+
+#ifndef FILEOPERATOR_H
+#define FILEOPERATOR_H
+
+#include "referenceHeader.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+bool isDirectory(const QString& path);
+bool isExists(const QString& path);
+bool isFile(const QString& path);
+void removeFile(const QString& filePath);
+unsigned long convertToULong(const QString& input);
+///
+/// 获取文件(绝对路径)
+///
+///
+///
+///
+std::vector getFilelist(const QString& folderpath, const QString& FilenameExtension = ".*",int (*logfun)(QString logtext,int value)=nullptr);
+
+QString getParantFolderNameFromPath(const QString& path);
+
+QString getFileNameFromPath(const QString& path);
+
+int write_binfile(char* filepath, char* data, size_t data_len);
+
+ char* read_textfile(char* text_path, int* length);
+
+bool exists_test(const QString& name);
+
+size_t fsize(FILE* fp);
+
+QString getParantFromPath(const QString& path);
+void copyFile(const QString& sourcePath, const QString& destinationPath);
+// QT FileOperator
+#endif
\ No newline at end of file
diff --git a/src/LAMPTool/GeoOperator.cpp b/src/PluginWBFZExchangePlugin/GeoOperator.cpp
similarity index 80%
rename from src/LAMPTool/GeoOperator.cpp
rename to src/PluginWBFZExchangePlugin/GeoOperator.cpp
index fdc77ce..c78fd67 100644
--- a/src/LAMPTool/GeoOperator.cpp
+++ b/src/PluginWBFZExchangePlugin/GeoOperator.cpp
@@ -22,24 +22,24 @@ using namespace std;
using namespace Eigen;
-Landpoint LAMPTOOLAPI operator +(const Landpoint& p1, const Landpoint& p2)
+Landpoint operator +(const Landpoint& p1, const Landpoint& p2)
{
return Landpoint{ p1.lon + p2.lon,p1.lat + p2.lat,p1.ati + p2.ati };
}
-Landpoint LAMPTOOLAPI operator -(const Landpoint& p1, const Landpoint& p2)
+Landpoint operator -(const Landpoint& p1, const Landpoint& p2)
{
return Landpoint{ p1.lon - p2.lon,p1.lat - p2.lat,p1.ati - p2.ati };
}
-bool LAMPTOOLAPI operator ==(const Landpoint& p1, const Landpoint& p2)
+bool operator ==(const Landpoint& p1, const Landpoint& p2)
{
return p1.lat == p2.lat && p1.lon == p2.lon && p1.ati == p2.ati;
}
-Landpoint LAMPTOOLAPI operator *(const Landpoint& p, double scale)
+Landpoint operator *(const Landpoint& p, double scale)
{
return Landpoint{
p.lon * scale,
@@ -49,7 +49,7 @@ Landpoint LAMPTOOLAPI operator *(const Landpoint& p, double scale)
}
-Landpoint LAMPTOOLAPI LLA2XYZ(const Landpoint& LLA) {
+Landpoint LLA2XYZ(const Landpoint& LLA) {
double L = LLA.lon * d2r;
double B = LLA.lat * d2r;
double H = LLA.ati;
@@ -68,7 +68,7 @@ Landpoint LAMPTOOLAPI LLA2XYZ(const Landpoint& LLA) {
}
-Eigen::MatrixXd LAMPTOOLAPI LLA2XYZ(Eigen::MatrixXd landpoint)
+Eigen::MatrixXd LLA2XYZ(Eigen::MatrixXd landpoint)
{
landpoint.col(0) = landpoint.col(0).array() * d2r; // lon
landpoint.col(1) = landpoint.col(1).array() * d2r; // lat
@@ -88,7 +88,7 @@ Eigen::MatrixXd LAMPTOOLAPI LLA2XYZ(Eigen::MatrixXd landpoint)
}
-Landpoint LAMPTOOLAPI XYZ2LLA(const Landpoint& XYZ) {
+Landpoint XYZ2LLA(const Landpoint& XYZ) {
double tmpX = XYZ.lon;//
double temY = XYZ.lat;//
double temZ = XYZ.ati;
@@ -118,7 +118,7 @@ Landpoint LAMPTOOLAPI XYZ2LLA(const Landpoint& XYZ) {
-double LAMPTOOLAPI getAngle(const Landpoint& a, const Landpoint& b)
+double getAngle(const Landpoint& a, const Landpoint& b)
{
double c = dot(a, b) / (getlength(a) * getlength(b));
if (a.lon * b.lat - a.lat * b.lon >= 0) {
@@ -129,17 +129,17 @@ double LAMPTOOLAPI getAngle(const Landpoint& a, const Landpoint& b)
}
}
-double LAMPTOOLAPI dot(const Landpoint& p1, const Landpoint& p2)
+double dot(const Landpoint& p1, const Landpoint& p2)
{
return p1.lat * p2.lat + p1.lon * p2.lon + p1.ati * p2.ati;
}
-double LAMPTOOLAPI getlength(const Landpoint& p1) {
+double getlength(const Landpoint& p1) {
return sqrt(dot(p1, p1));
}
-Landpoint LAMPTOOLAPI crossProduct(const Landpoint& a, const Landpoint& b) {
+Landpoint crossProduct(const Landpoint& a, const Landpoint& b) {
return Landpoint{
a.lat * b.ati - a.ati * b.lat,//x
a.ati * b.lon - a.lon * b.ati,//y
@@ -147,28 +147,28 @@ Landpoint LAMPTOOLAPI crossProduct(const Landpoint& a, const Landpoint& b) {
};
}
-float LAMPTOOLAPI cross2d(Point_3d a, Point_3d b)
+float cross2d(Point_3d a, Point_3d b)
{
return a.x * b.y - a.y * b.x;
}
-Point_3d LAMPTOOLAPI operator -(Point_3d a, Point_3d b)
+Point_3d operator -(Point_3d a, Point_3d b)
{
return Point_3d{ a.x - b.x, a.y - b.y, a.z - b.z };
}
-Point_3d LAMPTOOLAPI operator +(Point_3d a, Point_3d b)
+Point_3d operator +(Point_3d a, Point_3d b)
{
return Point_3d{ a.x + b.x, a.y + b.y, a.z + b.z };
}
-double LAMPTOOLAPI operator /(Point_3d a, Point_3d b)
+double operator /(Point_3d a, Point_3d b)
{
return sqrt(pow(a.x, 2) + pow(a.y, 2)) / sqrt(pow(b.x, 2) + pow(b.y, 2));
}
-Landpoint LAMPTOOLAPI getSlopeVector(const Landpoint& p0, const Landpoint& p1, const Landpoint& p2, const Landpoint& p3, const Landpoint& p4) {
+Landpoint getSlopeVector(const Landpoint& p0, const Landpoint& p1, const Landpoint& p2, const Landpoint& p3, const Landpoint& p4) {
Landpoint n0 = LLA2XYZ(p0),
n1 = LLA2XYZ(p1),
@@ -226,7 +226,7 @@ Landpoint LAMPTOOLAPI getSlopeVector(const Landpoint& p0, const Landpoint& p1,
-double LAMPTOOLAPI distance(const Vector3D& p1, const Vector3D& p2)
+double distance(const Vector3D& p1, const Vector3D& p2)
{
double dx = p1.x - p2.x;
double dy = p1.y - p2.y;
@@ -234,7 +234,7 @@ double LAMPTOOLAPI distance(const Vector3D& p1, const Vector3D& p2)
return std::sqrt(dx * dx + dy * dy + dz * dz);
}
-double LAMPTOOLAPI pointToLineDistance(const Vector3D& point, const Vector3D& linePoint, const Vector3D& lineDirection)
+double pointToLineDistance(const Vector3D& point, const Vector3D& linePoint, const Vector3D& lineDirection)
{
Vector3D pointToLine = { point.x - linePoint.x, point.y - linePoint.y, point.z - linePoint.z };
@@ -249,7 +249,7 @@ double LAMPTOOLAPI pointToLineDistance(const Vector3D& point, const Vector3D& li
return distance(point, projection);
}
-SphericalCoordinates LAMPTOOLAPI cartesianToSpherical(const CartesianCoordinates& cartesian)
+SphericalCoordinates cartesianToSpherical(const CartesianCoordinates& cartesian)
{
SphericalCoordinates spherical;
@@ -260,7 +260,7 @@ SphericalCoordinates LAMPTOOLAPI cartesianToSpherical(const CartesianCoordinates
return spherical;
}
-CartesianCoordinates LAMPTOOLAPI sphericalToCartesian(const SphericalCoordinates& spherical)
+CartesianCoordinates sphericalToCartesian(const SphericalCoordinates& spherical)
{
CartesianCoordinates cartesian;
diff --git a/src/PluginWBFZExchangePlugin/GeoOperator.h b/src/PluginWBFZExchangePlugin/GeoOperator.h
new file mode 100644
index 0000000..18a951f
--- /dev/null
+++ b/src/PluginWBFZExchangePlugin/GeoOperator.h
@@ -0,0 +1,111 @@
+#pragma once
+
+
+#ifndef _GEOOPERATOR_H
+#define _GEOOPERATOR_H
+#include "WBFZExchangePluginAPI.h"
+#include "BaseConstVariable.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+///
+/// 三维向量,坐标表达
+///
+struct Landpoint // 点 SAR影像的像素坐标;
+{
+ ///
+ /// 经度x
+ ///
+ double lon; // 经度x lon pixel_col
+ ///
+ /// 纬度y
+ ///
+ double lat; // 纬度y lat pixel_row
+ ///
+ /// 高度z
+ ///
+ double ati; // 高程z ati pixel_time
+};
+struct Point_3d {
+ double x;
+ double y;
+ double z;
+};
+
+///
+/// 将经纬度转换为地固参心坐标系
+///
+/// 经纬度点--degree
+/// 投影坐标系点
+Landpoint LLA2XYZ(const Landpoint& LLA);
+Eigen::MatrixXd LLA2XYZ(Eigen::MatrixXd landpoint);
+
+///
+/// 将地固参心坐标系转换为经纬度
+///
+/// 固参心坐标系
+/// 经纬度--degree
+Landpoint XYZ2LLA(const Landpoint& XYZ);
+
+
+Landpoint operator +(const Landpoint& p1, const Landpoint& p2);
+
+Landpoint operator -(const Landpoint& p1, const Landpoint& p2);
+
+bool operator ==(const Landpoint& p1, const Landpoint& p2);
+
+Landpoint operator *(const Landpoint& p, double scale);
+
+double getAngle(const Landpoint& a, const Landpoint& b);
+
+double dot(const Landpoint& p1, const Landpoint& p2);
+
+double getlength(const Landpoint& p1);
+
+Landpoint crossProduct(const Landpoint& a, const Landpoint& b);
+
+
+Landpoint getSlopeVector(const Landpoint& p0, const Landpoint& p1, const Landpoint& p2, const Landpoint& p3, const Landpoint& p4);
+
+
+
+float cross2d(Point_3d a, Point_3d b);
+
+Point_3d operator -(Point_3d a, Point_3d b);
+
+Point_3d operator +(Point_3d a, Point_3d b);
+
+double operator /(Point_3d a, Point_3d b);
+
+
+
+// 矢量计算
+struct Vector3D {
+ double x, y, z;
+};
+
+// 计算两点之间的距离
+double distance(const Vector3D& p1, const Vector3D& p2);
+// 计算点到直线的最短距离
+double pointToLineDistance(const Vector3D& point, const Vector3D& linePoint, const Vector3D& lineDirection);
+
+
+struct CartesianCoordinates {
+ double x, y, z;
+};
+
+struct SphericalCoordinates {
+ double r, theta, phi;
+};
+
+SphericalCoordinates cartesianToSpherical(const CartesianCoordinates& cartesian);
+
+CartesianCoordinates sphericalToCartesian(const SphericalCoordinates& spherical);
+
+
+#endif
\ No newline at end of file
diff --git a/src/WBCLFZSystemModule/HeaderSort.h b/src/PluginWBFZExchangePlugin/HeaderSort.h
similarity index 100%
rename from src/WBCLFZSystemModule/HeaderSort.h
rename to src/PluginWBFZExchangePlugin/HeaderSort.h
diff --git a/src/LAMPTool/ImageOperatorBase.cpp b/src/PluginWBFZExchangePlugin/ImageOperatorBase.cpp
similarity index 95%
rename from src/LAMPTool/ImageOperatorBase.cpp
rename to src/PluginWBFZExchangePlugin/ImageOperatorBase.cpp
index 9e75883..78db892 100644
--- a/src/LAMPTool/ImageOperatorBase.cpp
+++ b/src/PluginWBFZExchangePlugin/ImageOperatorBase.cpp
@@ -29,7 +29,7 @@ using namespace Eigen;
-std::shared_ptr LAMPTOOLAPI OpenDataset(const QString& in_path,GDALAccess rwmode)
+std::shared_ptr OpenDataset(const QString& in_path,GDALAccess rwmode)
{
GDALAllRegister();
GDALDataset* dataset_ptr = (GDALDataset*)(GDALOpen(in_path.toUtf8().constData(), rwmode));
@@ -37,13 +37,13 @@ std::shared_ptr LAMPTOOLAPI OpenDataset(const QString& in_path,GDA
return rasterDataset;
}
-void LAMPTOOLAPI CloseDataset(GDALDataset* ptr)
+void CloseDataset(GDALDataset* ptr)
{
GDALClose(ptr);
ptr = NULL;
}
-int LAMPTOOLAPI TIFF2ENVI(QString in_tiff_path, QString out_envi_path)
+int TIFF2ENVI(QString in_tiff_path, QString out_envi_path)
{
std::shared_ptr ds = OpenDataset(in_tiff_path);
const char* args[] = { "-of", "ENVI", NULL };
@@ -53,7 +53,7 @@ int LAMPTOOLAPI TIFF2ENVI(QString in_tiff_path, QString out_envi_path)
return 0;
}
-int LAMPTOOLAPI ENVI2TIFF(QString in_envi_path, QString out_tiff_path)
+int ENVI2TIFF(QString in_envi_path, QString out_tiff_path)
{
std::shared_ptr ds = OpenDataset(in_envi_path);
const char* args[] = { "-of", "Gtiff", NULL };
@@ -63,7 +63,7 @@ int LAMPTOOLAPI ENVI2TIFF(QString in_envi_path, QString out_tiff_path)
return 0;
}
-int LAMPTOOLAPI CreateDataset(QString new_file_path,int height, int width, int band_num,double* gt, QString projection, GDALDataType gdal_dtype ,bool need_gt)
+int CreateDataset(QString new_file_path,int height, int width, int band_num,double* gt, QString projection, GDALDataType gdal_dtype ,bool need_gt)
{
GDALAllRegister();
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("ENVI");
@@ -78,7 +78,7 @@ int LAMPTOOLAPI CreateDataset(QString new_file_path,int height, int width, int
return 0;
}
-int LAMPTOOLAPI saveDataset(QString new_file_path, int start_line,int start_cols ,int band_ids, int datacols,int datarows,void* databuffer)
+int saveDataset(QString new_file_path, int start_line,int start_cols ,int band_ids, int datacols,int datarows,void* databuffer)
{
GDALAllRegister();
std::shared_ptr poDstDS = OpenDataset(new_file_path,GA_Update);
@@ -88,7 +88,7 @@ int LAMPTOOLAPI saveDataset(QString new_file_path, int start_line,int start_col
return 0;
}
-int LAMPTOOLAPI block_num_pre_memory(int block_width, int height, GDALDataType gdal_datatype,double memey_size)
+int block_num_pre_memory(int block_width, int height, GDALDataType gdal_datatype,double memey_size)
{
// 计算大小
int size_meta = 0;
@@ -134,7 +134,7 @@ int LAMPTOOLAPI block_num_pre_memory(int block_width, int height, GDALDataType
return block_num;
}
-Eigen::Matrix LAMPTOOLAPI ReadComplexMatrixData(int start_line, int width, int line_num, std::shared_ptr rasterDataset, GDALDataType gdal_datatype)
+Eigen::Matrix ReadComplexMatrixData(int start_line, int width, int line_num, std::shared_ptr rasterDataset, GDALDataType gdal_datatype)
{
int band_num = rasterDataset->GetRasterCount();
@@ -276,7 +276,7 @@ Eigen::Matrix LAMPTOOL
}
}
-Eigen::Matrix LAMPTOOLAPI ReadMatrixDoubleData(int start_line, int width, int line_num, std::shared_ptr