[vtkusers] associating data to polydata
Malcolm Drummond
malcolm at geovision.co.za
Wed Mar 10 05:41:54 EST 2004
Hi Sebastien
I handled the polygons one by one as I was using GLU tessellation and could not see a way of sorting out which triangles belonged to which polygon if I passed more than one at a time. I needed to know this in order to assign scalar values + id.
With the current data-structures I don't see a way to provide lookup capabilities other than propagating the original ids in an extra array. Once the array is there, most of the filters will continue this propagation for you, but when you first create the polydata this would be your responsibility. You mention vtkTriangle filter, this should copy the polygon cell-data to respective triangles but it has no way of handling internal boundaries - or is that not an issue for you?
First prize would be a new cell-type comprising multiple triangles (like a surface-patch), each triangle would have it's own sub-id but also an id for the whole cell (or 'patch') - vtkTrisolation or something like that. I think it would be fairly complicated to implement as it would require handling of variable number of faces, in contrast to current 3D cells which have fixed number of faces. This could be used for glyphing as well as polygon decomposition and would allow direct mappings from cell-id into external data. I think it would be useful for importing CAD (polyface mesh etc.) as well as GIS. Maybe there are reasons why this would not be practical.
Regards
Malcolm
----- Original Message -----
From: Sébastien MARAUX
To: vtkusers at vtk.org ; 'Malcolm Drummond'
Sent: Tuesday, March 09, 2004 4:08 PM
Subject: RE : [vtkusers] associating data to polydata
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
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/20040310/c2f6db70/attachment.htm>
More information about the vtkusers
mailing list