[Paraview] Scalars in Polydata

Kent Eschenberg eschenbe at psc.edu
Tue Apr 17 16:31:04 EDT 2007


You need to learn about VTK's classes for storing polydata, points and lines. 
The documentation for VTK version 5.0.3 is currently available at

http://public.kitware.com/VTK/get-software.php

and that is probably close to the version used by ParaView. Class 
vtkPolyDataReader is a good place to start. It returns its data in the class 
vtkPolyData whose method GetLines returns information about the lines using 
class vtkCellArray. There are additional methods to get information about each 
cell and its points.

Kent
Pittsburgh Supercomputing Center

Bikash Agarwal wrote:
> Thanks Amy. Is it possible to achieve this from within the code of my 
> custom filter? So essentially, my code reads this polydata object which 
> is a list of point ids and somehow be able to identify which point is 
> associated with which line.
> 
> Bikash
> 
> On 4/17/07, *Amy Squillacote* <amy.squillacote at kitware.com 
> <mailto:amy.squillacote at kitware.com>> wrote:
> 
>     Hi Bikash,
> 
>     Try using the Pick filter in ParaView. It allows you to pick either
>     cells or points with either a 3D coordinate ("World Point") or an id.
>     You should use the Cell pick type. On the Parameters tab, it will list
>     the cell and the points used by this cell as well as any point-centered
>     or cell-centered data attributes.
> 
>     If you are picking with a 3D coordinate, you can interactively select
>     the point by either moving the point widget in the 3D scene or by
>     placing the mouse cursor over a particular location and pressing the 'P'
>     key.
> 
>     - Amy
> 
>     Bikash Agarwal wrote:
>      > Hi All,
>      >
>      > My question relates to legacy VTK file formats. For a polydata .vtk
>      > file with points and lines how can identify which points are being
>      > used by a particular line in paraview.
>      >
>      > I would like to identify the points used by each line and then use
>      > them for calculations in a custom filter. I have given an example
>      > below to demonstrate what I mean.
>      >
>      > #vtk DataFile Version 2.0
>      > My data
>      > ASCII
>      > DATASET POLYDATA
>      > POINTS 6 float
>      > 0.0 0.0 0.0
>      > 1.0 1.0 1.0
>      > 2.0 2.0 2.0
>      > 3.0 3.0 3.0
>      > 4.0 4.0 4.0
>      > 5.0 5.0 5.0
>      > LINES 3 9
>      > 2 0 1
>      > 2 2 3
>      > 2 4 5
>      >
>      > In this case after this has been read into paraview, I want to be
>     able
>      > pass this data to my filter and identify which points are being used
>      > by which lines. I was thinking of assigning scalars to each line
>     which
>      > might be a unique id, but am not sure how to implement that or if
>     that
>      > is a correct approach.
>      >
>      > Thanks,
>      > Bikash


More information about the ParaView mailing list