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

Dave Kindig kindig at txcorp.com
Fri Jan 11 13:50:04 EST 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: testWrite.py
Type: text/x-python
Size: 2738 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130111/245f99e1/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testWrite_ThisIsWhatIWant.py
Type: text/x-python
Size: 3123 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130111/245f99e1/attachment-0001.py>


More information about the vtkusers mailing list