New topic: 

Draw a Path Between Two coordinates

<http://forums.realsoftware.com/viewtopic.php?t=47899>

         Page 1 of 1
   [ 11 posts ]                 Previous topic | Next topic          Author  
Message        DaveS          Post subject: Draw a Path Between Two 
coordinatesPosted: Thu May 16, 2013 4:08 pm                                 
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4882
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                ktekinay          Post subject: 
Re: Draw a Path Between Two coordinatesPosted: Thu May 16, 2013 4:26 pm         
                        
Joined: Mon Feb 05, 2007 5:21 pm
Posts: 595
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                timhare          Post subject: 
Re: Draw a Path Between Two coordinatesPosted: Thu May 16, 2013 4:47 pm         
                
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12329
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                DaveS          Post subject: 
Re: Draw a Path Between Two coordinatesPosted: Thu May 16, 2013 4:47 pm         
                        
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4882
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                ktekinay          Post subject: 
Re: Draw a Path Between Two coordinatesPosted: Thu May 16, 2013 4:54 pm         
                        
Joined: Mon Feb 05, 2007 5:21 pm
Posts: 595
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                DaveS          Post subject: 
Re: Draw a Path Between Two coordinatesPosted: Thu May 16, 2013 4:56 pm         
                        
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4882
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                DaveS          Post subject: 
Re: Draw a Path Between Two coordinatesPosted: Thu May 16, 2013 4:59 pm         
                        
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4882
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                ktekinay          Post subject: 
Re: Draw a Path Between Two coordinatesPosted: Thu May 16, 2013 5:15 pm         
                        
Joined: Mon Feb 05, 2007 5:21 pm
Posts: 595
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                DaveS          Post subject: 
Re: Draw a Path Between Two coordinatesPosted: Thu May 16, 2013 5:38 pm         
                        
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4882
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                mikecotrone          Post 
subject: Re: Draw a Path Between Two coordinatesPosted: Fri May 17, 2013 12:17 
am                         
Joined: Tue Mar 05, 2013 2:33 pm
Posts: 60
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                DaveS          Post subject: 
Re: Draw a Path Between Two coordinatesPosted: Fri May 17, 2013 7:03 am         
                        
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4882
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             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 11 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to