xyz.luan.geometry.de.lighti.clipper.PolyTree Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geometry Show documentation
Show all versions of geometry Show documentation
Simple geometry package for Java, implementing set operations and area calculation for Polygons.
package xyz.luan.geometry.de.lighti.clipper;
import java.util.ArrayList;
import java.util.List;
class PolyTree extends PolyNode {
private final List allPolys = new ArrayList();
public void Clear() {
allPolys.clear();
childs.clear();
}
public List getAllPolys() {
return allPolys;
}
public PolyNode getFirst() {
if (!childs.isEmpty()) {
return childs.get(0);
} else {
return null;
}
}
public int getTotalSize() {
int result = allPolys.size();
// with negative offsets, ignore the hidden outer polygon ...
if (result > 0 && childs.get(0) != allPolys.get(0)) {
result--;
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy