Envelope geometries are immutable and cannot be changed directly once created. Use the constructors to define
minimum and maximum x,y coordinates, z and m values, and a SpatialReference
. Once set, the
SpatialReference
cannot be changed. Use GeometryBuilder.toGeometry()
to return the new
Envelope
from
the builder.
- Since:
- 100.0.0
- See Also:
-
Constructor Summary
ConstructorDescriptionEnvelopeBuilder
(Envelope envelope) Creates an envelope builder from the specifiedEnvelope
.EnvelopeBuilder
(Point center, double width, double height) Creates a new EnvelopeBuilder with the given center point, width and height.EnvelopeBuilder
(Point center, double width, double height, double depth) Creates a new EnvelopeBuilder with the given center point, width, height and depth.EnvelopeBuilder
(SpatialReference spatialReference) Creates a new empty EnvelopeBuilder with the given SpatialReference. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Centers the envelope at the specified point.void
changeAspectRatio
(double width, double height) Adjust the envelope's aspect ratio to match the ratio of the given width and height.void
expand
(double factor) Expands the envelope by the given scale factor.void
Expands the envelope at the anchor point by the given factor.Gets the center point of theEnvelope
being constructed.double
getDepth()
Gets the depth of theEnvelope
being constructed.double
Gets the height of theEnvelope
being constructed.double
getMMax()
Gets the m maximum value of theEnvelope
being constructed.double
getMMin()
Gets the m minimum value of theEnvelope
being constructed.double
getWidth()
Gets the width of theEnvelope
being constructed.double
getXMax()
Gets the x maximum value of theEnvelope
being constructed.double
getXMin()
The x minimum value of theEnvelope
being constructed.double
getYMax()
The y maximum value of theEnvelope
being constructed.double
getYMin()
The y minimum value of theEnvelope
being constructed.double
getZMax()
The z maximum value of theEnvelope
being constructed.double
getZMin()
The z minimum value of theEnvelope
being constructed.void
offsetBy
(double offsetX, double offsetY) Moves the builder's envelope geometry by the given offsets in the x and y dimension.void
setM
(double mMin, double mMax) Sets the new maximum and minimum m values of the Envelope currently being constructed.void
setMMax
(double mMax) Sets the m maximum value of theEnvelope
being constructed.void
setMMin
(double mMin) Sets the m minimum value of theEnvelope
being constructed.void
setXMax
(double xMax) Sets the x maximum value of theEnvelope
being constructed.void
setXMin
(double xMin) The x minimum value of theEnvelope
being constructed.void
setXY
(double xMin, double yMin, double xMax, double yMax) Sets new maximum and minimum x and y coordinates of the Envelope currently being constructed.void
setYMax
(double yMax) The y maximum value of theEnvelope
being constructed.void
setYMin
(double yMin) The y minimum value of theEnvelope
being constructed.void
setZ
(double zMin, double zMax) Sets the new maximum and minimum z values of the Envelope currently being constructed.void
setZMax
(double zMax) The z maximum value of theEnvelope
being constructed.void
setZMin
(double zMin) The z minimum value of theEnvelope
being constructed.Returns a newEnvelope
based on the current state of this builder.void
Finds the union of the builder's envelope and the specified envelope and updates the envelope builder with the result.void
Finds the union of the builder's envelope and the specified point and updates the envelope builder with the result.Methods inherited from class com.esri.arcgisruntime.geometry.GeometryBuilder
create, create, getBuilderType, getExtent, getSpatialReference, hasCurves, hasM, hasZ, isEmpty, isSketchValid, replaceGeometry
-
Constructor Details
-
EnvelopeBuilder
Creates a new empty EnvelopeBuilder with the given SpatialReference.- Parameters:
spatialReference
- the SpatialReference of the new builder- Since:
- 100.0.0
-
EnvelopeBuilder
Creates an envelope builder from the specifiedEnvelope
.The
SpatialReference
of the new envelope builder will match that of the givenEnvelope
. Use this constructor in workflows that create a modified version of an existing geometry.- Parameters:
envelope
- the envelope used to initialize this builder- Since:
- 100.0.0
-
EnvelopeBuilder
Creates a new EnvelopeBuilder with the given center point, width and height. The SpatialReference of the new builder will match that of the given center point.- Parameters:
center
- the center point of the Envelopewidth
- the width of the Envelope around the center pointheight
- the height of the Envelope around the center point- Throws:
IllegalArgumentException
- if center is null- Since:
- 100.1.0
-
EnvelopeBuilder
Creates a new EnvelopeBuilder with the given center point, width, height and depth. The SpatialReference of the new builder will match that of the given center point.- Parameters:
center
- the center point of the Envelopewidth
- the width of the Envelope around the center pointheight
- the height of the Envelope around the center pointdepth
- the depth of the Envelope around the center point- Throws:
IllegalArgumentException
- if center is null- Since:
- 100.1.0
-
-
Method Details
-
getXMin
public double getXMin()The x minimum value of theEnvelope
being constructed.- Returns:
- the current minimum x coordinate
- Since:
- 100.0.0
-
setXMin
public void setXMin(double xMin) The x minimum value of theEnvelope
being constructed.- Parameters:
xMin
- the new minimum x coordinate- Since:
- 100.0.0
-
getYMin
public double getYMin()The y minimum value of theEnvelope
being constructed.- Returns:
- the current minimum y coordinate
- Since:
- 100.0.0
-
setYMin
public void setYMin(double yMin) The y minimum value of theEnvelope
being constructed.- Parameters:
yMin
- the new minimum y coordinate- Since:
- 100.0.0
-
getZMin
public double getZMin()The z minimum value of theEnvelope
being constructed.- Returns:
- the current minimum z value
- Since:
- 100.0.0
-
setZMin
public void setZMin(double zMin) The z minimum value of theEnvelope
being constructed.- Parameters:
zMin
- the new minimum z value- Since:
- 100.0.0
-
getMMin
public double getMMin()Gets the m minimum value of theEnvelope
being constructed.- Returns:
- the current minimum m value
- Since:
- 100.0.0
-
setMMin
public void setMMin(double mMin) Sets the m minimum value of theEnvelope
being constructed.- Parameters:
mMin
- the new minimum m value- Since:
- 100.0.0
-
getXMax
public double getXMax()Gets the x maximum value of theEnvelope
being constructed.- Returns:
- the current maximum x coordinate
- Since:
- 100.0.0
-
setXMax
public void setXMax(double xMax) Sets the x maximum value of theEnvelope
being constructed.- Parameters:
xMax
- the new maximum x coordinate- Since:
- 100.0.0
-
getYMax
public double getYMax()The y maximum value of theEnvelope
being constructed.- Returns:
- the current maximum y coordinate
- Since:
- 100.0.0
-
setYMax
public void setYMax(double yMax) The y maximum value of theEnvelope
being constructed.- Parameters:
yMax
- the new maximum y coordinate- Since:
- 100.0.0
-
getZMax
public double getZMax()The z maximum value of theEnvelope
being constructed.- Returns:
- the current maximum z value
- Since:
- 100.0.0
-
setZMax
public void setZMax(double zMax) The z maximum value of theEnvelope
being constructed.- Parameters:
zMax
- the new maximum z value- Since:
- 100.0.0
-
getMMax
public double getMMax()Gets the m maximum value of theEnvelope
being constructed.- Returns:
- the current maximum m value
- Since:
- 100.0.0
-
setMMax
public void setMMax(double mMax) Sets the m maximum value of theEnvelope
being constructed.- Parameters:
mMax
- the new maximum m value- Since:
- 100.0.0
-
getWidth
public double getWidth()Gets the width of theEnvelope
being constructed.This is the difference between the minimum and maximum x coordinates.
- Returns:
- the width of the Envelope
- Since:
- 100.0.0
-
getHeight
public double getHeight()Gets the height of theEnvelope
being constructed.This is the difference between the minimum and maximum y coordinates.
- Returns:
- the height of the Envelope
- Since:
- 100.0.0
-
getDepth
public double getDepth()Gets the depth of theEnvelope
being constructed.This is the difference between the minimum and maximum z values. A 2D envelope has zero depth.
- Returns:
- the depth of the Envelope
- Since:
- 100.1.0
-
getCenter
Gets the center point of theEnvelope
being constructed.- Returns:
- the center point
- Since:
- 100.0.0
-
setXY
public void setXY(double xMin, double yMin, double xMax, double yMax) Sets new maximum and minimum x and y coordinates of the Envelope currently being constructed. Note that the SpatialReference of a builder cannot be changed after it is initialized.- Parameters:
xMin
- the new minimum x coordinateyMin
- the new minimum y coordinatexMax
- the new maximum x coordinateyMax
- the new maximum y coordinate- Since:
- 100.0.0
-
setZ
public void setZ(double zMin, double zMax) Sets the new maximum and minimum z values of the Envelope currently being constructed.- Parameters:
zMin
- the new minimum z valuezMax
- the new maximum z value- Since:
- 100.0.0
-
setM
public void setM(double mMin, double mMax) Sets the new maximum and minimum m values of the Envelope currently being constructed.- Parameters:
mMin
- the new minimum m valuemMax
- the new maximum m value- Since:
- 100.0.0
-
toGeometry
Returns a newEnvelope
based on the current state of this builder. This method can be called as many times as required for any specific instance; it does not affect the state of the builder, and returns a new Envelope each time.- Specified by:
toGeometry
in classGeometryBuilder
- Returns:
- a new Envelope based on the current state of this builder
- Since:
- 100.0.0
-
centerAt
Centers the envelope at the specified point.The point's spatial reference must be the same as the envelope builder's.
- Parameters:
point
- the point to center at- Throws:
IllegalArgumentException
- if point is null- Since:
- 100.5.0
-
changeAspectRatio
public void changeAspectRatio(double width, double height) Adjust the envelope's aspect ratio to match the ratio of the given width and height.The operation preserves the center of the envelope and only increases either height or width, not both. If the new width would be greater than the old, the width is changed and the height remains the same. If the new width would be less than or equal to the old, the height is changed and the width remains the same.
- Parameters:
width
- a widthheight
- a height- Since:
- 100.5.0
-
offsetBy
public void offsetBy(double offsetX, double offsetY) Moves the builder's envelope geometry by the given offsets in the x and y dimension.- Parameters:
offsetX
- the number of units to move the envelope on the x-axisoffsetY
- the number of units to move the envelope on the y-axis- Since:
- 100.5.0
-
expand
public void expand(double factor) Expands the envelope by the given scale factor.A factor of less than 1.0 shrinks the envelope and greater than 1.0 expands it. The envelope's center remains unchanged, but its corners change.
- Parameters:
factor
- the factor to scale the envelope by- Since:
- 100.5.0
-
expand
Expands the envelope at the anchor point by the given factor.A factor of less than 1.0 shrinks the envelope and greater than 1.0 expands it.
- Parameters:
anchorPoint
- a point within the envelope to expand fromfactor
- the factor to scale the envelope by- Throws:
IllegalArgumentException
- if anchorPoint is null- Since:
- 100.5.0
-
unionOf
Finds the union of the builder's envelope and the specified envelope and updates the envelope builder with the result.- Parameters:
envelope
- another Envelope to union with- Throws:
IllegalArgumentException
- if envelope is null- Since:
- 100.5.0
-
unionOf
Finds the union of the builder's envelope and the specified point and updates the envelope builder with the result.- Parameters:
point
- a point to union with- Throws:
IllegalArgumentException
- if point is null- Since:
- 100.5.0
-