[vtkusers] GetNumberOfPoints() returns 0

Tim Hutton tim.hutton at gmail.com
Mon May 15 04:26:23 EDT 2006


Hi Xiaobin,

VTK uses a pipeline architecture, so filters and sources do not get
executed until they are needed. see:

http://www.vtk.org/Wiki/VTK_FAQ#Why_does_this_filter_not_produce_any_output.3F_eg._GetPoints.28.29.3D.3D0

The quick answer is to call Sphere->Update.

Tim

On 5/15/06, Xiaobin Wang <xiaobin2006 at gmail.com> wrote:
> Hi users,
>
> I have got a very wierd problem .
> the code segment ---------------
>    vtkSphereSource *Sphere= vtkSphereSource::New();
>    Sphere->SetRadius(10);
>    Sphere->SetCenter(0,0,0);
>     vtkDoubleArray  *pDouble = vtkDoubleArray::New();
>     N=Sphere->GetOutput()->GetNumberOfPoints();
>     printf("%d,\n",N);
>
> I expect N is a finite number of points of the polygonal data representing
> the sphere.
> But  i got N =0!
> I really confused .can somebody help?
> thanks for your time ...
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>


-- 
Tim Hutton - http://www.sq3.org.uk

Take the Organic Builder challenge -
http://www.sq3.org.uk/Evolution/Squirm3/OrganicBuilder/



More information about the vtkusers mailing list