[vtkusers] vtkActor ID

David Doria daviddoria at gmail.com
Tue Jun 4 07:49:16 EDT 2013


On Mon, Jun 3, 2013 at 6:57 PM, Max <smapersmaper at gmail.com> wrote:
> Hi David,
> Thank you for your answer,
> Maybe my explanation was too vague,
> Suppose I have 2 groups, each has 3 vtkSpheres.
> I want to change color of the entire group a when a vtkSphere from group a
> is picked
> And the same for group b.
> So one solution for that is having Id a for every object from group a
> And b for every object from group b and then
> When clicked, check the id of the clicked item and change the color of all
> objects with the same id
> But how can I attach id?
>
>
> Thank you,
> Max

How big are the groups? If they are small, I'd just use a
vector<vector<vtkActor*>> and traverse the collections looking for the
picked actor's address, then set the color of all of the actors in the
particular vector<vtkActor*> where you founded the picked one.

David



More information about the vtkusers mailing list