Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Dec 12, 2019 3:28 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Draw a Path Between Two coordinates
PostPosted: Thu May 16, 2013 4:08 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
I have a need to draw a path between X1,Y1 and X2,Y2
using ONLY horizontal or vertical lines

With ONE other caveat.... each node will have an ID (1,2,3,4).... and that ID will determine the INITIAL or FINAL direction the path line must take.

+---0---+
| |
3 1
| |
+---2---+


If X1,Y1 has an ID of
0 - path must start VERTICAL UP
1 - path must start HORIZONTAL right
2 - path must start VERTICAL DOWN
3 - path must start HORIZONTAL left

regardless of where X2,Y2 is


and for the destination of X2,Y2 they must end similar

0 - path must end VERITCAL down
1 - path must end HORIZONTAL left
2- path must end VERTICAL UP
3 - path must end HORIZONTAL right

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw a Path Between Two coordinates
PostPosted: Thu May 16, 2013 4:26 pm 
Offline
User avatar

Joined: Mon Feb 05, 2007 5:21 pm
Posts: 600
Location: New York, NY
So you could, theoretically, have X1,Y1.ID = 1 and X2,Y2.ID = 3? If so, by what criteria would it determine the path?
+-------+
| 0----|
|
+----1


Or would it always be logical, so HorizontalLeft would lead to VerticalDown, for example?

_________________
Kem Tekinay
MacTechnologies Consulting
http://www.mactechnologies.com/

Need to develop, test, and refine regular expressions? Try RegExRX.


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw a Path Between Two coordinates
PostPosted: Thu May 16, 2013 4:47 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Sounds a little like routing traces between pins on a pc board. Do you have any additional criteria, such as you cannot touch any other existing features already in the picture?


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw a Path Between Two coordinates
PostPosted: Thu May 16, 2013 4:47 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
you are correct ... a path like you showed could very well be created.

A horizontal(left/right) always connects to a vertical(up/down) and vice-versa

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw a Path Between Two coordinates
PostPosted: Thu May 16, 2013 4:54 pm 
Offline
User avatar

Joined: Mon Feb 05, 2007 5:21 pm
Posts: 600
Location: New York, NY
So the path I presented would be comprised of 6 nodes (or more), not just the two I illustrated, yes? Are you looking for the Graphics code for this? Are the nodes a custom class?

_________________
Kem Tekinay
MacTechnologies Consulting
http://www.mactechnologies.com/

Need to develop, test, and refine regular expressions? Try RegExRX.


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw a Path Between Two coordinates
PostPosted: Thu May 16, 2013 4:56 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
It is similar to PC routing.... or more precisely VISIO routing :)

Avoiding other shapes would be a perk.... (and I DO have a list of rectangles that could be avoided)

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw a Path Between Two coordinates
PostPosted: Thu May 16, 2013 4:59 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
ktekinay wrote:
So the path I presented would be comprised of 6 nodes (or more), not just the two I illustrated, yes? Are you looking for the Graphics code for this? Are the nodes a custom class?




Given X1,Y1 and X2,Y2 .... return a list of X,Y,D values where D is the Direction (Horizontal or Vertical) and I can merge that with my existing classes...

I have all the rest of the drawing, editing, moving, adding, deleteing of shapes, images etc working.... and have been putting off the routing hoping I could come up with a novel approach... which so far I have not

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw a Path Between Two coordinates
PostPosted: Thu May 16, 2013 5:15 pm 
Offline
User avatar

Joined: Mon Feb 05, 2007 5:21 pm
Posts: 600
Location: New York, NY
So given node1 and node2, you would get back two nodes, nodeX and nodeY such that drawing would be:

node1->nodeX, nodeY->node2

The coordinates of nodeX and nodeY would be identical, only the D would differ, right?
> node1----nodeX/Y
> |
> |
> node2


In that case, if node1.X = 0, node1.Y = 0, node1.ID = 1, and node2.X = 10, node2.Y = 10, node2.ID = 0, then nodeX.X = 0, nodeX.Y = 10, nodeX.ID = 3, and nodeY.X = 0, nodeY.Y = 10, and nodeY.ID = 2. Right so far?

_________________
Kem Tekinay
MacTechnologies Consulting
http://www.mactechnologies.com/

Need to develop, test, and refine regular expressions? Try RegExRX.


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw a Path Between Two coordinates
PostPosted: Thu May 16, 2013 5:38 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
>Node 1 [0,0]-----[10,0] NodeX
> ID=1 |
> |
> [10,10] Node 2 ID=0


True =Horizontal False=Vertical
a list of points
[0,0], TRUE
[10,0],FALSE
[10,10] FALSE

This would always start and end with the provided X1,Y1 and X2,Y2 and the direction is leaves that point

Deltas can of course be infered by direction change or subtracting node coordinates :)




Some Examples

http://www.rdsisemore.com/nodes.pdf

the "x" is for phase 2 :)

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw a Path Between Two coordinates
PostPosted: Fri May 17, 2013 12:17 am 
Offline

Joined: Tue Mar 05, 2013 2:33 pm
Posts: 64
Location: Greensboro, North Carolina
DaveS wrote:
>Node 1 [0,0]-----[10,0] NodeX
> ID=1 |
> |
> [10,10] Node 2 ID=0


True =Horizontal False=Vertical
a list of points
[0,0], TRUE
[10,0],FALSE
[10,10] FALSE

This would always start and end with the provided X1,Y1 and X2,Y2 and the direction is leaves that point

Deltas can of course be infered by direction change or subtracting node coordinates :)




Some Examples

http://www.rdsisemore.com/nodes.pdf

the "x" is for phase 2 :)


Dave I'm curious if you have implemented zoom capability?

_________________
Mike Cotrone - CCIE #8411 R&S, CCIE #8411 Voice
Chief Technology Officer
Onepath Systems, LLC


Real Studio 2012 R2.1 Enterprise, Mac OS, Windows, Ubuntu Linux


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw a Path Between Two coordinates
PostPosted: Fri May 17, 2013 7:03 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
mikecotrone wrote:
Dave I'm curious if you have implemented zoom capability?


Yup.... from 25% to 400% and all increments in between

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group