[vtkusers] Java vtkPointToCellData

James Labiak jim at jslengineeringsoftware.com
Mon Sep 21 10:20:56 EDT 2015


Hello all,
I created a pipeline that seems to make sense to me, but always my 
polyDataComplete is empty. Any ideas why this code doesn't work? The 
only vtkPointToCellData example on the web that I can find uses 
blow.vtk, which doesn't exist on my 6.0.0 installation anywhere. The 
polyData variable gets correctly populated with the points and their 
scalars below.

         // Create a new, empty polyData
         polyData = new vtkPolyData();

         // populate the polyData points
         polyData.SetPoints(points);

         // populate the polyData scalars
         polyData.GetPointData().SetScalars(colorsScalars);

         vtkPointDataToCellData polyDataCreateCells = new 
vtkPointDataToCellData();
         polyDataCreateCells.SetInputData(polyData);
         polyDataCreateCells.PassPointDataOn();

         // Create new polyData, retrieve completed polyData from 
polyDataCreateCells
         vtkPolyData polyDataComplete = new vtkPolyData();
         polyDataComplete = polyDataCreateCells.GetPolyDataOutput();

         vtkPolyDataMapper polyMapper = new vtkPolyDataMapper();
         polyMapper.SetInputData(polyDataComplete);
         polyMapper.ScalarVisibilityOn();
         polyMapper.SetScalarRange(scalarMin, scalarMax);
         polyMapper.Update();

         vtkActor polyActor = new vtkActor();
         polyActor.SetMapper(polyMapper);
         polyActor.GetProperty().SetColor(1.0, 1.0, 1.0);

// ...Usual render stuff...

Thanks,
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150921/6bf32a1d/attachment.html>


More information about the vtkusers mailing list