helper function to get a boost polygon point from a Point3d
| 3291 | |
| 3292 | // helper function to get a boost polygon point from a Point3d |
| 3293 | boost::tuple<double, double> Space_Impl::point3dToTuple(const Point3d& point3d, std::vector<Point3d>& allPoints, double tol) const { |
| 3294 | // simple method |
| 3295 | //return boost::make_tuple(point3d.x(), point3d.y()); |
| 3296 | |
| 3297 | // detailed method, try to combine points within tolerance |
| 3298 | for (const Point3d& otherPoint : allPoints) { |
| 3299 | if (std::sqrt(std::pow(point3d.x() - otherPoint.x(), 2) + std::pow(point3d.y() - otherPoint.y(), 2)) < tol) { |
| 3300 | return boost::make_tuple(otherPoint.x(), otherPoint.y()); |
| 3301 | } |
| 3302 | } |
| 3303 | allPoints.push_back(point3d); |
| 3304 | return boost::make_tuple(point3d.x(), point3d.y()); |
| 3305 | } |
| 3306 | |
| 3307 | std::vector<ZoneMixing> Space_Impl::zoneMixing() const { |
| 3308 | return getObject<ModelObject>().getModelObjectSources<ZoneMixing>(); |