Interface Shape
-
- All Implemented Interfaces:
-
java.io.Serializable
public interface Shape<S extends Vector<S>, A extends Transformation<S>> implements Serializable
Models a generic shape.
-
-
Method Summary
Modifier and Type Method Description abstract Boolean
intersects(Shape<S, A> other)
A shape intersects another if any of its points is contained in the other one. abstract Boolean
contains(S vector)
Check if the shape contains a vector. abstract Shape<S, A>
transformed(Function1<A, Unit> transformation)
Transforms the shape. abstract Double
getDiameter()
The largest distance between any pair of vertices. Double
getRadius()
abstract S
getCentroid()
The geometric center. -
-
Method Detail
-
intersects
abstract Boolean intersects(Shape<S, A> other)
A shape intersects another if any of its points is contained in the other one.
- Parameters:
other
- the other shape- Returns:
true if the intersection is not empty
-
contains
abstract Boolean contains(S vector)
Check if the shape contains a vector.
- Parameters:
vector
- the position vector- Returns:
true if the vector is contained in the shape
-
transformed
abstract Shape<S, A> transformed(Function1<A, Unit> transformation)
Transforms the shape.
- Parameters:
transformation
- describes the transformations to apply to the shape- Returns:
a copy of the shape transformed accordingly
-
getDiameter
abstract Double getDiameter()
The largest distance between any pair of vertices.
-
getCentroid
abstract S getCentroid()
The geometric center.
-
-
-
-