[vtk-developers] Fwd: bug in vtkContourRepresentation ?

NsPx nspx.roronoa at gmail.com
Wed Mar 21 03:42:24 EDT 2012

Dear vtk developpers,

I think I felt on a bug concerning vtkContourRepresentation but i'm not 
sure so i'm exposing the situation. Then you'll confirm me or not.
(vtk 5.8, windows XP 32bits, visual studio 2008)

I use vtkOrientedGlyphContourRepresentation (with 
vtkPolygonalSurfacePointPlacer and 
vtkPolygonalSurfaceContourLineInterpolator) via vtkContourWidget to draw 
a contour on a mesh interactively.

However when I want to close the contour, the penultimate line is reset 
to be a simple segment.

I found the problem comes from the function : void 
vtkContourRepresentation::UpdateLines( int index ) in this portion of code :

  if (this->LineInterpolator)
     vtkIntArray *arr = vtkIntArray::New();
     this->LineInterpolator->GetSpan( index, arr, this );

     int nNodes = arr->GetNumberOfTuples();
     for (int i = 0; i < nNodes; i++)
       arr->GetTupleValue( i, indices );
       this->UpdateLine( indices[0], indices[1] );

if I understand well, this function clear the path between node 
indices[0] and indices[1] and build it again.But when 
indices[0]=nNodes-1 and indices[1]=nNodes-2 (or vice-versa) this line is 
only cleared.

Please someone confirm the problem.

This test can be reproduce using the example on the wiki and closing a 
contour on the sphere : 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20120321/f0eb8534/attachment.html>

More information about the vtk-developers mailing list