From 12808861e0f6a2b6673a71bf9a0391d35e3bb58f Mon Sep 17 00:00:00 2001 From: Oliver Gloth Date: Fri, 19 Apr 2024 09:14:13 +0200 Subject: [PATCH] updated to modern VTK --- src/libengrid/correctsurfaceorientation.cpp | 7 ++++--- src/libengrid/guimainwindow.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/libengrid/correctsurfaceorientation.cpp b/src/libengrid/correctsurfaceorientation.cpp index 71e4c095..e595b815 100644 --- a/src/libengrid/correctsurfaceorientation.cpp +++ b/src/libengrid/correctsurfaceorientation.cpp @@ -50,9 +50,10 @@ void CorrectSurfaceOrientation::pass1() } } if (!ok) { - QVector nodes(num_pts2); - for (vtkIdType j = 0; j < num_pts2; ++j) nodes[j] = pts2->GetId(j); - for (vtkIdType j = 0; j < num_pts2; ++j) pts2->SetId(num_pts2 - j - 1, nodes[j]); + m_Grid->GetCells()->ReverseCellAtId(pair[i].item2); + // QVector nodes(num_pts2); + // for (vtkIdType j = 0; j < num_pts2; ++j) nodes[j] = pts2->GetId(j); + // for (vtkIdType j = 0; j < num_pts2; ++j) pts2->SetId(num_pts2 - j - 1, nodes[j]); } } } diff --git a/src/libengrid/guimainwindow.cpp b/src/libengrid/guimainwindow.cpp index 9553f66c..fe2240f5 100755 --- a/src/libengrid/guimainwindow.cpp +++ b/src/libengrid/guimainwindow.cpp @@ -1640,10 +1640,11 @@ vtkIdType GuiMainWindow::getPickedPoint() void GuiMainWindow::changeSurfaceOrientation() { for (vtkIdType cellId = 0; cellId < m_Grid->GetNumberOfCells(); ++cellId) { - EG_GET_CELL(cellId, m_Grid); - QVector nodes(num_pts); - for (vtkIdType j = 0; j < num_pts; ++j) nodes[j] = pts[j]; - for (vtkIdType j = 0; j < num_pts; ++j) pts[num_pts - j - 1] = nodes[j]; + m_Grid->GetCells()->ReverseCellAtId(cellId); + // EG_GET_CELL(cellId, m_Grid); + // QVector nodes(num_pts); + // for (vtkIdType j = 0; j < num_pts; ++j) nodes[j] = pts[j]; + // for (vtkIdType j = 0; j < num_pts; ++j) pts[num_pts - j - 1] = nodes[j]; } updateActors(); m_Grid->Modified();// to make sure VTK notices the changes and changes the cell colors -- 2.11.4.GIT