package com.persagy.adm.diagram.core.line;

import com.persagy.adm.diagram.core.model.DiagramNode;
import com.persagy.adm.diagram.core.model.base.XY;
import com.persagy.adm.diagram.core.util.GeomUtil;
import org.locationtech.jts.geom.Polygon;

public class Block {

	private DiagramNode node;

	private XY location;

	private XY size;

	private Polygon polygon;

	public Block(DiagramNode node) {
		this.node = node;
		this.location = node.locationToRoot();
		this.size = node.getSize();
		this.polygon = GeomUtil.getPolygon(location, size);
	}

	public XY getLocation() {
		return location;
	}

	public XY getSize() {
		return size;
	}

	public Polygon getPolygon() {
		return polygon;
	}

}
