I have a 2D distance widget and 3D distance widget. I want to pick them by left button click. I’ve done well the distance widget on 2D image but I cannot pick the 3D one(vtkDistanceRepresentation3D) in opengl window.
Here is my snippet. The path and picked actor is None. maybe my problem is I cannot set the correct 3d widget’s actor.
# add distance widget actor to picker list interactor.GetPicker().AddPickList(measure_widget.GetDistanceRepresentation().GetGlyphActor()) def leftButtonPressEvent(self, obj, event): click_pos = self.GetInteractor().GetEventPosition() picker = self.GetInteractor().GetPicker() picker.Pick(click_pos, click_pos, 0, self.GetDefaultRenderer()) path = picker.GetPath() # doen't go through if if path: node = path.GetFirstNode() actor = node.GetViewProp()
I tried my interactor default picker and vtkPropPicker and also vtkPicker.
Can anyone help me to pick my 3D distance widget?