refactoring

This commit is contained in:
Giovanni Fattori
2026-01-06 00:37:57 +01:00
parent bd6568d8dd
commit c3a2812afd
3 changed files with 17 additions and 3 deletions
+4 -1
View File
@@ -6,6 +6,8 @@
#include <vtkImageData.h>
#include <vtkMarchingCubes.h>
#include <vtkNew.h>
#include <vtkPointData.h>
#include <vtkPointDataToCellData.h>
#include <vtkPoints.h>
#include <vtkPolyData.h>
#include <vtkPolyDataConnectivityFilter.h>
@@ -30,7 +32,7 @@ struct Surf
Point3d centroid;
};
static Point3d centroidFromPoints(const vtkPoints* pts)
static Point3d centroidFromPoints(vtkPoints* pts)
{
Point3d c;
if (!pts) return c;
@@ -41,6 +43,7 @@ static Point3d centroidFromPoints(const vtkPoints* pts)
double p[3];
for (vtkIdType i = 0; i < n; ++i)
{
// vtkPoints::GetPoint is non-const in VTK 9.x, so keep pts non-const here.
pts->GetPoint(i, p);
sx += p[0];
sy += p[1];
+10
View File
@@ -34,6 +34,16 @@
#include <vtkSmartVolumeMapper.h>
// Types used as members / inlined code below
#include <vtkCamera.h>
#include <vtkColorTransferFunction.h>
#include <vtkFieldData.h>
#include <vtkPiecewiseFunction.h>
#include <vtkPointData.h>
#include <vtkStringArray.h>
#include <vtkTextProperty.h>
#include <vtkVolumeProperty.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
+3 -2
View File
@@ -1091,6 +1091,7 @@ void MainWindow::onLocalizationError(const QString& message)
{
qWarning() << "Localization error:" << message;
// Re-enable UI bits if needed
Ui->pb_localize->setEnabled(true);
Ui->pb_localize_abort->setEnabled(false);
// UI uses generic button names from the legacy .ui
Ui->pushButton_3->setEnabled(true); // "Localize" / start
Ui->pushButton_4->setEnabled(false); // abort
}