| 105 | //------------------------------------------------------------------------------ |
| 106 | template <typename GridType> |
| 107 | void ApplyTranslation(GridType* grid, double Translation[3]) |
| 108 | { |
| 109 | vtkDoubleArray* xCoordinate = vtkDoubleArray::SafeDownCast(grid->GetXCoordinates()); |
| 110 | for (vtkIdType i = 0; i < xCoordinate->GetNumberOfTuples(); ++i) |
| 111 | { |
| 112 | xCoordinate->SetTuple1(i, xCoordinate->GetTuple1(i) + Translation[0]); |
| 113 | } |
| 114 | vtkDoubleArray* yCoordinate = vtkDoubleArray::SafeDownCast(grid->GetYCoordinates()); |
| 115 | for (vtkIdType i = 0; i < yCoordinate->GetNumberOfTuples(); ++i) |
| 116 | { |
| 117 | yCoordinate->SetTuple1(i, yCoordinate->GetTuple1(i) + Translation[1]); |
| 118 | } |
| 119 | vtkDoubleArray* zCoordinate = vtkDoubleArray::SafeDownCast(grid->GetZCoordinates()); |
| 120 | for (vtkIdType i = 0; i < zCoordinate->GetNumberOfTuples(); ++i) |
| 121 | { |
| 122 | zCoordinate->SetTuple1(i, zCoordinate->GetTuple1(i) + Translation[2]); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | //------------------------------------------------------------------------------ |
| 127 | template <typename GridType> |
no test coverage detected