2008-11-14 22:40:31 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: polygon_test_point_inside.h
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2010-09-20 16:21:47 +00:00
|
|
|
#ifndef __WXWINDOWS__
|
|
|
|
// define here wxPoint if we want to compile outside wxWidgets
|
|
|
|
class wxPoint
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int x, y;
|
|
|
|
};
|
|
|
|
#endif
|
2013-07-19 18:27:22 +00:00
|
|
|
class CPOLYGONS_LIST;
|
|
|
|
|
2010-11-12 16:59:16 +00:00
|
|
|
/**
|
|
|
|
* Function TestPointInsidePolygon
|
2008-11-14 22:40:31 +00:00
|
|
|
* test if a point is inside or outside a polygon.
|
|
|
|
* @param aPolysList: the list of polygons
|
2010-09-20 16:21:47 +00:00
|
|
|
* @param aIdxstart: the starting point of a given polygon in m_FilledPolysList.
|
|
|
|
* @param aIdxend: the ending point of the polygon in m_FilledPolysList.
|
|
|
|
* @param aRefx, aRefy: the point coordinate to test
|
2008-11-14 22:40:31 +00:00
|
|
|
* @return true if the point is inside, false for outside
|
|
|
|
*/
|
2013-05-08 18:20:58 +00:00
|
|
|
bool TestPointInsidePolygon( const CPOLYGONS_LIST& aPolysList,
|
|
|
|
int aIdxstart,
|
|
|
|
int aIdxend,
|
|
|
|
int aRefx,
|
|
|
|
int aRefy);
|
2010-11-12 16:59:16 +00:00
|
|
|
/**
|
|
|
|
* Function TestPointInsidePolygon (overlaid)
|
2010-09-20 16:21:47 +00:00
|
|
|
* same as previous, but mainly use wxPoint
|
|
|
|
* @param aPolysList: the list of polygons
|
|
|
|
* @param aCount: corners count in aPolysList.
|
|
|
|
* @param aRefPoint: the point coordinate to test
|
|
|
|
* @return true if the point is inside, false for outside
|
|
|
|
*/
|
2014-05-04 17:08:36 +00:00
|
|
|
bool TestPointInsidePolygon( const wxPoint* aPolysList,
|
2010-09-20 16:21:47 +00:00
|
|
|
int aCount,
|
2014-05-04 17:08:36 +00:00
|
|
|
const wxPoint &aRefPoint );
|