[vtkusers] SetInputArrayToProces(...) ..??

David Doria daviddoria+vtk at gmail.com
Wed Feb 17 08:07:04 EST 2010


On Wed, Feb 17, 2010 at 3:32 AM, Rakesh Patil <rakeshthp at in.com> wrote:
> I was going through the documentation of vtkGlyph3D here
>
> http://www.vtk.org/doc/release/5.4/html/a00651.html
>
> I came across:
>
> "You can set what arrays to use for the scalars, vectors, normals, and color
> scalars by using the SetInputArrayToProcess methods in vtkAlgorithm. The
> first array is scalars, the next vectors, the next normals and finally color
> scalars."
>
> SetInputArrayToProces(...)
>
> Sorry to ask such stupid question, but can any one explain me with example
> how to use this method..?? In my case, I have two different arrays.. one
> scalar array and another color scalars.. So how do i do this..??
>
> Thanks in advance
>
> Rakesh Patil
>
>

vtkGlyph3D is derived from vktAlgorithm, so you can call
SetInputArrayToProcess directly on the glyph filter:

vtkGlyph3D* glyph = vtkGlyph3D::New();
glyph->SetInputArrayToProcess(...)

The trick, then, is knowing what to pass it :) It is extremely
confusing - here are a couple of use cases I've seen, maybe you can
use this as a starting point:

glyph->SetInputArrayToProcess(0, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_CELLS,
vtkDataSetAttributes::SCALARS);

glyph->SetInputArrayToProcess(0, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_CELLS, "index");

glyph->SetInputArrayToProcess(0, 0, 0,
                                   vtkDataObject::FIELD_ASSOCIATION_CELLS,
                                   vtkDataSetAttributes::SCALARS);

I think you'd want to change the first 0 to a 1, 2 or 3 depending on
if you want to set scalars, vectors, normals or color scalars.

Play around with those and let us know if you get anywhere.

Thanks,

David



More information about the vtkusers mailing list