Another option here is to create a filter (or family of filters) that can be inserted into the pipeline to check for validity (there could be different sorts of checks). The filter could be removed, or disabled with a flag, once the application is being tuned for performance and the data is known to be good. In my mind these validity checks are more like debugging tools and should be able to easily removed when debugging is complete.<div>

<br><br><div class="gmail_quote">On Sat, Feb 13, 2010 at 9:52 PM, Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com">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;">

<br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div class="gmail_quote"><div class="gmail_quote">Is vtkXMLReader::RequestData the right place in the pipeline to do this kind of check?</div>


<div class="gmail_quote"><br></div>
<div class="gmail_quote">A simple thing could be to add something like:</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">if(this->CurrentOutput->GetNumberOfElements(vtkDataObject::POINT) == 0)</div>



<div class="gmail_quote">  {</div><div class="gmail_quote">  return 0;</div><div class="gmail_quote">  }</div><div class="gmail_quote"><br></div><div class="gmail_quote">(Is there ever a time where there could be 0 points but still some reasonable data set?)</div>


</div></div></blockquote></div><div><br>Yes. It is possible. Let's say you have a multi-piece dataset where some of the pieces are empty but you still want associated meta-data that may be stored in the field data.<br>

 <br>
</div><div class="im"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div class="gmail_quote"><div class="gmail_quote">
<div class="gmail_quote">An extensive check would be to go through all the cells and make sure the points that they reference actually exist. Maybe this could be a flag?</div><div class="gmail_quote">
<br></div><div class="gmail_quote">reader->SetValidityCheck(true);</div><div class="gmail_quote"><br></div><div class="gmail_quote">The above would make the reader traverse the cells checking that they are defined on valid geometry. If speed is a priority (for large data sets), this option could be turned off.</div>



</div><div class="gmail_quote"><br></div></div></blockquote></div><div>I wouldn't even bother with the flag. Even if you went over the whole cell array to make this check, compared to IO, it would be quite negligible.  <br>


<br>-berk<br></div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br><br clear="all"><br>-- <br>William J. Schroeder, PhD<br>Kitware, Inc.<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a><br>

<a href="http://www.kitware.com">http://www.kitware.com</a><br>(518) 881-4902<br>
</div>