[vtkusers] associating data to polydata
Sébastien MARAUX
maraux at ondim.fr
Tue Mar 9 09:08:33 EST 2004
Hello, I am studying the problem of associating data to vtkPolyData
What happens if, for example, you call vtkTriangleFilter on a
vtkPolyData composed of several polygons, each being assigned an ID in
the vtkPolyData main field data array?
Is it necessary to handle the inheritance of those Ids to all the
created triangles, which means handling polygons one by one and
recreating a vtkPolyData for input for each of them.
This issue occurs with nearly all complex processing, and it is a big
amount of work to associate Ids with each new cells created (I am also
thinking about banded contours, etc)
Sebastien
-----Message d'origine-----
De : vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] De la part
de Malcolm Drummond
Envoyé : mercredi 25 février 2004 15:33
À : vtkusers
Objet : Re: [vtkusers] associating datra to polydata
Hi Sebastien
There is the issue of 'compound' objects: ie when you glyph data
associated with points or when you tesselate or otherwise decompose
concave polygons and/or polygons with internal boundaries into simpler
primitives. In both cases, to avoid a massive duplication of data, I
append an array that just stores indexes into the original cell-ids or
data (which I usually keep out of the pipeline). When a pick takes
place, the cell-id is used as an index into the stored indexes - and so
on to the original data.
I visualize a lot of mining layouts that use an arc/node model similar
to many GIS. In my reader I build the polygon boundaries (internal and
external) and then tessellate, after which I add the triangular cells to
the polydata. I have two arrays in the cell-data, one for the scalar
value of interest and the other for the original polygon id, which are
also updated as the triangles are added. I've also used this approach to
visualize polygon data from shapefiles and associated dBase tables.
I've used a similar technique glyphing seismic events from an access
database. I wrote my own glyph filter but I see there is an option in
vtkGlyph3D to store ids in the point data (which you could still get at
using vtkPolyData::GetCellPoints if you used a cell picker).
I think the most efficient approach is to only put data relevant to the
visualization into the pipelines (plus one array for indexes if
required) - keep additional data upstream or out of the pipeline and use
indexing to get it when required.
HTH
Malcolm
----- Original Message -----
From: Sébastien MARAUX <mailto:maraux at ondim.fr>
To: vtkusers at vtk.org
Sent: Tuesday, February 24, 2004 4:40 PM
Subject: [vtkusers] associating datra to polydata
Hello,
I am working in GIS field, where many polygons/lines or points groups
are associated with data (data for points, for lines, for polygons, and
for general group information).
What is the simpliest way of keeping my associated information (which
can be float, double, string arrays) when I convert a GIS format into a
vtkPolyData + ???(for associated information)
And keep the link between information and what it is relevant to (points
with their data, lines with their data, general group data) ?
Seb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040309/e7949108/attachment.htm>
More information about the vtkusers
mailing list