[vtkusers] vtkParametricSpline not displaying after loading vtkPoints data

Charlotte Curtis c.f.curtis at gmail.com
Wed May 26 13:40:20 EDT 2010


Hi list,

I've got a fairly complicated wxwidgets/vtk/itk program that has a
frustrating glitch.  In my program, I do some image processing and
generate a set of points describing the contour of my object of
interest.  To display these points, I have a function that goes as
follows (where "m_info->splinepoints" is my point set):

**********

vtkParametricSpline *spline = vtkParametricSpline::New();
vtkParametricFunctionSource *contour = vtkParametricFunctionSource::New();
vtkPolyDataMapper *contourmapper = vtkPolyDataMapper::New();
vtkActor *contouractor = vtkActor::New();

spline->SetPoints(m_info->splinepoints);
contour->SetParametricFunction(spline);
contourmapper->SetInput(contour->GetOutput());
contouractor->SetMapper(contourmapper);
m_renderer->AddActor(contouractor);

contour->SetUResolution(m_info->splineres);
contour->SetVResolution(m_info->splineres);
contour->SetWResolution(m_info->splineres);

vtkProperty* contourprop = contouractor->GetProperty();
contourprop->EdgeVisibilityOn();
contourprop->SetEdgeColor(1.0, 0, 0);
contourprop->SetColor(1.0, 0, 0);
contourprop->SetLineWidth(2.0);

m_iren->Render();

**********

This function works for the most part - I can create a contour, modify
my processing algorithm, and redisplay a new contour.  However, if I
try to save and reload the point data (using
vtkPolyDataReader/Writer), they don't display.  The really odd thing
is if I save the contour, quit the program, restart, load the contour
(displaying nothing), and save again, the data is there.  It's just
not showing up!

I've updated to the latest version of VTK, and I'm kind of at a loss.
Any ideas where I should look to figure out what's happening?  Thanks,

Charlotte



More information about the vtkusers mailing list