MCPcopy Create free account
hub / github.com/Kitware/ParaView / BuildVTKGrid

Function BuildVTKGrid

Examples/Catalyst/CxxParticlePathExample/FEAdaptor.cxx:25–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23vtkCPProcessor* Processor = nullptr;
24
25void 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
48void UpdateVTKAttributes(
49 Grid& grid, Attributes& attributes, vtkUnstructuredGrid* vtkgrid, vtkCPInputDataDescription* idd)

Callers 1

BuildVTKDataStructuresFunction · 0.70

Calls 9

SetPointsMethod · 0.80
InsertNextCellMethod · 0.80
SetNumberOfComponentsMethod · 0.45
GetPointsArrayMethod · 0.45
GetNumberOfPointsMethod · 0.45
SetDataMethod · 0.45
GetNumberOfCellsMethod · 0.45
AllocateMethod · 0.45
GetCellPointsMethod · 0.45

Tested by

no test coverage detected