[vtkusers] Why GetNumberOfCells return 0

Patric.Weis at mycrona.de Patric.Weis at mycrona.de
Fri Sep 1 07:18:17 EDT 2000


Hi Guido,

Insert

    cone->Update();

before

    cells=cone->GetOutput()->GetNumberOfCells();

or first render the cone by e.g.

    pRenderWindow->Render();

Source objects like vtkConeSource are objects that begin the visualization
pipeline. If you have not yet rendered them, you must use Update() to bring
the network up-to-date. For further information please see 'Implicit
Control of Execution' on pages 102-103 of the book 'The Visualization
Toolkit 2nd Edition'.

Hope it works!

Patric Weis
MYCRONA GmbH

- - - Original Message - - -


                                                                                                                 
                    Guido Ioele                                                                                  
                    <g.ioele at mail-arts.sssu        An:     VTKMAIL <vtkusers at public.kitware.com>                 
                    p.it>                          Kopie:                                                        
                    Gesendet von:                  Thema:  [vtkusers] Why GetNumberOfCells return 0              
                    vtkusers-admin at public.k                                                                      
                    itware.com                                                                                   
                                                                                                                 
                                                                                                                 
                    01.09.00 11:59                                                                               
                                                                                                                 
                                                                                                                 


   Hi all,
   could you give me an aswer for this:
   ......
   vtkConeSource *cone = vtkConeSource::New();
       cone->SetResolution(16);
       cone->SetRadius(3.0);
       cone->SetHeight(7.0);
   int cells;
   cells=cone->GetOutput()->GetNumberOfCells();
   cout<<cells;
   ...........
   Why I retrieve cells=0 ?

   Thanks in advance
   Guido

   --
   **********************************
   Guido Ioele
   Electronic Engineer

   Centro INAIL RTR
   Via della Vetraia 7
   55049 Viareggio (LU)
   Italy

   Voice: +39-0584-385371
   Fax:   +39-0584-385359
   E-mail: g.ioele at mail-arts.sssup.it
   **********************************



   _______________________________________________
   This is the private VTK discussion list.
   Please keep messages on-topic. Check the FAQ at: <
   http://public.kitware.com/cgi-bin/vtkfaq>
   Follow this link to subscribe/unsubscribe:
   http://public.kitware.com/mailman/listinfo/vtkusers








More information about the vtkusers mailing list