[vtkusers] Streamtracer examples in c++ and some help

John Murphy infinity.probability at gmail.com
Mon Nov 17 08:35:33 EST 2008


Hello all,

I'm using VTK 5, and trying to trace streamlines using vtkStreamTracer. I
can visualize my data using vtkGlyphs2D correctly, but not with
streamtracer. My input data is on this format:

x    y     vx     vy

and i put this data inside a Polydata using

   points->InsertNextPoint(d1[i], d2[i], 0);
   vector->InsertNextTuple(entry);

where d1 has the x points, d2 the y points, and entry is a vector with
entry[0] = vx, entry[1] = vy and entry[2] = 0. Then I associate the points
(vtkPoints) and vector(vtkFloatArray) with

   PolyData->SetPoints(points);
   PolyData->GetPointData()->SetVectors(vector);

I try then to associate this data with the streamer with
    streamer = vtkStreamTracer::New();
    streamer->SetInput(PolyData);

    streamer->SetMaximumPropagation(500);
    streamer->SetMaximumPropagationUnitToTimeUnit();
    streamer->SetInitialIntegrationStep(0.05);
    streamer->SetInitialIntegrationStepUnitToCellLengthUnit();
    streamer->SetIntegrationDirectionToBoth();
    streamer->SetStartPosition(50, 51, 0);
    streamer->Update();

And associates it with a polydata mapper and a actor. The output is just a
black screen. The data file starts on 0,0 and ends in 100,100, for example.
I dont know what can I be doing wrong, or how to try do debug this. Any
clues or examples in C++ would be appreciated.

TIA!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081117/a666e9f6/attachment.htm>


More information about the vtkusers mailing list