Timer and Mouse call back connection

What I am trying to do is very simple in concept, but I don’t know how to do it in VTK as a beginner.
I have picked up a point in a 3D image using Mousecallback. The point I am calling seed point gives me world coordinates and point ID.
Now I want to use that seed point and find the nearest point and draw a line between two…the new point is now seed point and have to iterate this in the next timer callback.

I can share the codes I have written if necessary.