Page 1 of 1
how to identify curve from array?
Posted: Wed Oct 29, 2014 12:32 am
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
Re: how to identify curve from array?
Posted: Wed Oct 29, 2014 1:50 am
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.
Re: how to identify curve from array?
Posted: Wed Oct 29, 2014 9:19 am
by MyCo
I've posted an example that shows the difference between isOutlineVisible and isVisible long time ago:
viewtopic.php?f=2&t=1035#p2976Here's a possible solution for your problem
Re: how to identify curve from array?
Posted: Wed Oct 29, 2014 9:26 am
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
Re: how to identify curve from array?
Posted: Wed Oct 29, 2014 11:08 am
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.
Re: how to identify curve from array?
Posted: Fri Oct 31, 2014 12:22 pm
by tulamide
So, simply said, both only work on closed graphics paths. Good to know! Thanks, Myco!