Interface Shape1afp<ST extends Shape1afp<?,?,P,V,S,B>,IT extends Shape1afp<?,?,P,V,S,B>,P extends Point1D<? super P,? super V,? super S>,V extends Vector1D<? super V,? super P,? super S>,S extends Segment1D<?,?>,B extends Rectangle1afp<?,?,P,V,S,B>>
-
- Type Parameters:
ST
- is the type of the general implementation.IT
- is the type of the implementation of this shape.P
- is the type of the points.V
- is the type of the vectors.S
- is the type of the segments.B
- is the type of the bounding boxes.
- All Superinterfaces:
Cloneable
,JsonableObject
,Serializable
,Shape1D<ST,IT,P,V,S,B>
- All Known Subinterfaces:
Rectangle1afp<ST,IT,P,V,S,B>
,RectangularShape1afp<ST,IT,P,V,S,B>
,Shape1d<IT>
,Shape1dfx<IT>
- All Known Implementing Classes:
AbstractRectangularShape1d
,AbstractRectangularShape1dfx
,AbstractShape1d
,AbstractShape1dfx
,Rectangle1d
,Rectangle1dfx
public interface Shape1afp<ST extends Shape1afp<?,?,P,V,S,B>,IT extends Shape1afp<?,?,P,V,S,B>,P extends Point1D<? super P,? super V,? super S>,V extends Vector1D<? super V,? super P,? super S>,S extends Segment1D<?,?>,B extends Rectangle1afp<?,?,P,V,S,B>> extends Shape1D<ST,IT,P,V,S,B>
2D shape with 2D floating coordinates.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
contains(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies if the given rectangle is inside this shape.default boolean
contains(Point1D<?,?,?> pt)
Replies if the given point is inside this shape.boolean
contains(Segment1D<?,?> segment, double x, double y)
Replies if the given point is inside this shape.default boolean
contains(Shape1D<?,?,?,?,?,?> shape)
Replies if this shape is inside the given shape.P
getClosestPointTo(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies the closest point on this shape to the given rectangle.default P
getClosestPointTo(Shape1D<?,?,?,?,?,?> shape)
Replies the point on the shape that is closest to the given shape.default double
getDistanceSquared(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies the minimum distance between this shape and the given rectangle.default double
getDistanceSquared(Shape1D<?,?,?,?,?,?> shape)
Replies the squared value of the minimal distance from this shape to the given shape.GeomFactory1afp<P,V,S,B>
getGeomFactory()
Replies the geometry factory associated to this point.boolean
intersects(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies if this shape is intersecting the given rectangle.default boolean
intersects(Shape1D<?,?,?,?,?,?> shape)
Replies if this shape is intersecting the given shape.default B
toBoundingBox()
Replies the bounding box of this shape.void
translate(double dx, double dy)
Translate the shape.default void
translate(Vector1D<?,?,?> vector)
Translate the shape.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d1.Shape1D
clear, clone, equalsToShape, getClosestPointTo, getDistance, getDistance, getDistanceL1, getDistanceLinf, getDistanceSquared, getFarthestPointTo, getSegment, isEmpty, operator_add, operator_and, operator_and, operator_minus, operator_plus, operator_remove, operator_upTo, set, setSegment, toBoundingBox
-
-
-
-
Method Detail
-
contains
@Pure default boolean contains(Point1D<?,?,?> pt)
Description copied from interface:Shape1D
Replies if the given point is inside this shape.- Specified by:
contains
in interfaceShape1D<ST extends Shape1afp<?,?,P,V,S,B>,IT extends Shape1afp<?,?,P,V,S,B>,P extends Point1D<? super P,? super V,? super S>,V extends Vector1D<? super V,? super P,? super S>,S extends Segment1D<?,?>,B extends Rectangle1afp<?,?,P,V,S,B>>
- Parameters:
pt
- the point.- Returns:
true
if the given shape is intersecting this shape, otherwisefalse
.
-
contains
@Pure default boolean contains(Shape1D<?,?,?,?,?,?> shape)
Description copied from interface:Shape1D
Replies if this shape is inside the given shape.You must use the containing functions with a specific parameter type in place of this general function. Indeed, the implementation of this function is unefficient due to the tests against the types of the given shape, and the cast operators.
- Specified by:
contains
in interfaceShape1D<ST extends Shape1afp<?,?,P,V,S,B>,IT extends Shape1afp<?,?,P,V,S,B>,P extends Point1D<? super P,? super V,? super S>,V extends Vector1D<? super V,? super P,? super S>,S extends Segment1D<?,?>,B extends Rectangle1afp<?,?,P,V,S,B>>
- Parameters:
shape
- the shape to compare to.- Returns:
true
if the given shape is inside this shape;false
otherwise.
-
contains
@Pure boolean contains(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies if the given rectangle is inside this shape.- Parameters:
rectangle
- the rectangle.- Returns:
true
if the given rectangle is inside this shape, otherwisefalse
.
-
contains
@Pure boolean contains(Segment1D<?,?> segment, double x, double y)
Replies if the given point is inside this shape.- Parameters:
segment
- the segment to test.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
.
-
translate
void translate(double dx, double dy)
Translate the shape.- Parameters:
dx
- x translation.dy
- y translation.
-
translate
@Pure default void translate(Vector1D<?,?,?> vector)
Description copied from interface:Shape1D
Translate the shape.- Specified by:
translate
in interfaceShape1D<ST extends Shape1afp<?,?,P,V,S,B>,IT extends Shape1afp<?,?,P,V,S,B>,P extends Point1D<? super P,? super V,? super S>,V extends Vector1D<? super V,? super P,? super S>,S extends Segment1D<?,?>,B extends Rectangle1afp<?,?,P,V,S,B>>
- Parameters:
vector
- the translation vector.
-
intersects
@Pure default boolean intersects(Shape1D<?,?,?,?,?,?> shape)
Description copied from interface:Shape1D
Replies if this shape is intersecting the given shape.You must use the intersection functions with a specific parameter type in place of this general function. Indeed, the implementation of this function is unefficient due to the tests against the types of the given shape, and the cast operators.
- Specified by:
intersects
in interfaceShape1D<ST extends Shape1afp<?,?,P,V,S,B>,IT extends Shape1afp<?,?,P,V,S,B>,P extends Point1D<? super P,? super V,? super S>,V extends Vector1D<? super V,? super P,? super S>,S extends Segment1D<?,?>,B extends Rectangle1afp<?,?,P,V,S,B>>
- Parameters:
shape
- the shape to compare to.- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure boolean intersects(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies if this shape is intersecting the given rectangle.- Parameters:
rectangle
- the rectangle.- Returns:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
getDistanceSquared
@Pure default double getDistanceSquared(Shape1D<?,?,?,?,?,?> shape)
Description copied from interface:Shape1D
Replies the squared value of the minimal distance from this shape to the given shape.- Specified by:
getDistanceSquared
in interfaceShape1D<ST extends Shape1afp<?,?,P,V,S,B>,IT extends Shape1afp<?,?,P,V,S,B>,P extends Point1D<? super P,? super V,? super S>,V extends Vector1D<? super V,? super P,? super S>,S extends Segment1D<?,?>,B extends Rectangle1afp<?,?,P,V,S,B>>
- Parameters:
shape
- the shape.- Returns:
- squared value of the minimal distance between this shape and the given shape.
-
getDistanceSquared
@Pure default double getDistanceSquared(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies the minimum distance between this shape and the given rectangle.- Parameters:
rectangle
- the rectangle.- Returns:
- the minimum distance between the two shapes.
-
getClosestPointTo
@Pure default P getClosestPointTo(Shape1D<?,?,?,?,?,?> shape)
Description copied from interface:Shape1D
Replies the point on the shape that is closest to the given shape.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in interfaceShape1D<ST extends Shape1afp<?,?,P,V,S,B>,IT extends Shape1afp<?,?,P,V,S,B>,P extends Point1D<? super P,? super V,? super S>,V extends Vector1D<? super V,? super P,? super S>,S extends Segment1D<?,?>,B extends Rectangle1afp<?,?,P,V,S,B>>
- Parameters:
shape
- the shape.- Returns:
- the closest point on the shape.
-
getClosestPointTo
@Pure P getClosestPointTo(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies the closest point on this shape to the given rectangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Parameters:
rectangle
- the rectangle.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getGeomFactory
GeomFactory1afp<P,V,S,B> getGeomFactory()
Description copied from interface:Shape1D
Replies the geometry factory associated to this point.- Specified by:
getGeomFactory
in interfaceShape1D<ST extends Shape1afp<?,?,P,V,S,B>,IT extends Shape1afp<?,?,P,V,S,B>,P extends Point1D<? super P,? super V,? super S>,V extends Vector1D<? super V,? super P,? super S>,S extends Segment1D<?,?>,B extends Rectangle1afp<?,?,P,V,S,B>>
- Returns:
- the factory.
-
toBoundingBox
default B toBoundingBox()
Description copied from interface:Shape1D
Replies the bounding box of this shape.- Specified by:
toBoundingBox
in interfaceShape1D<ST extends Shape1afp<?,?,P,V,S,B>,IT extends Shape1afp<?,?,P,V,S,B>,P extends Point1D<? super P,? super V,? super S>,V extends Vector1D<? super V,? super P,? super S>,S extends Segment1D<?,?>,B extends Rectangle1afp<?,?,P,V,S,B>>
- Returns:
- the bounding box of this shape.
-
-