import { Rectangle } from '..';
import { uniteSets } from '../utils/setOperations';
// this class contains a set of edge geometries, and set of node boundaries, ICurves, that might obstruct the edge routing
export class PreGraph {
    static constructorStatic(egs, nodeBoundaries) {
        const pg = new PreGraph();
        pg.edgeGeometries = egs;
        pg.nodeBoundaries = nodeBoundaries;
        pg.boundingBox = Rectangle.mkEmpty();
        for (const curve of pg.nodeBoundaries) {
            pg.boundingBox = pg.boundingBox.addRec(curve.boundingBox);
        }
        return pg;
    }
    AddGraph(a) {
        this.edgeGeometries = this.edgeGeometries.concat(a.edgeGeometries);
        this.nodeBoundaries = uniteSets(this.nodeBoundaries, a.nodeBoundaries);
        this.boundingBox.addRec(a.boundingBox);
    }
    AddNodeBoundary(curve) {
        this.nodeBoundaries.add(curve);
        this.boundingBox.addRec(curve.boundingBox);
    }
}
//# sourceMappingURL=PreGraph.js.map