[vtkusers] vtkActorCollection how this works?

Francois Bertel francois.bertel at kitware.com
Mon Mar 30 12:14:29 EDT 2009


Did you use InitTraversal()?

Typically, iterating over a vtkCollection should look like that:


vtkCollection *c;
vtkObject *o;

c->InitTraversal();
o=c->GetNextItem();
while(o!=0)
  {
  // process o
  // ...

  // next step
  o=c->GetNextItem();
  }


On Mon, Mar 30, 2009 at 12:03 PM, Giancarlo Amati
<ilferraresebono at hotmail.it> wrote:
> Hello everybody,
>
> I'm using the class vtkPIcker to pick an object in the scene. From the class
> picker I'm getting the vtkActorCollection using picker->GetActors()....
> and so I use
>
> vtkActor *act = vtkActor::New();
>
>
> act = actColl->GetNextItem();
>
> to access the list of the actors but  the pointer I get back is NULL,  while
> if I use pick->GetActor (without the final S) I get the pointer to the
> actor.
> I want to apply a transformation to the sselected actor so...what's the
> problem with the collection?
>
> Kind Regards.
> Giancarlo
>
> ________________________________
> Scopri tutte le novità. Scarica Messenger 2009!
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list