Search in sources :

Example 6 with Rect2D

use of aima.core.util.math.geom.shapes.Rect2D in project aima-java by aimacode.

the class CartesianPlot2D method loadMap.

/**
	 * Loads a map input into this Cartesian plot.
	 * @param input the stream containing the data.
	 * @param groupID the identification for the group of elements that will be loaded.
	 * @throws Exception thrown if the input does not contain the group.
	 * @throws Exception thrown by the parser when it encounters an error in the input.
	 */
public void loadMap(InputStream input, String groupID) throws Exception {
    shapes = parser.parse(input, groupID);
    boundaries = new ArrayList<Rect2D>(shapes.size());
    for (IGeometric2D shape : shapes) {
        boundaries.add(shape.getBounds());
    }
}
Also used : IGeometric2D(aima.core.util.math.geom.shapes.IGeometric2D) Rect2D(aima.core.util.math.geom.shapes.Rect2D)

Aggregations

Rect2D (aima.core.util.math.geom.shapes.Rect2D)6 IGeometric2D (aima.core.util.math.geom.shapes.IGeometric2D)5 Circle2D (aima.core.util.math.geom.shapes.Circle2D)2 Ellipse2D (aima.core.util.math.geom.shapes.Ellipse2D)2 Line2D (aima.core.util.math.geom.shapes.Line2D)2 Polyline2D (aima.core.util.math.geom.shapes.Polyline2D)2 SVGGroupParser (aima.core.util.math.geom.SVGGroupParser)1 Point2D (aima.core.util.math.geom.shapes.Point2D)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 Before (org.junit.Before)1 Test (org.junit.Test)1