Hi,
I’m trying to visualize a scalar field on an unstructured grid. I already managed to build and visualize an vtkUnstructuredGrid where Points and Cells where defined. Now I want to “plot” a scalar field on that grid…
For this, I think the easiest way is to do the following:
myVtkUnstructuredGrid.GetPointData().SetScalars(myScalarData);
The problem is ‘myScalarData’ needs to be an vtkDataArray. However I cannot create a new instance of this object. I tried the following, and they all give errors:
vtkDataArray myScalarData = new vtkDataArray();
vtkDataArray myScalarData = vtkDataArray.New();
vtkDataArray myScalarData = (vtkDataArray)vtkObject.New();
What am I doing wrong?