Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

how to identify curve from array?

For general discussion related FlowStone

how to identify curve from array?

Postby Nubeat7 » Wed Oct 29, 2014 12:32 am

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 729 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: how to identify curve from array?

Postby tulamide » Wed Oct 29, 2014 1:50 am

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 721 times
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: how to identify curve from array?

Postby MyCo » Wed Oct 29, 2014 9:19 am

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 742 times
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: how to identify curve from array?

Postby MyCo » Wed Oct 29, 2014 9:26 am

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 752 times
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: how to identify curve from array?

Postby Nubeat7 » Wed Oct 29, 2014 11:08 am

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.
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: how to identify curve from array?

Postby tulamide » Fri Oct 31, 2014 12:22 pm

So, simply said, both only work on closed graphics paths. Good to know! Thanks, Myco!
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany


Return to General

Who is online

Users browsing this forum: No registered users and 41 guests