I suspect that this question / concern is addressed somewhere in an example (or reference page) that I haven’t found.
I have a number of actors in my program. I would like to be able to set a name or label for them when I create them so that I can distinguish them from each other when I loop over them in a vtkActorCollection (in order to change properties for some of them).
It’s possible I’m not thinking about this correctly. How can I accomplish my goal of knowing which actor is which?
IMO this is headed in the area of application logic. Typically I’ve used a map or hash to create a lookup between the actor’s address/pointer and additional metadata (such as name) that I’d like to associate with the actor. And of course you can create a two-way data structure so you can go from name to address etc.
I see from the vtkActor reference page that vtkActor inherits from vtkObject. However, when I try to use SetObjectName, I receive a compile message that “class vtkActor has no member named SetObject Name”.
e.g.
vtkNew myActor;
myActor->SetObjectName(“AName”);
I have included both vtkObject.h and vtkActor.h in my header file.
Okay. I must be doing something stupid here. Any ideas as to why this fails for me?