[Paraview] Finding the Input Array for A Module

Kent Eschenberg eschenbe at psc.edu
Fri Jun 30 10:17:45 EDT 2006


Berk,

Your explaination is perfectly clear; thanks! Is this information in a book 
or the doxygen docs? Do do plan to publish "The Collected Wisdom of Berk"?

Can the ParaView GUI make use of this multiple-input feature? That is, 
provide two pull-downs to select two variables where both are sent to 
SetInputArrayToProcess(). I didn't see how and so the widget that selects 
the 2nd input sends it to a method in my new module created for this 
purpose.

Kent
Pittsburgh Supercomputing Center

--On Friday, June 30, 2006 09:19:22 AM -0400 Berk Geveci 
<berk.geveci at gmail.com> wrote:

> GetInputArrayToProcess() is a bit tricky :-) The first argument (idx) does
> not correspond to the index of the array. Here is how it works:
>
> Let's say your algorithm need to input arrays: temperature and velocity.
> You
> want these to correspond to scalars and vectors by default. The algorithm
> then says something like "temperature is the first array I process, the
> velocity second". Note, these indices have nothing to do with indices the
> arrays are stored with. They are rather a convention the algorithm uses to
> note what it does with which array. Maybe string keys would have been a
> better choice. Anyway, the algorithm then has something like:
>
>   // by default process active point scalars (temperature)
>
> this->SetInputArrayToProcess(0,0,0,vtkDataObject::FIELD_ASSOCIATION_POINT
> S,
>                                vtkDataSetAttributes::SCALARS);
>   // by default process active point vectors (velocity)
>
> this->SetInputArrayToProcess(1,0,0,vtkDataObject::FIELD_ASSOCIATION_POINT
> S,
>                                vtkDataSetAttributes::VECTORS);
> in the constructor. In RequestData:
>
>   vtkDataArray *temperature = this->GetInputArrayToProcess(0,inputVector);
>   vtkDataArray *velocity = this->GetInputArrayToProcess(1,inputVector);
>
> This is why vtkSurfaceVectors always use idx. It has only 1 array
> (vectors)
> it processes. I hope this answers your question.
>
> -Berk



More information about the ParaView mailing list