增加了 点云的 选择筛选功能
parent
1196289cfd
commit
ed821fb003
|
|
@ -3,7 +3,7 @@
|
||||||
#include "Geometry/geometryData.h"
|
#include "Geometry/geometryData.h"
|
||||||
#include "Geometry/geometrySet.h"
|
#include "Geometry/geometrySet.h"
|
||||||
#include "Geometry/geometryParaSphere.h"
|
#include "Geometry/geometryParaSphere.h"
|
||||||
|
#include <QDebug>
|
||||||
namespace Command
|
namespace Command
|
||||||
{
|
{
|
||||||
GeoCommandCreateSphere::GeoCommandCreateSphere(GUI::MainWindow *m, MainWidget::PreWindow *p)
|
GeoCommandCreateSphere::GeoCommandCreateSphere(GUI::MainWindow *m, MainWidget::PreWindow *p)
|
||||||
|
|
@ -13,6 +13,8 @@ namespace Command
|
||||||
|
|
||||||
bool GeoCommandCreateSphere::execute()
|
bool GeoCommandCreateSphere::execute()
|
||||||
{
|
{
|
||||||
|
qDebug()<<"localtion: "<<_location[0]<<" "<<_location[1]<<" "<<_location[2];
|
||||||
|
qDebug()<<"radius: "<<_radius;
|
||||||
gp_Pnt pt(_location[0], _location[1], _location[2]);
|
gp_Pnt pt(_location[0], _location[1], _location[2]);
|
||||||
TopoDS_Shape aTopoBox = BRepPrimAPI_MakeSphere(pt, _radius).Shape();
|
TopoDS_Shape aTopoBox = BRepPrimAPI_MakeSphere(pt, _radius).Shape();
|
||||||
TopoDS_Shape *shape = new TopoDS_Shape;
|
TopoDS_Shape *shape = new TopoDS_Shape;
|
||||||
|
|
|
||||||
|
|
@ -134,5 +134,4 @@ namespace Command
|
||||||
{
|
{
|
||||||
return _sketchUndoList;
|
return _sketchUndoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -41,7 +41,16 @@ target_compile_definitions(GeometryWidgets PRIVATE "GEOMETRYWIDGETS_API")
|
||||||
list(APPEND _depend_library PythonModule Settings DataProperty SelfDefObject Geometry ModuleBase GeometryCommand)
|
list(APPEND _depend_library PythonModule Settings DataProperty SelfDefObject Geometry ModuleBase GeometryCommand)
|
||||||
|
|
||||||
list(APPEND _runtimes_libraries
|
list(APPEND _runtimes_libraries
|
||||||
OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKMath OpenCASCADE::TKPrim OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKernel 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
|
OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo
|
||||||
|
OpenCASCADE::TKGeomBase OpenCASCADE::TKMath OpenCASCADE::TKPrim OpenCASCADE::TKShHealing
|
||||||
|
OpenCASCADE::TKTopAlgo OpenCASCADE::TKernel 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
|
||||||
)
|
)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QLabel" name="label_7">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QLabel" name="label_7">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -120,7 +120,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_9">
|
<widget class="QLabel" name="label_9">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_11">
|
<widget class="QLabel" name="label_11">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_12">
|
<widget class="QLabel" name="label_12">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -147,7 +147,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_13">
|
<widget class="QLabel" name="label_13">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -172,7 +172,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_21">
|
<widget class="QLabel" name="label_21">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -197,7 +197,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_14">
|
<widget class="QLabel" name="label_14">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -222,7 +222,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_15">
|
<widget class="QLabel" name="label_15">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -247,7 +247,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_16">
|
<widget class="QLabel" name="label_16">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -284,7 +284,7 @@
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -309,7 +309,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_19">
|
<widget class="QLabel" name="label_19">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxR2">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxR2">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>100000000000000004384584304507619735463404765184.000000000000000</double>
|
<double>100000000000000004384584304507619735463404765184.000000000000000</double>
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxL">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxL">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>10000000000.000000000000000</double>
|
<double>10000000000.000000000000000</double>
|
||||||
|
|
@ -105,7 +105,7 @@
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxR">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxR">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>9999999999999999932209486743616279764617084419440640.000000000000000</double>
|
<double>9999999999999999932209486743616279764617084419440640.000000000000000</double>
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxR">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxR">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>100000000000.000000000000000</double>
|
<double>100000000000.000000000000000</double>
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxL">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxL">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>10000000000.000000000000000</double>
|
<double>10000000000.000000000000000</double>
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_9">
|
<widget class="QLabel" name="label_9">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_11">
|
<widget class="QLabel" name="label_11">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_12">
|
<widget class="QLabel" name="label_12">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -125,7 +125,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_13">
|
<widget class="QLabel" name="label_13">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_16">
|
<widget class="QLabel" name="label_16">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -167,7 +167,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_14">
|
<widget class="QLabel" name="label_14">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -188,7 +188,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_15">
|
<widget class="QLabel" name="label_15">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -222,7 +222,7 @@
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CreateLineDialog</class>
|
<class>CreateLineDialog</class>
|
||||||
<widget class="QDialog" name="CreateLineDialog">
|
<widget class="QDialog" name="CreateLineDialog">
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>400</width>
|
||||||
<height>358</height>
|
<height>414</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="pointTab">
|
<widget class="QWidget" name="pointTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QLabel" name="label_7">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -120,7 +120,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxR">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxR">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>100000000000.000000000000000</double>
|
<double>100000000000.000000000000000</double>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>GeoSplitterDialog</class>
|
<class>GeoSplitterDialog</class>
|
||||||
<widget class="QDialog" name="GeoSplitterDialog">
|
<widget class="QDialog" name="GeoSplitterDialog">
|
||||||
|
|
@ -128,7 +128,7 @@
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -135,7 +135,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QLabel" name="label_7">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>DialogFillGap</class>
|
<class>DialogFillGap</class>
|
||||||
<widget class="QDialog" name="DialogFillGap">
|
<widget class="QDialog" name="DialogFillGap">
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CreateRevol</class>
|
<class>CreateRevol</class>
|
||||||
<widget class="QDialog" name="CreateRevol">
|
<widget class="QDialog" name="CreateRevol">
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>412</width>
|
<width>412</width>
|
||||||
<height>465</height>
|
<height>507</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -180,7 +180,7 @@
|
||||||
<item row="1" column="0" colspan="2">
|
<item row="1" column="0" colspan="2">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_1">
|
<widget class="QWidget" name="tab_1">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>408</width>
|
<width>408</width>
|
||||||
<height>430</height>
|
<height>429</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -72,7 +72,7 @@
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
@ -317,7 +317,7 @@
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -426,7 +426,7 @@
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>MirrorFeatureDialog</class>
|
<class>MirrorFeatureDialog</class>
|
||||||
<widget class="QDialog" name="MirrorFeatureDialog">
|
<widget class="QDialog" name="MirrorFeatureDialog">
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>434</width>
|
<width>434</width>
|
||||||
<height>383</height>
|
<height>448</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>MoveFeatureDialog</class>
|
<class>MoveFeatureDialog</class>
|
||||||
<widget class="QDialog" name="MoveFeatureDialog">
|
<widget class="QDialog" name="MoveFeatureDialog">
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>456</width>
|
<width>456</width>
|
||||||
<height>399</height>
|
<height>466</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>RotateFeatureDialog</class>
|
<class>RotateFeatureDialog</class>
|
||||||
<widget class="QDialog" name="RotateFeatureDialog">
|
<widget class="QDialog" name="RotateFeatureDialog">
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>456</width>
|
<width>456</width>
|
||||||
<height>439</height>
|
<height>514</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QLabel" name="label_7">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>m</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
|
|
@ -31,13 +31,8 @@ add_library(MainWidgets
|
||||||
${_interface}
|
${_interface}
|
||||||
${_header}
|
${_header}
|
||||||
${_source}
|
${_source}
|
||||||
fekocadTaskinit.cpp
|
vtkMeshSelectTableModel.cpp
|
||||||
fekocadTaskinit.h
|
vtkMeshSelectTableModel.h
|
||||||
fekocadTaskinit.ui
|
|
||||||
createfekocadmodel.cpp
|
|
||||||
createfekocadmodel.h
|
|
||||||
createfekocadmodel.ui
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
@ -52,13 +47,15 @@ if(OpenMP_CXX_FOUND)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND _runtimes_libraries
|
list(APPEND _runtimes_libraries
|
||||||
OpenCASCADE::Freetype OpenCASCADE::TKBRep OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKHLR OpenCASCADE::TKIVtk OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKernel Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersModeling 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::RenderingGL2PSOpenGL2 VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib
|
OpenCASCADE::Freetype OpenCASCADE::TKBRep OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKHLR OpenCASCADE::TKIVtk OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKernel
|
||||||
|
Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml Qt5::OpenGL
|
||||||
|
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::FiltersModeling 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::RenderingGL2PSOpenGL2 VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib
|
||||||
OpenMeshCore OpenMeshTools
|
OpenMeshCore OpenMeshTools
|
||||||
)
|
)
|
||||||
list(APPEND _runtimes_libraries
|
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
|
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
|
||||||
)
|
)
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------s
|
||||||
# 链接依赖库
|
# 链接依赖库
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
target_link_libraries(MainWidgets PRIVATE
|
target_link_libraries(MainWidgets PRIVATE
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,13 @@ namespace MainWidget {
|
||||||
{
|
{
|
||||||
// qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")<<"
|
// qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")<<"
|
||||||
// MeshKernalViewObj::setPointDisplayColor start ";
|
// MeshKernalViewObj::setPointDisplayColor start ";
|
||||||
std::set<int> indexSet(indexs.begin(), indexs.end()); // 转换为 set-- std 实现是B+树
|
// std::set<int> indexSet(indexs.begin(), indexs.end()); // 转换为 set-- std 实现是B+树
|
||||||
|
|
||||||
|
QSet<int> indexSet;
|
||||||
|
foreach (int value, indexs) {
|
||||||
|
indexSet.insert(value); // Insert each element of list into set
|
||||||
|
}
|
||||||
|
|
||||||
// qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")<<"
|
// qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")<<"
|
||||||
// MeshKernalViewObj::setPointDisplayColor create set ";
|
// MeshKernalViewObj::setPointDisplayColor create set ";
|
||||||
vtkDataArray* colorArray = _displayData->GetPointData()->GetScalars();
|
vtkDataArray* colorArray = _displayData->GetPointData()->GetScalars();
|
||||||
|
|
@ -119,8 +125,7 @@ namespace MainWidget {
|
||||||
if(indexs.isEmpty())
|
if(indexs.isEmpty())
|
||||||
break;
|
break;
|
||||||
int pointindex = indexArray->GetComponent(i, 1);
|
int pointindex = indexArray->GetComponent(i, 1);
|
||||||
if(indexSet.find(pointindex)
|
if(indexSet.contains(pointindex)) // 选择点是否在 渲染 点集中, 选中 && 渲染 修改
|
||||||
!= indexSet.end()) // 选择点是否在 渲染 点集中, 选中 && 渲染 修改
|
|
||||||
{
|
{
|
||||||
colorArray->SetComponent(i, 0, col[0]);
|
colorArray->SetComponent(i, 0, col[0]);
|
||||||
colorArray->SetComponent(i, 1, col[1]);
|
colorArray->SetComponent(i, 1, col[1]);
|
||||||
|
|
@ -172,7 +177,11 @@ namespace MainWidget {
|
||||||
{
|
{
|
||||||
// qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")<<"
|
// qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")<<"
|
||||||
// MeshKernalViewObj::setCellDisplayColor start ";
|
// MeshKernalViewObj::setCellDisplayColor start ";
|
||||||
std::set<int> indexSet(indexs.begin(), indexs.end()); // 转换为 set-- std 实现是B+树
|
//std::set<int> indexSet(indexs.begin(), indexs.end()); // 转换为 set-- std 实现是B+树
|
||||||
|
QSet<int> indexSet;
|
||||||
|
foreach (int value, indexs) {
|
||||||
|
indexSet.insert(value); // Insert each element of list into set
|
||||||
|
}
|
||||||
// qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")<<"
|
// qDebug()<<QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")<<"
|
||||||
// MeshKernalViewObj::setPointDisplayColor create set ";
|
// MeshKernalViewObj::setPointDisplayColor create set ";
|
||||||
vtkDataArray* colorArray = _displayData->GetCellData()->GetScalars();
|
vtkDataArray* colorArray = _displayData->GetCellData()->GetScalars();
|
||||||
|
|
@ -202,8 +211,7 @@ namespace MainWidget {
|
||||||
auto serial = [=](int beg, int end) {
|
auto serial = [=](int beg, int end) {
|
||||||
for(int i = beg; i <= end; ++i) {
|
for(int i = beg; i <= end; ++i) {
|
||||||
int cellid = indexArray->GetComponent(i, 1);
|
int cellid = indexArray->GetComponent(i, 1);
|
||||||
// if(indexs.contains(cellid))
|
if(indexSet.contains(cellid))// if(indexSet.find(cellid) != indexSet.end()) // 判断是否在显示对象中
|
||||||
if(indexSet.find(cellid) != indexSet.end()) // 判断是否在显示对象中
|
|
||||||
{
|
{
|
||||||
colorArray->SetComponent(i, 0, col[0]);
|
colorArray->SetComponent(i, 0, col[0]);
|
||||||
colorArray->SetComponent(i, 1, col[1]);
|
colorArray->SetComponent(i, 1, col[1]);
|
||||||
|
|
@ -271,10 +279,16 @@ namespace MainWidget {
|
||||||
if(show)
|
if(show)
|
||||||
value = 1;
|
value = 1;
|
||||||
|
|
||||||
std::set<int> indexSet(indexs.begin(), indexs.end());
|
// std::set<int> indexSet(indexs.begin(), indexs.end());
|
||||||
|
QSet<int> indexSet;
|
||||||
|
foreach (int value, indexs) {
|
||||||
|
indexSet.insert(value); // Insert each element of list into set
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for(int i = 0; i < showArray->GetNumberOfTuples(); ++i) {
|
for(int i = 0; i < showArray->GetNumberOfTuples(); ++i) {
|
||||||
int cellid = IDSArray->GetComponent(i, 1);
|
int cellid = IDSArray->GetComponent(i, 1);
|
||||||
if(indexSet.find(cellid) != indexSet.end()) // 判断是否正确
|
if(indexSet.contains(cellid)) // 判断是否正确
|
||||||
{
|
{
|
||||||
showArray->SetComponent(i, 0, value);
|
showArray->SetComponent(i, 0, value);
|
||||||
}
|
}
|
||||||
|
|
@ -445,7 +459,13 @@ namespace MainWidget {
|
||||||
}
|
}
|
||||||
void MeshKernalViewObj::showPoints(const QList<int>& index, bool show)
|
void MeshKernalViewObj::showPoints(const QList<int>& index, bool show)
|
||||||
{
|
{
|
||||||
std::set<int> indexSet(index.begin(), index.end());
|
// std::set<int> indexSet(index.begin(), index.end());
|
||||||
|
QSet<int> indexSet;
|
||||||
|
foreach (int value, index) {
|
||||||
|
indexSet.insert(value); // Insert each element of list into set
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 判断是否需要显示
|
// 判断是否需要显示
|
||||||
auto dataSet = _kernal->getMeshData();
|
auto dataSet = _kernal->getMeshData();
|
||||||
vtkDataArray* showArray = dataSet->GetPointData()->GetArray("SHOW");
|
vtkDataArray* showArray = dataSet->GetPointData()->GetArray("SHOW");
|
||||||
|
|
@ -458,7 +478,7 @@ namespace MainWidget {
|
||||||
int pointid = -1;
|
int pointid = -1;
|
||||||
for(int i = 0; i < showArray->GetNumberOfTuples(); ++i) {
|
for(int i = 0; i < showArray->GetNumberOfTuples(); ++i) {
|
||||||
int pointid =IDSArray->GetComponent(i, 1);
|
int pointid =IDSArray->GetComponent(i, 1);
|
||||||
if(indexSet.find(pointid) != indexSet.end()) // 判断是否正确
|
if(indexSet.contains(pointid))//if(indexSet.find(pointid) != indexSet.end()) // 判断是否正确
|
||||||
{
|
{
|
||||||
showArray->SetComponent(i, 0, value);
|
showArray->SetComponent(i, 0, value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,6 @@ namespace MainWidget
|
||||||
* @brief 高亮状态标记
|
* @brief 高亮状态标记
|
||||||
*/
|
*/
|
||||||
bool _isKernalHighLight{ false };
|
bool _isKernalHighLight{ false };
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -394,7 +394,7 @@ namespace MainWidget
|
||||||
{
|
{
|
||||||
auto k = _meshData->getKernalByID(dataset); // 获取对应的kernal
|
auto k = _meshData->getKernalByID(dataset); // 获取对应的kernal
|
||||||
auto vObjs = _viewObjects.value(k); // 获取对应的view对象
|
auto vObjs = _viewObjects.value(k); // 获取对应的view对象
|
||||||
QList<int> members = items->values(); //
|
QList<int> members = items->values(dataset); //
|
||||||
if (vObjs == nullptr)
|
if (vObjs == nullptr)
|
||||||
continue;
|
continue;
|
||||||
if(members.isEmpty()){
|
if(members.isEmpty()){
|
||||||
|
|
|
||||||
|
|
@ -241,6 +241,9 @@ namespace MainWidget
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void PreWindow::setSelectItems(QMultiHash<int, int> items, ModuleBase::SelectModel model) {
|
||||||
|
this->_interactionStyle->setSelectItems(items);
|
||||||
|
this->_interactionStyle->setSelectModel((int)model);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,9 @@ namespace MainWidget
|
||||||
QMultiHash<int, int> *getSelectItems();
|
QMultiHash<int, int> *getSelectItems();
|
||||||
|
|
||||||
MeshViewProvider *getMeshViewProvider();
|
MeshViewProvider *getMeshViewProvider();
|
||||||
|
|
||||||
|
void setSelectItems(QMultiHash<int, int> items, ModuleBase::SelectModel model);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//关闭
|
//关闭
|
||||||
void closed();
|
void closed();
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,8 @@ namespace MainWidget
|
||||||
_axisYActor->GetProperty()->SetLineWidth(3);
|
_axisYActor->GetProperty()->SetLineWidth(3);
|
||||||
_axisYActor->GetProperty()->SetColor(0, 1, 0);
|
_axisYActor->GetProperty()->SetColor(0, 1, 0);
|
||||||
_preWindow->AppendActor(_axisXActor, ModuleBase::D3, false);
|
_preWindow->AppendActor(_axisXActor, ModuleBase::D3, false);
|
||||||
_preWindow->AppendActor(_axisYActor, ModuleBase::D3, false);
|
_preWindow->AppendActor(_axisYActor, ModuleBase::D3, false); // 绘制坐标轴
|
||||||
|
|
||||||
|
|
||||||
_pointWidget = new GeometryWidget::SketchPointWidget(_mainWindow, _preWindow, _creater);
|
_pointWidget = new GeometryWidget::SketchPointWidget(_mainWindow, _preWindow, _creater);
|
||||||
emit showDialog(_pointWidget);
|
emit showDialog(_pointWidget);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,536 @@
|
||||||
|
/**
|
||||||
|
* @file vtkMeshSelectTableModel.cpp
|
||||||
|
* @brief None
|
||||||
|
* @author 陈增辉 (3045316072@qq.com)
|
||||||
|
* @version 2.5.0
|
||||||
|
* @date 24-7-30
|
||||||
|
* @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "vtkMeshSelectTableModel.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QColor>
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QVariantMap>
|
||||||
|
#include <QVariantList>
|
||||||
|
#include <QVariant>
|
||||||
|
#include <QList>
|
||||||
|
#include <QMultiHash>
|
||||||
|
#include "preWindow.h"
|
||||||
|
#include "MeshData/meshKernal.h"
|
||||||
|
#include "meshViewProvider.h"
|
||||||
|
#include "meshKernalViewObject.h"
|
||||||
|
#include "MeshData/meshSet.h"
|
||||||
|
#include "MeshData/meshSingleton.h"
|
||||||
|
#include "Settings/busAPI.h" // 获取高亮颜色
|
||||||
|
#include "Settings/GraphOption.h" // 获取高亮颜色
|
||||||
|
|
||||||
|
namespace MainWidget {
|
||||||
|
vtkMeshSelectTableModel::vtkMeshSelectTableModel(PreWindow* _preWindow,QObject* parent)
|
||||||
|
: QAbstractTableModel(parent)
|
||||||
|
, _preWindow(_preWindow)
|
||||||
|
{
|
||||||
|
this->_meshData = MeshData::MeshData::getInstance();
|
||||||
|
if(nullptr!=_preWindow){
|
||||||
|
this->_meshProvider = _preWindow->getMeshViewProvider();
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(this,SIGNAL(itemChanged(const QModelIndex&, const QVariant&)),this,SLOT(onItemChanged(const QModelIndex&, const QVariant&)));
|
||||||
|
}
|
||||||
|
|
||||||
|
vtkMeshSelectTableModel::~vtkMeshSelectTableModel() {}
|
||||||
|
|
||||||
|
// void vtkMeshSelectTableModel::SetData(const QVariantMap& map)
|
||||||
|
// {
|
||||||
|
// beginResetModel();
|
||||||
|
// m_hor_hedlbls = map["headerlabel"].toStringList();
|
||||||
|
// m_table_map = map;
|
||||||
|
// m_vec_hedlbls = map.keys();
|
||||||
|
// endResetModel();
|
||||||
|
// }
|
||||||
|
|
||||||
|
void vtkMeshSelectTableModel::setHignlightIndex(QVector<QPair<int, int>> vec_index)
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
m_highlight_indexs = vec_index;
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt::ItemFlags vtkMeshSelectTableModel::flags(const QModelIndex& index) const
|
||||||
|
{
|
||||||
|
Qt::ItemFlags flags = QAbstractItemModel::flags(index);
|
||||||
|
flags |= Qt::ItemIsEditable;
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant vtkMeshSelectTableModel::data(const QModelIndex& _index, int role) const
|
||||||
|
{
|
||||||
|
if(role == Qt::DisplayRole || role == Qt::EditRole) {
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[_index.row()]].data());
|
||||||
|
return (*_map)[m_hor_hedlbls[_index.column()]];
|
||||||
|
} else if(role == Qt::TextAlignmentRole)
|
||||||
|
return Qt::AlignCenter; // 文字居中
|
||||||
|
else if(role == Qt::BackgroundColorRole) // 设置背景色
|
||||||
|
{
|
||||||
|
if(m_highlight_indexs.contains(qMakePair<int, int>(_index.row(), _index.column()))) {
|
||||||
|
return QColor(230, 247, 255);
|
||||||
|
} else {
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[_index.row()]].data());
|
||||||
|
if((*_map)[SELECTSAVEDFIELDNAME].toInt() ==0) {
|
||||||
|
return QColor(255, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// else if(role == Qt::DecorationRole) // 为item添加图标
|
||||||
|
// {
|
||||||
|
// return QIcon(":/images/device.svg");
|
||||||
|
// }
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant vtkMeshSelectTableModel::headerData(int section, Qt::Orientation orientation,
|
||||||
|
int role) const
|
||||||
|
{
|
||||||
|
if(orientation == Qt::Horizontal) {
|
||||||
|
if(role == Qt::DisplayRole)
|
||||||
|
return m_hor_hedlbls.at(section);
|
||||||
|
else
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QAbstractTableModel::headerData(section, orientation, role); // 垂直表头的序号
|
||||||
|
}
|
||||||
|
|
||||||
|
bool vtkMeshSelectTableModel::setData(const QModelIndex& _index, const QVariant& value,
|
||||||
|
int role)
|
||||||
|
{
|
||||||
|
if(_index.isValid() && role == Qt::EditRole) {
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[_index.row()]].data());
|
||||||
|
if((*_map)[m_hor_hedlbls[_index.column()]] != value) {
|
||||||
|
(*_map)[m_hor_hedlbls[_index.column()]] = value;
|
||||||
|
emit dataChanged(_index, _index);
|
||||||
|
emit itemChanged(_index, value);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int vtkMeshSelectTableModel::rowCount() const
|
||||||
|
{
|
||||||
|
return m_vec_hedlbls.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
int vtkMeshSelectTableModel::columnCount() const
|
||||||
|
{
|
||||||
|
return m_hor_hedlbls.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString vtkMeshSelectTableModel::itemText(int row, int column) const
|
||||||
|
{
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[row]].data());
|
||||||
|
return (*_map)[m_hor_hedlbls[column]].toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString vtkMeshSelectTableModel::itemText(const QModelIndex& index) const
|
||||||
|
{
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[index.row()]].data());
|
||||||
|
return (*_map)[m_hor_hedlbls[index.column()]].toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void vtkMeshSelectTableModel::setItemText(const QModelIndex& index, const QString& str)
|
||||||
|
{
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[index.row()]].data());
|
||||||
|
(*_map)[m_hor_hedlbls[index.column()]] = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
void vtkMeshSelectTableModel::setItemText(int row, int column, const QString& str)
|
||||||
|
{
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[row]].data());
|
||||||
|
(*_map)[m_hor_hedlbls[column]] = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant vtkMeshSelectTableModel::ItemData(const QModelIndex& index) const
|
||||||
|
{
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[index.row()]].data());
|
||||||
|
return (*_map)[m_hor_hedlbls[index.column()]];
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant vtkMeshSelectTableModel::ItemData(int row, int column) const
|
||||||
|
{
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[row]].data());
|
||||||
|
return (*_map)[m_hor_hedlbls[column]];
|
||||||
|
}
|
||||||
|
|
||||||
|
void vtkMeshSelectTableModel::SetItemData(const QModelIndex& index, const QVariant& data)
|
||||||
|
{
|
||||||
|
int vec_lbl = m_vec_hedlbls[index.row()];
|
||||||
|
if(!m_data_map.contains(vec_lbl))
|
||||||
|
m_data_map[vec_lbl] = QVariantMap();
|
||||||
|
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[vec_lbl].data());
|
||||||
|
(*_map)[m_hor_hedlbls[index.column()]] = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
void vtkMeshSelectTableModel::SetItemData(int row, int column, const QVariant& data)
|
||||||
|
{
|
||||||
|
int vec_lbl = m_vec_hedlbls[row];
|
||||||
|
if(!m_data_map.contains(vec_lbl))
|
||||||
|
m_data_map[vec_lbl] = QVariantMap();
|
||||||
|
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[vec_lbl].data());
|
||||||
|
(*_map)[m_hor_hedlbls[column]] = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
void vtkMeshSelectTableModel::clear()
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
// m_table_map.clear();
|
||||||
|
m_data_map.clear();
|
||||||
|
m_hor_hedlbls.clear();
|
||||||
|
m_vec_hedlbls.clear();
|
||||||
|
m_highlight_indexs.clear();
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
void vtkMeshSelectTableModel::SetData(QMultiHash<int, int>* items,
|
||||||
|
ModuleBase::SelectModel _selectModel)
|
||||||
|
{
|
||||||
|
qDebug()<<"\tvoid vtkMeshSelectTableModel::SetData(QMultiHash<int, int>* items,ModuleBase::SelectModel _selectModel)";
|
||||||
|
beginResetModel();
|
||||||
|
this->_selectModel = _selectModel;
|
||||||
|
|
||||||
|
// m_hor_hedlbls = map["headerlabel"].toStringList();
|
||||||
|
// m_table_map = map;
|
||||||
|
// m_vec_hedlbls = map.keys();
|
||||||
|
|
||||||
|
switch(_selectModel) {
|
||||||
|
case ModuleBase::SelectModel::MeshNode:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshNode:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshSurfaceNode: { // 选择点集
|
||||||
|
m_hor_hedlbls << "SELECTID" << "MeshSetID" << "PointID" << "X" << "Y" << "Z"
|
||||||
|
<< SELECTSAVEDFIELDNAME; // 点击
|
||||||
|
this->m_data_map.clear();
|
||||||
|
|
||||||
|
int selectId = 1;
|
||||||
|
// 处理实体数据
|
||||||
|
if(items->isEmpty()) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
QList<int> datasetList = items->uniqueKeys(); // 获取所有的key
|
||||||
|
qDebug() << QString("kernel size: %1").arg(datasetList.size());
|
||||||
|
for(auto dataset : datasetList) {
|
||||||
|
auto k = _meshData->getKernalByID(dataset); // 获取对应的kernal
|
||||||
|
if(!(k->isVisible())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
auto vObjs = _meshProvider->getViewObjects(k); // 获取对应的view对象
|
||||||
|
QList<int> members = items->values(); // 获取所有的value
|
||||||
|
QSet<int> indexSet;
|
||||||
|
foreach(int value, members) {
|
||||||
|
indexSet.insert(value); // Insert each element of list into set
|
||||||
|
}
|
||||||
|
if(vObjs == nullptr || members.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
vtkDataSet* displayData = vObjs->getDisplayData();
|
||||||
|
|
||||||
|
vtkDataArray* IDSArray = displayData->GetPointData()->GetArray("IDS");
|
||||||
|
|
||||||
|
vtkSmartPointer<vtkGeometryFilter> geometryfilter = vtkSmartPointer<vtkGeometryFilter>::New();
|
||||||
|
geometryfilter->SetInputData(displayData);
|
||||||
|
geometryfilter->Update();
|
||||||
|
vtkPolyData* polyData = geometryfilter->GetOutput();
|
||||||
|
if(nullptr==polyData) {
|
||||||
|
qDebug()<<"polyData is nullptr";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
vtkPoints* points = polyData->GetPoints();
|
||||||
|
double p[3];
|
||||||
|
for(int i = 0; i < displayData->GetNumberOfPoints(); ++i) {
|
||||||
|
int pointid = IDSArray->GetComponent(i, 1);
|
||||||
|
if(indexSet.contains(pointid)) // if(indexSet.find(pointid) !=
|
||||||
|
// indexSet.end()) // 判断是否正确
|
||||||
|
{
|
||||||
|
points->GetPoint(i, p);
|
||||||
|
QVariantMap temp_map;
|
||||||
|
temp_map["SELECTID"] = selectId++;
|
||||||
|
temp_map["MeshSetID"] = dataset;
|
||||||
|
temp_map["PointID"] = pointid;
|
||||||
|
temp_map["X"] = p[0];
|
||||||
|
temp_map["Y"] = p[1];
|
||||||
|
temp_map["Z"] = p[2];
|
||||||
|
temp_map[SELECTSAVEDFIELDNAME] = 1;
|
||||||
|
this->m_data_map[selectId] = temp_map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_vec_hedlbls = m_data_map.keys();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ModuleBase::SelectModel::MeshCell:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshCell:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshSurfaceCell: { // 选择网格单元
|
||||||
|
m_hor_hedlbls << "SELECTID" << "MeshSetID" << "CellID" << SELECTSAVEDFIELDNAME; // 点击
|
||||||
|
// 处理网格数据
|
||||||
|
int selectId = 1;
|
||||||
|
// 处理实体数据
|
||||||
|
if(items->isEmpty()) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
QList<int> datasetList = items->uniqueKeys(); // 获取所有的key
|
||||||
|
qDebug() << QString("kernel size: %1").arg(datasetList.size());
|
||||||
|
for(auto dataset : datasetList) {
|
||||||
|
auto k = _meshData->getKernalByID(dataset); // 获取对应的kernal
|
||||||
|
if(!(k->isVisible())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
auto vObjs = _meshProvider->getViewObjects(k); // 获取对应的view对象
|
||||||
|
QList<int> members = items->values(); // 获取所有的value
|
||||||
|
QSet<int> indexSet;
|
||||||
|
foreach(int value, members) {
|
||||||
|
indexSet.insert(value); // Insert each element of list into set
|
||||||
|
}
|
||||||
|
if(vObjs == nullptr || members.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
vtkDataSet* displayData = vObjs->getDisplayData();
|
||||||
|
|
||||||
|
vtkDataArray* IDSArray = displayData->GetCellData()->GetArray("IDS");
|
||||||
|
|
||||||
|
for(int i = 0; i < displayData->GetNumberOfPoints(); ++i) {
|
||||||
|
int cellid = IDSArray->GetComponent(i, 1);
|
||||||
|
if(indexSet.contains(cellid)) // if(indexSet.find(pointid) !=
|
||||||
|
// indexSet.end()) // 判断是否正确
|
||||||
|
{
|
||||||
|
QVariantMap temp_map;
|
||||||
|
temp_map["SELECTID"] = selectId++;
|
||||||
|
temp_map["MeshSetID"] = dataset;
|
||||||
|
temp_map["CellID"] = cellid;
|
||||||
|
temp_map[SELECTSAVEDFIELDNAME] = 1;
|
||||||
|
this->m_data_map[selectId] = temp_map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_vec_hedlbls = m_data_map.keys();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
int vtkMeshSelectTableModel::rowCount(const QModelIndex& parent) const
|
||||||
|
{
|
||||||
|
if(parent.isValid()){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return m_vec_hedlbls.size();
|
||||||
|
}
|
||||||
|
int vtkMeshSelectTableModel::columnCount(const QModelIndex& parent) const
|
||||||
|
{
|
||||||
|
if(parent.isValid()){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return m_hor_hedlbls.size();
|
||||||
|
}
|
||||||
|
void vtkMeshSelectTableModel::setRemoveFlag(int row, bool isdelete) {
|
||||||
|
// 当前行的删除标记
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[row]].data());
|
||||||
|
(*_map)[SELECTSAVEDFIELDNAME] = isdelete ? 0 : 1;
|
||||||
|
auto gp = Setting::BusAPI::instance()->getGraphOption();
|
||||||
|
// if(isdelete) {
|
||||||
|
// auto c = gp->getMeshNodeColor();
|
||||||
|
// this->HightlightCurrentRow(row,c);
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// auto c = gp->getHighLightColor();
|
||||||
|
// this->HightlightCurrentRow(row,c);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
bool vtkMeshSelectTableModel::getRemoveFlag(int row)
|
||||||
|
{
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[row]].data());
|
||||||
|
return (*_map)[SELECTSAVEDFIELDNAME].toInt() == 0;
|
||||||
|
}
|
||||||
|
QMultiHash<int, int> vtkMeshSelectTableModel::getSelectItems()
|
||||||
|
{
|
||||||
|
switch(this->_selectModel) {
|
||||||
|
case ModuleBase::SelectModel::MeshNode:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshNode:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshSurfaceNode: { // 选择点集
|
||||||
|
QMultiHash<int, int> items;
|
||||||
|
for(auto key : m_data_map.keys()) {
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[key].data());
|
||||||
|
if((*_map)[SELECTSAVEDFIELDNAME].toInt() == 1) {
|
||||||
|
items.insert((*_map)["MeshSetID"].toInt(), (*_map)["PointID"].toInt());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return items;
|
||||||
|
// break;
|
||||||
|
}
|
||||||
|
case ModuleBase::SelectModel::MeshCell:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshCell:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshSurfaceCell: { // 选择网格单元
|
||||||
|
QMultiHash<int, int> items;
|
||||||
|
for(auto key : m_data_map.keys()) {
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[key].data());
|
||||||
|
if((*_map)[SELECTSAVEDFIELDNAME].toInt() == 1) {
|
||||||
|
items.insert((*_map)["MeshSetID"].toInt(), (*_map)["CellID"].toInt());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return items;
|
||||||
|
// break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return QMultiHash<int, int>();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
ModuleBase::SelectModel vtkMeshSelectTableModel::getSelectModel()
|
||||||
|
{
|
||||||
|
return this->_selectModel;
|
||||||
|
}
|
||||||
|
void vtkMeshSelectTableModel::setCurrentRowIndex(const QModelIndex& current) {
|
||||||
|
// int row=current.row();
|
||||||
|
// QColor selectc = Setting::BusAPI::instance()->getGraphOption()->getHighLightColor(); // 获取高亮颜色
|
||||||
|
// this->HightlightCurrentRow(currentRow,selectc);
|
||||||
|
// QColor preselectc = Setting::BusAPI::instance()->getGraphOption()->getPreHighLightColor(); // 获取高亮颜色
|
||||||
|
// this->HightlightCurrentRow(row,selectc);
|
||||||
|
// this->currentRow=row;
|
||||||
|
}
|
||||||
|
void vtkMeshSelectTableModel::HightlightRow(int row,QColor c ) {
|
||||||
|
if(row<0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据不同的选择模式,进行不同的操作
|
||||||
|
switch(this->_selectModel) {
|
||||||
|
case ModuleBase::SelectModel::MeshNode:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshNode:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshSurfaceNode: { // 选择点集
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[row]].data());
|
||||||
|
int meshSetID = (*_map)["MeshSetID"].toInt();
|
||||||
|
int pointID = (*_map)["PointID"].toInt();
|
||||||
|
// 根据meshSetID和pointID,选中对应的点
|
||||||
|
auto k = _meshData->getKernalByID(meshSetID); // 获取对应的kernal
|
||||||
|
auto vObjs = _meshProvider->getViewObjects(k);//_viewObjects.value(k); // 获取对应的view对象
|
||||||
|
if(vObjs == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QList<int> members;
|
||||||
|
members.push_back(pointID);
|
||||||
|
vObjs->setPointDisplayColor(members, c,true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ModuleBase::SelectModel::MeshCell:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshCell:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshSurfaceCell: { // 选择网格单元
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[row]].data());
|
||||||
|
int meshSetID = (*_map)["MeshSetID"].toInt();
|
||||||
|
int cellID = (*_map)["CellID"].toInt();
|
||||||
|
// 根据meshSetID和cellID,选中对应的单元
|
||||||
|
auto k = _meshData->getKernalByID(meshSetID); // 获取对应的kernal
|
||||||
|
auto vObjs = _meshProvider->getViewObjects(k);//_viewObjects.value(k); // 获取对应的view对象
|
||||||
|
if(vObjs == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QList<int> members;
|
||||||
|
members.push_back(cellID);
|
||||||
|
vObjs->setCellDisplayColor(members, c,true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_preWindow->reRender();
|
||||||
|
}
|
||||||
|
void vtkMeshSelectTableModel::onItemChanged(const QModelIndex& index, const QVariant& value) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
void vtkMeshSelectTableModel::HightlightRows(QList<int> rows, QColor c) {
|
||||||
|
|
||||||
|
if(rows.count()==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QMultiHash<int, int> items;
|
||||||
|
// 根据不同的选择模式,进行不同的操作
|
||||||
|
switch(this->_selectModel) {
|
||||||
|
case ModuleBase::SelectModel::MeshNode:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshNode:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshSurfaceNode: { // 选择点集
|
||||||
|
for(int i=0;i<rows.count();i++) {
|
||||||
|
int row=rows[i];
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[row]].data());
|
||||||
|
int meshSetID = (*_map)["MeshSetID"].toInt();
|
||||||
|
int pointID = (*_map)["PointID"].toInt();
|
||||||
|
items.insert(meshSetID,pointID);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ModuleBase::SelectModel::MeshCell:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshCell:
|
||||||
|
case ModuleBase::SelectModel::BoxMeshSurfaceCell: { // 选择网格单元
|
||||||
|
for(int i=0;i<rows.count();i++) {
|
||||||
|
int row=rows[i];
|
||||||
|
QVariantMap* _map = (QVariantMap*)(m_data_map[m_vec_hedlbls[row]].data());
|
||||||
|
int meshSetID = (*_map)["MeshSetID"].toInt();
|
||||||
|
int cellID = (*_map)["CellID"].toInt();
|
||||||
|
items.insert(meshSetID,cellID);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(items.isEmpty()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QList<int> datasetList = items.uniqueKeys(); // 获取所有的key
|
||||||
|
qDebug()<<QString("kernel size: %1").arg(datasetList.size());
|
||||||
|
for (auto dataset : datasetList)
|
||||||
|
{
|
||||||
|
auto k = _meshData->getKernalByID(dataset); // 获取对应的kernal
|
||||||
|
if(!(k->isVisible())){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
auto vObjs = _meshProvider->getViewObjects(k); // 获取对应的view对象
|
||||||
|
QList<int> members = items.values(); // 获取所有的value
|
||||||
|
if (vObjs == nullptr)
|
||||||
|
continue;
|
||||||
|
if(members.isEmpty()){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_selectModel == ModuleBase::BoxMeshNode || _selectModel == ModuleBase::MeshNode||_selectModel==ModuleBase::BoxMeshSurfaceNode) {
|
||||||
|
vObjs->setPointDisplayColor(members,c,true);
|
||||||
|
} else if(_selectModel == ModuleBase::BoxMeshCell || _selectModel == ModuleBase::MeshCell||_selectModel==ModuleBase::BoxMeshSurfaceCell) {
|
||||||
|
vObjs->setCellDisplayColor(members,c,true);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//k->getMeshData()->DeepCopy(vObjs->getDisplayData());// 更新结果 与 显示保持一致
|
||||||
|
//vObjs->getDisplayData()->DeepCopy(k->getMeshData());
|
||||||
|
vObjs->modifyPointDisplay();
|
||||||
|
}
|
||||||
|
_preWindow->reRender();
|
||||||
|
}
|
||||||
|
void vtkMeshSelectTableModel::UpdateHightlight() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace MainWidget
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
/**
|
||||||
|
* @file vtkMeshSelectTableModel.h
|
||||||
|
* @brief vtkMesh选择模型表格
|
||||||
|
* @author 陈增辉 (3045316072@qq.com)
|
||||||
|
* @version 2.5.0
|
||||||
|
* @date 24-7-30
|
||||||
|
* @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LAMPCAE_VTKMESHSELECTTABLEMODEL_H
|
||||||
|
#define LAMPCAE_VTKMESHSELECTTABLEMODEL_H
|
||||||
|
#include "mainWidgetsAPI.h"
|
||||||
|
#include <QAbstractTableModel>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QVector>
|
||||||
|
#include "preWindow.h"
|
||||||
|
#include "MeshData/meshKernal.h"
|
||||||
|
#include "meshViewProvider.h"
|
||||||
|
#include "meshKernalViewObject.h"
|
||||||
|
#include "MeshData/meshSet.h"
|
||||||
|
|
||||||
|
namespace MainWidget {
|
||||||
|
const QString SELECTSAVEDFIELDNAME("isSaved"); // 保存选择的字段名
|
||||||
|
|
||||||
|
class MAINWIDGETSAPI vtkMeshSelectTableModel : public QAbstractTableModel {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
void SetData(QMultiHash<int, int>* _selectItems, ModuleBase::SelectModel _selectModel);
|
||||||
|
|
||||||
|
explicit vtkMeshSelectTableModel(PreWindow* _preWindow, QObject* parent = NULL);
|
||||||
|
~vtkMeshSelectTableModel();
|
||||||
|
|
||||||
|
// void SetData(const QVariantMap& map);
|
||||||
|
void setHignlightIndex(QVector<QPair<int, int>> vec_index);
|
||||||
|
|
||||||
|
virtual Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||||
|
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||||
|
|
||||||
|
virtual int rowCount(const QModelIndex& parent) const;
|
||||||
|
virtual int columnCount(const QModelIndex& parent) const;
|
||||||
|
|
||||||
|
virtual int rowCount() const;
|
||||||
|
virtual int columnCount() const;
|
||||||
|
|
||||||
|
virtual QVariant data(const QModelIndex& index, int role) const;
|
||||||
|
virtual bool setData(const QModelIndex& index, const QVariant& value, int role);
|
||||||
|
|
||||||
|
QString itemText(int row, int column) const;
|
||||||
|
QString itemText(const QModelIndex& index) const;
|
||||||
|
void setItemText(const QModelIndex& index, const QString& str);
|
||||||
|
void setItemText(int row, int column, const QString& str);
|
||||||
|
|
||||||
|
QVariant ItemData(const QModelIndex& index) const;
|
||||||
|
QVariant ItemData(int row, int column) const;
|
||||||
|
void SetItemData(const QModelIndex& index, const QVariant& data);
|
||||||
|
void SetItemData(int row, int column, const QVariant& data);
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
void setRemoveFlag(int row, bool isdelete);
|
||||||
|
bool getRemoveFlag(int row);
|
||||||
|
|
||||||
|
QMultiHash<int, int> getSelectItems();
|
||||||
|
ModuleBase::SelectModel getSelectModel();
|
||||||
|
|
||||||
|
void setCurrentRowIndex(const QModelIndex& index);
|
||||||
|
void HightlightRow(int row,QColor c );
|
||||||
|
void HightlightRows(QList<int> rows,QColor c );
|
||||||
|
|
||||||
|
void UpdateHightlight();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void itemChanged(const QModelIndex& index, const QVariant& value);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void onItemChanged(const QModelIndex& index, const QVariant& value);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QStringList m_hor_hedlbls; // headerlabels
|
||||||
|
QList<int> m_vec_hedlbls; // oids - map.keys()
|
||||||
|
QMap<int, QVariant> m_data_map;
|
||||||
|
QVector<QPair<int, int>> m_highlight_indexs; // 背景高亮的indexs
|
||||||
|
ModuleBase::SelectModel _selectModel;
|
||||||
|
MeshData::MeshData* _meshData;
|
||||||
|
PreWindow* _preWindow;
|
||||||
|
MeshViewProvider* _meshProvider;
|
||||||
|
int currentRow;
|
||||||
|
};
|
||||||
|
} // namespace MainWidget
|
||||||
|
#endif // LAMPCAE_VTKMESHSELECTTABLEMODEL_H
|
||||||
|
|
@ -47,6 +47,8 @@
|
||||||
#include "MainWidgets/projectSolveDialog.h"
|
#include "MainWidgets/projectSolveDialog.h"
|
||||||
#include "MainWidgets/meshViewProvider.h"
|
#include "MainWidgets/meshViewProvider.h"
|
||||||
#include "MainWidgets/meshKernalViewObject.h"
|
#include "MainWidgets/meshKernalViewObject.h"
|
||||||
|
#include "MainWidgets/vtkMeshSelectTableModel.h"
|
||||||
|
#include "MainWidgets/SelectNodeShow.h"
|
||||||
|
|
||||||
#include "MainWindowPy.h"
|
#include "MainWindowPy.h"
|
||||||
#include "MeshData/meshKernal.h"
|
#include "MeshData/meshKernal.h"
|
||||||
|
|
@ -490,6 +492,11 @@ namespace GUI {
|
||||||
|
|
||||||
connect(_ui->actionCreateCADModel, SIGNAL(triggered()), this,
|
connect(_ui->actionCreateCADModel, SIGNAL(triggered()), this,
|
||||||
SLOT(on_actionCreateCADModel()));
|
SLOT(on_actionCreateCADModel()));
|
||||||
|
connect(_ui->actionEditSelectDialog, SIGNAL(triggered()), this,
|
||||||
|
SLOT(on_actionEditSelectDialog()));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1559,7 +1566,7 @@ namespace GUI {
|
||||||
_graphRange = new QLabel(this);
|
_graphRange = new QLabel(this);
|
||||||
_ui->statusbar->addPermanentWidget(_graphRange);
|
_ui->statusbar->addPermanentWidget(_graphRange);
|
||||||
}
|
}
|
||||||
QString text = QString(tr("Canvas %1m * %2m ")).arg(w).arg(h);
|
QString text = QString(tr("画布 %1mm * %2mm ")).arg(w).arg(h);
|
||||||
|
|
||||||
_graphRange->setText(text);
|
_graphRange->setText(text);
|
||||||
}
|
}
|
||||||
|
|
@ -1732,7 +1739,7 @@ namespace GUI {
|
||||||
_ui->statusbar->addPermanentWidget(_vtkworldPostion);
|
_ui->statusbar->addPermanentWidget(_vtkworldPostion);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString text = QString(tr("model world position : %2m, %3m, %4m ")).arg(x).arg(y).arg(z);
|
QString text = QString(tr(u8"世界坐标 : %1 mm, %2 mm, %3 mm ")).arg(x).arg(y).arg(z);
|
||||||
_vtkworldPostion->setText(text);
|
_vtkworldPostion->setText(text);
|
||||||
}
|
}
|
||||||
void MainWindow::on_actionvtkPointSamplor()
|
void MainWindow::on_actionvtkPointSamplor()
|
||||||
|
|
@ -2080,5 +2087,10 @@ namespace GUI {
|
||||||
scriptPath);
|
scriptPath);
|
||||||
}else{}
|
}else{}
|
||||||
}
|
}
|
||||||
|
void MainWindow::on_actionEditSelectDialog() {
|
||||||
|
MainWidget::SelectNodeShow* selectNodeShow=new MainWidget::SelectNodeShow(this->getSubWindowManager()->getPreWindow(),this);
|
||||||
|
selectNodeShow->initSelectNodeShow(this->getSubWindowManager()->getPreWindow()->getSelectItems(),this->getSubWindowManager()->getPreWindow()->getSelectModel()) ;
|
||||||
|
selectNodeShow->show();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace GUI
|
} // namespace GUI
|
||||||
|
|
|
||||||
|
|
@ -155,10 +155,10 @@ namespace GUI {
|
||||||
// Ribbon Customize
|
// Ribbon Customize
|
||||||
SARibbonActionsManager* getActionManager();
|
SARibbonActionsManager* getActionManager();
|
||||||
|
|
||||||
// 导入mesh
|
// // 导入mesh
|
||||||
void importMesh(QString filepath,QString aSuffix,int modelID);
|
// void importMesh(QString filepath,QString aSuffix,int modelID);
|
||||||
/// 导入点云
|
// /// 导入点云
|
||||||
void importPcl(QString filepath,QString aSuffix,int modelID);
|
// void importPcl(QString filepath,QString aSuffix,int modelID);
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
@ -363,6 +363,9 @@ namespace GUI {
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
void on_actionEditSelectDialog();
|
||||||
|
|
||||||
void on_actionCreateLoadModelScript();
|
void on_actionCreateLoadModelScript();
|
||||||
|
|
||||||
/*状态栏显示信息 */
|
/*状态栏显示信息 */
|
||||||
|
|
|
||||||
|
|
@ -375,6 +375,8 @@
|
||||||
<addaction name="actionBoxMeshCell"/>
|
<addaction name="actionBoxMeshCell"/>
|
||||||
<addaction name="actionBoxMeshSurfaceNode"/>
|
<addaction name="actionBoxMeshSurfaceNode"/>
|
||||||
<addaction name="actionBoxMeshSurfaceCell"/>
|
<addaction name="actionBoxMeshSurfaceCell"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionEditSelectDialog"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuMeshEdit">
|
<widget class="QMenu" name="menuMeshEdit">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
|
@ -1262,12 +1264,12 @@
|
||||||
</action>
|
</action>
|
||||||
<action name="actionFEKOScatterSetting">
|
<action name="actionFEKOScatterSetting">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>FEKO散射仿真参数设置</string>
|
<string>微波测量仿真分系统散射仿真参数设置</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionLoadFEKOScatterResult">
|
<action name="actionLoadFEKOScatterResult">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>加载FEKO散射仿真结果</string>
|
<string>加载散射仿真结果</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionExportRCS">
|
<action name="actionExportRCS">
|
||||||
|
|
@ -1282,7 +1284,7 @@
|
||||||
</action>
|
</action>
|
||||||
<action name="actionLoadFEKOImageResult">
|
<action name="actionLoadFEKOImageResult">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>加载FEKO图像回波仿真结果</string>
|
<string>加载仿真图像回波仿真结果</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionExportFEKOResultToEcho">
|
<action name="actionExportFEKOResultToEcho">
|
||||||
|
|
@ -1292,7 +1294,7 @@
|
||||||
</action>
|
</action>
|
||||||
<action name="actionFEKOImageCreate">
|
<action name="actionFEKOImageCreate">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>FEKO成像结果</string>
|
<string>仿真成像结果</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionNew">
|
<action name="actionNew">
|
||||||
|
|
@ -2633,27 +2635,27 @@
|
||||||
</action>
|
</action>
|
||||||
<action name="actionImageSetting">
|
<action name="actionImageSetting">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Image FEKO Simulation Setting</string>
|
<string>图像仿真设置</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionFEKOImage">
|
<action name="actionFEKOImage">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Feko Result Image</string>
|
<string>仿真图像生成</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionantScatteringFEKOSetting">
|
<action name="actionantScatteringFEKOSetting">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>LAMP Scattering Ant Setting</string>
|
<string>微波测量仿真分系统散射测量装置参数设置</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionFEKO2csv">
|
<action name="actionFEKO2csv">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>FEKO Result Import</string>
|
<string>仿真结果转散射数据</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionScatterExport">
|
<action name="actionScatterExport">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>FEKO Scatter Data Export</string>
|
<string>仿真散射结果导出</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionAttriutionDBShow">
|
<action name="actionAttriutionDBShow">
|
||||||
|
|
@ -2798,6 +2800,11 @@
|
||||||
<string>生成加载模型参数文件</string>
|
<string>生成加载模型参数文件</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionEditSelectDialog">
|
||||||
|
<property name="text">
|
||||||
|
<string>EditSelectDialog</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../qrc/qianfan.qrc"/>
|
<include location="../qrc/qianfan.qrc"/>
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,8 @@ add_library(ModuleBase
|
||||||
${_interface}
|
${_interface}
|
||||||
${_header}
|
${_header}
|
||||||
${_source}
|
${_source}
|
||||||
|
sketchViewInteractorStyle.cpp
|
||||||
|
sketchViewInteractorStyle.h
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -956,5 +956,11 @@ namespace ModuleBase
|
||||||
same = false;
|
same = false;
|
||||||
return same;
|
return same;
|
||||||
}
|
}
|
||||||
|
void PropPickerInteractionStyle::setSelectItems(QMultiHash<int, int> items) {
|
||||||
|
// 设置选中的单元或点
|
||||||
|
_selectItems.clear();
|
||||||
|
_selectItems = items;
|
||||||
|
emit highLight(&_selectItems);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,9 @@ namespace ModuleBase
|
||||||
void connectToMainWindow(GUI::MainWindow *mw, QWidget *parent);
|
void connectToMainWindow(GUI::MainWindow *mw, QWidget *parent);
|
||||||
void setRenderWindow(vtkRenderWindow *w);
|
void setRenderWindow(vtkRenderWindow *w);
|
||||||
void setRender(vtkRenderer *r);
|
void setRender(vtkRenderer *r);
|
||||||
|
|
||||||
|
void setSelectItems(QMultiHash<int, int> items);
|
||||||
|
|
||||||
// private:
|
// private:
|
||||||
// vtkSmartPointer<vtkPolyData> Points;
|
// vtkSmartPointer<vtkPolyData> Points;
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "PreWindowInteractorStyle.h"
|
#include "PreWindowInteractorStyle.h"
|
||||||
|
#include "sketchViewInteractorStyle.h"
|
||||||
#include "MainWindow/MainWindow.h"
|
#include "MainWindow/MainWindow.h"
|
||||||
#include "MeshData/meshSet.h"
|
#include "MeshData/meshSet.h"
|
||||||
#include "MeshData/meshKernal.h"
|
#include "MeshData/meshKernal.h"
|
||||||
|
|
@ -82,6 +83,8 @@ namespace ModuleBase
|
||||||
|
|
||||||
if (_interactionStyle)
|
if (_interactionStyle)
|
||||||
_interactionStyle->Delete();
|
_interactionStyle->Delete();
|
||||||
|
if(_sketchViewInteractorStyle)
|
||||||
|
_sketchViewInteractorStyle->Delete();
|
||||||
}
|
}
|
||||||
void Graph3DWindow::enableKeyBoard(bool on)
|
void Graph3DWindow::enableKeyBoard(bool on)
|
||||||
{
|
{
|
||||||
|
|
@ -561,15 +564,6 @@ namespace ModuleBase
|
||||||
|
|
||||||
}
|
}
|
||||||
void Graph3DWindow::mouseMoveEvent(QMouseEvent* event)
|
void Graph3DWindow::mouseMoveEvent(QMouseEvent* event)
|
||||||
{
|
{}
|
||||||
// // 获取鼠标当前位置
|
|
||||||
// QPointF pos=event->pos();
|
|
||||||
// double dispCoord[2] = {pos.x(), pos.y()};
|
|
||||||
// vtkSmartPointer<vtkCoordinate> pCoorPress = vtkSmartPointer<vtkCoordinate>::New();
|
|
||||||
// pCoorPress->SetCoordinateSystemToDisplay();
|
|
||||||
// pCoorPress->SetValue(dispCoord);
|
|
||||||
// double *worldCoord = pCoorPress->GetComputedWorldValue(_render);
|
|
||||||
//// qDebug() << worldCoord[0] << worldCoord[1] << worldCoord[2];
|
|
||||||
// emit this->WorldPointMouseMove(worldCoord[0],worldCoord[1],worldCoord[2]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,7 @@ namespace ModuleBase
|
||||||
};
|
};
|
||||||
|
|
||||||
class PropPickerInteractionStyle;
|
class PropPickerInteractionStyle;
|
||||||
|
class sketchViewInteractorStyle;
|
||||||
|
|
||||||
class MODULEBASEAPI Graph3DWindow : /*public QWidget,*/ public GraphWindowBase
|
class MODULEBASEAPI Graph3DWindow : /*public QWidget,*/ public GraphWindowBase
|
||||||
{
|
{
|
||||||
|
|
@ -180,10 +181,16 @@ namespace ModuleBase
|
||||||
void createCubeAxes(double minx=-1000,double maxx=1000,double miny=-1000,double maxy=1000,double minz=-1000,double maxz=1000);
|
void createCubeAxes(double minx=-1000,double maxx=1000,double miny=-1000,double maxy=1000,double minz=-1000,double maxz=1000);
|
||||||
|
|
||||||
|
|
||||||
|
// 切换草图
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//重绘
|
//重绘
|
||||||
void reRender();
|
void reRender();
|
||||||
|
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void setSelectType(int model);
|
void setSelectType(int model);
|
||||||
void enableKeyBoard(bool on);
|
void enableKeyBoard(bool on);
|
||||||
|
|
@ -244,6 +251,7 @@ namespace ModuleBase
|
||||||
|
|
||||||
//拾取相关
|
//拾取相关
|
||||||
PropPickerInteractionStyle* _interactionStyle{};
|
PropPickerInteractionStyle* _interactionStyle{};
|
||||||
|
sketchViewInteractorStyle* _sketchViewInteractorStyle{};
|
||||||
SelectModel _selectModel{ None };
|
SelectModel _selectModel{ None };
|
||||||
|
|
||||||
// 世界坐标系
|
// 世界坐标系
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
/**
|
||||||
|
* @file sketchViewInteractorStyle.cpp
|
||||||
|
* @brief None
|
||||||
|
* @author 陈增辉 (3045316072@qq.com)
|
||||||
|
* @version 2.5.0
|
||||||
|
* @date 24-7-26
|
||||||
|
* @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
|
||||||
|
*/
|
||||||
|
#include <vtkPolyData.h>
|
||||||
|
#include <vtkConeSource.h>
|
||||||
|
#include <vtkSmartPointer.h>
|
||||||
|
#include <vtkPolyDataMapper.h>
|
||||||
|
#include <vtkActor.h>
|
||||||
|
#include <vtkRenderWindow.h>
|
||||||
|
#include <vtkRenderer.h>
|
||||||
|
#include <vtkRenderWindowInteractor.h>
|
||||||
|
#include <vtkCamera.h>
|
||||||
|
#include "sketchViewInteractorStyle.h"
|
||||||
|
void ModuleBase::sketchViewInteractorStyle::Pan() {
|
||||||
|
int x, y;
|
||||||
|
this->Interactor->GetEventPosition(x, y);
|
||||||
|
int lastX, lastY;
|
||||||
|
this->Interactor->GetLastEventPosition(lastX, lastY);
|
||||||
|
double deltaX = (x - lastX) * 0.01; // 调整平移速度
|
||||||
|
double deltaY = (y - lastY) * 0.01; // 调整平移速度
|
||||||
|
|
||||||
|
vtkCamera* camera = this->CurrentRenderer->GetActiveCamera();
|
||||||
|
camera->Azimuth(deltaX);
|
||||||
|
camera->Elevation(deltaY);
|
||||||
|
camera->OrthogonalizeViewUp();
|
||||||
|
this->Interactor->Render();
|
||||||
|
}
|
||||||
|
void ModuleBase::sketchViewInteractorStyle::Rotate()
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
this->Interactor->GetEventPosition(x, y);
|
||||||
|
int lastX, lastY;
|
||||||
|
this->Interactor->GetLastEventPosition(lastX, lastY);
|
||||||
|
double deltaAngle = (x - lastX) * 0.5; // 调整旋转速度
|
||||||
|
this->CurrentRenderer->GetActiveCamera()->Roll(deltaAngle);
|
||||||
|
this->Interactor->Render();
|
||||||
|
}
|
||||||
|
void ModuleBase::sketchViewInteractorStyle::OnMouseMove() {
|
||||||
|
if (this->LeftButtonDown)
|
||||||
|
{
|
||||||
|
this->Rotate();
|
||||||
|
}
|
||||||
|
else if (this->MiddleButtonDown)
|
||||||
|
{
|
||||||
|
this->Pan();
|
||||||
|
}
|
||||||
|
else if (this->RightButtonDown)
|
||||||
|
{
|
||||||
|
// 禁止缩放
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
vtkInteractorStyleTrackballCamera::OnMouseMove();
|
||||||
|
}
|
||||||
|
ModuleBase::sketchViewInteractorStyle::sketchViewInteractorStyle() : LeftButtonDown(false), MiddleButtonDown(false), RightButtonDown(false) {}
|
||||||
|
ModuleBase::sketchViewInteractorStyle::~sketchViewInteractorStyle() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ModuleBase::sketchViewInteractorStyle* ModuleBase::sketchViewInteractorStyle::New(){
|
||||||
|
return new sketchViewInteractorStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ModuleBase::sketchViewInteractorStyle::OnLeftButtonDown()
|
||||||
|
{
|
||||||
|
this->LeftButtonDown = true;
|
||||||
|
vtkInteractorStyleTrackballCamera::OnLeftButtonDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModuleBase::sketchViewInteractorStyle::OnLeftButtonUp()
|
||||||
|
{
|
||||||
|
this->LeftButtonDown = false;
|
||||||
|
vtkInteractorStyleTrackballCamera::OnLeftButtonUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModuleBase::sketchViewInteractorStyle::OnMiddleButtonDown()
|
||||||
|
{
|
||||||
|
this->MiddleButtonDown = true;
|
||||||
|
vtkInteractorStyleTrackballCamera::OnMiddleButtonDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModuleBase::sketchViewInteractorStyle::OnMiddleButtonUp()
|
||||||
|
{
|
||||||
|
this->MiddleButtonDown = false;
|
||||||
|
vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModuleBase::sketchViewInteractorStyle::OnRightButtonDown()
|
||||||
|
{
|
||||||
|
this->RightButtonDown = true;
|
||||||
|
vtkInteractorStyleTrackballCamera::OnRightButtonDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModuleBase::sketchViewInteractorStyle::OnRightButtonUp()
|
||||||
|
{
|
||||||
|
this->RightButtonDown = false;
|
||||||
|
vtkInteractorStyleTrackballCamera::OnRightButtonUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
/**
|
||||||
|
* @file sketchViewInteractorStyle.h
|
||||||
|
* @brief None
|
||||||
|
* @author 陈增辉 (3045316072@qq.com)
|
||||||
|
* @version 2.5.0
|
||||||
|
* @date 24-7-26
|
||||||
|
* @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LAMPCAE_SKETCHVIEWINTERACTORSTYLE_H
|
||||||
|
#define LAMPCAE_SKETCHVIEWINTERACTORSTYLE_H
|
||||||
|
#include <vtkActor.h>
|
||||||
|
#include <vtkCubeSource.h>
|
||||||
|
#include <vtkInteractorStyleTrackballCamera.h>
|
||||||
|
#include <vtkPolyDataMapper.h>
|
||||||
|
#include <vtkRenderWindow.h>
|
||||||
|
#include <vtkRenderWindowInteractor.h>
|
||||||
|
#include <vtkRenderer.h>
|
||||||
|
#include <vtkInteractorStyleRubberBandPick.h>
|
||||||
|
#include <vtkDataSetMapper.h>
|
||||||
|
#include <QObject>
|
||||||
|
#include "ModuleBase/ModuleType.h"
|
||||||
|
#include <vtkIdTypeArray.h>
|
||||||
|
#include <QMultiHash>
|
||||||
|
#include <QList>
|
||||||
|
#include "moduleBaseAPI.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
#include <vtkSmartPointer.h>
|
||||||
|
#include <vtkPointData.h>
|
||||||
|
#include <vtkIdTypeArray.h>
|
||||||
|
#include <vtkDataSetSurfaceFilter.h>
|
||||||
|
#include <vtkRendererCollection.h>
|
||||||
|
#include <vtkProperty.h>
|
||||||
|
#include <vtkPlanes.h>
|
||||||
|
#include <vtkObjectFactory.h>
|
||||||
|
#include <vtkPolyDataMapper.h>
|
||||||
|
#include <vtkActor.h>
|
||||||
|
#include <vtkRenderWindow.h>
|
||||||
|
#include <vtkRenderer.h>
|
||||||
|
#include <vtkRenderWindowInteractor.h>
|
||||||
|
#include <vtkPolyData.h>
|
||||||
|
#include <vtkPointSource.h>
|
||||||
|
#include <vtkInteractorStyleRubberBandPick.h>
|
||||||
|
#include <vtkAreaPicker.h>
|
||||||
|
#include <vtkExtractGeometry.h>
|
||||||
|
#include <vtkDataSetMapper.h>
|
||||||
|
#include <vtkUnstructuredGrid.h>
|
||||||
|
#include <vtkVertexGlyphFilter.h>
|
||||||
|
#include <vtkIdFilter.h>
|
||||||
|
#include <vtkWorldPointPicker.h>
|
||||||
|
|
||||||
|
class vtkActor;
|
||||||
|
class vtkProperty;
|
||||||
|
class vtkDataSet;
|
||||||
|
class vtkIdTypeArray;
|
||||||
|
class vtkAreaPicker;
|
||||||
|
class vtkRenderWindow;
|
||||||
|
class vtkRenderer;
|
||||||
|
class QKeyEvent;
|
||||||
|
class QWidget;
|
||||||
|
class vtkCoordinate;
|
||||||
|
|
||||||
|
namespace ModuleBase {
|
||||||
|
class sketchViewInteractorStyle: public QObject, public vtkInteractorStyleTrackballCamera
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static sketchViewInteractorStyle* New();
|
||||||
|
vtkTypeMacro(sketchViewInteractorStyle, vtkInteractorStyleTrackballCamera);
|
||||||
|
|
||||||
|
sketchViewInteractorStyle();
|
||||||
|
~sketchViewInteractorStyle();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void Rotate() override;
|
||||||
|
void Pan() override;
|
||||||
|
void OnLeftButtonDown() override;
|
||||||
|
void OnLeftButtonUp() override;
|
||||||
|
void OnMiddleButtonDown() override;
|
||||||
|
void OnMiddleButtonUp() override;
|
||||||
|
void OnRightButtonDown() override;
|
||||||
|
void OnRightButtonUp() override;
|
||||||
|
void OnMouseMove() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool LeftButtonDown;
|
||||||
|
bool MiddleButtonDown;
|
||||||
|
bool RightButtonDown;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endif // LAMPCAE_SKETCHVIEWINTERACTORSTYLE_H
|
||||||
|
|
@ -251,7 +251,11 @@ namespace MeshData {
|
||||||
|
|
||||||
void MeshOperator::SearchPoints(vtkDataSet* dataSet,const QList<int>& index ,int value)
|
void MeshOperator::SearchPoints(vtkDataSet* dataSet,const QList<int>& index ,int value)
|
||||||
{
|
{
|
||||||
std::set<int> indexSet(index.begin(), index.end());
|
//std::set<int> indexSet(index.begin(), index.end());
|
||||||
|
QSet<int> indexSet;
|
||||||
|
foreach (int value, index) {
|
||||||
|
indexSet.insert(value); // Insert each element of list into set
|
||||||
|
}
|
||||||
// 判断是否需要显示
|
// 判断是否需要显示
|
||||||
vtkDataArray* showArray = dataSet->GetPointData()->GetArray("SHOW");
|
vtkDataArray* showArray = dataSet->GetPointData()->GetArray("SHOW");
|
||||||
vtkDataArray* IDSArray=dataSet->GetPointData()->GetArray("IDS");
|
vtkDataArray* IDSArray=dataSet->GetPointData()->GetArray("IDS");
|
||||||
|
|
@ -261,7 +265,7 @@ namespace MeshData {
|
||||||
int pointid = -1;
|
int pointid = -1;
|
||||||
for(int i = 0; i < showArray->GetNumberOfTuples(); ++i) {
|
for(int i = 0; i < showArray->GetNumberOfTuples(); ++i) {
|
||||||
int pointid =IDSArray->GetComponent(i, 1);
|
int pointid =IDSArray->GetComponent(i, 1);
|
||||||
if(indexSet.find(pointid) != indexSet.end()) // 判断是否正确
|
if(indexSet.contains(pointid))//if(indexSet.find(pointid) != indexSet.end()) // 判断是否正确
|
||||||
{
|
{
|
||||||
showArray->SetComponent(i, 0, value);
|
showArray->SetComponent(i, 0, value);
|
||||||
}
|
}
|
||||||
|
|
@ -295,10 +299,15 @@ namespace MeshData {
|
||||||
if(nullptr==IDSArray||nullptr == showArray)
|
if(nullptr==IDSArray||nullptr == showArray)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::set<int> indexSet(indexs.begin(), indexs.end());
|
//std::set<int> indexSet(indexs.begin(), indexs.end());
|
||||||
|
QSet<int> indexSet;
|
||||||
|
foreach (int value, indexs) {
|
||||||
|
indexSet.insert(value); // Insert each element of list into set
|
||||||
|
}
|
||||||
|
|
||||||
for(int i = 0; i < showArray->GetNumberOfTuples(); ++i) {
|
for(int i = 0; i < showArray->GetNumberOfTuples(); ++i) {
|
||||||
int cellid = IDSArray->GetComponent(i, 1);
|
int cellid = IDSArray->GetComponent(i, 1);
|
||||||
if(indexSet.find(cellid) != indexSet.end()) // 判断是否正确
|
if(indexSet.contains(cellid))//if(indexSet.find(cellid) != indexSet.end()) // 判断是否正确
|
||||||
{
|
{
|
||||||
showArray->SetComponent(i, 0, value);
|
showArray->SetComponent(i, 0, value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -293,8 +293,8 @@ namespace WBFZ {
|
||||||
// 创建 vtkCellDataToPointData 过滤器
|
// 创建 vtkCellDataToPointData 过滤器
|
||||||
vtkSmartPointer<vtkGeometryFilter> cellToPointFilter = vtkSmartPointer<vtkGeometryFilter>::New();
|
vtkSmartPointer<vtkGeometryFilter> cellToPointFilter = vtkSmartPointer<vtkGeometryFilter>::New();
|
||||||
vtkSmartPointer<vtkPolyData> inpolyData=vtkSmartPointer<vtkPolyData>::New();
|
vtkSmartPointer<vtkPolyData> inpolyData=vtkSmartPointer<vtkPolyData>::New();
|
||||||
|
vtkSmartPointer<vtkPolyData> polydata2 = vtkSmartPointer<vtkPolyData>::New();
|
||||||
vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();
|
vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();
|
||||||
|
|
||||||
for (QString compontId: qCompontIds) {
|
for (QString compontId: qCompontIds) {
|
||||||
meshSet = meshData->getMeshSetByID(compontId.toInt());
|
meshSet = meshData->getMeshSetByID(compontId.toInt());
|
||||||
DebugInfo("point count %d : %d \n", compontId.toInt(), meshSet == nullptr);
|
DebugInfo("point count %d : %d \n", compontId.toInt(), meshSet == nullptr);
|
||||||
|
|
@ -312,15 +312,54 @@ namespace WBFZ {
|
||||||
inpolyData = cellToPointFilter->GetOutput();
|
inpolyData = cellToPointFilter->GetOutput();
|
||||||
|
|
||||||
|
|
||||||
if(PointCloudOperator::PointCloudMeshOperator::GP(inpolyData,polydata,_SearchRadius,_Mu,_MaximumNearestNeighbors,_MaximumSurfaceAngle,_MaximumAngle,_MinimumAngle)){
|
|
||||||
|
|
||||||
}else{
|
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_with_rgba(new pcl::PointCloud<pcl::PointXYZRGBA>);
|
||||||
return false;
|
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_filtered( new pcl::PointCloud<pcl::PointXYZRGBA>);
|
||||||
}
|
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr output( new pcl::PointCloud<pcl::PointXYZRGBA>); // 输出结果
|
||||||
|
pcl::PointCloud<pcl::PointNormal>::Ptr cloud_with_normals(new pcl::PointCloud<pcl::PointNormal>); // 法线向量
|
||||||
|
|
||||||
|
pcl::search::KdTree<pcl::PointNormal>::Ptr tree2(new pcl::search::KdTree<pcl::PointNormal>);
|
||||||
|
|
||||||
|
pcl::io::vtkPolyDataToPointCloud(inpolyData, *cloud_with_rgba);
|
||||||
|
qDebug()<<"cloud_with_rgba "<<cloud_with_rgba->size();
|
||||||
|
PointCloudOperator::PointCloudCommon::NormalEstimation(cloud_with_rgba, cloud_with_normals);
|
||||||
|
tree2->setInputCloud(cloud_with_normals); // 构建搜索树
|
||||||
|
|
||||||
|
std::shared_ptr<pcl::PolygonMesh> mesh (new pcl::PolygonMesh); // 非智能指针,需要释放
|
||||||
|
|
||||||
|
pcl::GreedyProjectionTriangulation<pcl::PointNormal> gp3; // 定义三角化对象
|
||||||
|
gp3.setSearchRadius(_SearchRadius); // 设置连接点之间的最大距离(即三角形的最大边长)
|
||||||
|
gp3.setMu(_Mu); // 设置被样本点搜索其临近点的最远距离,为了适应点云密度的变化
|
||||||
|
gp3.setMaximumNearestNeighbors(_MaximumNearestNeighbors); // 设置样本点可搜索的邻域个数
|
||||||
|
gp3.setMaximumSurfaceAngle(_MaximumSurfaceAngle); // 设置某点法线方向偏离样本点法线方向的最大角度
|
||||||
|
gp3.setMinimumAngle(_MaximumAngle); // 设置三角化后得到三角形内角的最小角度
|
||||||
|
gp3.setMaximumAngle(_MinimumAngle); // 设置三角化后得到三角形内角的最大角度
|
||||||
|
gp3.setNormalConsistency(false); // 设置该参数保证法线朝向一致
|
||||||
|
gp3.setInputCloud(cloud_with_normals); // 设置输入点云为有向点云
|
||||||
|
gp3.setSearchMethod(tree2); // 设置搜索方式
|
||||||
|
gp3.reconstruct(*mesh); // 重建提取三角化 -- 这里会导致程序崩溃,可能存在内存泄露,
|
||||||
|
|
||||||
|
// DebugInfo("remesh over GP \n");
|
||||||
|
// return false;
|
||||||
|
size_t pointcount = PointCloudOperator::PointCloudCommon::mesh2vtk(*mesh, polydata2);
|
||||||
|
|
||||||
|
vtkSmartPointer<vtkGeometryFilter> geofilter=vtkSmartPointer<vtkGeometryFilter>::New();
|
||||||
|
geofilter->SetInputData(polydata2);
|
||||||
|
geofilter->Update();
|
||||||
|
polydata=geofilter->GetOutput();
|
||||||
|
|
||||||
|
qDebug()<<"cellToPointFilter successfully!! wait for writing file dataset : "<<inpolyData->GetNumberOfPoints()<<" "<<inpolyData->GetNumberOfCells();
|
||||||
|
// if(PointCloudOperator::PointCloudMeshOperator::GP(inpolyData,polydata,_SearchRadius,_Mu,_MaximumNearestNeighbors,_MaximumSurfaceAngle,_MaximumAngle,_MinimumAngle)){
|
||||||
|
//
|
||||||
|
// }else{
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
DebugInfo("PCLGPMeshAlg successfully!! wait for writing file dataset : %d \n",nullptr==polydata);
|
DebugInfo("PCLGPMeshAlg successfully!! wait for writing file dataset : %d \n",nullptr==polydata);
|
||||||
if(nullptr!=polydata){
|
if(nullptr!=polydata){
|
||||||
DebugInfo("PCLGPMeshAlg successfully!! wait for writing file dataset : %d %d\n",polydata->GetNumberOfPoints(),polydata->GetNumberOfCells());
|
DebugInfo("PCLGPMeshAlg successfully!! wait for writing file dataset : %d %d\n",polydata->GetNumberOfPoints(),polydata->GetNumberOfCells());
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
QString filepath = _fileName;
|
QString filepath = _fileName;
|
||||||
QFile outfile_presave(_fileName);
|
QFile outfile_presave(_fileName);
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,9 @@ EchoTableEditWindow::EchoTableEditWindow(QWidget* parent)
|
||||||
connect(ui->actionSave, SIGNAL(triggered()),this, SLOT(on_actionSave_triggered()));
|
connect(ui->actionSave, SIGNAL(triggered()),this, SLOT(on_actionSave_triggered()));
|
||||||
connect(ui->actionSaveAs, SIGNAL(triggered()),this, SLOT(on_actionSaveAs_triggered()));
|
connect(ui->actionSaveAs, SIGNAL(triggered()),this, SLOT(on_actionSaveAs_triggered()));
|
||||||
connect(ui->actionRCSExport ,SIGNAL(triggered()),this,SLOT(on_actionRCSExport()));
|
connect(ui->actionRCSExport ,SIGNAL(triggered()),this,SLOT(on_actionRCSExport()));
|
||||||
|
|
||||||
|
QObject::connect(ui->actiondeleteRows, SIGNAL(triggered()), this, SLOT(tableView_RemoveSelectRows()));
|
||||||
|
QObject::connect(ui->actionundeleteRows, SIGNAL(triggered()), this, SLOT(tableView_unRemoveSelectRows()));
|
||||||
}
|
}
|
||||||
|
|
||||||
EchoTableEditWindow::~EchoTableEditWindow()
|
EchoTableEditWindow::~EchoTableEditWindow()
|
||||||
|
|
@ -66,8 +69,6 @@ int EchoTableEditWindow::initTableViewContextMenu()
|
||||||
this->tableViewContextMenu->addAction(m_undoAction);
|
this->tableViewContextMenu->addAction(m_undoAction);
|
||||||
this->tableViewContextMenu->addAction(m_redoAction);
|
this->tableViewContextMenu->addAction(m_redoAction);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QAction *copyAction= this->tableViewContextMenu->addAction(u8"复制"); // 复制
|
QAction *copyAction= this->tableViewContextMenu->addAction(u8"复制"); // 复制
|
||||||
copyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
|
copyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
|
||||||
QObject::connect(copyAction, SIGNAL(triggered()), this, SLOT(tableView_CopyAction()));
|
QObject::connect(copyAction, SIGNAL(triggered()), this, SLOT(tableView_CopyAction()));
|
||||||
|
|
@ -78,6 +79,7 @@ int EchoTableEditWindow::initTableViewContextMenu()
|
||||||
|
|
||||||
QAction* CheckFieldHasEmptyCeilAction = this->tableViewContextMenu->addAction(u8"检查单元格为空");
|
QAction* CheckFieldHasEmptyCeilAction = this->tableViewContextMenu->addAction(u8"检查单元格为空");
|
||||||
QObject::connect(CheckFieldHasEmptyCeilAction, SIGNAL(triggered()), this, SLOT(tableView_CheckFieldHasEmptyCeilAction()));
|
QObject::connect(CheckFieldHasEmptyCeilAction, SIGNAL(triggered()), this, SLOT(tableView_CheckFieldHasEmptyCeilAction()));
|
||||||
|
|
||||||
//qDebug() << u8"初始化contextMenu结束";
|
//qDebug() << u8"初始化contextMenu结束";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -225,8 +227,6 @@ void EchoTableEditWindow::tableView_CheckFieldHasEmptyCeilAction()
|
||||||
}
|
}
|
||||||
this->ui->tableView->show();
|
this->ui->tableView->show();
|
||||||
this->ui->tableView->scrollTo(cellIndexes[0], QAbstractItemView::EnsureVisible);
|
this->ui->tableView->scrollTo(cellIndexes[0], QAbstractItemView::EnsureVisible);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EchoTableEditWindow::on_actionOpen_triggered()
|
void EchoTableEditWindow::on_actionOpen_triggered()
|
||||||
|
|
@ -244,6 +244,167 @@ void EchoTableEditWindow::on_actionSaveAs_triggered()
|
||||||
this->SaveAsDialog();
|
this->SaveAsDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EchoTableEditWindow::on_actionCalibrationConst_triggered()
|
||||||
|
{
|
||||||
|
// 补充定标软件功能
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int EchoTableEditWindow::LockFileOpen(bool flag)
|
||||||
|
{
|
||||||
|
this->FILEOPENLOCK = flag;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EchoTableEditWindow::setCheckFieldContextHasEmptyCeilLOCK(bool flag)
|
||||||
|
{
|
||||||
|
this->CheckFieldContextHasEmptyCeilLOCK = flag;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EchoTableEditWindow::loadTablemode(std::shared_ptr<AbstractTableModel> mode)
|
||||||
|
{
|
||||||
|
this->model = mode;
|
||||||
|
this->ui->tableView->setModel(this->model.get());
|
||||||
|
if (this->model->rowCount() > 1e4) {
|
||||||
|
this->ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EchoTableEditWindow::setTableViewAutoSort(bool flag)
|
||||||
|
{
|
||||||
|
this->ui->tableView->setSortingEnabled(flag);
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EchoTableEditWindow::initTableViewStatusBarControl()
|
||||||
|
{
|
||||||
|
this->statusprogressBar = new QProgressBar();
|
||||||
|
this->statusprogressBar->setRange(0, 100); // 设置进度条范围
|
||||||
|
this->statusprogressBar->setValue(0); // 设置当前进度
|
||||||
|
this->ui->statusbar->addPermanentWidget(this->statusprogressBar); // 在状态栏中添加进度条
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EchoTableEditWindow::OpenCSVDialog()
|
||||||
|
{
|
||||||
|
if (this->FILEOPENLOCK) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {}
|
||||||
|
QString tableFilepath = getOpenFilePath(
|
||||||
|
this,
|
||||||
|
QString::fromUtf8(u8"打开表格文件"),
|
||||||
|
QString::fromUtf8(u8"csv文件 (*.csv);;xls文件(*.xls)"));
|
||||||
|
|
||||||
|
this->ui->statusbar->showMessage(u8"正在打开文件....");
|
||||||
|
std::shared_ptr< FEKOResultCsvTableModel> tablemode = std::make_shared< FEKOResultCsvTableModel>();
|
||||||
|
tablemode->loadCSVFilePath(tableFilepath);
|
||||||
|
this->loadTablemode(tablemode);
|
||||||
|
this->setTableViewAutoSort(true);
|
||||||
|
this->LockFileOpen();
|
||||||
|
this->ui->statusbar->showMessage(u8"文件打开结束");
|
||||||
|
QFileInfo fileinfo(tableFilepath);
|
||||||
|
this->setWindowTitle(fileinfo.fileName());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int EchoTableEditWindow::SaveCSVDialog()
|
||||||
|
{
|
||||||
|
this->model->saveFilePath();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EchoTableEditWindow::SaveAsDialog()
|
||||||
|
{
|
||||||
|
QString filepath = getSaveFilePath(
|
||||||
|
this,
|
||||||
|
QString::fromUtf8(u8"另存为"),
|
||||||
|
QString::fromUtf8(u8"csv文件 (*.csv)"));//多组扩展名用双分号";;"隔开
|
||||||
|
this->model->saveAsFilePath(filepath);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
void EchoTableEditWindow::on_actionRCSExport() {
|
||||||
|
// 检查是否远场回波
|
||||||
|
bool isfar=false;
|
||||||
|
bool isnear=false;
|
||||||
|
|
||||||
|
//this->model;
|
||||||
|
//判断指针
|
||||||
|
std::shared_ptr<FEKOResultCsvTableModel> echoTableModel(new FEKOResultCsvTableModel);
|
||||||
|
echoTableModel->loadCSVFilePath(this->model->getCSVPath());
|
||||||
|
if(echoTableModel->rowCount()<=0||echoTableModel->colCount()<=0){
|
||||||
|
QMessageBox::warning(this, u8"警告", u8"回波文件结构解析错误,请检查文件");
|
||||||
|
return ;
|
||||||
|
}else{}
|
||||||
|
|
||||||
|
|
||||||
|
if(echoTableModel){
|
||||||
|
QStringList colnames=echoTableModel->getColumnNames();
|
||||||
|
for(size_t i=0;i<colnames.count();i++){
|
||||||
|
if(colnames[i].toLower().contains("file type")||colnames[i]=="File Type"){
|
||||||
|
size_t colidx=echoTableModel->getColumnIdxByColumName(colnames[i]);
|
||||||
|
QString filetypeStr=echoTableModel->itemText(0,colidx);
|
||||||
|
if(filetypeStr.toLower().contains("far field")||filetypeStr.contains("Far Field")||filetypeStr=="Far Field"){
|
||||||
|
isfar=true;
|
||||||
|
}else{}
|
||||||
|
if(filetypeStr.toLower().contains("near field")||filetypeStr=="Electric near field"){
|
||||||
|
isnear= true;
|
||||||
|
}else{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
QMessageBox::warning(this, u8"警告", u8"回波文件结构解析错误,请检查文件");
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
// ---------------------- 远场结果 --------------------------------------------------
|
||||||
|
if(isfar){
|
||||||
|
QString filepath =
|
||||||
|
getSaveFilePath(this, QString::fromUtf8(u8"另存为"),
|
||||||
|
QString::fromUtf8(u8"RCS (*.csv)")); // 多组扩展名用双分号";;"隔开
|
||||||
|
|
||||||
|
// 保存并导出RCS文件
|
||||||
|
FEKOBase::RCSEchoDataComputer rsccomputer;
|
||||||
|
rsccomputer.ComputerFromFile(this->model->getCSVPath());
|
||||||
|
rsccomputer.toCSV(filepath);
|
||||||
|
QMessageBox::information(this, u8"信息",QString(u8"保存至:%1").arg(filepath));
|
||||||
|
|
||||||
|
}else{
|
||||||
|
QMessageBox::warning(this, u8"警告",u8"请使用远场数据作为RCS计算输入");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
void EchoTableEditWindow::tableView_RemoveSelectRows() {
|
||||||
|
// 删除指定行数
|
||||||
|
QItemSelectionModel* selectionModel = this->ui->tableView->selectionModel();
|
||||||
|
QModelIndexList selectedIndexes = selectionModel->selectedIndexes();
|
||||||
|
if (selectedIndexes.count() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QList<int> rows;
|
||||||
|
for (int i = 0; i < selectedIndexes.count(); i++) {
|
||||||
|
this->model->setDeleteFlag(selectedIndexes[i].row(), true);
|
||||||
|
}
|
||||||
|
this->ui->tableView->show();
|
||||||
|
// this->m_undoStack->push(new RemoveRowsCommand(this->ui->tableView, rows));
|
||||||
|
// this->ui->tableView->show();
|
||||||
|
}
|
||||||
|
void EchoTableEditWindow::tableView_unRemoveSelectRows() {
|
||||||
|
// int index = this->m_undoStack->index();
|
||||||
|
// this->m_undoStack->setIndex(index );
|
||||||
|
QItemSelectionModel* selectionModel = this->ui->tableView->selectionModel();
|
||||||
|
QModelIndexList selectedIndexes = selectionModel->selectedIndexes();
|
||||||
|
if (selectedIndexes.count() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QList<int> rows;
|
||||||
|
for (int i = 0; i < selectedIndexes.count(); i++) {
|
||||||
|
this->model->setDeleteFlag(selectedIndexes[i].row(), false);
|
||||||
|
}
|
||||||
|
this->ui->tableView->show();
|
||||||
|
}
|
||||||
|
|
||||||
void EchoTableEditWindow::on_actionEchoSplitExport_triggered()
|
void EchoTableEditWindow::on_actionEchoSplitExport_triggered()
|
||||||
{
|
{
|
||||||
// 在窗口关闭事件中询问用户是否关闭
|
// 在窗口关闭事件中询问用户是否关闭
|
||||||
|
|
@ -378,147 +539,4 @@ void EchoTableEditWindow::on_actionEchoSplitExport_triggered()
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::information(this, u8"信息", u8"文件格式读取错误");
|
QMessageBox::information(this, u8"信息", u8"文件格式读取错误");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void EchoTableEditWindow::on_actionCalibrationConst_triggered()
|
|
||||||
{
|
|
||||||
// 补充定标软件功能
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int EchoTableEditWindow::LockFileOpen(bool flag)
|
|
||||||
{
|
|
||||||
this->FILEOPENLOCK = flag;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int EchoTableEditWindow::setCheckFieldContextHasEmptyCeilLOCK(bool flag)
|
|
||||||
{
|
|
||||||
this->CheckFieldContextHasEmptyCeilLOCK = flag;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int EchoTableEditWindow::loadTablemode(std::shared_ptr<AbstractTableModel> mode)
|
|
||||||
{
|
|
||||||
this->model = mode;
|
|
||||||
this->ui->tableView->setModel(this->model.get());
|
|
||||||
if (this->model->rowCount() > 1e4) {
|
|
||||||
this->ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int EchoTableEditWindow::setTableViewAutoSort(bool flag)
|
|
||||||
{
|
|
||||||
this->ui->tableView->setSortingEnabled(flag);
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
int EchoTableEditWindow::initTableViewStatusBarControl()
|
|
||||||
{
|
|
||||||
this->statusprogressBar = new QProgressBar();
|
|
||||||
this->statusprogressBar->setRange(0, 100); // 设置进度条范围
|
|
||||||
this->statusprogressBar->setValue(0); // 设置当前进度
|
|
||||||
this->ui->statusbar->addPermanentWidget(this->statusprogressBar); // 在状态栏中添加进度条
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int EchoTableEditWindow::OpenCSVDialog()
|
|
||||||
{
|
|
||||||
if (this->FILEOPENLOCK) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else {}
|
|
||||||
QString tableFilepath = getOpenFilePath(
|
|
||||||
this,
|
|
||||||
QString::fromUtf8(u8"打开表格文件"),
|
|
||||||
QString::fromUtf8(u8"csv文件 (*.csv);;xls文件(*.xls)"));
|
|
||||||
|
|
||||||
|
|
||||||
this->ui->statusbar->showMessage(u8"正在打开文件....");
|
|
||||||
std::shared_ptr< FEKOResultCsvTableModel> tablemode = std::make_shared< FEKOResultCsvTableModel>();
|
|
||||||
tablemode->loadCSVFilePath(tableFilepath);
|
|
||||||
this->loadTablemode(tablemode);
|
|
||||||
this->setTableViewAutoSort(true);
|
|
||||||
this->LockFileOpen();
|
|
||||||
this->ui->statusbar->showMessage(u8"文件打开结束");
|
|
||||||
QFileInfo fileinfo(tableFilepath);
|
|
||||||
this->setWindowTitle(fileinfo.fileName());
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int EchoTableEditWindow::SaveCSVDialog()
|
|
||||||
{
|
|
||||||
this->model->saveFilePath();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int EchoTableEditWindow::SaveAsDialog()
|
|
||||||
{
|
|
||||||
QString filepath = getSaveFilePath(
|
|
||||||
this,
|
|
||||||
QString::fromUtf8(u8"另存为"),
|
|
||||||
QString::fromUtf8(u8"csv文件 (*.csv)"));//多组扩展名用双分号";;"隔开
|
|
||||||
this->model->saveAsFilePath(filepath);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
void EchoTableEditWindow::on_actionRCSExport() {
|
|
||||||
// 检查是否远场回波
|
|
||||||
bool isfar=false;
|
|
||||||
bool isnear=false;
|
|
||||||
|
|
||||||
//this->model;
|
|
||||||
//判断指针
|
|
||||||
std::shared_ptr<FEKOResultCsvTableModel> echoTableModel(new FEKOResultCsvTableModel);
|
|
||||||
echoTableModel->loadCSVFilePath(this->model->getCSVPath());
|
|
||||||
if(echoTableModel->rowCount()<=0||echoTableModel->colCount()<=0){
|
|
||||||
QMessageBox::warning(this, u8"警告", u8"回波文件结构解析错误,请检查文件");
|
|
||||||
return ;
|
|
||||||
}else{}
|
|
||||||
|
|
||||||
|
|
||||||
if(echoTableModel){
|
|
||||||
QStringList colnames=echoTableModel->getColumnNames();
|
|
||||||
for(size_t i=0;i<colnames.count();i++){
|
|
||||||
if(colnames[i].toLower().contains("file type")||colnames[i]=="File Type"){
|
|
||||||
size_t colidx=echoTableModel->getColumnIdxByColumName(colnames[i]);
|
|
||||||
QString filetypeStr=echoTableModel->itemText(0,colidx);
|
|
||||||
if(filetypeStr.toLower().contains("far field")||filetypeStr.contains("Far Field")||filetypeStr=="Far Field"){
|
|
||||||
isfar=true;
|
|
||||||
}else{}
|
|
||||||
if(filetypeStr.toLower().contains("near field")||filetypeStr=="Electric near field"){
|
|
||||||
isnear= true;
|
|
||||||
}else{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
QMessageBox::warning(this, u8"警告", u8"回波文件结构解析错误,请检查文件");
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
// ---------------------- 远场结果 --------------------------------------------------
|
|
||||||
if(isfar){
|
|
||||||
QString filepath =
|
|
||||||
getSaveFilePath(this, QString::fromUtf8(u8"另存为"),
|
|
||||||
QString::fromUtf8(u8"RCS (*.csv)")); // 多组扩展名用双分号";;"隔开
|
|
||||||
|
|
||||||
FEKOBase::RCSEchoDataComputer rsccomputer;
|
|
||||||
rsccomputer.ComputerFromFile(this->model->getCSVPath());
|
|
||||||
rsccomputer.toCSV(filepath);
|
|
||||||
QMessageBox::information(this, u8"信息",QString(u8"保存至:%1").arg(filepath));
|
|
||||||
|
|
||||||
}else{
|
|
||||||
QMessageBox::warning(this, u8"警告",u8"请使用远场数据作为RCS计算输入");
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,13 +62,17 @@ private:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void calBackSCatter();
|
// void calBackSCatter();
|
||||||
// tableview 右键菜单
|
// tableview 右键菜单
|
||||||
void ShowTableViewContextMenu(QPoint p);
|
void ShowTableViewContextMenu(QPoint p);
|
||||||
void tableView_CopyAction();
|
void tableView_CopyAction();
|
||||||
void tableView_PasteAction();
|
void tableView_PasteAction();
|
||||||
void tableView_UndoAction();
|
void tableView_UndoAction();
|
||||||
void tableView_RedoAction();
|
void tableView_RedoAction();
|
||||||
|
|
||||||
|
void tableView_RemoveSelectRows();
|
||||||
|
void tableView_unRemoveSelectRows();
|
||||||
|
|
||||||
void tableView_CheckFieldHasEmptyCeilAction();
|
void tableView_CheckFieldHasEmptyCeilAction();
|
||||||
|
|
||||||
void on_actionOpen_triggered();
|
void on_actionOpen_triggered();
|
||||||
|
|
|
||||||
|
|
@ -124,8 +124,16 @@
|
||||||
<addaction name="actionEchoSplitExport"/>
|
<addaction name="actionEchoSplitExport"/>
|
||||||
<addaction name="actionRCSExport"/>
|
<addaction name="actionRCSExport"/>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuTableEdit">
|
||||||
|
<property name="title">
|
||||||
|
<string>表格编辑</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actiondeleteRows"/>
|
||||||
|
<addaction name="actionundeleteRows"/>
|
||||||
|
</widget>
|
||||||
<addaction name="menu"/>
|
<addaction name="menu"/>
|
||||||
<addaction name="menu_4"/>
|
<addaction name="menu_4"/>
|
||||||
|
<addaction name="menuTableEdit"/>
|
||||||
</widget>
|
</widget>
|
||||||
<action name="actionOpen">
|
<action name="actionOpen">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
@ -272,6 +280,16 @@
|
||||||
<string>RCS导出</string>
|
<string>RCS导出</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actiondeleteRows">
|
||||||
|
<property name="text">
|
||||||
|
<string>删除指定行</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionundeleteRows">
|
||||||
|
<property name="text">
|
||||||
|
<string>撤销删除</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
||||||
|
|
@ -2141,7 +2141,6 @@ bool FEKOBase::FBPImage_ISARNEAR(QString& restiffpath, MatrixXcd& echoData, Matr
|
||||||
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
|
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
|
||||||
for(long ii=start_ii;ii<start_ii+block_len &&ii<image_height ;ii++)
|
for(long ii=start_ii;ii<start_ii+block_len &&ii<image_height ;ii++)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
|
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
|
||||||
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
|
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
|
||||||
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
|
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
|
||||||
|
|
|
||||||
|
|
@ -1281,7 +1281,7 @@ Eigen::MatrixXcd gdalImageComplex::getDataComplex(int start_row, int start_col,
|
||||||
void gdalImageComplex::saveImage()
|
void gdalImageComplex::saveImage()
|
||||||
{
|
{
|
||||||
this->saveImage(this->data, this->start_row, this->start_col, this->data_band_ids);
|
this->saveImage(this->data, this->start_row, this->start_col, this->data_band_ids);
|
||||||
this->savePreViewImage();
|
// this->savePreViewImage(); // 存在内存泄露问题,2024-07-29 发现,后续修改
|
||||||
}
|
}
|
||||||
void gdalImageComplex::savePreViewImage()
|
void gdalImageComplex::savePreViewImage()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -357,3 +357,5 @@ void PasteCommand::redo()
|
||||||
}
|
}
|
||||||
this->tableItem->show();
|
this->tableItem->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,24 @@ public:
|
||||||
void redo() override;
|
void redo() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class RemoveRowsCommand : public QUndoCommand { // 删除行命令
|
||||||
|
private:
|
||||||
|
QTableView* tableItem;
|
||||||
|
std::vector<std::vector<QString>> oldText;
|
||||||
|
std::vector<std::vector<QString>> newText;
|
||||||
|
size_t start_row;
|
||||||
|
public:
|
||||||
|
RemoveRowsCommand(QTableView* tableItem, QList<int> rows , QUndoCommand* parent = 0);
|
||||||
|
~RemoveRowsCommand();
|
||||||
|
//撤销
|
||||||
|
void undo() override;
|
||||||
|
//回退
|
||||||
|
void redo() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 表格编辑窗体情况分析
|
* 表格编辑窗体情况分析
|
||||||
|
|
|
||||||
|
|
@ -9,25 +9,19 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "SharedModuleLib/ProcessOn.h"
|
#include "SharedModuleLib/ProcessOn.h"
|
||||||
|
|
||||||
|
AbstractTableModel::AbstractTableModel(QObject* parent)
|
||||||
AbstractTableModel::AbstractTableModel(QObject* parent ):QAbstractTableModel(parent)
|
: QAbstractTableModel(parent)
|
||||||
{}
|
{
|
||||||
|
|
||||||
AbstractTableModel::~AbstractTableModel(){
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AbstractTableModel::~AbstractTableModel() {}
|
||||||
|
|
||||||
FEKOResultCsvTableModel::FEKOResultCsvTableModel(QObject* parent)
|
FEKOResultCsvTableModel::FEKOResultCsvTableModel(QObject* parent)
|
||||||
: AbstractTableModel(parent)
|
: AbstractTableModel(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FEKOResultCsvTableModel::~FEKOResultCsvTableModel()
|
FEKOResultCsvTableModel::~FEKOResultCsvTableModel() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void FEKOResultCsvTableModel::loadFilePath(QString csvPath)
|
void FEKOResultCsvTableModel::loadFilePath(QString csvPath)
|
||||||
{
|
{
|
||||||
|
|
@ -37,9 +31,8 @@ void FEKOResultCsvTableModel::loadFilePath(QString csvPath)
|
||||||
void FEKOResultCsvTableModel::saveFilePath()
|
void FEKOResultCsvTableModel::saveFilePath()
|
||||||
{
|
{
|
||||||
if(!isExists(this->csvPath)) {
|
if(!isExists(this->csvPath)) {
|
||||||
this->csvPath = getSaveFilePath(
|
this->csvPath =
|
||||||
nullptr,
|
getSaveFilePath(nullptr, QString::fromUtf8(u8"另存为"),
|
||||||
QString::fromUtf8(u8"另存为"),
|
|
||||||
|
|
||||||
QString::fromUtf8(u8"csv文件 (*.csv)")); // 多组扩展名用双分号";;"隔开
|
QString::fromUtf8(u8"csv文件 (*.csv)")); // 多组扩展名用双分号";;"隔开
|
||||||
}
|
}
|
||||||
|
|
@ -60,11 +53,9 @@ void FEKOResultCsvTableModel::loadCSVFilePath(QString csvPath)
|
||||||
QStringList rowIDlist;
|
QStringList rowIDlist;
|
||||||
bool hascolnames = true;
|
bool hascolnames = true;
|
||||||
size_t rowid = 0;
|
size_t rowid = 0;
|
||||||
if (inFile.open(QIODevice::ReadOnly))
|
if(inFile.open(QIODevice::ReadOnly)) {
|
||||||
{
|
|
||||||
QTextStream stream_text(&inFile);
|
QTextStream stream_text(&inFile);
|
||||||
while (!stream_text.atEnd())
|
while(!stream_text.atEnd()) {
|
||||||
{
|
|
||||||
QString line = stream_text.readLine();
|
QString line = stream_text.readLine();
|
||||||
QStringList linesplit = line.split(QRegularExpression(",(?!\\s)")); // 字段切分
|
QStringList linesplit = line.split(QRegularExpression(",(?!\\s)")); // 字段切分
|
||||||
if(hascolnames) { // 列名
|
if(hascolnames) { // 列名
|
||||||
|
|
@ -74,8 +65,7 @@ void FEKOResultCsvTableModel::loadCSVFilePath(QString csvPath)
|
||||||
colnames.append(linesplit.at(col)); // 追加字段名称
|
colnames.append(linesplit.at(col)); // 追加字段名称
|
||||||
}
|
}
|
||||||
hascolnames = false;
|
hascolnames = false;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
QVector<QVariant> mapline(colnames.count()); // 单行数据
|
QVector<QVariant> mapline(colnames.count()); // 单行数据
|
||||||
mapline[0] = linesplit.at(0);
|
mapline[0] = linesplit.at(0);
|
||||||
for(int col = 1; col < colnames.size(); col++) {
|
for(int col = 1; col < colnames.size(); col++) {
|
||||||
|
|
@ -88,8 +78,13 @@ void FEKOResultCsvTableModel::loadCSVFilePath(QString csvPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inFile.close();
|
inFile.close();
|
||||||
|
} else {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(0)
|
||||||
|
{
|
||||||
|
int iii=0;
|
||||||
|
// 废弃代码
|
||||||
// this->SetData(datamap, colnames, rowIDlist);
|
// this->SetData(datamap, colnames, rowIDlist);
|
||||||
// QStringList tempColNames;
|
// QStringList tempColNames;
|
||||||
// for(int i=0;i<colnames.size();i++){
|
// for(int i=0;i<colnames.size();i++){
|
||||||
|
|
@ -110,18 +105,17 @@ void FEKOResultCsvTableModel::loadCSVFilePath(QString csvPath)
|
||||||
// double re = 0;
|
// double re = 0;
|
||||||
// double im = 0;
|
// double im = 0;
|
||||||
// for(int col = 1; col < mapline.size(); col++) {
|
// for(int col = 1; col < mapline.size(); col++) {
|
||||||
// if(colnames[col].contains("Re") && colnames[col].contains(tempColNames[ii])){
|
// if(colnames[col].contains("Re") &&
|
||||||
// re=mapline[col].toDouble();
|
// colnames[col].contains(tempColNames[ii])){ re=mapline[col].toDouble(); }else{} if(colnames[col].contains("Im") && colnames[col].contains(tempColNames[ii])){ im=mapline[col].toDouble(); }else{}
|
||||||
// }else{}
|
|
||||||
// if(colnames[col].contains("Im") && colnames[col].contains(tempColNames[ii])){
|
|
||||||
// im=mapline[col].toDouble();
|
|
||||||
// }else{}
|
|
||||||
// }
|
// }
|
||||||
// double RCS=(re*re+im*im)*4*M_PI;
|
// double RCS=(re*re+im*im)*4*M_PI;
|
||||||
// mapline.append(QString::number(RCS));
|
// mapline.append(QString::number(RCS));
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this->SetData(datamap, colnames, rowIDlist);
|
this->SetData(datamap, colnames, rowIDlist);
|
||||||
QStringList tempColNames;
|
QStringList tempColNames;
|
||||||
for(int i = 0; i < colnames.size(); i++) {
|
for(int i = 0; i < colnames.size(); i++) {
|
||||||
|
|
@ -134,7 +128,6 @@ void FEKOResultCsvTableModel::loadCSVFilePath(QString csvPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// for(int ii=0;ii<tempColNames.size();ii++) {
|
// for(int ii=0;ii<tempColNames.size();ii++) {
|
||||||
// colnames.append(tempColNames[ii]);
|
// colnames.append(tempColNames[ii]);
|
||||||
// for(size_t i = 0; i < datamap.size(); i++) {
|
// for(size_t i = 0; i < datamap.size(); i++) {
|
||||||
|
|
@ -159,8 +152,7 @@ void FEKOResultCsvTableModel::saveCSVFilePath(QString csvpath)
|
||||||
{
|
{
|
||||||
qDebug() << u8"正在保存为 csv文件中";
|
qDebug() << u8"正在保存为 csv文件中";
|
||||||
QFile file(csvpath);
|
QFile file(csvpath);
|
||||||
if (file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
if(file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) {
|
||||||
{
|
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
// 写入表头
|
// 写入表头
|
||||||
for(const QString& header : this->m_hor_hedlbls) // 写入表头
|
for(const QString& header : this->m_hor_hedlbls) // 写入表头
|
||||||
|
|
@ -172,6 +164,8 @@ void FEKOResultCsvTableModel::saveCSVFilePath(QString csvpath)
|
||||||
stream << "\n";
|
stream << "\n";
|
||||||
// 写入数据
|
// 写入数据
|
||||||
for(int i = 0; i < this->m_vec_hedlbls.count(); i++) {
|
for(int i = 0; i < this->m_vec_hedlbls.count(); i++) {
|
||||||
|
if(this->isdeletes[i]) {
|
||||||
|
} else { // 非删除目标
|
||||||
for(int j = 0; j < this->m_hor_hedlbls.count() - 1; j++) {
|
for(int j = 0; j < this->m_hor_hedlbls.count() - 1; j++) {
|
||||||
stream << this->m_data_map[i][j].toString();
|
stream << this->m_data_map[i][j].toString();
|
||||||
stream << ",";
|
stream << ",";
|
||||||
|
|
@ -179,6 +173,7 @@ void FEKOResultCsvTableModel::saveCSVFilePath(QString csvpath)
|
||||||
stream << this->m_data_map[i][this->m_hor_hedlbls.count() - 1].toString();
|
stream << this->m_data_map[i][this->m_hor_hedlbls.count() - 1].toString();
|
||||||
stream << "\n";
|
stream << "\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
qDebug() << csvpath;
|
qDebug() << csvpath;
|
||||||
|
|
@ -198,12 +193,13 @@ QStringList FEKOResultCsvTableModel::getItemDataByColumn(int colidx)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FEKOResultCsvTableModel::getCSVPath() {
|
QString FEKOResultCsvTableModel::getCSVPath()
|
||||||
|
{
|
||||||
return this->csvPath;
|
return this->csvPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int FEKOResultCsvTableModel::getColumnIdxByColumName(QString ColumnName)
|
||||||
int FEKOResultCsvTableModel::getColumnIdxByColumName(QString ColumnName) {
|
{
|
||||||
for(int i = 0; i < this->colCount(); i++) {
|
for(int i = 0; i < this->colCount(); i++) {
|
||||||
if(ColumnName == this->m_hor_hedlbls[i]) {
|
if(ColumnName == this->m_hor_hedlbls[i]) {
|
||||||
return i;
|
return i;
|
||||||
|
|
@ -212,19 +208,27 @@ int FEKOResultCsvTableModel::getColumnIdxByColumName(QString ColumnName) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FEKOResultCsvTableModel::SetData(const QVector<QVector<QVariant>>& map, QStringList& colnames,
|
||||||
void FEKOResultCsvTableModel::SetData(const QVector<QVector<QVariant>>& map,QStringList &colnames, QStringList& rowIds)
|
QStringList& rowIds)
|
||||||
{
|
{
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
m_hor_hedlbls = colnames; // 列名
|
m_hor_hedlbls = colnames; // 列名
|
||||||
m_data_map = map;
|
m_data_map = map;
|
||||||
m_vec_hedlbls = rowIds; // 行名
|
m_vec_hedlbls = rowIds; // 行名
|
||||||
this->colorData = QVector<QVector<QColor>>(m_vec_hedlbls.count(), QVector<QColor>(m_hor_hedlbls.count()));
|
this->colorData =
|
||||||
|
QVector<QVector<QColor>>(m_vec_hedlbls.count(), QVector<QColor>(m_hor_hedlbls.count()));
|
||||||
|
// 增加标记
|
||||||
|
this->isdeletes = QVector<bool>(m_vec_hedlbls.count(), false);
|
||||||
|
for(int j = 0; j < m_vec_hedlbls.count(); j++) {
|
||||||
|
this->isdeletes[j] = false;
|
||||||
|
}
|
||||||
|
|
||||||
for(int i = 0; i < m_hor_hedlbls.count(); i++) {
|
for(int i = 0; i < m_hor_hedlbls.count(); i++) {
|
||||||
for(int j = 0; j < m_vec_hedlbls.count(); j++) {
|
for(int j = 0; j < m_vec_hedlbls.count(); j++) {
|
||||||
this->colorData[j][i] = QColor(255, 255, 255);
|
this->colorData[j][i] = QColor(255, 255, 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -244,18 +248,15 @@ Qt::ItemFlags FEKOResultCsvTableModel::flags(const QModelIndex& index) const
|
||||||
|
|
||||||
QVariant FEKOResultCsvTableModel::data(const QModelIndex& _index, int role) const
|
QVariant FEKOResultCsvTableModel::data(const QModelIndex& _index, int role) const
|
||||||
{
|
{
|
||||||
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
if(role == Qt::DisplayRole || role == Qt::EditRole) {
|
||||||
{
|
|
||||||
return this->m_data_map[_index.row()][_index.column()];
|
return this->m_data_map[_index.row()][_index.column()];
|
||||||
}
|
} else if(role == Qt::TextAlignmentRole)
|
||||||
else if (role == Qt::TextAlignmentRole) return Qt::AlignCenter; // 文字居中
|
return Qt::AlignCenter; // 文字居中
|
||||||
else if(role == Qt::BackgroundColorRole) // 设置背景色
|
else if(role == Qt::BackgroundColorRole) // 设置背景色
|
||||||
{
|
{
|
||||||
if (m_highlight_indexs.contains(qMakePair<int, int>(_index.row(), _index.column())))
|
if(m_highlight_indexs.contains(qMakePair<int, int>(_index.row(), _index.column()))) {
|
||||||
{
|
|
||||||
return QColor(230, 247, 255);
|
return QColor(230, 247, 255);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return this->colorData[_index.row()][_index.column()];
|
return this->colorData[_index.row()][_index.column()];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -268,12 +269,14 @@ QVariant FEKOResultCsvTableModel::data(const QModelIndex& _index, int role) cons
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant FEKOResultCsvTableModel::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant FEKOResultCsvTableModel::headerData(int section, Qt::Orientation orientation,
|
||||||
|
int role) const
|
||||||
{
|
{
|
||||||
if (orientation == Qt::Horizontal)
|
if(orientation == Qt::Horizontal) {
|
||||||
{
|
if(role == Qt::DisplayRole)
|
||||||
if (role == Qt::DisplayRole) return m_hor_hedlbls.at(section);
|
return m_hor_hedlbls.at(section);
|
||||||
else return QVariant();
|
else
|
||||||
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
return QAbstractTableModel::headerData(section, orientation, role); // 垂直表头的序号
|
return QAbstractTableModel::headerData(section, orientation, role); // 垂直表头的序号
|
||||||
|
|
@ -281,19 +284,17 @@ QVariant FEKOResultCsvTableModel::headerData(int section, Qt::Orientation orient
|
||||||
|
|
||||||
bool FEKOResultCsvTableModel::setData(const QModelIndex& _index, const QVariant& value, int role)
|
bool FEKOResultCsvTableModel::setData(const QModelIndex& _index, const QVariant& value, int role)
|
||||||
{
|
{
|
||||||
if (_index.isValid() && role == Qt::EditRole)
|
if(_index.isValid() && role == Qt::EditRole) {
|
||||||
{
|
|
||||||
this->isNeedExtendTable(_index.row(), _index.column());
|
this->isNeedExtendTable(_index.row(), _index.column());
|
||||||
if(this->m_data_map[_index.row()][_index.column()] == value) {
|
if(this->m_data_map[_index.row()][_index.column()] == value) {
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
}
|
}
|
||||||
else {}
|
|
||||||
this->m_data_map[_index.row()][_index.column()] = value;
|
this->m_data_map[_index.row()][_index.column()] = value;
|
||||||
emit dataChanged(_index, _index);
|
emit dataChanged(_index, _index);
|
||||||
emit itemChanged(_index, value);
|
emit itemChanged(_index, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
} else if(role == Qt::BackgroundColorRole) {
|
||||||
else if (role == Qt::BackgroundColorRole) {
|
|
||||||
this->colorData[_index.row()][_index.column()] = value.value<QColor>();
|
this->colorData[_index.row()][_index.column()] = value.value<QColor>();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -333,19 +334,27 @@ void FEKOResultCsvTableModel::setItemText(int row, int column, const QString& st
|
||||||
|
|
||||||
QVariant FEKOResultCsvTableModel::ItemData(const QModelIndex& index) const
|
QVariant FEKOResultCsvTableModel::ItemData(const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
|
if(index.row() >= this->m_data_map.count()
|
||||||
|
|| index.column() >= this->m_data_map[index.row()].count()) {
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
return this->m_data_map[index.row()][index.column()];
|
return this->m_data_map[index.row()][index.column()];
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant FEKOResultCsvTableModel::ItemData(int row, int column) const
|
QVariant FEKOResultCsvTableModel::ItemData(int row, int column) const
|
||||||
{
|
{
|
||||||
|
if(row >= this->m_data_map.count() || column >= this->m_data_map[row].count()) {
|
||||||
return this->m_data_map[row][column];
|
return this->m_data_map[row][column];
|
||||||
|
} else {
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FEKOResultCsvTableModel::SetItemData(const QModelIndex& index, const QVariant& data)
|
void FEKOResultCsvTableModel::SetItemData(const QModelIndex& index, const QVariant& data)
|
||||||
{
|
{
|
||||||
this->isNeedExtendTable(index.row(), index.column());
|
this->isNeedExtendTable(index.row(), index.column());
|
||||||
this->m_data_map[index.row()][index.column()] = data;
|
this->m_data_map[index.row()][index.column()] = data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FEKOResultCsvTableModel::SetItemData(int row, int column, const QVariant& data)
|
void FEKOResultCsvTableModel::SetItemData(int row, int column, const QVariant& data)
|
||||||
|
|
@ -359,14 +368,16 @@ size_t FEKOResultCsvTableModel::rowCount()
|
||||||
return this->m_data_map.count();
|
return this->m_data_map.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t FEKOResultCsvTableModel::colCount()
|
size_t FEKOResultCsvTableModel::colCount()
|
||||||
{
|
{
|
||||||
return this->m_vec_hedlbls.count();
|
return this->m_vec_hedlbls.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FEKOResultCsvTableModel::isNeedExtendTable(size_t row, size_t column) {
|
void FEKOResultCsvTableModel::isNeedExtendTable(size_t row, size_t column)
|
||||||
size_t max_colnum = this->m_hor_hedlbls.count() - 1 < column ? column + 1 : this->m_hor_hedlbls.count(); // 判断是否扩展列名
|
{
|
||||||
|
size_t max_colnum = this->m_hor_hedlbls.count() - 1 < column
|
||||||
|
? column + 1
|
||||||
|
: this->m_hor_hedlbls.count(); // 判断是否扩展列名
|
||||||
if(this->m_hor_hedlbls.count() <= column) {
|
if(this->m_hor_hedlbls.count() <= column) {
|
||||||
for(int i = this->m_hor_hedlbls.count(); i <= column; i++) {
|
for(int i = this->m_hor_hedlbls.count(); i <= column; i++) {
|
||||||
this->m_hor_hedlbls.append(QString::number(i));
|
this->m_hor_hedlbls.append(QString::number(i));
|
||||||
|
|
@ -374,24 +385,20 @@ void FEKOResultCsvTableModel::isNeedExtendTable(size_t row, size_t column) {
|
||||||
}
|
}
|
||||||
if(0 > row || column < 0) {
|
if(0 > row || column < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
} else if(row > this->m_vec_hedlbls.count() - 1 || column > this->m_hor_hedlbls.count() - 1) {
|
||||||
else if (row > this->m_vec_hedlbls.count()-1 || column > this->m_hor_hedlbls.count()-1) {
|
|
||||||
for(int i = 0; i <= row; i++) {
|
for(int i = 0; i <= row; i++) {
|
||||||
if(i >= this->m_data_map.count()) {
|
if(i >= this->m_data_map.count()) {
|
||||||
this->m_data_map.append(QVector<QVariant>(max_colnum));
|
this->m_data_map.append(QVector<QVariant>(max_colnum));
|
||||||
this->colorData.append(QVector<QColor>(max_colnum));
|
this->colorData.append(QVector<QColor>(max_colnum));
|
||||||
this->m_vec_hedlbls.append(QString::number(i));
|
this->m_vec_hedlbls.append(QString::number(i));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if(this->m_data_map[i].count() < column + 1) { // 扩充
|
if(this->m_data_map[i].count() < column + 1) { // 扩充
|
||||||
this->m_data_map[i].reserve(max_colnum);
|
this->m_data_map[i].reserve(max_colnum);
|
||||||
// this->colorData[i].reserve(max_colnum);
|
// this->colorData[i].reserve(max_colnum);
|
||||||
for(size_t ci = this->colorData[i].count(); ci < max_colnum; ci++) {
|
for(size_t ci = this->colorData[i].count(); ci < max_colnum; ci++) {
|
||||||
this->colorData[i].append(QColor(255, 255, 255));
|
this->colorData[i].append(QColor(255, 255, 255));
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -414,21 +421,36 @@ QVariant* FEKOResultCsvTableModel::getVariantPtr(size_t row, size_t col)
|
||||||
return &(this->m_data_map[row][col]);
|
return &(this->m_data_map[row][col]);
|
||||||
// return nullptr;
|
// return nullptr;
|
||||||
}
|
}
|
||||||
|
void FEKOResultCsvTableModel::setDeleteFlag(int row, bool flag)
|
||||||
void AbstractTableModel::loadFilePath(QString csvPath)
|
|
||||||
{
|
{
|
||||||
|
this->isdeletes[row] = flag;
|
||||||
|
if(flag) {
|
||||||
|
for(int i = 0; i < this->m_hor_hedlbls.size(); i++) {
|
||||||
|
this->colorData[row][i] = QColor(255, 0, 0); // 删除标记
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for(int i = 0; i < this->m_hor_hedlbls.size(); i++) {
|
||||||
|
this->colorData[row][i] = QColor(255, 255, 255); // 非删除标记
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool FEKOResultCsvTableModel::getDeleteFlag(int row)
|
||||||
|
{
|
||||||
|
return this->isdeletes[row];
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractTableModel::saveFilePath()
|
void AbstractTableModel::loadFilePath(QString csvPath) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
void AbstractTableModel::saveFilePath() {}
|
||||||
|
|
||||||
void AbstractTableModel::saveAsFilePath(QString csvpath)
|
void AbstractTableModel::saveAsFilePath(QString csvpath) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QString AbstractTableModel::getCSVPath()
|
QString AbstractTableModel::getCSVPath()
|
||||||
{
|
{
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
void AbstractTableModel::setDeleteFlag(int row, bool flag) {}
|
||||||
|
bool AbstractTableModel::getDeleteFlag(int row)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ public:
|
||||||
virtual void saveFilePath();
|
virtual void saveFilePath();
|
||||||
virtual void saveAsFilePath(QString csvpath);
|
virtual void saveAsFilePath(QString csvpath);
|
||||||
virtual QString getCSVPath();
|
virtual QString getCSVPath();
|
||||||
|
virtual void setDeleteFlag(int row, bool flag);
|
||||||
|
virtual bool getDeleteFlag(int row);
|
||||||
};
|
};
|
||||||
|
|
||||||
// FKEOResult.csv 表格对应类 2023.07.25 重写类
|
// FKEOResult.csv 表格对应类 2023.07.25 重写类
|
||||||
|
|
@ -33,6 +35,7 @@ private:
|
||||||
QVector<QPair<int, int>> m_highlight_indexs; // 背景高亮的indexs
|
QVector<QPair<int, int>> m_highlight_indexs; // 背景高亮的indexs
|
||||||
QVector<QVector<QColor>> colorData;
|
QVector<QVector<QColor>> colorData;
|
||||||
QString csvPath;
|
QString csvPath;
|
||||||
|
QVector<bool> isdeletes;// 用于标记是否删除
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FEKOResultCsvTableModel(QObject* parent = nullptr);
|
explicit FEKOResultCsvTableModel(QObject* parent = nullptr);
|
||||||
|
|
@ -83,6 +86,9 @@ public:
|
||||||
|
|
||||||
QVariant* getVariantPtr(size_t row, size_t col);
|
QVariant* getVariantPtr(size_t row, size_t col);
|
||||||
|
|
||||||
|
virtual void setDeleteFlag(int row, bool flag);
|
||||||
|
virtual bool getDeleteFlag(int row);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void itemChanged(const QModelIndex& index, const QVariant& value);
|
void itemChanged(const QModelIndex& index, const QVariant& value);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#include "PointCloudMesh.h"
|
#include "PointCloudMesh.h"
|
||||||
#include "PointCloudCommon.h"
|
#include "PointCloudCommon.h"
|
||||||
#include "Common/DebugLogger.h"
|
#include "Common/DebugLogger.h"
|
||||||
|
#include <QDebug>
|
||||||
namespace PointCloudOperator {
|
namespace PointCloudOperator {
|
||||||
PointCloudMeshOperator::PointCloudMeshOperator(QObject* parent)
|
PointCloudMeshOperator::PointCloudMeshOperator(QObject* parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
|
@ -35,6 +35,7 @@ namespace PointCloudOperator {
|
||||||
pcl::search::KdTree<pcl::PointNormal>::Ptr tree2(new pcl::search::KdTree<pcl::PointNormal>);
|
pcl::search::KdTree<pcl::PointNormal>::Ptr tree2(new pcl::search::KdTree<pcl::PointNormal>);
|
||||||
|
|
||||||
pcl::io::vtkPolyDataToPointCloud(inpolygon, *cloud_with_rgba);
|
pcl::io::vtkPolyDataToPointCloud(inpolygon, *cloud_with_rgba);
|
||||||
|
qDebug()<<"cloud_with_rgba "<<cloud_with_rgba->size();
|
||||||
PointCloudOperator::PointCloudCommon::NormalEstimation(cloud_with_rgba, cloud_with_normals);
|
PointCloudOperator::PointCloudCommon::NormalEstimation(cloud_with_rgba, cloud_with_normals);
|
||||||
tree2->setInputCloud(cloud_with_normals); // 构建搜索树
|
tree2->setInputCloud(cloud_with_normals); // 构建搜索树
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="colorTab">
|
<widget class="QWidget" name="colorTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|
@ -459,6 +459,45 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="tab_3">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>模型选择参数</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_2">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_8">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="checkBox_NearPointGap">
|
||||||
|
<property name="text">
|
||||||
|
<string>最近点捕捉</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue