I am currently a student and trying to design a Visual C++ application to allow me to visually insert an oriented graph in order to create a text file with the graph's matrix. At this point I have created an onClick event to create nodes and have used the form's Paint event to draw the nodes. I have also inserted the conditions to avoid nodes from overlapping.
I am currently working on creating the links between nodes. The problem that I have encountered is that the line that unites two nodes crosses another node. I consider that writing an algorithm to detect overlapping and calculate how much the line needs to arch in order to avoid that is too tedious in this situation. Therefore I thought about creating a line that can be arched by the user by clicking and dragging it to the left or right, however I have had problems finding any tutorials on how to do this. So if anyone has ever had to introduce this kind of arching line in a project or has any idea where I could find some information about this I would deeply appreciate it.
Mentions:
1) please do not recommend any fancy graphics libraries for doing this, as I am not interested in installing 3rd party stuff for this program. The function I want to insert the code into is named smth like form1_onPaint, so I would like to keep it strictly to the C++ standard libraries.
2) I know I said I am interested in arching a line through click and drag, however if someone could suggest another viable solution to this, such as a function that detects overlapping in onPaint events or anything else that could be of use to solve this it would be of great help.