1#ifndef GENERATOR_REPEATSHAPE_HPP
2#define GENERATOR_REPEATSHAPE_HPP
14template<
typename shape_t>
23 return index_ >= repeat_shape_->instances_;
28 edge_t temp = edges_.generate();
40 delta_ += repeat_shape_->vertex_count_;
41 edges_ = repeat_shape_->shape_.edges();
55 : repeat_shape_{repeatShape}
56 , edges_{repeatShape->shape_.edges()}
57 , index_{repeatShape->vertex_count_ > 0 ? 0 : repeatShape->instances_}
62 int countEdges() const noexcept
64 if(repeat_shape_->instances_ < 1)
67 return count(repeat_shape_->shape_.edges()) * (repeat_shape_->instances_ - index_ - 1) +
count(edges_);
83 return index_ >= repeat_shape_->instances_;
100 delta_ += repeat_shape_->delta_;
101 vertices_ = repeat_shape_->shape_.vertices();
107 : repeat_shape_{repeatShape}
108 , vertices_{repeatShape->shape_.
vertices()}
109 , index_{repeatShape->vertex_count_ > 0 ? 0 : repeatShape->instances_}
122 int countvertices_t() const noexcept
124 if(repeat_shape_->instances_ < 1)
127 return repeat_shape_->vertex_count_ * (repeat_shape_->instances_ - index_ - 1) +
count(vertices_);
141 explicit repeat_shape_t(shape_t shape,
int instances,
const gml::dvec2& delta) noexcept
142 : shape_{std::move(shape)}
143 , instances_{instances}
145 , vertex_count_{
count(shape_.vertices())}
169template<
typename shape_t>
bool done() const noexcept
friend int count(const edges_t &generator) noexcept
friend int count(const vertices_t &generator) noexcept
shape_vertex_t generate() const
bool done() const noexcept
edges_t edges() const noexcept
vertices_t vertices() const noexcept
repeat_shape_t(shape_t shape, int instances, const gml::dvec2 &delta) noexcept
int count(const generator_t &generator) noexcept
Counts the number of steps left in the generator.
repeat_shape_t< shape_t > repeat_shape(shape_t shape, int instances, const gml::dvec2 &delta) noexcept