[vtkusers] vtkPolyData array

Mathieu Malaterre mathieu.malaterre at kitware.com
Mon Mar 7 09:52:47 EST 2005


buonni at freesurf.ch wrote:
> Hi,
> 
> I am pretty new to VTK and I'm struggling with array of vtkPoints and 
> vtkPolyData. I would like to define a data of type (vtkPolyData **array) 
> that I could Initialize as vtkPolyData *array[num] and initialize with 
> *array[i] = vtkPolyData::New();
> All that exercise is needed because I need to view a mesh with many 
> "layers" (they can be selected run time) and at each "layer" I need to 
> associate a color.
> 
> Are thee anybody that could give me a tip?

This is used everywhere in VTK. For instance, Hybrid/vtkLegendBoxActor.cxx:

vtkPolyData **symbol = new vtkPolyData* [num];
...


Make sure to call ->Delete when you call ->New. You can turn 
VTK_DEBUG_LEAKS ON in your VTK cmake cache to check that.

HTH
Mathieu



More information about the vtkusers mailing list