how to identify curve from array?

For general discussion related FlowStone
Post Reply
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

how to identify curve from array?

Post by Nubeat7 »

hi all,

in my actual project i'm drawing curves with the graphic path, the points for the curve are coming from an array,
now i need to identify the array index which holds the curvepoints of the curve when the mouse pointer is over one of the curves.

there are 2 methodes which should make this possible, 'isVisible' and 'isOutlineVisible' - i just don't know how to use this methodes, i tried different variations but failed..

i know there were some examples in the forum once but with the absolutely useless search function the forum provides i couldn't find them :( can't this be fixed one day!!!

any help would be great

i attached a schematic which shows the basic idea
Attachments
outline visible.fsm
(1.76 KiB) Downloaded 850 times
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: how to identify curve from array?

Post by tulamide »

Nubeat7 wrote:hi all,

in my actual project i'm drawing curves with the graphic path, the points for the curve are coming from an array,
now i need to identify the array index which holds the curvepoints of the curve when the mouse pointer is over one of the curves.

there are 2 methodes which should make this possible, 'isVisible' and 'isOutlineVisible' - i just don't know how to use this methodes, i tried different variations but failed..

i know there were some examples in the forum once but with the absolutely useless search function the forum provides i couldn't find them :( can't this be fixed one day!!!

any help would be great

i attached a schematic which shows the basic idea


I made some modifications needed to make it work. You've created two GraphicsPaths but only one reference (@path). But isVisible/isOutlineVisible are methods of the GraphicsPath. The demonstration uses mousedown event to output the integer, since I started that way. But it shouldn't be a problem.

However, I found that both methods don't work as expected from me. Imagine a horizontal line, with that line isVisible only reports point in upper half, while isOutlineVisible reports point in lower half. Maybe one should tweak with the last parameter of both methods, which would be a view parameter. But I wanted to give you something at hand, without testing all too long.
Attachments
outline visible.fsm
(1.81 KiB) Downloaded 844 times
"There lies the dog buried" (German saying translated literally)
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: how to identify curve from array?

Post by MyCo »

I've posted an example that shows the difference between isOutlineVisible and isVisible long time ago:
viewtopic.php?f=2&t=1035#p2976

Here's a possible solution for your problem
Attachments
outline visible (MyCo).fsm
(1.83 KiB) Downloaded 877 times
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: how to identify curve from array?

Post by MyCo »

BTW: found another cool demo on my drive, not sure if I've posted this already. It's about 1 1/2 years old
Attachments
Curve Segment HitTest.fsm
(120.61 KiB) Downloaded 876 times
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: how to identify curve from array?

Post by Nubeat7 »

thank you guys, this helped a lot.

the curve segment hit brought me directly to what i need, thanks myco for sharing and linking the thread.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: how to identify curve from array?

Post by tulamide »

So, simply said, both only work on closed graphics paths. Good to know! Thanks, Myco!
"There lies the dog buried" (German saying translated literally)
Post Reply