| 24 | vtkUnstructuredGrid* VTKGrid; |
| 25 | |
| 26 | void BuildVTKGrid(Grid& grid) |
| 27 | { |
| 28 | // create the points information |
| 29 | vtkNew<vtkAOSDataArrayTemplate<double>> pointArray; |
| 30 | pointArray->SetNumberOfComponents(3); |
| 31 | pointArray->SetArray( |
| 32 | grid.GetPointsArray(), 3 * static_cast<vtkIdType>(grid.GetNumberOfPoints()), /*save=*/1); |
| 33 | vtkNew<vtkPoints> points; |
| 34 | points->SetData(pointArray); |
| 35 | VTKGrid->SetPoints(points); |
| 36 | |
| 37 | // create the cells |
| 38 | size_t numCells = grid.GetNumberOfCells(); |
| 39 | VTKGrid->Allocate(static_cast<vtkIdType>(numCells * 9)); |
| 40 | for (size_t cell = 0; cell < numCells; cell++) |
| 41 | { |
| 42 | unsigned int* cellPoints = grid.GetCellPoints(cell); |
| 43 | vtkIdType tmp[8] = { cellPoints[0], cellPoints[1], cellPoints[2], cellPoints[3], cellPoints[4], |
| 44 | cellPoints[5], cellPoints[6], cellPoints[7] }; |
| 45 | VTKGrid->InsertNextCell(VTK_HEXAHEDRON, 8, tmp); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | void UpdateVTKAttributes(Grid& grid, Attributes& attributes, vtkCPInputDataDescription* idd) |
| 50 | { |
no test coverage detected