Class AbstractRectangularShape2d<IT extends AbstractRectangularShape2d<?>>
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.d.AbstractShape2d<IT>
-
- org.arakhne.afc.math.geometry.d2.d.AbstractRectangularShape2d<IT>
-
- Type Parameters:
IT
- is the type of the implementation of this shape.
- All Implemented Interfaces:
Serializable
,Cloneable
,RectangularShape2afp<Shape2d<?>,IT,PathElement2d,Point2d,Vector2d,Rectangle2d>
,Shape2afp<Shape2d<?>,IT,PathElement2d,Point2d,Vector2d,Rectangle2d>
,Shape2d<IT>
,Shape2D<Shape2d<?>,IT,PathIterator2afp<PathElement2d>,Point2d,Vector2d,Rectangle2d>
,JsonableObject
- Direct Known Subclasses:
Ellipse2d
,RoundRectangle2d
public abstract class AbstractRectangularShape2d<IT extends AbstractRectangularShape2d<?>> extends AbstractShape2d<IT> implements RectangularShape2afp<Shape2d<?>,IT,PathElement2d,Point2d,Vector2d,Rectangle2d>
Abstract rectangular shape with 2 double precision floating-point numbers.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Constructor Summary
Constructors Constructor Description AbstractRectangularShape2d()
Construct an empty shape.AbstractRectangularShape2d(RectangularShape2afp<?,?,?,?,?,?> rect)
Constructor by copy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getMaxX()
Replies the max x.double
getMaxY()
Replies the max y.double
getMinX()
Replies the min X.double
getMinY()
Replies the min y.int
hashCode()
void
setFromCorners(double x1, double y1, double x2, double y2)
Change the frame of the rectangle conserving previous min and max if needed.void
setMaxX(double x)
Set the max X conserving previous max if needed.void
setMaxY(double y)
Set the max Y conserving previous max if needed.void
setMinX(double x)
Set the min X conserving previous min if needed.void
setMinY(double y)
Set the min Y conserving previous min if needed.-
Methods inherited from class org.arakhne.afc.math.geometry.d2.d.AbstractShape2d
addShapeGeometryChangeListener, clone, equals, fireGeometryChange, getGeomFactory, removeShapeGeometryChangeListener, toJson, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.RectangularShape2afp
clear, getCenter, getCenterX, getCenterY, getHeight, getWidth, inflate, isEmpty, set, set, set, setFromCenter, setFromCenter, setFromCorners, setHeight, setWidth, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Shape2afp
contains, contains, contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Shape2D
clone, equalsToPathIterator, equalsToShape, getClosestPointTo, getDistance, getDistance, getDistanceL1, getDistanceLinf, getDistanceSquared, getFarthestPointTo, getPathIterator, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Constructor Detail
-
AbstractRectangularShape2d
public AbstractRectangularShape2d()
Construct an empty shape.
-
AbstractRectangularShape2d
public AbstractRectangularShape2d(RectangularShape2afp<?,?,?,?,?,?> rect)
Constructor by copy.- Parameters:
rect
- the rectangular shape to copy.
-
-
Method Detail
-
setFromCorners
public void setFromCorners(double x1, double y1, double x2, double y2)
Description copied from interface:RectangularShape2afp
Change the frame of the rectangle conserving previous min and max if needed.- Specified by:
setFromCorners
in interfaceRectangularShape2afp<Shape2d<?>,IT extends AbstractRectangularShape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>
- Parameters:
x1
- is the coordinate of the first corner.y1
- is the coordinate of the first corner.x2
- is the coordinate of the second corner.y2
- is the coordinate of the second corner.
-
getMinX
@Pure public double getMinX()
Description copied from interface:RectangularShape2afp
Replies the min X.- Specified by:
getMinX
in interfaceRectangularShape2afp<Shape2d<?>,IT extends AbstractRectangularShape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>
- Returns:
- the min x.
-
setMinX
public void setMinX(double x)
Description copied from interface:RectangularShape2afp
Set the min X conserving previous min if needed.- Specified by:
setMinX
in interfaceRectangularShape2afp<Shape2d<?>,IT extends AbstractRectangularShape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>
- Parameters:
x
- the min x.
-
getMaxX
@Pure public double getMaxX()
Description copied from interface:RectangularShape2afp
Replies the max x.- Specified by:
getMaxX
in interfaceRectangularShape2afp<Shape2d<?>,IT extends AbstractRectangularShape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>
- Returns:
- the max x.
-
setMaxX
public void setMaxX(double x)
Description copied from interface:RectangularShape2afp
Set the max X conserving previous max if needed.- Specified by:
setMaxX
in interfaceRectangularShape2afp<Shape2d<?>,IT extends AbstractRectangularShape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>
- Parameters:
x
- the max x.
-
getMinY
@Pure public double getMinY()
Description copied from interface:RectangularShape2afp
Replies the min y.- Specified by:
getMinY
in interfaceRectangularShape2afp<Shape2d<?>,IT extends AbstractRectangularShape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>
- Returns:
- the min y.
-
setMinY
public void setMinY(double y)
Description copied from interface:RectangularShape2afp
Set the min Y conserving previous min if needed.- Specified by:
setMinY
in interfaceRectangularShape2afp<Shape2d<?>,IT extends AbstractRectangularShape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>
- Parameters:
y
- the min y.
-
getMaxY
@Pure public double getMaxY()
Description copied from interface:RectangularShape2afp
Replies the max y.- Specified by:
getMaxY
in interfaceRectangularShape2afp<Shape2d<?>,IT extends AbstractRectangularShape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>
- Returns:
- the max y.
-
setMaxY
public void setMaxY(double y)
Description copied from interface:RectangularShape2afp
Set the max Y conserving previous max if needed.- Specified by:
setMaxY
in interfaceRectangularShape2afp<Shape2d<?>,IT extends AbstractRectangularShape2d<?>,PathElement2d,Point2d,Vector2d,Rectangle2d>
- Parameters:
y
- the max y.
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCode
in classAbstractShape2d<IT extends AbstractRectangularShape2d<?>>
-
-