VisTrails Home

User:Tohline/vtk/Examples/XMLwarpedQuilt

From VisTrailsWiki

Jump to: navigation, search

Example Input Files & VisTrails Pipelines

Whitworth's (1981) Isothermal Free-Energy Surface
|   Tiled Menu   |   Tables of Content   |  Banner Video   |  Tohline Home Page   |

This is an example of an input data file that we have successfully used to generate a useful interactive rendering within VisTrails. The file illustrates the POLYDATA dataset format in the context of VTK's XML File Format. To aid in implementation, we present the full ascii dataset, two resulting rendered images, and a screen shot of the VisTrails pipeline that was used to generate the image. Note that the image captioned "Point Data" was generated, by default, while the image captioned "Cell Data" was generated after activating the SetScalarModeToUseCellData method within the vtkPolyDataMapper module. Note, further, that the vertical "warping" of the configuration can be excluded — with the result being the rendering of a flat plane — by either:

  • Removing the vtkWarpScalar module from the VisTrails pipeline and connecting the vtkXMLPolyDataReader module directly to the vtkPolyDataMapper module; or
  • Changing the floating-point value associated with the SetScaleFactor method inside the vtkWarpScalar method from 2.0 to 0.0.

The lessons that we learned as we initially constructed this "Warped Quilt" example are detailed in the "WarpScalar" subsection of our accompanying tutorial. A list of other example input data files is provided near the end of the same tutorial.

XML (PolyData) Warped Quilt Example

<?xml version="1.0"?>
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian">
  <PolyData>
    <Piece NumberOfPoints="36" NumberOfPolys="25">
      <CellData Scalars="cell_scalars" Normals="cell_normals">
        <DataArray type="Float32" Name="cell_scalars" format="ascii">
          0.2 0.2 0.2 0.2 0.2
          0.2 0.4 0.6 0.4 0.2
          0.2 0.6 0.8 0.6 0.2
          0.2 0.4 0.6 0.4 0.2
          0.2 0.2 0.2 0.2 0.2
        </DataArray>
        <DataArray type="Float32" Name="cell_normals" NumberOfComponents="3" format="ascii">
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1
        </DataArray>
      </CellData>
      <PointData Scalars="colorful" Normals="magnify">
        <DataArray type="Float32" Name="colorful" format="ascii">
          0.2 0.2 0.2 0.2 0.2 0.2
          0.2 0.4 0.6 0.6 0.4 0.2
          0.2 0.6 0.8 0.8 0.6 0.2
          0.2 0.6 0.8 0.8 0.6 0.2
          0.2 0.4 0.6 0.6 0.4 0.2
          0.2 0.2 0.2 0.2 0.2 0.2
        </DataArray>
        <DataArray type="Float32" Name="magnify" NumberOfComponents="3" format="ascii">
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1  0 0 1
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1  0 0 1
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1  0 0 1
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1  0 0 1
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1  0 0 1
          0 0 1   0 0 1   0 0 1   0 0 1  0 0 1  0 0 1
        </DataArray>
      </PointData>
      <Points>
        <DataArray type="Float32" NumberOfComponents="3" format="ascii">
         0 0 0 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0
         0 1 0 1 1 0 2 1 0 3 1 0 4 1 0 5 1 0
         0 2 0 1 2 0 2 2 0 3 2 0 4 2 0 5 2 0
         0 3 0 1 3 0 2 3 0 3 3 0 4 3 0 5 3 0
         0 4 0 1 4 0 2 4 0 3 4 0 4 4 0 5 4 0
         0 5 0 1 5 0 2 5 0 3 5 0 4 5 0 5 5 0
        </DataArray>
      </Points>
      <Polys>
        <DataArray type="Int32" Name="connectivity" format="ascii">
           0  1  7  6   1  2  8  7   2  3  9  8   3  4 10  9   4  5 11 10
           6  7 13 12   7  8 14 13   8  9 15 14   9 10 16 15  10 11 17 16
          12 13 19 18  13 14 20 19  14 15 21 20  15 16 22 21  16 17 23 22
          18 19 25 24  19 20 26 25  20 21 27 26  21 22 28 27  22 23 29 28
          24 25 31 30  25 26 32 31  26 27 33 32  27 28 34 33  28 29 35 34
        </DataArray>
        <DataArray type="Int32" Name="offsets" format="ascii">
          4  8 12 16 20 24 28 32 36 40
         44 48 52 56 60 64 68 72 76 80
         84 88 92 96 100
        </DataArray>
      </Polys>
    </Piece>
  </PolyData>
</VTKFile>


Pipeline03
Warp (Point Data) Image
Warp (Cell Data) Image

Related Discussions

Personal tools