Class MultiShape2d<T extends Shape2d<?>>
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.d.AbstractShape2d<MultiShape2d<T>>
-
- org.arakhne.afc.math.geometry.d2.d.MultiShape2d<T>
-
- Type Parameters:
T- the type of the shapes inside the multishape.
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,MultiShape2afp<Shape2d<?>,MultiShape2d<T>,T,PathElement2d,Point2d,Vector2d,Rectangle2d>,Shape2afp<Shape2d<?>,MultiShape2d<T>,PathElement2d,Point2d,Vector2d,Rectangle2d>,Shape2d<MultiShape2d<T>>,MultiShape2D<Shape2d<?>,MultiShape2d<T>,T,PathIterator2afp<PathElement2d>,Point2d,Vector2d,Rectangle2d>,Shape2D<Shape2d<?>,MultiShape2d<T>,PathIterator2afp<PathElement2d>,Point2d,Vector2d,Rectangle2d>,JsonableObject
public class MultiShape2d<T extends Shape2d<?>> extends AbstractShape2d<MultiShape2d<T>> implements MultiShape2afp<Shape2d<?>,MultiShape2d<T>,T,PathElement2d,Point2d,Vector2d,Rectangle2d>
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.afp.MultiShape2afp
MultiShape2afp.AbstractMultiShapePathIterator<IE extends PathElement2afp>, MultiShape2afp.MultiShapePathIterator<IE extends PathElement2afp>, MultiShape2afp.TransformedMultiShapePathIterator<IE extends PathElement2afp>
-
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 MultiShape2d()Construct an empty multishape.MultiShape2d(Iterable<? extends T> shapes)Construct a multishape with shapes inside.MultiShape2d(T... shapes)Construct a multishape with shapes inside.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiShape2d<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.Rectangle2dtoBoundingBox()Replies the bounding box of this shape.voidtoBoundingBox(Rectangle2d box)Replies the bounds of the shape.voidtranslate(double dx, double dy)Translate the shape.-
Methods inherited from class org.arakhne.afc.math.geometry.d2.d.AbstractShape2d
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.afp.MultiShape2afp
contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getFirstShapeIntersecting, getFlatteningPathIterator, getPathIterator, getShapesIntersecting, intersects, intersects, intersects, intersects, intersects, 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.afp.Shape2afp
contains, contains, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, 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
-
MultiShape2d
public MultiShape2d()
Construct an empty multishape.
-
MultiShape2d
public MultiShape2d(T... shapes)
Construct a multishape with shapes inside.- Parameters:
shapes- the shapes to add into the multishape.
-
-
Method Detail
-
clone
@Pure public MultiShape2d<T> clone()
Description copied from interface:Shape2DClone this shape.- Specified by:
clonein interfaceShape2D<Shape2d<?>,MultiShape2d<T extends Shape2d<?>>,PathIterator2afp<PathElement2d>,Point2d,Vector2d,Rectangle2d>- Overrides:
clonein classAbstractShape2d<MultiShape2d<T extends Shape2d<?>>>- Returns:
- the clone.
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCodein interfaceCollection<T extends Shape2d<?>>- Specified by:
hashCodein interfaceList<T extends Shape2d<?>>- Specified by:
hashCodein classAbstractShape2d<MultiShape2d<T extends Shape2d<?>>>
-
onBackendDataChange
public void onBackendDataChange()
Description copied from interface:MultiShape2DInvoked each time the backend data has changed.- Specified by:
onBackendDataChangein interfaceMultiShape2D<Shape2d<?>,MultiShape2d<T extends Shape2d<?>>,T extends Shape2d<?>,PathIterator2afp<PathElement2d>,Point2d,Vector2d,Rectangle2d>
-
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<Shape2d<?>,MultiShape2d<T extends Shape2d<?>>,T extends Shape2d<?>,PathIterator2afp<PathElement2d>,Point2d,Vector2d,Rectangle2d>- Returns:
- the backend data list.
-
toBoundingBox
@Pure public Rectangle2d toBoundingBox()
Description copied from interface:Shape2DReplies the bounding box of this shape.- Specified by:
toBoundingBoxin interfaceShape2afp<Shape2d<?>,MultiShape2d<T extends Shape2d<?>>,PathElement2d,Point2d,Vector2d,Rectangle2d>- Specified by:
toBoundingBoxin interfaceShape2D<Shape2d<?>,MultiShape2d<T extends Shape2d<?>>,PathIterator2afp<PathElement2d>,Point2d,Vector2d,Rectangle2d>- Returns:
- the bounding box of this shape.
-
toBoundingBox
@Pure public void toBoundingBox(Rectangle2d box)
Description copied from interface:Shape2DReplies the bounds of the shape.- Specified by:
toBoundingBoxin interfaceMultiShape2afp<Shape2d<?>,MultiShape2d<T extends Shape2d<?>>,T extends Shape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>- Specified by:
toBoundingBoxin interfaceShape2D<Shape2d<?>,MultiShape2d<T extends Shape2d<?>>,PathIterator2afp<PathElement2d>,Point2d,Vector2d,Rectangle2d>- Parameters:
box- is set with the bounds of the shape.
-
translate
public void translate(double dx, double dy)Description copied from interface:Shape2afpTranslate the shape.- Specified by:
translatein interfaceMultiShape2afp<Shape2d<?>,MultiShape2d<T extends Shape2d<?>>,T extends Shape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>- Specified by:
translatein interfaceShape2afp<Shape2d<?>,MultiShape2d<T extends Shape2d<?>>,PathElement2d,Point2d,Vector2d,Rectangle2d>- Parameters:
dx- x translation.dy- y translation.
-
-