[vtkusers] vtkPointSource output has N points and 1 cell?

David Gobbi david.gobbi at gmail.com
Mon Nov 28 11:36:26 EST 2011


Hi David,

A cell with many verts is a vtkPolyVertex.  It uses half as much memory as
placing the same number of verts in individual cells.

It would be easy to add an option to vtkPointSource so that it places each
point in a different cell, all you would have to do is change the loop that
builds the cells.  This would be preferable to adding a
vtkVertexGlyphFilter, which would add a lot of overhead.

 - David


On Mon, Nov 28, 2011 at 9:10 AM, David Doria <daviddoria at gmail.com> wrote:

> The output of vtkPointSource has the requested number of points and 1
> cell.  I looked in vtkPointSource.cxx and it has:
>
>   newVerts = vtkCellArray::New();
> newVerts->Allocate(newVerts->EstimateSize(1,this->NumberOfPoints));
> newVerts->InsertNextCell(this->NumberOfPoints);
>
> and then goes on to do this in a loop:
>
>  newVerts->InsertCellPoint(newPoints->InsertNextPoint(x));
>
> My question is which type of cell is this that has no connectivity but
> more than 1 point? And why does vtkPointSource not just use a
> vtkVertexGlyphFilter to create an output with the name number of
> vertices as points?
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111128/9f63bb43/attachment.htm>


More information about the vtkusers mailing list