[vtk-developers] Fwd: bug in vtkContourRepresentation ?

Karthik Krishnan karthik.krishnan at kitware.com
Wed Mar 21 05:08:01 EDT 2012


NsPx:

Excellent insight.

I had fixed in VTK a few months ago (post the VTK58 release). Please switch
to the development version

--
karthik

On Wed, Mar 21, 2012 at 1:12 PM, NsPx <nspx.roronoa at gmail.com> wrote:

>  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] );
>       }
>     arr->Delete();
>     }
>
>
> 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 :
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/vtkPolygonalSurfacePointPlacer
>
> Regards.
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20120321/5b4b6f35/attachment.html>


More information about the vtk-developers mailing list