Repository navigation
PolyPathD Child
Seth Hillbrand edited this page Oct 29, 2026
·
2 revisions
Home › clipper.engine.h › PolyPathD › PolyPathD.Child
const PolyPathD* Child(size_t index) const
const PolyPathD* operator [] (size_t index) constChild is perhaps the most explicit way of accessing children (ie nested polygon contours that are contained within Polygon).
The array operator [ ] is another (simpler) way of access children, and iterators can also be used.
Example:
// nice and simple
for (const auto& poly : polytree)
for (const auto& hole : *poly)
{
if (!hole->IsHole() || hole->Level() != 2)
std::cout << "oops!";
}
// or full disclosure
PolyPathDList::const_iterator ppi, ppi2;
for (ppi = polytree.begin(); ppi != polytree.end(); ++ppi)
for (ppi2 = (*ppi)->begin(); ppi != (*ppi)->end(); ++ppi2)
{
const std::unique_ptr<PolyPathD>& hole = *ppi2;
if (!hole->IsHole() || hole->Level() != 2)
std::cout << "oops!";
}
// and other somewhat messy options
const auto& first_poly = polytree.Child(0);
if (first_poly->Count() &&
first_poly->Child(0)->Level() != 2 ||
!first_poly[0].IsHole())
std::cout << "oops!" << std::endl;Copyright © 2010-2025 Angus Johnson. Clipper2 is distributed under the Boost Software License.
Headers
- clipper.h
- clipper.core.h
- clipper.engine.h
- clipper.export.h
- clipper.minkowski.h
- clipper.offset.h
- clipper.rectclip.h
- clipper.triangulation.h
Classes
Data types and structure definitions
- ClipType
- EndType
- FillRule
- JoinType
- Path64
- PathD
- Paths64
- PathsD
- Point64
- PointD
- PointInPolygonResult
- Rect64
- RectD
- TriangulateResult
- ZCallback64
- ZCallbackD
Static Functions
- Area
- BooleanOp
- Difference
- InflatePaths
- Intersect
- IsPositive
- MakePath
- MinkowskiDiff
- MinkowskiSum
- PointInPolygon
- PolyTreeToPaths64
- PolyTreeToPathsD
- RectClip
- RectClipLines
- ReversePath
- SimplifyPaths
- TranslatePath
- Triangulate
- TrimCollinear
- Union
- XOR
Topics