Package org.arakhne.afc.math.geometry.d3
Interface MultiShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends Shape3D<?,?,I,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.I
- is the type of the iterator used to obtain the elements of the path.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>
,Serializable
,Shape3D<ST,IT,I,P,V,B>
- All Known Subinterfaces:
MultiShape3afp<ST,IT,CT,IE,P,V,B>
,MultiShape3ai<ST,IT,CT,IE,P,V,B>
- All Known Implementing Classes:
MultiShape3d
,MultiShape3dfx
,MultiShape3i
,MultiShape3ifx
public interface MultiShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>,B extends Shape3D<?,?,I,P,V,B>> extends Shape3D<ST,IT,I,P,V,B>, List<CT>
Container for grouping of shapes.The coordinates of the shapes inside the multishape are global. They are not relative to the multishape.
- 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
MultiShape3D.BackendIterator<CT extends Shape3D<?,?,?,?,?,?>>
Iterator on elements of a list that is able to notify the backend when the iterator has change the backend data.static class
MultiShape3D.BackendList<CT extends Shape3D<?,?,?,?,?,?>>
View on a list that is able to notify the backend when the view has change the backend data.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
add(int index, CT element)
default boolean
add(CT element)
default boolean
addAll(int index, Collection<? extends CT> collection)
default boolean
addAll(Collection<? extends CT> collection)
default void
clear()
Reset this shape to be equivalent to an just-created instance of this shape type.default boolean
contains(Object obj)
default boolean
containsAll(Collection<?> collection)
default boolean
equalsToShape(IT shape)
Replies this shape is equal to the given shape.default CT
get(int index)
List<CT>
getBackendDataList()
Replies the list that contains the backend data.default P
getClosestPointTo(Point3D<?,?> point)
Replies the point on the shape that is closest to the given point.default double
getDistanceL1(Point3D<?,?> point)
Computes the L-1 (Manhattan) distance between this shape and point p1.default double
getDistanceLinf(Point3D<?,?> point)
Computes the L-infinite distance between this shape and point p1.default double
getDistanceSquared(Point3D<?,?> point)
Replies the squared value of the minimal distance from this shape to the given point.default P
getFarthestPointTo(Point3D<?,?> point)
Replies the point on the shape that is farthest the given point.default CT
getFirstShapeContaining(Point3D<?,?> point)
Get the first shape in this multishape that is containing the given point.CT
getFirstShapeIntersecting(ST shape)
Get the first shape in this multishape that is intersecting the given shape.default List<CT>
getShapesContaining(Point3D<?,?> point)
Get the shapes in this multishape that are containing the given point.List<CT>
getShapesIntersecting(ST shape)
Get the shapes in this multishape that are intersecting the given shape.default int
indexOf(Object obj)
default boolean
isEmpty()
Replies if this shape is empty.default Iterator<CT>
iterator()
default int
lastIndexOf(Object obj)
default ListIterator<CT>
listIterator()
default ListIterator<CT>
listIterator(int index)
default void
onBackendDataChange()
Invoked each time the backend data has changed.default CT
remove(int index)
default boolean
remove(Object obj)
default boolean
removeAll(Collection<?> collection)
default boolean
retainAll(Collection<?> collection)
default CT
set(int index, CT element)
default void
set(IT multishape)
Set this shape with the attributes of the given shape.default int
size()
default List<CT>
subList(int fromIndex, int toIndex)
default Object[]
toArray()
default <T> T[]
toArray(T[] array)
-
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.d3.Shape3D
clone, contains, contains, createTransformedShape, equalsToPathIterator, getClosestPointTo, getDistance, getDistance, getDistanceSquared, getGeomFactory, getPathIterator, getPathIterator, intersects, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo, toBoundingBox, toBoundingBox, translate
-
-
-
-
Method Detail
-
getFirstShapeContaining
@Pure default CT getFirstShapeContaining(Point3D<?,?> point)
Get the first shape in this multishape that is containing the given point.- Parameters:
point
- the point.- Returns:
- the shape, or
null
if no shape contains the given point.
-
getShapesContaining
@Pure default List<CT> getShapesContaining(Point3D<?,?> point)
Get the shapes in this multishape that are containing the given point.- Parameters:
point
- the point.- Returns:
- the shapes, or an empty list.
-
getFirstShapeIntersecting
@Pure CT getFirstShapeIntersecting(ST shape)
Get the first shape in this multishape that is intersecting the given shape.- Parameters:
shape
- the shape.- Returns:
- the shape, or
null
if no shape intersecting the given shape.
-
getShapesIntersecting
@Pure List<CT> getShapesIntersecting(ST shape)
Get the shapes in this multishape that are intersecting the given shape.- Parameters:
shape
- the shape.- Returns:
- the shapes, or an empty list.
-
getBackendDataList
@Pure List<CT> getBackendDataList()
Replies 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.
- Returns:
- the backend data list.
-
onBackendDataChange
default void onBackendDataChange()
Invoked each time the backend data has changed.
-
set
default void set(IT multishape)
Description copied from interface:Shape3D
Set this shape with the attributes of the given shape.- Specified by:
set
in interfaceShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>
- Parameters:
multishape
- the shape.
-
equalsToShape
@Pure default boolean equalsToShape(IT shape)
Description copied from interface:Shape3D
Replies this shape is equal to the given shape.- Specified by:
equalsToShape
in interfaceShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>
- Parameters:
shape
- the shape to compare to.- Returns:
true
if this shape is equal is equal to the given path.
-
clear
default void clear()
Description copied from interface:Shape3D
Reset this shape to be equivalent to an just-created instance of this shape type.- Specified by:
clear
in interfaceCollection<ST extends Shape3D<?,?,I,P,V,B>>
- Specified by:
clear
in interfaceList<ST extends Shape3D<?,?,I,P,V,B>>
- Specified by:
clear
in interfaceShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>
-
isEmpty
@Pure default boolean isEmpty()
Description copied from interface:Shape3D
Replies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.- Specified by:
isEmpty
in interfaceCollection<ST extends Shape3D<?,?,I,P,V,B>>
- Specified by:
isEmpty
in interfaceList<ST extends Shape3D<?,?,I,P,V,B>>
- Specified by:
isEmpty
in interfaceShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>
- Returns:
true
if the shape is empty;false
otherwise.
-
getClosestPointTo
@Pure default P getClosestPointTo(Point3D<?,?> point)
Description copied from interface:Shape3D
Replies the point on the shape that is closest to the given point.- Specified by:
getClosestPointTo
in interfaceShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>
- Parameters:
point
- the point.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getFarthestPointTo
@Pure default P getFarthestPointTo(Point3D<?,?> point)
Description copied from interface:Shape3D
Replies the point on the shape that is farthest the given point.- Specified by:
getFarthestPointTo
in interfaceShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>
- Parameters:
point
- the point.- Returns:
- the farthest point on the shape.
-
getDistanceSquared
@Pure default double getDistanceSquared(Point3D<?,?> point)
Description copied from interface:Shape3D
Replies the squared value of the minimal distance from this shape to the given point.- Specified by:
getDistanceSquared
in interfaceShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>
- Parameters:
point
- the point.- Returns:
- squared value of the minimal distance between this shape and the point.
-
getDistanceL1
@Pure default double getDistanceL1(Point3D<?,?> point)
Description copied from interface:Shape3D
Computes the L-1 (Manhattan) distance between this shape and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).- Specified by:
getDistanceL1
in interfaceShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>
- Parameters:
point
- the point- Returns:
- the distance.
-
getDistanceLinf
@Pure default double getDistanceLinf(Point3D<?,?> point)
Description copied from interface:Shape3D
Computes the L-infinite distance between this shape and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2), abs(z1-z2)].- Specified by:
getDistanceLinf
in interfaceShape3D<ST extends Shape3D<?,?,I,P,V,B>,IT extends MultiShape3D<?,?,CT,I,P,V,B>,CT extends Shape3D<?,?,I,P,V,B>,I extends PathIterator3D<?>,P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>
- Parameters:
point
- the point.- Returns:
- the distance.
-
toArray
@Pure default Object[] toArray()
-
toArray
default <T> T[] toArray(T[] array)
-
size
@Pure default int size()
-
contains
@Pure default boolean contains(Object obj)
-
add
default boolean add(CT element)
-
add
default void add(int index, CT element)
-
remove
default boolean remove(Object obj)
-
remove
default CT remove(int index)
-
containsAll
@Pure default boolean containsAll(Collection<?> collection)
-
addAll
default boolean addAll(Collection<? extends CT> collection)
-
addAll
default boolean addAll(int index, Collection<? extends CT> collection)
-
removeAll
default boolean removeAll(Collection<?> collection)
-
retainAll
default boolean retainAll(Collection<?> collection)
-
get
@Pure default CT get(int index)
-
indexOf
@Pure default int indexOf(Object obj)
-
lastIndexOf
@Pure default int lastIndexOf(Object obj)
-
listIterator
@Pure default ListIterator<CT> listIterator()
-
listIterator
@Pure default ListIterator<CT> listIterator(int index)
-
-