-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.implementations.geometry.AwtShapeCompatible,it.unibo.alchemist.model.interfaces.geometry.ConvexGeometricShape,it.unibo.alchemist.model.interfaces.geometry.GeometricShape,it.unibo.alchemist.model.interfaces.geometry.euclidean2d.ConvexPolygon,java.io.Serializable
public interface MutableConvexPolygon implements ConvexPolygon
A mutable ConvexPolygon.
-
-
Method Summary
Modifier and Type Method Description abstract BooleanaddVertex(Integer index, Double x, Double y)Adds a vertex to the polygon. abstract BooleanremoveVertex(Integer index)Removes a vertex from the polygon. abstract BooleanmoveVertex(Integer index, Double newX, Double newY)Moves a vertex of the polygon to a new absolute position. abstract BooleanreplaceEdge(Integer index, Segment2D<Euclidean2DPosition> newEdge)Replaces an edge of the polygon. abstract Euclidean2DPositiongetCentroid()abstract DoublegetDiameter()DoublegetRadius()-
Methods inherited from class it.unibo.alchemist.model.interfaces.geometry.euclidean2d.MutableConvexPolygon
closestEdgeTo, contains, contains, containsBoundaryExcluded, containsBoundaryIncluded, edges, getEdge, intersects, intersects, isAdjacentTo, liesOnBoundary, vertices -
Methods inherited from class it.unibo.alchemist.model.interfaces.geometry.ConvexGeometricShape
intersects, transformed -
Methods inherited from class it.unibo.alchemist.model.interfaces.geometry.euclidean2d.ConvexPolygon
asAwtShape -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
addVertex
abstract Boolean addVertex(Integer index, Double x, Double y)
Adds a vertex to the polygon.
- Parameters:
index- the index in the list of vertices where to put the new vertexx- x coordinatey- y coordinate
-
removeVertex
abstract Boolean removeVertex(Integer index)
Removes a vertex from the polygon.
- Parameters:
index- the index of the vertex to be removed in the list of vertices
-
moveVertex
abstract Boolean moveVertex(Integer index, Double newX, Double newY)
Moves a vertex of the polygon to a new absolute position.
- Parameters:
index- the index of the vertex to movenewX- new absolute x coordinatenewY- new absolute y coordinate
-
replaceEdge
abstract Boolean replaceEdge(Integer index, Segment2D<Euclidean2DPosition> newEdge)
Replaces an edge of the polygon.
- Parameters:
index- the index of the edge to replace (edge i connects vertices i and i+1)newEdge- the new edge
-
getCentroid
abstract Euclidean2DPosition getCentroid()
-
getDiameter
abstract Double getDiameter()
-
-
-
-