I have an image actor on which different tools like distance or angle may be placed. Trying to integrate a feature where user can remove individual tools by clicking on them. It is Qt IDE language c++. Below is my code snippet
int* clickPos = renderWindowInteractor->GetEventPosition();
vtkNew<vtkPropPicker> picker;
picker->Pick(clickPos[0], clickPos[1], 0, renderer);
double* pos = picker->GetPickPosition();
qDebug()<<"Pick position (world coordinates) :"<<pos[0]<<pos[1];
auto pickedProp = picker->GetViewProp();
if(pickedProp == nullptr){
qDebug()<<"No prop picked";
}else{
qDebug()<<"Picked prop:"<<pickedProp;
if(pickedProp!=actor // image actor shouldn't be removable
{
renderer->RemoveViewProp(pickedProp);
//Doesn't remove handles at end points
}
}
I have this placed in event filter, for left button down event - so that position may be caught. However the problem is - deleting the picked prop doesn’t delete the handles at the end - which are used to pick and reposition the tool. How to delete those as well while removing the prop?