MCPcopy Create free account
hub / github.com/MapServer/MapServer / PointInPolygon

Function PointInPolygon

renderers/agg/src/clipper.cpp:116–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114//------------------------------------------------------------------------------
115
116bool PointInPolygon(const IntPoint &pt, PolyPt *pp)
117{
118 PolyPt *pp2 = pp;
119 bool result = false;
120 do
121 {
122 if ((((pp2->pt.Y <= pt.Y) && (pt.Y < pp2->prev->pt.Y)) ||
123 ((pp2->prev->pt.Y <= pt.Y) && (pt.Y < pp2->pt.Y))) &&
124 (pt.X - pp2->pt.X < (pp2->prev->pt.X - pp2->pt.X) * (pt.Y - pp2->pt.Y) /
125 (pp2->prev->pt.Y - pp2->pt.Y))) result = !result;
126 pp2 = pp2->next;
127 }
128 while (pp2 != pp);
129 return result;
130}
131//------------------------------------------------------------------------------
132
133bool SlopesEqual(TEdge &e1, TEdge &e2)

Callers 1

JoinCommonEdgesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected