Bezierkurven an Rechtecke andocken und bewegen

kubilay

Grünschnabel
Hallo,

leider bin ich nicht der C#-Hacker, daher bräuchte ich für eine Laborübung eure Hilfe.

Ich muss die unten beschriebene Aufgabe in C# realisieren. Wie muss ich vorgehen. Code-Beispiele sind gerne erwünscht.

Many types of diagrams consist of boxes that are connected with curved lines. Write a software that produces a screen display like the one below. The user can drag each of the boxes with the mouse; a possible result of such an operation is shown in red in the diagram below. Where a connection line enters a rectangle, its tangent forms a right angle with the corresponding sides of the rectangle.

boxes.gif



Apply thorough object-oriented design. Use the built-in curve-drawing functionality of .NET. The number of boxes and the way they are connected may be fixed in your software. If you aim at four points for this assignment, try to come up with a solution that also allows to create boxes and define their connections with the mouse.

mfG

Celal
 
Hi,

würde erstmal den Start/End Punkt berechnen, dann den Mittelpunkt, den 3. Punkt deines BezierSplines und dann entweder eine fertige Bezierfunktion nutzen (glaube sowas gibts schon in .NET bei GDI+ ) oder eben mit deiner eigenen Funktion die Kurve dazwischen zeichnen.

Das ganze musst du natürlich jedes mal neu zeichnen lassen, wenn du mit deiner Maus eins der Objekte bewegst. Also ich würde das mit Panels versuchen zu lösen, indem ich die Panels als Boxen mache, und dazwischen jeweils ein neues Panel erzeuge, welches dann den Bezier für die Boxen hat.

Gruss

MFC OpenGL
 
Zurück