All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.luan.geometry.de.lighti.clipper.PolyTree Maven / Gradle / Ivy

Go to download

Simple geometry package for Java, implementing set operations and area calculation for Polygons.

There is a newer version: 1.5.4
Show newest version
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