Displaying a point in the Screen On Mouseclick

How to display the point which was clicked on the screen. And how to connect these points to diplay the line.. Please Help

Thanks & Regards

arkoala's picture

I've just got it some weeks ago.

Take a glance at:

If this is what you need, I could help you deeper although all the code is there.

Sharjith Naramparambath's picture

If you are on windows there is a function ConvertClickToPoint in the MFC samples. You can use it directly to get the gp_Pnt at the mouse click, in the InputEvent method. Then you can use it to create AIS_Point and display it. Remember, all this has to be done on mouse lbutton down event if you have written code from scratch. If you are using the wizard generated code or cut-paste from samples then InputEvent in the View class is the best place to put it.

Hope this helps

N. Sharjith

Vidhyan's picture

Thanks for your Reply

Vidhyan's picture

What is " InputEvent in the View class "

Sharjith Naramparambath's picture

Sorry, my mistake. It is in the Doc class. In your workspace the class that represents the Document generally named CXXXDoc.cpp where XXX is your project name. There are methods like InputEvent, DragEvent, ShiftInputEvent etc. Or search using these keywords.