You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: polygon_test_point_inside.h
  3. /////////////////////////////////////////////////////////////////////////////
  4. #ifndef __WXWINDOWS__
  5. // define here wxPoint if we want to compile outside wxWidgets
  6. class wxPoint
  7. {
  8. public:
  9. int x, y;
  10. };
  11. #endif
  12. class CPOLYGONS_LIST;
  13. /**
  14. * Function TestPointInsidePolygon
  15. * test if a point is inside or outside a polygon.
  16. * @param aPolysList: the list of polygons
  17. * @param aIdxstart: the starting point of a given polygon in m_FilledPolysList.
  18. * @param aIdxend: the ending point of the polygon in m_FilledPolysList.
  19. * @param aRefx, aRefy: the point coordinate to test
  20. * @return true if the point is inside, false for outside
  21. */
  22. bool TestPointInsidePolygon( const CPOLYGONS_LIST& aPolysList,
  23. int aIdxstart,
  24. int aIdxend,
  25. int aRefx,
  26. int aRefy);
  27. /**
  28. * Function TestPointInsidePolygon (overlaid)
  29. * same as previous, but mainly use wxPoint
  30. * @param aPolysList: the list of polygons
  31. * @param aCount: corners count in aPolysList.
  32. * @param aRefPoint: the point coordinate to test
  33. * @return true if the point is inside, false for outside
  34. */
  35. bool TestPointInsidePolygon( const wxPoint* aPolysList,
  36. int aCount,
  37. const wxPoint &aRefPoint );