Results 1 to 8 of 8

Thread: Somewhat OT, line routing for diagramming tool

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Somewhat OT, line routing for diagramming tool

    Hi everyone,

    Sorry, this is a little off topic. I have a "boxes and lines" type program using QGraphicsView, where people can drag boxes and connect them with "smart" connectors. Just like Visio, openoffice draw, Dia, etc. A connector line can be attached from any side of one box to any side of another box, and be routed so that it won't cross the start or end box. (I've attached a pic of some example routings it would do)

    I've got a simple implementation, but it's not smart at all, just does a sort of ok job most of the time. What I want is something that can connect two boxes with a line and respect some basic rules of symmetry (like putting the corners halfway between two points)...

    It seems like such a simple problem, but I can't for the life of me figure out a good way to do it. I thought about just special casing all the different scenarios, but that just seems like it'll be a mess. In the past I've also implemented an A* pathfinding algorithm, but it seems way overkill for something as simple as this, and I don't know how I would divide up the space into a coarser grid if the start and end points can be at any pixel coordinates...

    So, anyone done this before? I must not be searching for the right terms because my google searching is bringing up nothing and I'm getting really discouraged... Any help greatly appreciated.
    Attached Images Attached Images

Similar Threads

  1. QTcpSocket exception.
    By Fastman in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2008, 13:51
  2. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  3. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.