<div dir="ltr"><div>Will,<br><br>According to QtCreator's find usages option, it is used 7 times in vtkDelaunay2D and 6 times in vtkGreedyTerrainDecimation.  And that is all.  Of course this is only including the things in a default build of VTK in its search.  But I think it is safe to say there are not very many places this is used.<br><br></div>Shawn<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 4:03 PM, Will Schroeder <span dir="ltr"><<a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Shawn I'm curious do you know how many places is vtkPolyData::ReplaceCell used? <div><br></div><div>If the method, rather than returning "void" returned a pointer to the cell array, then it'd be easy to invoke Modified() on it.</div><div><br></div><div>Best,</div><div>W</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 3:39 PM, Shawn Waldon <span dir="ltr"><<a href="mailto:shawn.waldon@kitware.com" target="_blank">shawn.waldon@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Ok, so what should be added to the documentation on vtkPolyData::ReplaceCell?<br><br></div>// This operation modifies one of the vtkCellArrays contained in this vtkPolyData.  In order for this change to be picked up by the rendering system, Modified() must be called on that vtkCellArray. (What goes here to help them figure out which cell array to call Modified() on????)<br><br></div>I think that at least for now we have to change vtkPolyData::ReplaceCell to either call Modified() on the correct vtkCellArray or return something to indicate to the user which cell array they need to modify.  I lean toward the first, and just add a line in the method's documentation saying that this is not recommended for tight loops and to use ReplaceCell on the vtkCellArrays if you need to change many cells in tight loops.  This method is already doing lookups to determine which cell array to modify and a switch to do it, which is not something you really want in tight loops.<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Shawn<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 3:17 PM, Will Schroeder <span dir="ltr"><<a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">FYI- Just to provide more background context: there are several triangulation classes like vtkDelaunay2D, vtkQuadricDecimation, and vtkGreedyTerrainDecimation that routinely swap the diagonal of the quadrilateral consisting of two adjacent triangles (sharing an edge). The edge swap is done to improve the triangulation quality. As Dave and Berk indicated, this is considered an atomic operation performed in tight loops so it is expected that Modified() is called at the end.<div><br></div><div>Best,</div><div>W</div></div><div class="gmail_extra"><br><div class="gmail_quote"><span>On Mon, Aug 15, 2016 at 12:54 PM, David Cole via vtk-developers <span dir="ltr"><<a href="mailto:vtk-developers@vtk.org" target="_blank">vtk-developers@vtk.org</a>></span> wrote:<br></span><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don't specifically know the answer to this one, but in general,<br>
these sorts of things are on purpose for performance in VTK.<br>
<br>
If you want to replace 100 (or even more) cells, you'd want<br>
ReplaceCell NOT to call Modified, and just do it once at the end of<br>
your bulk replacement. I'd be surprised if somebody chimed in and<br>
contradicted this... so I would think just fixing the docs is the<br>
right way to go here.<br>
<br>
<br>
HTH,<br>
David C.<br>
<div><div><br>
<br>
On Mon, Aug 15, 2016 at 11:59 AM, Shawn Waldon <<a href="mailto:shawn.waldon@kitware.com" target="_blank">shawn.waldon@kitware.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I have been tracking down a bug in the vtkBoxRepresentation where the<br>
> selected face never updated.  The issue was that the widget was calling<br>
> ReplaceCell on the vtkCellArray for the selected face polydata, but never<br>
> calling Modified() on the cell array (though it did call Modified() on the<br>
> polydata).  With the new OpenGL backend this matters.  The documentation for<br>
> ReplaceCell doesn't say that you have to do this afterward and the writer of<br>
> vtkBoxRepresentation used that documentation.<br>
><br>
> So my question is this: why doesn't ReplaceCell mark the cell array as<br>
> modified? Is this a bug or on purpose for performance reasons?  I will<br>
> update the docs or fix ReplaceCell once I know which is wrong.<br>
><br>
> Thank you,<br>
> Shawn<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtk-developers</a><br>
><br>
><br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtk-developers</a><br>
<br>
</blockquote></div></div></div><br><br clear="all"><span><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div>William J. Schroeder, PhD<br>Kitware, Inc. - Building the World's Technical Computing Software<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a><br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br><a href="tel:%28518%29%20881-4902" value="+15188814902" target="_blank">(518) 881-4902</a></div></div></div>
</span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div>William J. Schroeder, PhD<br>Kitware, Inc. - Building the World's Technical Computing Software<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a><br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br><a href="tel:%28518%29%20881-4902" value="+15188814902" target="_blank">(518) 881-4902</a></div></div></div>
</div>
</div></div></blockquote></div><br></div>