ProjBox class
A bounding box with minX, minY, maxX and maxY coordinates.
Optional minZ and maxZ for 3D boxes, and minM and maxM for measured boxes can be provided too.
Supported coordinate value combinations by coordinate type:
Type | Bounding box values |
---|---|
xy | minX, minY, maxX, maxY |
xyz | minX, minY, minZ, maxX, maxY, maxZ |
xym | minX, minY, minM, maxX, maxY, maxM |
xyzm | minX, minY, minZ, minM, maxX, maxY, maxZ, maxM |
- Inheritance
-
- Object
- Positionable
- ValuePositionable
- Box
- ProjBox
- Annotations
-
- @immutable
Constructors
- ProjBox({required double minX, required double minY, double? minZ, double? minM, required double maxX, required double maxY, double? maxZ, double? maxM})
-
A bounding box with
minX
,minY
,maxX
andmaxY
coordinates.const -
ProjBox.build(Iterable<
num> coords, {int offset = 0, Coords? type}) -
Builds a projected bounding box from
coords
starting fromoffset
.factory - ProjBox.create({required double minX, required double minY, double? minZ, double? minM, required double maxX, required double maxY, double? maxZ, double? maxM})
-
A bounding box from parameters compatible with
CreateBox
function type.const -
ProjBox.from(Iterable<
Projected> positions) -
A minimum bounding box calculated from
positions
.factory - ProjBox.parse(String text, {Pattern delimiter = ',', Coords? type, bool swapXY = false})
-
Parses a projected bounding box from
text
.factory
Properties
- conforming → PositionScheme
-
Returns a position scheme this bounding box is conforming to.
no setteroverride
- coordinateDimension → int
-
The number of coordinate values (2, 3 or 4) on a position.
no setteroverride
- coordType → Coords
-
A value of Coords representing the coordinate type of position data
contained directly or within child objects.
no setterinherited
-
corners2D
→ Iterable<
Projected> -
Returns all distinct (in 2D) corners for this axis aligned bounding box.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setteroverride
- height → double
-
The height of the bounding box, equals to
maxY - minY
.no setteroverride - is3D → bool
-
True for 3D positions (with z or elevation coordinate).
no setteroverride
- isMeasured → bool
-
True if a measure value is available (or the m coordinate for a position).
no setteroverride
- max → Projected
-
The maximum position (or east-north) of this bounding box.
no setteroverride
- maxM → double?
-
The maximum m coordinate optionally. Returns null if not available.
no setteroverride
- maxX → double
-
The maximum x (or east) coordinate.
no setteroverride
- maxY → double
-
The maximum y (or north) coordinate.
no setteroverride
- maxZ → double?
-
The maximum z coordinate optionally. Returns null if not available.
no setteroverride
- min → Projected
-
The minimum position (or west-south) of this bounding box.
no setteroverride
- minM → double?
-
The minimum m coordinate optionally. Returns null if not available.
no setteroverride
- minX → double
-
The minimum x (or west) coordinate.
no setteroverride
- minY → double
-
The minimum y (or south) coordinate.
no setteroverride
- minZ → double?
-
The minimum z coordinate optionally. Returns null if not available.
no setteroverride
- positionCount → int
-
A Box object represents two positions (min and max), returns always
2
.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spatialDimension → int
-
The number of spatial coordinate values (2 for 2D or 3 for 3D) on a
position.
no setteroverride
- type → Coords
-
The coordinate type.
no setteroverride
- valueCount → int
-
The number of coordinate values contained.
no setterinherited
-
values
→ Iterable<
double> -
Coordinate values of this bounding box as an iterable of 4, 6 or 8 items.
no setterinherited
- width → double
-
The width of the bounding box, equals to
maxX - minX
.no setteroverride
Methods
-
aligned2D(
[Aligned align = Aligned.center]) → Projected -
Returns an aligned 2D position relative to this box.
override
-
copyByType(
Coords type) → ProjBox -
Copies
this
as another object according to the giventype
.override -
copyTo<
R extends Box> (CreateBox< R> factory) → R -
Copies this box to a new box created by the
factory
.inherited -
copyWith(
{double? minX, double? minY, double? minZ, double? minM, double? maxX, double? maxY, double? maxZ, double? maxM}) → ProjBox -
Copies this box with optional attributes overriding values.
override
-
equals2D(
covariant Box other, {double toleranceHoriz = defaultEpsilon}) → bool -
True if this box equals with
other
by testing 2D coordinates only.inherited -
equals3D(
covariant Box other, {double toleranceHoriz = defaultEpsilon, double toleranceVert = defaultEpsilon}) → bool -
True if this box equals with
other
by testing 3D coordinates only.inherited -
equalsCoords(
covariant Box other) → bool -
True if this and the
other
box equals.inherited -
intersects(
Box other) → bool -
Returns true if this bounding box intesects with
other
box.inherited -
intersects2D(
Box other) → bool -
Returns true if this bounding box intersects with
other
box in 2D.inherited -
intersectsPoint(
Position point) → bool -
Returns true if this bounding box intesects with
point
.inherited -
intersectsPoint2D(
Position point) → bool -
Returns true if this bounding box intesects with
point
in 2D.inherited -
length2D(
) → double -
Returns the perimeter of the area represented by this bounding box
calculated in a cartesian 2D plane.
inherited
-
merge(
Box other) → ProjBox -
Returns a minimum bounding box containing both this and
other
.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
project(
Projection projection) → GeoBox -
Projects this projected bounding box to a geographic box using
the inverse
projection
.override -
splitUnambiguously(
) → Iterable< ProjBox> -
Returns unambiguous bounding boxes whose merged area equals with this
bounding box.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
toText(
{String delimiter = ',', int? decimals, bool compactNums = true, bool swapXY = false}) → String -
Returns coordinate values as a string separated by
delimiter
.inherited -
valuesByType(
Coords type) → Iterable< double> -
Coordinate values as a double iterable according to the given
type
.inherited
Operators
-
operator *(
double factor) → ProjBox -
Returns a bounding box with coordinate values of this scaled by
factor
.override -
operator +(
Position addend) → ProjBox -
Returns a bounding box with min and max coordinate values of this summed
with coordinate values of
addend
.override -
operator -(
Position subtract) → ProjBox -
Returns a bounding box with min and max coordinate values of this
subtracted with coordinate values of
subtract
.override -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator unary-(
) → ProjBox -
Returns a bounding box with coordinate values of this negated.
override