Hi, some member functions take pointers as arguments like vtkPointSet's method SetPoints :
virtual void SetPoints (vtkPoints *)
However, C# doesn't do pointers so the following code errors,
vtkPoints p = new vtkPoints(); vtkPointSet pts = new vtkPointSet(); pts.SetPoints(p);
Could not downcast pointer to native class.
Help?
You need to insert points to vtkPoints before you call SetPoints()
Working example:
vtkPoints points = new vtkPoints(); for (int z = 0; z < vecs.Length; z++) { points.InsertPoint(z, vecs[z].ToDouble()); }
vtkPolyData pd = new vtkPolyData(); pd.SetPoints(points); pd.SetPolys(cells);
vecs - array of Vectors(My class)
Log in to post a comment.
Hi, some member functions take pointers as arguments like vtkPointSet's method SetPoints :
virtual void SetPoints (vtkPoints *)
However, C# doesn't do pointers so the following code errors,
vtkPoints p = new vtkPoints();
vtkPointSet pts = new vtkPointSet();
pts.SetPoints(p);
Could not downcast pointer to native class.
Help?
You need to insert points to vtkPoints before you call SetPoints()
Working example:
vtkPoints points = new vtkPoints();
for (int z = 0; z < vecs.Length; z++)
{
points.InsertPoint(z, vecs[z].ToDouble());
}
vtkPolyData pd = new vtkPolyData();
pd.SetPoints(points);
pd.SetPolys(cells);
vecs - array of Vectors(My class)