Interface MutableConvexPolygon
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.geometry.AwtShapeCompatible
,it.unibo.alchemist.model.geometry.ConvexPolygon
,it.unibo.alchemist.model.geometry.ConvexShape
,it.unibo.alchemist.model.geometry.Shape
,java.io.Serializable
public interface MutableConvexPolygon implements ConvexPolygon
A mutable ConvexPolygon.
-
-
Method Summary
Modifier and Type Method Description abstract Boolean
addVertex(Integer index, Double x, Double y)
Adds a vertex to the polygon. abstract Boolean
removeVertex(Integer index)
Removes a vertex from the polygon. abstract Boolean
moveVertex(Integer index, Double newX, Double newY)
Moves a vertex of the polygon to a new absolute position. abstract Boolean
replaceEdge(Integer index, Segment2D<Euclidean2DPosition> newEdge)
Replaces an edge of the polygon. -
Methods inherited from class it.unibo.alchemist.model.geometry.ConvexPolygon
closestEdgeTo, contains, contains, containsBoundaryExcluded, containsBoundaryIncluded, edges, getEdge, intersects, intersects, isAdjacentTo, liesOnBoundary, vertices
-
Methods inherited from class it.unibo.alchemist.model.geometry.Shape
getCentroid, getDiameter, getRadius, intersects, transformed
-
Methods inherited from class it.unibo.alchemist.model.geometry.AwtShapeCompatible
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
-
-
-
-