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

Method AddPolyPt

renderers/agg/src/clipper.cpp:1375–1404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1373//------------------------------------------------------------------------------
1374
1375PolyPt* Clipper::AddPolyPt(TEdge *e, const IntPoint &pt)
1376{
1377 bool ToFront = (e->side == esLeft);
1378 if( e->outIdx < 0 )
1379 {
1380 PolyPt* newPolyPt = new PolyPt;
1381 newPolyPt->pt = pt;
1382 newPolyPt->isHole = IsHole(e);
1383 m_PolyPts.push_back(newPolyPt);
1384 newPolyPt->next = newPolyPt;
1385 newPolyPt->prev = newPolyPt;
1386 e->outIdx = m_PolyPts.size()-1;
1387 return newPolyPt;
1388 } else
1389 {
1390 PolyPt* pp = m_PolyPts[e->outIdx];
1391 if (ToFront && PointsEqual(pt, pp->pt)) return pp;
1392 if (!ToFront && PointsEqual(pt, pp->prev->pt)) return pp->prev;
1393
1394 PolyPt* newPolyPt = new PolyPt;
1395 newPolyPt->pt = pt;
1396 newPolyPt->isHole = pp->isHole;
1397 newPolyPt->next = pp;
1398 newPolyPt->prev = pp->prev;
1399 newPolyPt->prev->next = newPolyPt;
1400 pp->prev = newPolyPt;
1401 if (ToFront) m_PolyPts[e->outIdx] = newPolyPt;
1402 return newPolyPt;
1403 }
1404}
1405//------------------------------------------------------------------------------
1406
1407void Clipper::ProcessHorizontals()

Callers

nothing calls this directly

Calls 3

PointsEqualFunction · 0.85
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected