Acquire 3D Point data using LineWidtget2

Hello,

I’m using VTK9 and VS2015 C++
and I loaded Ply Data and Line in 3D Space using LineWidget2.

I want to get the coordinate (=X, Y) and height values (=Z) of 3D Point included in Line drawn with LineWidget2.

Finally, I want to take the X, Y, and Z values of the points included in the line and express it as a profile.

Is this possible?
Please let me know if there is a way. please.

Thanks!