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