[vtkusers] iterating over FIELDdata and colormapping by vector magnitude

Jasper VTK jaspervtk at gmail.com
Tue Jun 21 09:49:38 EDT 2011


Dear VTK Users,

I have a couple of questions.

Below you can find a rudimentary sketch of a pipeline (used ASCIIflow). I have one VTK file containing the geometry&   topology from a FEM mesh, and a second file (vtkDataObject with fielddata)
wich holds the results of a FE analysis. I have multiple possible outputfiles, so it is best to keep the nominal mesh and the results in different files.

I use a mergefilter to merge the geometry with the fielddata, followed by a FieldDataToAttributeDataFilter to extract the vectorcomponents from the named field.
I want to iterate over the fielddata-array's using some slider interaction.

In the FieldDataToAttributeDataFilter i specify the vectorcomponents to set as active, where i change the name to select a specific fieldarray.
The idea was to determine the names of the different array's in the field, and then use this name to set this array as the active vector attributedata.

However, i am even unable to extract the names of the arrays in the FIELD. (after updating all the filters, as suggested in the FAQ)

I noticed there is a iterator defined for vtkFieldData, however it is not really well-documented (and I am a newbie in programming C++)
Could this iterator be used to iterate over all of my vtkDoubleArrays defined in the FIELD?


Secondly, i am trying to implement some colormapping, where colormapping should represent the magnitude of the vectors in my vectordata.
To do that, i first have to obtain the vector magnitudes for each point, and then determine the range (min and max value) to set up the lookuptable?

Thanks in advance,

Kind regards,
Jasper



      +----------------------------+  +---------------------------+
      |   vtk file                 |  |  vtk File with fieldData  |
      |----------------------------|  |---------------------------|
      |  vtkUnstructuredGrid       |  |  vtkDataObject            |
      |  Geometry / topology       |  |  FieldData /w DoubleArrays|
      |                            |  |                           |
      +-------------+--------------+  +-------------+-------------+
                    |                               |
      +-------------v--------------+  +-------------v-------------+
      |vtkUnstructuredGridReader   |  | vtkDataObjectReader       |
      +-------------+--------------+  +-------------+-------------+
                    |                               |
                    |                               |
                    +--------------+----------------+
                                   |
                                   |
                        +----------v-------------+
                        |                        |
                        |vtkMergeDataObjectFilter|
                        |                        |
                        +----------+-------------+
                                   |
                                   |
              +--------------------v----------------------------+
              |                                                 |
              |         vtkFieldDataToAttributeDataFilter       |
              +--------------------+----------------------------+
                                   |
                                   |
                            +------v---------+
                            |                |
                            | vtkWarpVector  |
                            +------+---------+            +---------------------------+
                                   |                      |                           |
                                   |                      |  vtkLookupTable           |
                                   |                      |                           |
                            +------v---------+            |  Needs vector magnitude   |
                            |                |            |  from VECTORs in field    |
                            |  Actor         |            |  ScalarRange MIN MAX      |
                            +------+---------+            +------------+--------------+
                                   |                                   |
                            +------v---------+                         |
                            |  Mapper        |                         |
                            |                |<------------------------+
                            +------+---------+
                                   |
                            +------v---------+
                            |   Rendered     |
                            | RenderWindow   |
                            |                |
                            +----------------+













More information about the vtkusers mailing list