Package lejos.robotics.geometry
Interface Shape
-
- All Known Implementing Classes:
Line,Line2D,Line2D.Double,Line2D.Float,Rectangle,Rectangle2D,Rectangle2D.Double,Rectangle2D.Float,RectangleInt32,RectangularShape
public interface ShapeShape interface without getPathIterator methods- Author:
- Lawrie Griffiths
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(double x, double y)Test if the shape contains the point (x,y)booleancontains(double x, double y, double w, double h)Test if the shape contains the rectangle with top left at (x,y), width w and height h.booleancontains(Point2D p)Test if the shape contains the Point2Dbooleancontains(Rectangle2D r)Test if the shape contains the Rectangle2DRectangleInt32getBounds()Get the bounding Rectangle for the shapeRectangle2DgetBounds2D()Get the bounding Rectangle2D for the shapebooleanintersects(double x, double y, double w, double h)Test if the shape intersects the rectangle with top left at (x,y), width w and height h.booleanintersects(Rectangle2D r)Test if the shape intersects the Rectangle2D r
-
-
-
Method Detail
-
getBounds
RectangleInt32 getBounds()
Get the bounding Rectangle for the shape- Returns:
- the bounding Rectangle
-
getBounds2D
Rectangle2D getBounds2D()
Get the bounding Rectangle2D for the shape- Returns:
- the bounding Rectangle2D
-
contains
boolean contains(double x, double y)Test if the shape contains the point (x,y)- Parameters:
x- the x co-ordinate of the pointy- the y co-ordinate of the point- Returns:
- true iff the shape contains the point
-
contains
boolean contains(Point2D p)
Test if the shape contains the Point2D- Parameters:
p- the Point2D- Returns:
- true iff the shape contains the point
-
intersects
boolean intersects(double x, double y, double w, double h)Test if the shape intersects the rectangle with top left at (x,y), width w and height h.- Parameters:
x- the x-coordinate of the top left point of the rectangley- the y-coordinate of the top left point of the rectanglew- the width of the rectangleh- the height of the rectangle- Returns:
- true iff the shape intersects the rectangle
-
intersects
boolean intersects(Rectangle2D r)
Test if the shape intersects the Rectangle2D r- Parameters:
r- the Recangle2D- Returns:
- true iff the shape intersects the Rectangle2D
-
contains
boolean contains(double x, double y, double w, double h)Test if the shape contains the rectangle with top left at (x,y), width w and height h.- Parameters:
x- the x-coordinate of the top left point of the rectangley- the y-coordinate of the top left point of the rectanglew- the width of the rectangleh- the height of the rectangle- Returns:
- true iff the shape contains the rectangle
-
contains
boolean contains(Rectangle2D r)
Test if the shape contains the Rectangle2D- Parameters:
r- the Rectangle2D- Returns:
- true iff the shape contains the Rectangle2D
-
-