| 23 | vtkUnstructuredGrid* VTKGrid; |
| 24 | |
| 25 | void BuildVTKGrid(unsigned int numberOfPoints, double* pointsData, unsigned int numberOfCells, |
| 26 | unsigned int* cellsData) |
| 27 | { |
| 28 | // create the points information |
| 29 | vtkNew<vtkDoubleArray> pointArray; |
| 30 | pointArray->SetNumberOfComponents(3); |
| 31 | pointArray->SetArray(pointsData, static_cast<vtkIdType>(numberOfPoints * 3), 1); |
| 32 | vtkNew<vtkPoints> points; |
| 33 | points->SetData(pointArray); |
| 34 | VTKGrid->SetPoints(points); |
| 35 | |
| 36 | // create the cells |
| 37 | VTKGrid->Allocate(static_cast<vtkIdType>(numberOfCells * 9)); |
| 38 | for (unsigned int cell = 0; cell < numberOfCells; cell++) |
| 39 | { |
| 40 | unsigned int* cellPoints = cellsData + 8 * cell; |
| 41 | vtkIdType tmp[8] = { cellPoints[0], cellPoints[1], cellPoints[2], cellPoints[3], cellPoints[4], |
| 42 | cellPoints[5], cellPoints[6], cellPoints[7] }; |
| 43 | VTKGrid->InsertNextCell(VTK_HEXAHEDRON, 8, tmp); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | void UpdateVTKAttributes(vtkCPInputDataDescription* idd, unsigned int numberOfPoints, |
| 48 | double* velocityData, unsigned int numberOfCells, float* pressureData) |
no test coverage detected