[vtkusers] Uniform Grid with Vectors and Scalars

David E DeMarle dave.demarle at kitware.com
Thu Dec 1 08:56:59 EST 2011


Call myImageData->Get[Point/Cell]Data() to get a hold of the container
(vtkDataSetAttributes) for the point/cell associated arrays. The
container can hold any number of arrays and they can have any number
of components. Each array (vtkAbstractArray) has a SetName(const char
*) and GetName method too.
The API for vtkImageData that exposes only one scalar array is a
legacy from the days before that container existed. It works simply by
finding the one array in the container that has been marked as the
"active" scalars.


David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909



On Thu, Dec 1, 2011 at 6:41 AM, Dan Barker <djb_ro at hotmail.co.uk> wrote:
> Dear all,
>
> I have several fields, some of which are vector quantities and others
> scalar, that I wish to store at points on a regular grid, i.e. cubic
> lattice.
>
> I have some code working using the 'vtkImageData' class. This is okay except
> it can only seem to store scalars (unless I'm missing something) and further
> I can't see a way to label the scalar components of the vtkImageData with
> meaningful names.
>
> So my question is: What class is best used to store mixed scalar/vector
> quantities on a regular grid?
>
> Kind regards,
> Dan
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list