[vtkusers] [EXTERNAL] Assiging attributes to vtk polydata

Gerrick Bivins Gerrick.Bivins at halliburton.com
Wed Mar 11 13:41:23 EDT 2015


Hi Chiranjib,
You could use vtkAssignAttribute to set “foo” as the “Active Scalar Array of the Point Data” , as in the example,
which is useful in situations where algorithms/filters that are consuming the output of vtkAssignAttribute are setup
to work on the “Active Scalar”( http://www.vtk.org/doc/nightly/html/classvtkDataSetAttributes.html#a626aeb4cf7f739d11068a464c968db8c ).

I’ve used vtkAssignAttribute in instances where I needed to calculate a new array via vtkArrayCalculator.
I set the output array of the calculator as the active scalar using vtkAssignAttribute,
so that it would be used as the “input array to process” in a vtkContourFilter, for example.

Gerrick

From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Chiranjib Sur
Sent: Wednesday, March 11, 2015 11:32 AM
To: vtkusers at vtk.org
Subject: [EXTERNAL] [vtkusers] Assiging attributes to vtk polydata

Hi All,
Once I generate the vtkpolydata, how do I assign any particular attributes (say of type scaler and named as "density") to the dataset.

I looked into the examples using vtkAssignAttribute (http://www.vtk.org/doc/nightly/html/classvtkAssignAttribute.html)

Can anyone please explain what does this statement means from the page :


aa->Assign("foo", vtkDataSetAttributes::SCALARS,

           vtkAssignAttribute::POINT_DATA);

Once the point attributes are assigned, does it mean that each point data will contain the information of the attributes in the vtk (.vtp) file ?

Thanks much.

Chiranjib

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150311/a6972b15/attachment.html>


More information about the vtkusers mailing list