feat(actor.objectName): adding objectName as an actor property#3384
feat(actor.objectName): adding objectName as an actor property#3384GeorgeFuller wants to merge 2 commits intoKitware:masterfrom
Conversation
|
In vtk C++ those methods are on the vtkObject class, not on the actor. Which means, you should add them on the obj macro, not on the actor. Also by default vtk.js let you add any attribute by calling |
finetjul
left a comment
There was a problem hiding this comment.
please do not commit package-lock.json
…objectName from actor
This is good to know, works perfectly for my use case, doesn't really look this this PR is needed (for me anyway). I didn't notice that it was actually in Object on vtk, would you like me to move it to macros? |
|
Let's close it for now. If people want that API on vtkObject, we will add it in the macro. But otherwise, vtk.js flexibility let you add anything that don't conflict with the object, so many users should be good. |
Context
There is currently no easy way to identify an actor when it is picked out of context of it's pipeline.
Results
GetObjectName and SetObjectName can now be called on actors.
Changes
Added objectName to the default values of actor along with a macro for get and set. This provides a feature that the c++ vtk library already has and matches its naming convention.
Testing
Tested within the context it was required, the CellPicker example, the example now console logs the name applied to the cone source when it is clicked.