[vtkusers] Streamlines from scalars of structured points. Needing help!
stefano mininel
mininel.ml at gnbts.univ.trieste.it
Thu May 30 10:10:36 EDT 2002
I know there should be an easy answer but right now I'm blocked.
I've got a
"vtkStructuredPoints *pPotGrid;"
with its scalars containing electric potential values around a current
dipole source (calculated from a previous PDE numerical solution and
copied in this vtk object for visualization of the results).
I want to show some current lines, so I tried with
"
// using sphere source to have a bunch of points around the dipole
position
vtkSphereSource *pNearPoints = vtkSphereSource::New();
pNearPoints->SetCenter(xDipPos,yDipPos,zDipPos);
pNearPoints->... // other sphere settings
// setting the integrator for the streamlines
vtkRungeKutta4 *pIntegrator = vtkRungeKutta4::New();
vtkStreamLine *pStreamer = vtkStreamLine::New();
pStreamer->SetInput(pPotGrid);
pStreamer->SetSource(pNearPoints->GetOutput());
pStreamer->... // other streamline settings, quite standard and copied
from vtk examples
... // all the other things in visualization pipeline
"
But upon rendering I receive the message "ERROR: in... No vector data
defined!"
True, I say! The structured points object contains only scalars. I need
vectors.
So I go with
"
vtkImageGradient* grad = vtkImageGradient::New();
grad->SetDimensionality( 3 );
grad->SetInput(pPotGrid);
"
and put
"pStreamer->SetInput(grad->GetOutput());"
But I receive the same error message.
Probably I doing something very stupid but I'm lost in a maze, and I
hope someone can enlighten me.
Thanks in advance for any tip/help/suggestion/insult (erh ... not the
last I hope!).
Stefano Mininel
More information about the vtkusers
mailing list