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

Method BuildResult

renderers/agg/src/clipper.cpp:1936–1966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1934//------------------------------------------------------------------------------
1935
1936void Clipper::BuildResult(Polygons &polypoly)
1937{
1938 for (PolyPtList::size_type i = 0; i < m_PolyPts.size(); ++i)
1939 if (m_PolyPts[i])
1940 {
1941 m_PolyPts[i] = FixupOutPolygon(m_PolyPts[i]);
1942 //fix orientation ...
1943 PolyPt *p = m_PolyPts[i];
1944 if (p && p->isHole == IsClockwise(p))
1945 ReversePolyPtLinks(*p);
1946 }
1947 JoinCommonEdges();
1948
1949 int k = 0;
1950 polypoly.resize(m_PolyPts.size());
1951 for (unsigned i = 0; i < m_PolyPts.size(); ++i) {
1952 if (m_PolyPts[i]) {
1953 Polygon* pg = &polypoly[k];
1954 pg->clear();
1955 PolyPt* p = m_PolyPts[i];
1956
1957 do {
1958 pg->push_back(p->pt);
1959 p = p->next;
1960 } while (p != m_PolyPts[i]);
1961 //make sure each polygon has at least 3 vertices ...
1962 if (pg->size() < 3) pg->clear(); else k++;
1963 }
1964 }
1965 polypoly.resize(k);
1966}
1967//------------------------------------------------------------------------------
1968
1969void SwapIntersectNodes(IntersectNode &int1, IntersectNode &int2)

Callers

nothing calls this directly

Calls 7

FixupOutPolygonFunction · 0.85
IsClockwiseFunction · 0.85
ReversePolyPtLinksFunction · 0.85
sizeMethod · 0.45
resizeMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected