Interface MultiShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>
-
- Type Parameters:
ST
- is the type of the general implementation.IT
- is the type of the implementation of this multishape.CT
- is the type of the shapes that are inside this multishape.IE
- is the type of the path elements.P
- is the type of the points.V
- is the type of the vectors.B
- is the type of the bounding boxes.
- All Superinterfaces:
Cloneable
,Collection<CT>
,Iterable<CT>
,JsonableObject
,List<CT>
,MultiShape2D<ST,IT,CT,PathIterator2ai<IE>,P,V,B>
,Serializable
,Shape2ai<ST,IT,IE,P,V,B>
,Shape2D<ST,IT,PathIterator2ai<IE>,P,V,B>
- All Known Implementing Classes:
MultiShape2i
,MultiShape2ifx
public interface MultiShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>> extends Shape2ai<ST,IT,IE,P,V,B>, MultiShape2D<ST,IT,CT,PathIterator2ai<IE>,P,V,B>
Container for grouping of shapes.The coordinates of the shapes inside the multishape are global. They are not relative to the multishape.
- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Thomas PIOTROWSKI, Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MultiShape2ai.AbstractMultiShapePathIterator<IE extends PathElement2ai>
Abstract iterator on the path elements of the multishape.static class
MultiShape2ai.MultiShapePathIterator<IE extends PathElement2ai>
Iterator on the path elements of the multishape.static class
MultiShape2ai.MultiShapePointIterator<P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
Iterator on the points of the multishape.static class
MultiShape2ai.TransformedMultiShapePathIterator<IE extends PathElement2ai>
Iterator on the path elements of the multishape.-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.MultiShape2D
MultiShape2D.BackendIterator<CT extends Shape2D<?,?,?,?,?,?>>, MultiShape2D.BackendList<CT extends Shape2D<?,?,?,?,?,?>>
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default boolean
contains(int x, int y)
Replies if the given point is inside this shape.default boolean
contains(Rectangle2ai<?,?,?,?,?,?> rectangle)
Replies if the given rectangle is inside this shape.default ST
createTransformedShape(Transform2D transform)
Apply the transformation to the shape and reply the result.default P
getClosestPointTo(Circle2ai<?,?,?,?,?,?> circle)
Replies the closest point on this shape to the given rectangle.default P
getClosestPointTo(MultiShape2ai<?,?,?,?,?,?,?> multishape)
Replies the closest point on this shape to the given rectangle.default P
getClosestPointTo(Path2ai<?,?,?,?,?,?> path)
Replies the closest point on this shape to the given rectangle.default P
getClosestPointTo(Rectangle2ai<?,?,?,?,?,?> rectangle)
Replies the closest point on this shape to the given rectangle.default P
getClosestPointTo(Segment2ai<?,?,?,?,?,?> segment)
Replies the closest point on this shape to the given rectangle.default CT
getFirstShapeIntersecting(ST shape)
Get the first shape in this multishape that is intersecting the given shape.default PathIterator2ai<IE>
getFlatteningPathIterator()
Replies a path iterator on this shape that is replacing the curves by line approximations.default PathIterator2ai<IE>
getPathIterator(Transform2D transform)
Replies the elements of the paths.default Iterator<P>
getPointIterator()
Replies an iterator on the points covered by the perimeter of this shape.default List<CT>
getShapesIntersecting(ST shape)
Get the shapes in this multishape that are intersecting the given shape.default boolean
intersects(Circle2ai<?,?,?,?,?,?> circle)
Replies if this shape is intersecting the given circle.default boolean
intersects(MultiShape2ai<?,?,?,?,?,?,?> multishape)
Replies if this shape is intersecting the given multishape.default boolean
intersects(PathIterator2ai<?> iterator)
Replies if this shape is intersecting the path described by the given iterator.default boolean
intersects(Rectangle2ai<?,?,?,?,?,?> rectangle)
Replies if this shape is intersecting the given rectangle.default boolean
intersects(Segment2ai<?,?,?,?,?,?> segment)
Replies if this shape is intersecting the given segment.default void
toBoundingBox(B box)
Replies the bounds of the shape.default void
translate(int dx, int dy)
Translate the shape.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliterator
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.MultiShape2D
add, add, addAll, addAll, clear, contains, containsAll, equalsToShape, get, getBackendDataList, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getFarthestPointTo, getFirstShapeContaining, getShapesContaining, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, onBackendDataChange, remove, remove, removeAll, retainAll, set, set, size, subList, toArray, toArray
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.ai.Shape2ai
contains, contains, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Shape2D
clone, equalsToPathIterator, getDistance, getDistance, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Method Detail
-
intersects
@Pure default boolean intersects(Circle2ai<?,?,?,?,?,?> circle)
Description copied from interface:Shape2ai
Replies if this shape is intersecting the given circle.- Specified by:
intersects
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
circle
- the circle.- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Rectangle2ai<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2ai
Replies if this shape is intersecting the given rectangle.- Specified by:
intersects
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
rectangle
- the rectangle.- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Segment2ai<?,?,?,?,?,?> segment)
Description copied from interface:Shape2ai
Replies if this shape is intersecting the given segment.- Specified by:
intersects
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
segment
- the segment.- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(PathIterator2ai<?> iterator)
Description copied from interface:Shape2ai
Replies if this shape is intersecting the path described by the given iterator.- Specified by:
intersects
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
iterator
- the path iterator.- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(MultiShape2ai<?,?,?,?,?,?,?> multishape)
Description copied from interface:Shape2ai
Replies if this shape is intersecting the given multishape.- Specified by:
intersects
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
multishape
- the multishape.- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
contains
@Pure default boolean contains(int x, int y)
Description copied from interface:Shape2ai
Replies if the given point is inside this shape.- Specified by:
contains
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
x
- x coordinate of the point to test.y
- y coordinate of the point to test.- Returns:
true
if the given point is inside this shape, otherwisefalse
.
-
contains
@Pure default boolean contains(Rectangle2ai<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2ai
Replies if the given rectangle is inside this shape.- Specified by:
contains
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
rectangle
- the rectangle to test.- Returns:
true
if the given box is inside the shape.
-
translate
default void translate(int dx, int dy)
Description copied from interface:Shape2ai
Translate the shape.- Specified by:
translate
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
dx
- x translation.dy
- y translation.
-
createTransformedShape
@Pure default ST createTransformedShape(Transform2D transform)
Description copied from interface:Shape2D
Apply the transformation to the shape and reply the result. This function does not change the current shape.- Specified by:
createTransformedShape
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Specified by:
createTransformedShape
in interfaceShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
transform
- is the transformation to apply to the shape.- Returns:
- the result of the transformation.
-
getFirstShapeIntersecting
@Pure default CT getFirstShapeIntersecting(ST shape)
Description copied from interface:MultiShape2D
Get the first shape in this multishape that is intersecting the given shape.- Specified by:
getFirstShapeIntersecting
in interfaceMultiShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>
- Parameters:
shape
- the shape.- Returns:
- the shape, or
null
if no shape intersecting the given shape.
-
getShapesIntersecting
@Pure default List<CT> getShapesIntersecting(ST shape)
Description copied from interface:MultiShape2D
Get the shapes in this multishape that are intersecting the given shape.- Specified by:
getShapesIntersecting
in interfaceMultiShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2ai<?,?,IE,P,V,B>>
- Parameters:
shape
- the shape.- Returns:
- the shapes, or an empty list.
-
toBoundingBox
@Pure default void toBoundingBox(B box)
Description copied from interface:Shape2D
Replies the bounds of the shape.- Specified by:
toBoundingBox
in interfaceShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
box
- is set with the bounds of the shape.
-
getPathIterator
default PathIterator2ai<IE> getPathIterator(Transform2D transform)
Description copied from interface:Shape2D
Replies the elements of the paths.- Specified by:
getPathIterator
in interfaceShape2D<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
transform
- is the transformation to apply to the path.- Returns:
- the elements of the path.
-
getFlatteningPathIterator
@Pure default PathIterator2ai<IE> getFlatteningPathIterator()
Replies a path iterator on this shape that is replacing the curves by line approximations.- Returns:
- the iterator on the approximation.
- See Also:
Shape2D.getPathIterator()
,GeomConstants.SPLINE_APPROXIMATION_RATIO
-
getPointIterator
default Iterator<P> getPointIterator()
Description copied from interface:Shape2ai
Replies an iterator on the points covered by the perimeter of this shape.The implementation of the iterator depends on the shape type. There is no warranty about the order of the points.
- Specified by:
getPointIterator
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Returns:
- an iterator on the points that are located at the perimeter of the shape.
-
getClosestPointTo
default P getClosestPointTo(Rectangle2ai<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2ai
Replies the closest point on this shape to the given rectangle.- Specified by:
getClosestPointTo
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
rectangle
- the rectangle.- Returns:
- the closest point on this shape to the given shape; or the point if the point is in this shape.
-
getClosestPointTo
default P getClosestPointTo(Circle2ai<?,?,?,?,?,?> circle)
Description copied from interface:Shape2ai
Replies the closest point on this shape to the given rectangle.- Specified by:
getClosestPointTo
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
circle
- the circle.- Returns:
- the closest point on this shape to the given shape; or the point if the point is in this shape.
-
getClosestPointTo
default P getClosestPointTo(Segment2ai<?,?,?,?,?,?> segment)
Description copied from interface:Shape2ai
Replies the closest point on this shape to the given rectangle.- Specified by:
getClosestPointTo
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
segment
- the segment.- Returns:
- the closest point on this shape to the given shape; or the point if the point is in this shape.
-
getClosestPointTo
default P getClosestPointTo(MultiShape2ai<?,?,?,?,?,?,?> multishape)
Description copied from interface:Shape2ai
Replies the closest point on this shape to the given rectangle.- Specified by:
getClosestPointTo
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
multishape
- the multishape.- Returns:
- the closest point on this shape to the given shape; or the point if the point is in this shape.
-
getClosestPointTo
default P getClosestPointTo(Path2ai<?,?,?,?,?,?> path)
Description copied from interface:Shape2ai
Replies the closest point on this shape to the given rectangle.- Specified by:
getClosestPointTo
in interfaceShape2ai<ST extends Shape2ai<?,?,IE,P,V,B>,IT extends MultiShape2ai<?,?,CT,IE,P,V,B>,CT extends Shape2ai<?,?,IE,P,V,B>,IE extends PathElement2ai,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>
- Parameters:
path
- the path.- Returns:
- the closest point on this shape to the given shape; or the point if the point is in this shape.
-
-