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];