[vtkusers] HELP!! vtkActorCollection

marisa aurelio asiram00 at hotmail.com
Wed Jun 25 03:27:46 EDT 2003


Hi vtkUsers,

I did a list of actors using vtkActorCollection.
This is a piece of may code:

>vtkActor *imageActor1 = vtkActor::New();
>vtkActor *imageActor2 = vtkActor::New();

>vtkActorCollection *imageActorCollection = vtkActorCollection::New();
>imageActorCollection->AddItem(imageActor1);
>imageActorCollection->AddItem(imageActor2);

Now I want to add my vtkActorCollection to the renderer Window. And I did 
this:
>renderer2->AddActor(imageActorCollection);

But I got an error saying that vtkRenderer does not receive an 
vtkActorCollection.
->>>>'AddActor' : cannot convert parameter 1 from 'class vtkActorCollection 
*' to 'class vtkProp *'


So I did a cicle 'for' to obtain each actor from the vtkActorCollection and 
I add the actor to the renderer:

>int number = imageActorCollection->GetNumberOfPaths();

>for(int j = 0; j<number; j++)
>{
>       renderer2->AddActor(imageActorCollection->GetNextActor());
>}

But when I ask to show the renderer window it doesn't appear anything on the 
window!!

What am I doing wrong ????

Thanks in advance,
Marisa

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail




More information about the vtkusers mailing list