Hello,<div><br></div><div>I was building the polydata from scratch, so no filters were involved. Main reason for posting this was that I could not find a solution online, and thought it might be useful. Does the documentation about how to build filters include directions on how to use DeleteCells/BuildCells?</div>
<div><br></div><div>-Bob</div><div><br></div><div><br><div class="gmail_quote">On Fri, Mar 1, 2013 at 2:12 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Robert,<br>
<br>
I'd like to get a feel for whether or not this might be is a bug.<br>
<br>
Were you building the polydata yourself (i.e. from scratch)<br>
or was it produced by a filter? And if the latter, what filter<br>
was producing it?<br>
<br>
Going a bit further, was the polydata that you were picking<br>
also being used as an input to a filter, i.e. were you picking<br>
a polydata that was somewhere in the middle of a pipeline?<br>
And if so, what filter?<br>
<br>
It seems to me that your application shouldn't have to call<br>
DeleteCells() unless your application is also building the<br>
polydata from scratch. If your application is using VTK<br>
sources, readers, or filters to produce the polydata then<br>
really VTK should be calling DeleteCells()/BuildCells()<br>
automatically, and if VTK isn't doing this, then there must<br>
be a bug somewhere e.g. in one of the filters you are using.<br>
<span class="HOEnZb"><font color="#888888"><br>
- David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Fri, Mar 1, 2013 at 10:35 AM, Robert Dean <<a href="mailto:bob.dean@gmail.com">bob.dean@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> For a long time I had an issue where my application would randomly crash<br>
> while picking cells. Each time the stack dump was in the depths of the vtk<br>
> code. What I tracked it down to was that when an actor is first clicked,<br>
> vtk allocates an internal cell array to assist in mapping the click to cell<br>
> index. This array is not automatically resized on future clicks.<br>
><br>
> Therefore when the actor is first clicked an array of N is allocated. If the<br>
> array is then updated to contain N*2 cells, clicking cells N through 2N-1<br>
> will access outside the cell index array, resulting in the segfault.<br>
><br>
> As cell picking is a rare event in the application timing, the solution was<br>
> to call polydata->DeleteCells() method on each update.<br>
><br>
> Posting in case someone else runs into the same problem. I am currently<br>
> using vtk 5.10, so I do not know if a newer version addresses this issue.<br>
><br>
> -Bob<br>
</div></div></blockquote></div><br></div>