[Paraview] Writing new readers for paraview

Berk Geveci berk . geveci at kitware . com
08 Oct 2003 15:17:04 -0400


> ...
> The same reader in ParaView only shows the first block, i.e. [reader 
> GetOutput 0].
> 
> What is missing? I suspect that one more requirement to add to Berk's 
> list is that the reader should be able to return its number of Outputs 
> early on. Exactly when is my question. During ExecuteInformation?

Actually, in the current implementation:
1. If using a ReaderModule, GetNumberOfOutputs() has to return the
correct number even before ExecuteInformation() is called
2. If using AdvancedReaderModule, GetNumberOfOutputs() has to return the
correct number after ExecuteInformation() is called

I am changing this behaviour in the development branch. Both modules
will call UpdateInformation() before GetNumberOfOutputs().

Here is another tip on writing VTK readers:

* In your reader class, do not make calls that update the reader's MTime
anywhere other than ExecuteInformation() and SetXXX() methods. For
example, the reader should not call SetNumberOfOutputs() or
SetNthOutput() in GetNumberOfOutputs(). If you do this, the following
will call ExecuteInformation() twice:

reader UpdateInformation
reader GetNumberOfOutputs
reader UpdateInformation

This should not happen normally since UpdateInformation() calls
ExecuteInformation() only if the reader's MTime is newer than
the last ExecuteInformation() MTime.

-Berk