[vtkusers] how does one add two vector fields to a grid and display them separately

Gerrick Bivins Gerrick.Bivins at halliburton.com
Fri Jan 11 14:45:55 EST 2013


Hi Dave,
Check out the docs for vtkAlgorithm::SetInputArrayToProcess
http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html#a6bea16e1329609dbccce0ff8d2367484

I often am in the same situation as you've described so instead of using SetActive*, SetInputArrayToProcess
allows me more control over what is used in various pieces of the pipeline.
There are different variants, especially for wrapped languages so make sure you understand
what all the parameters mean and you should be able to get the results you want.
HTH
Gerrick
-----Original Message-----
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Dave Kindig
Sent: Friday, January 11, 2013 12:50 PM
To: vtkusers at vtk.org
Subject: [vtkusers] how does one add two vector fields to a grid and display them separately

I have two vector fields and I wish to display them separately, but using the same grid, along with some scalar data( this may be
unimportant...)
The vectors are orthogonal.
I am guessing that I need a separate grid for each piece I want to show separately.

If I attach the two vector fields to the grid using GetPointData()->AddArray(), then use SetActiveVector(name) only the active vector is displayed.

Do I have to create a separate grid for each vector field I wish to display even if it is the same grid? I know I have to create a separate actor for each field.

I have attached a python script (testWrite) demonstrating the issues.

I am writing two .vtk files containing the grid and data. The output of these files demonstrates the issue about the active vs. inactive vector as well If there are no active fields, all the data are stored as FieldData with a shape.
If there are active fields, only they are stored as a SCALAR or VECTOR field, the rest are stored as FieldData with a shape.

testWrite_ThisIsWhatIWant.py shows essentially what I am looking for.

Ciao,
Dave Kindig

--
--Dave


Dave Kindig
Research Assistant - TechX Corp (www.txcorp.com)
303-444-2386




More information about the vtkusers mailing list