I create a vtkContourWidget instance, and I want to know if the mouse is hovering near the endpoint of contour. The code like this:
pos = interactor.GetEventPosition()
state = contourRep.ComputeInteractionState(pos[0], pos[1])
Even though I move mouse on the endpoint, the state always return 0. Is my function is wrong or send the wrong parameter to ComputeInteractionState().
To determine if it is due to the incorrect position passed in by the mouse,I have traversed all endpoints on the cntour, and only the first endpoint returned a state value of 1.
num = contourRep.GetNumberOfNodes()
for i in range(num):
pos = [0, 0]
contourRep.GetNthNodeDisplayPosition(i, pos)
print(i, contourRep.ComputeInteractionState(int(pos[0]), int(pos[1])))
Any help would be appreciated.