[vtkusers] Associating vtkCurvatures to surface structure
David Doria
daviddoria at gmail.com
Thu Nov 4 08:10:36 EDT 2010
>
> Thanks! Not exactly what I'm looking for (I don't need to colour the
> surface - I need the numbers), but I think I get the drill: set active
> scalars, then extract them on a point-by-point basis (i.e., per vertex).
> All that remains is finding all triangles and edges sharing that
> vertex... the edges I think I would get from vtkExtractEdges, but any
> hints about triangles would be greatly appreciated.
>
> Thanks!
>
>
You don't need to set anything as active just to get the numbers:
vtkFloatArray* yourNumbers =
vtkFloatArray::SafeDownCast(polydata->GetPointData()->GetArray("YourArray");
(where of course vtkFloatArray is replaced by whatever type the array
actually is)
Getting all triangles that share a vertex can be done with
vtkPolyData::GetPointCells:
http://www.vtk.org/doc/nightly/html/classvtkPolyData.html#ac5d9684045b6bd80c5973fe8ae1d914b
<http://www.vtk.org/doc/nightly/html/classvtkPolyData.html#ac5d9684045b6bd80c5973fe8ae1d914b>Then
to get the edges, for each cell that you found from GetPointCells, you can
use GetCellPoints to determine the edges.
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101104/1e11e7a5/attachment.htm>
More information about the vtkusers
mailing list