[vtkusers] visualizing scalars associated with polylines

Marcel Weiss mweiss at cbs.mpg.de
Fri Jun 12 03:33:03 EDT 2009


Hi vtkusers,

i´d like to visualize scalar data associated with polylines stored within a vtkPolyData object.

I added the values as a scalar array to the cellData of the object.

I used SetScalarModeToUseCellData() to switch to cell data rendering and also set the right scalar array to active. But the renderer does not show anything.

I tried to associate each of the points of the polyline with the scalar value of the corresponding polyline, so I used pointData. This works but stores ~ ten times more scalar values.

What might go wrong? (see code below...)

yours

Marcel Weiss
PhD student
Department of Neurophysics
Max Planck Institute for Human Cognitive and Brain Sciences 

vtkFloatArray* cellLengthScalars = vtkFloatArray::New();
cellLengthScalars->SetNumberOfComponents(1);
cellLengthScalars->SetNumberOfTuples(source -> GetNumberOfLines());
cellLengthScalars->SetName("name");

... /* fill array */
cellLengthScalars->SetTuple1(cellID , value);
... /* ********** */
	



More information about the vtkusers mailing list