[vtk-developers] Handling invalid vtp files

Berk Geveci berk.geveci at kitware.com
Sat Feb 13 21:52:49 EST 2010


> Is vtkXMLReader::RequestData the right place in the pipeline to do this
> kind of check?
>
> A simple thing could be to add something like:
>
> if(this->CurrentOutput->GetNumberOfElements(vtkDataObject::POINT) == 0)
>   {
>   return 0;
>   }
>
> (Is there ever a time where there could be 0 points but still some
> reasonable data set?)
>

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.


> 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?
>
> reader->SetValidityCheck(true);
>
> 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.
>
> 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.

-berk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100213/453ca07d/attachment.html>


More information about the vtk-developers mailing list