Class MultiShape2i<T extends Shape2i<?>>
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.i.AbstractShape2i<MultiShape2i<T>>
-
- org.arakhne.afc.math.geometry.d2.i.MultiShape2i<T>
-
- Type Parameters:
T- the type of the shapes inside the multishape.
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,MultiShape2ai<Shape2i<?>,MultiShape2i<T>,T,PathElement2i,Point2i,Vector2i,Rectangle2i>,Shape2ai<Shape2i<?>,MultiShape2i<T>,PathElement2i,Point2i,Vector2i,Rectangle2i>,Shape2i<MultiShape2i<T>>,MultiShape2D<Shape2i<?>,MultiShape2i<T>,T,PathIterator2ai<PathElement2i>,Point2i,Vector2i,Rectangle2i>,Shape2D<Shape2i<?>,MultiShape2i<T>,PathIterator2ai<PathElement2i>,Point2i,Vector2i,Rectangle2i>,JsonableObject
public class MultiShape2i<T extends Shape2i<?>> extends AbstractShape2i<MultiShape2i<T>> implements MultiShape2ai<Shape2i<?>,MultiShape2i<T>,T,PathElement2i,Point2i,Vector2i,Rectangle2i>
Container for grouping of shapes.The coordinates of the shapes inside the multishape are global. They are not relative to the multishape.
Caution: The multishape does not detect the bound change of the stored shapes.
- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Thomas PIOTROWSKI, Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.ai.MultiShape2ai
MultiShape2ai.AbstractMultiShapePathIterator<IE extends PathElement2ai>, MultiShape2ai.MultiShapePathIterator<IE extends PathElement2ai>, MultiShape2ai.MultiShapePointIterator<P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>>, MultiShape2ai.TransformedMultiShapePathIterator<IE extends PathElement2ai>
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.MultiShape2D
MultiShape2D.BackendIterator<CT extends Shape2D<?,?,?,?,?,?>>, MultiShape2D.BackendList<CT extends Shape2D<?,?,?,?,?,?>>
-
-
Constructor Summary
Constructors Constructor Description MultiShape2i()Construct an empty multishape.MultiShape2i(Iterable<? extends T> shapes)Construct a multishape with shapes inside.MultiShape2i(T... shapes)Construct a multishape with shapes inside.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiShape2i<T>clone()Clone this shape.List<T>getBackendDataList()Replies the list that contains the backend data.inthashCode()voidonBackendDataChange()Invoked each time the backend data has changed.protected voidonContentGeometryChange()Invoked when the geometry of the content has changed.Rectangle2itoBoundingBox()Replies the bounding box of this shape.voidtoBoundingBox(Rectangle2i box)Replies the bounds of the shape.voidtranslate(int dx, int dy)Translate the shape.-
Methods inherited from class org.arakhne.afc.math.geometry.d2.i.AbstractShape2i
addShapeGeometryChangeListener, equals, fireGeometryChange, getGeomFactory, removeShapeGeometryChangeListener, toJson, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
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, replaceAll, sort, spliterator
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.ai.MultiShape2ai
contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getFirstShapeIntersecting, getFlatteningPathIterator, getPathIterator, getPointIterator, getShapesIntersecting, intersects, intersects, intersects, intersects, intersects
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.MultiShape2D
add, add, addAll, addAll, clear, contains, containsAll, equalsToShape, get, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getFarthestPointTo, getFirstShapeContaining, getShapesContaining, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, 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, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Shape2D
equalsToPathIterator, getDistance, getDistance, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Constructor Detail
-
MultiShape2i
public MultiShape2i()
Construct an empty multishape.
-
MultiShape2i
public MultiShape2i(T... shapes)
Construct a multishape with shapes inside.- Parameters:
shapes- the shapes to add into the multishape.
-
-
Method Detail
-
clone
public MultiShape2i<T> clone()
Description copied from interface:Shape2DClone this shape.- Specified by:
clonein interfaceShape2D<Shape2i<?>,MultiShape2i<T extends Shape2i<?>>,PathIterator2ai<PathElement2i>,Point2i,Vector2i,Rectangle2i>- Overrides:
clonein classAbstractShape2i<MultiShape2i<T extends Shape2i<?>>>- Returns:
- the clone.
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<T extends Shape2i<?>>- Specified by:
hashCodein interfaceList<T extends Shape2i<?>>- Specified by:
hashCodein classAbstractShape2i<MultiShape2i<T extends Shape2i<?>>>
-
onBackendDataChange
public void onBackendDataChange()
Description copied from interface:MultiShape2DInvoked each time the backend data has changed.- Specified by:
onBackendDataChangein interfaceMultiShape2D<Shape2i<?>,MultiShape2i<T extends Shape2i<?>>,T extends Shape2i<?>,PathIterator2ai<PathElement2i>,Point2i,Vector2i,Rectangle2i>
-
onContentGeometryChange
protected void onContentGeometryChange()
Invoked when the geometry of the content has changed.
-
getBackendDataList
@Pure public List<T> getBackendDataList()
Description copied from interface:MultiShape2DReplies the list that contains the backend data.Use this function with caution. Indeed, any change made in the replied list has no consequence on the internal attributes of this multishape object.
- Specified by:
getBackendDataListin interfaceMultiShape2D<Shape2i<?>,MultiShape2i<T extends Shape2i<?>>,T extends Shape2i<?>,PathIterator2ai<PathElement2i>,Point2i,Vector2i,Rectangle2i>- Returns:
- the backend data list.
-
toBoundingBox
@Pure public Rectangle2i toBoundingBox()
Description copied from interface:Shape2DReplies the bounding box of this shape.- Specified by:
toBoundingBoxin interfaceShape2ai<Shape2i<?>,MultiShape2i<T extends Shape2i<?>>,PathElement2i,Point2i,Vector2i,Rectangle2i>- Specified by:
toBoundingBoxin interfaceShape2D<Shape2i<?>,MultiShape2i<T extends Shape2i<?>>,PathIterator2ai<PathElement2i>,Point2i,Vector2i,Rectangle2i>- Returns:
- the bounding box of this shape.
-
toBoundingBox
@Pure public void toBoundingBox(Rectangle2i box)
Description copied from interface:Shape2DReplies the bounds of the shape.- Specified by:
toBoundingBoxin interfaceMultiShape2ai<Shape2i<?>,MultiShape2i<T extends Shape2i<?>>,T extends Shape2i<?>,PathElement2i,Point2i,Vector2i,Rectangle2i>- Specified by:
toBoundingBoxin interfaceShape2D<Shape2i<?>,MultiShape2i<T extends Shape2i<?>>,PathIterator2ai<PathElement2i>,Point2i,Vector2i,Rectangle2i>- Parameters:
box- is set with the bounds of the shape.
-
translate
public void translate(int dx, int dy)Description copied from interface:Shape2aiTranslate the shape.- Specified by:
translatein interfaceMultiShape2ai<Shape2i<?>,MultiShape2i<T extends Shape2i<?>>,T extends Shape2i<?>,PathElement2i,Point2i,Vector2i,Rectangle2i>- Specified by:
translatein interfaceShape2ai<Shape2i<?>,MultiShape2i<T extends Shape2i<?>>,PathElement2i,Point2i,Vector2i,Rectangle2i>- Parameters:
dx- x translation.dy- y translation.
-
-