-
public class RectRegion
RectRegion is just a rectangle with additional methods for determining intersections with other RectRegion instances. RectRegion operates on "native units" which are simply whatever unit type is passed into it by the user.
-
-
Constructor Summary
Constructors Constructor Description RectRegion()
RectRegion(XYCoords min, XYCoords max)
RectRegion(Number minX, Number maxX, Number minY, Number maxY, String label)
RectRegion(RectF rect)
RectRegion(Number minX, Number maxX, Number minY, Number maxY)
-
Method Summary
Modifier and Type Method Description String
getLabel()
void
setLabel(String label)
static RectRegion
withDefaults(RectRegion defaults)
XYCoords
transform(Number x, Number y, RectRegion region2, boolean flipX, boolean flipY)
XYCoords
transform(Number x, Number y, RectRegion region2)
XYCoords
transform(XYCoords value, RectRegion region2)
RectRegion
transform(RectRegion r, RectRegion r2, boolean flipX, boolean flipY)
Transform a region (r) from the current region space (this) into the specified one (r2) PointF
transformScreen(Number x, Number y, RectF region2)
Convenience method to transform into screen coordinate space. void
transformScreen(PointF result, Number x, Number y, RectF region2)
void
transform(PointF result, Number x, Number y, RectF region2, boolean flipX, boolean flipY)
PointF
transform(Number x, Number y, RectF region2, boolean flipX, boolean flipY)
PointF
transformScreen(XYCoords value, RectF region2)
PointF
transform(XYCoords value, RectF region2, boolean flipX, boolean flipY)
Convenience method to transform into screen coordinate space. void
union(Number x, Number y)
void
union(RectRegion input)
Compares the input bounds xy min/max vals against this instance's current xy min/max vals.If the input.min is less than this.min then this.min will be set to input.min.If the input.max is greater than this.max then this.max will be set to input.maxThe result will always have equal or greater area than the inputs. boolean
intersects(RectRegion region)
boolean
intersects(Number minX, Number maxX, Number minY, Number maxY)
Tests whether this region intersects the region defined by params. RectF
asRectF()
void
intersect(RectRegion clippingBounds)
The result of an intersect is always a RectRegion with an equal or smaller area. List<RectRegion>
intersects(List<RectRegion> regions)
Returns a list of XYRegions that either completely or partially intersect the areadefined by params. Number
getWidth()
Number
getHeight()
void
set(Number minX, Number maxX, Number minY, Number maxY)
boolean
isMinXSet()
Number
getMinX()
void
setMinX(Number minX)
boolean
isMaxXSet()
Number
getMaxX()
void
setMaxX(Number maxX)
boolean
isMinYSet()
Number
getMinY()
void
setMinY(Number minY)
boolean
isMaxYSet()
Number
getMaxY()
void
setMaxY(Number maxY)
Region
getxRegion()
void
setxRegion(Region xRegion)
Region
getyRegion()
void
setyRegion(Region yRegion)
boolean
isFullyDefined()
boolean
contains(Number x, Number y)
True if this region contains the specified coordinates. String
toString()
-
-
Method Detail
-
withDefaults
static RectRegion withDefaults(RectRegion defaults)
-
transform
XYCoords transform(Number x, Number y, RectRegion region2, boolean flipX, boolean flipY)
-
transform
XYCoords transform(Number x, Number y, RectRegion region2)
-
transform
XYCoords transform(XYCoords value, RectRegion region2)
-
transform
RectRegion transform(RectRegion r, RectRegion r2, boolean flipX, boolean flipY)
Transform a region (r) from the current region space (this) into the specified one (r2)
- Parameters:
r
- The region to which the transformation appliesr2
- The region into which r is being transformed
-
transformScreen
PointF transformScreen(Number x, Number y, RectF region2)
Convenience method to transform into screen coordinate space. Equivalent to invoking transform withflipX = false and flipY = true.
-
transformScreen
void transformScreen(PointF result, Number x, Number y, RectF region2)
-
transform
void transform(PointF result, Number x, Number y, RectF region2, boolean flipX, boolean flipY)
-
transformScreen
PointF transformScreen(XYCoords value, RectF region2)
-
transform
PointF transform(XYCoords value, RectF region2, boolean flipX, boolean flipY)
Convenience method to transform into screen coordinate space. Equivalent to invoking transform with flipX = false and flipY = true.
-
union
void union(RectRegion input)
Compares the input bounds xy min/max vals against this instance's current xy min/max vals.If the input.min is less than this.min then this.min will be set to input.min.If the input.max is greater than this.max then this.max will be set to input.maxThe result will always have equal or greater area than the inputs.
-
intersects
boolean intersects(RectRegion region)
-
intersects
boolean intersects(Number minX, Number maxX, Number minY, Number maxY)
Tests whether this region intersects the region defined by params. Usenull to represent infinity. Negative and positive infinity is implied bythe boundary edge, ie. a maxX of null equals positive infinity while aminX of null equals negative infinity.
-
intersect
void intersect(RectRegion clippingBounds)
The result of an intersect is always a RectRegion with an equal or smaller area.
-
intersects
List<RectRegion> intersects(List<RectRegion> regions)
Returns a list of XYRegions that either completely or partially intersect the areadefined by params. A null value for any parameter represents infinity / no boundary.
- Parameters:
regions
- The list of regions to search through
-
isMinXSet
boolean isMinXSet()
-
isMaxXSet
boolean isMaxXSet()
-
isMinYSet
boolean isMinYSet()
-
isMaxYSet
boolean isMaxYSet()
-
getxRegion
Region getxRegion()
-
setxRegion
void setxRegion(Region xRegion)
-
getyRegion
Region getyRegion()
-
setyRegion
void setyRegion(Region yRegion)
-
isFullyDefined
boolean isFullyDefined()
-
contains
boolean contains(Number x, Number y)
True if this region contains the specified coordinates.
-
-
-
-