Moved the polygonization code to the specific regions that are being polygonized.

Also, maxPoints no longer has confusing semantics.
This commit is contained in:
TomyLobo
2013-07-27 11:12:29 +02:00
committed by wizjany
parent 34093884bc
commit c838ef7b25
5 changed files with 70 additions and 42 deletions

View File

@ -530,4 +530,13 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion {
clone.points = new ArrayList<BlockVector2D>(points);
return clone;
}
@Override
public List<BlockVector2D> polygonize(int maxPoints) {
if (maxPoints >= 0 && maxPoints < points.size()) {
throw new IllegalArgumentException("Cannot polygonize a this Polygonal2DRegion into the amount of points given.");
}
return points;
}
}