[vtkusers] two scalars for a single unstructured grid??

Berk Geveci berk.geveci at kitware.com
Tue Feb 16 06:34:58 EST 2010


You can simply add another scalar array with

foo->SetName("my scalar");
uGrid->GetPointData()->AddArray(foo);

The attributes are merely for convenience - they are treated like any other
array. Most filters have methods to select any arbitrary array by name. It
is usually something like SetInputArrayToProces(...) for filters.

-berk

On Tue, Feb 16, 2010 at 6:06 AM, Rakesh Patil <rakeshthp at in.com> wrote:

> Hello,
>
> Is it possible to use two scalars for a single unstructured grid.??
> Actually, to display vectors I am computing scale factor for each point and
> storing in a data array and i set this array as a scalar for unstructured
> grid:
>
> uGrid->SetScalar(vec_values);
>
> and i set this grid to glyph object
>
> glyph->SetInput(uGrid);
>
> and say,
>
> glyph->SetScaleModeToScaleByScalar();
>
> BY doing so, i get the desired output.. But when i want to display colored
> vectors, then i need to replace this scalar data array with color data
> array.. So my question is, by re[placing, will my scale factor data array be
> affected??
>
> If so is there any technique, where in i can attach more than one data
> array as a scalar to unstructured grid..?
>
> Thanks
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100216/a867c5ae/attachment.htm>


More information about the vtkusers mailing list