[vtkusers] Setting Single Value Attributes into Data sets

Michael Jackson mike.jackson at bluequartz.net
Wed Feb 24 11:04:08 EST 2010


Found it. SOrry for the noise.

Berk G. Responded way back in 2008 with this answer.
>
> Yes. Create a new data array (with the appropriate name) and add it to
> the FieldData. Something like:
>
> vtkFloatArray* newarray = vtkFloatArray::New();
> newarray->SetName("foo");
>
> vtkFieldData* fd = vtkFieldData::New();
> fd->AddArray(newarray);
>
> output->SetFieldData(fd);
>
> newarray->Delete();
> fd->Delete();
>
> The field data is automatically propagated by the pipeline and will be
> accessible to all filters downstream.
>
> -berk

I will assume that this still holds for the latest versions of VTK and  
ParaView?

___________________________________________________________
Mike Jackson                      www.bluequartz.net


On Feb 24, 2010, at 11:01 AM, Michael Jackson wrote:

> I know there is a way but my email searching skills are sub-par this  
> morning.
>
> I would like to store some "meta-data" into a data set. Say, for  
> example I have a vtkPolyData object that represents a surface mesh  
> and that surface mesh has an a few items like "Grain ID" and "Euler  
> Angle". The Grain ID is a single 32 bit integer. The Euler angle is  
> a 3 float vector. I could easily create a Scalar Attribute for each  
> Cell but that seems VERY redundant and a memory waste.
>
>  I thought there were some methods to store these "simple" values  
> into a vtk Data set? I have been perusing the vtk 5.4 documentation  
> going up and down the inheritance tree for vtkPolyData and nothing  
> is really sticking out at me.
>
> Help is much appreciated.
> ___________________________________________________________
> Mike Jackson                      www.bluequartz.net
> Principal Software Engineer       mike.jackson at bluequartz.net
> BlueQuartz Software               Dayton, Ohio
>
>




More information about the vtkusers mailing list