MCPcopy Create free account
hub / github.com/Notgnoshi/generative / RecursiveGeometryIterator

Method RecursiveGeometryIterator

generative/geometry-flattener.cpp:37–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37GeometryFlattener::RecursiveGeometryIterator::RecursiveGeometryIterator(
38 const geos::geom::Geometry& geometry, int n) :
39 m_geometry(geometry),
40 m_iterator(nullptr),
41 m_num_subgeometries(m_geometry.getNumGeometries()),
42 m_index(n < 0 ? m_num_subgeometries : static_cast<size_t>(n)),
43 m_exhausted(m_index >= m_num_subgeometries)
44{
45 if (!m_exhausted && !m_iterator && is_multi_geometry(m_geometry.getGeometryN(m_index)))
46 {
47 LOG4CPLUS_TRACE(s_logger,
48 "Initializing " << m_geometry.getGeometryType()
49 << " iterator with new recursive iterator for child "
50 << m_geometry.getGeometryN(m_index)->getGeometryType());
51 m_iterator = std::make_unique<GeometryFlattener::RecursiveGeometryIterator>(
52 *m_geometry.getGeometryN(m_index), 0);
53 }
54}
55
56const geos::geom::Geometry& GeometryFlattener::RecursiveGeometryIterator::operator*() const
57{

Callers

nothing calls this directly

Calls 1

is_multi_geometryFunction · 0.85

Tested by

no test coverage detected