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