| 1934 | //------------------------------------------------------------------------------ |
| 1935 | |
| 1936 | void 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 | |
| 1969 | void SwapIntersectNodes(IntersectNode &int1, IntersectNode &int2) |
nothing calls this directly
no test coverage detected