<div dir="ltr">Why can't you instead of:<div><br></div><div><div>    this->HexFacePolyData->Modified();</div><div>    cells->ReplaceCell(0,npts,pts)</div><div><br></div><div>do:</div><div><br></div><div><div>    cells->Modified();</div><div>    cells->ReplaceCell(0,npts,pts)</div></div><div><br></div><div>Best,</div><div>W</div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 2:48 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>See the example script on this bug report: <a href="https://gitlab.kitware.com/vtk/vtk/issues/16812" target="_blank">https://gitlab.kitware.com/<wbr>vtk/vtk/issues/16812</a>.  It is calling Modified() on the polydata, but to actually see the updated geometry, you have to add pdata.GetPolys().Modified().  And I can only say that for sure because I know the cell in question is polygonal.  ReplaceCell doesn't tell the caller which cell array needs to be updated.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Shawn</font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 2:36 PM, Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@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">Can you provide a bit more detail? Who's MTime is important in this case? Note that vtkPolyData does not take into account the MTime of the underlying vtkCellArrays when computing its own MTime. So if the MTime of the polydata is becoming stale, simply calling Modified() on it should be sufficient. As far as I can tell, vtkCellArray does nothing with MTime.</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 1:25 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>Thanks David & Berk,<br><br>Ok, I'll add a commit to my branch to update the docs and add you as reviewers.  I have a follow-up question though:  vtkPolyData::ReplaceCell.  This function figures out which cell array the cell is in and then calls ReplaceCell on that one.  It can be in Verts, Lines, Polys, or Strips.  So the caller may not know which cell array to call Modified on.  What should we do in this case?<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 12:55 PM, Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@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">I agree with David.</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">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><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><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><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/<wbr>opensource/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/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" 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>(518) 881-4902</div></div></div>
</div>