Displaying 1 result from an estimated 1 matches for "notifynewregion".
2014 Oct 17
1
Holding a large number of SEXPs in C++
...entially, so an
appropriate C++ 'framework' (for the point of illustration) might be:
typedef std::pair<double, double> Point;
typedef std::vector<Point> Polygon;
typedef std::vector<Polygon> Polygons;
typedef std::vector<Polygons> Regions;
struct Holder {
void notifyNewRegion(void) const {
regions.push_back(Polygons());
}
template<typename Iter>
void addSubPoly(Iter b, Iter e) {
regions.back().push_back(Polygon(b, e));
}
private:
Regions regions;
};
where the reference_type of Iter is convertible to Point. In practice I use
p...