Results 1 to 20 of 20

Thread: Working with polygon regions [Resolved]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545

    Working with polygon regions [Resolved]

    Hi,

    I've created a program that displays DXF maps and allows the user to zoom, add markup etc.

    In the near future I am going to have to implement a feature that allows the user to draw one or more POLYGON shaped region (meaning it could be triangle, square, or any other weird shape you can imagine!). These regions would be stored in a database or text file (which isn't necessariliy important right now) and from time to time I would need to determine what regions a specific X and Y coordinate on this map belong to.

    What I'm looking for, is some ideas about how I would accomplish this. It would be easy as pie to figure this out if the regions were all square, but this isn't the case.

    In case you are confused as to what I need to do, I am including here an example of what I'm talking about.



    As you can see from this example, Point A would belong to region 1 only, point B would belong to Regions 2, 3, and 4, Point C would belong to regions 1 and 4, and finally Point D belongs to no regions.

    It's easy to visualize this, but how the heck do you program it?

    I appreciate any ideas or suggestions you may have!
    Last edited by ae_jester; May 8th, 2003 at 12:06 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width