The envelope builder allows you to create and modify envelope geometries incrementally. More...
Header: | #include <EnvelopeBuilder.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::GeometryBuilder |
Public Functions
EnvelopeBuilder(const Esri::ArcGISRuntime::Point ¢er, double width, double height, QObject *parent = nullptr) | |
EnvelopeBuilder(const Esri::ArcGISRuntime::Point ¢er, double width, double height, double depth, QObject *parent = nullptr) | |
EnvelopeBuilder(const Esri::ArcGISRuntime::Envelope &envelope, QObject *parent = nullptr) | |
EnvelopeBuilder(const Esri::ArcGISRuntime::SpatialReference &spatialReference, QObject *parent = nullptr) | |
virtual | ~EnvelopeBuilder() override |
Esri::ArcGISRuntime::Point | center() const |
void | centerAtPoint(const Esri::ArcGISRuntime::Point &point) |
double | depth() const |
void | expandByFactor(double factor) |
void | expandByFactor(double factor, const Esri::ArcGISRuntime::Point &anchorPoint) |
double | height() const |
double | mMax() const |
double | mMin() const |
void | offsetBy(double offsetX, double offsetY) |
void | reaspect(double width, double height) |
void | setM(double mMin, double mMax) |
void | setMMax(double mMax) |
void | setMMin(double mMin) |
void | setXMax(double xMax) |
void | setXMin(double xMin) |
void | setXY(double xMin, double yMin, double xMax, double yMax) |
void | setYMax(double yMax) |
void | setYMin(double yMin) |
void | setZ(double zMin, double zMax) |
void | setZMax(double zMax) |
void | setZMin(double zMin) |
Esri::ArcGISRuntime::Envelope | toEnvelope() const |
void | unionWithEnvelope(const Esri::ArcGISRuntime::Envelope &envelope) |
void | unionWithPoint(const Esri::ArcGISRuntime::Point &point) |
double | width() const |
double | xMax() const |
double | xMin() const |
double | yMax() const |
double | yMin() const |
double | zMax() const |
double | zMin() const |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::Geometry | toGeometry() const override |
Detailed Description
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.
// create an Envelope, then use an EnvelopeBuilder to move it. Envelope envelope(0.0, 0.0, 1.0, 1.0, SpatialReference(4326)); auto* eBuilder = new EnvelopeBuilder(envelope, this); eBuilder->offsetBy(10.0, 10.0); // move right and up by 10 envelope = eBuilder->toEnvelope();
Member Function Documentation
[since Esri::ArcGISRuntime 100.3]
EnvelopeBuilder::EnvelopeBuilder (const Esri::ArcGISRuntime::Point ¢er, double width, double height, QObject *parent = nullptr)
Initializes an envelope builder with specified dimensions.
- center - The center point for the envelope.
- width - The width of the envelope around the center point.
- height - The height of the envelope around the center point.
- parent - An optional parent.
This function was introduced in Esri::ArcGISRuntime 100.3.
[since Esri::ArcGISRuntime 100.3]
EnvelopeBuilder::EnvelopeBuilder (const Esri::ArcGISRuntime::Point ¢er, double width, double height, double depth, QObject *parent = nullptr)
Initializes an envelope builder with specified dimensions.
- center - The center point for the envelope.
- width - The width of the envelope around the center point.
- height - The height of the envelope around the center point.
- depth - The depth of the envelope around the center point.
- parent - An optional parent.
This function was introduced in Esri::ArcGISRuntime 100.3.
[explicit]
EnvelopeBuilder::EnvelopeBuilder (const Esri::ArcGISRuntime::Envelope &envelope, QObject *parent = nullptr)
Creates an envelope builder from the specified Envelope.
- envelope - The envelope.
- parent - The optional parent QObject.
The SpatialReference of the new envelope builder will match that of the given Envelope. Use this constructor in workflows that create a modified version of an existing geometry.
[explicit]
EnvelopeBuilder::EnvelopeBuilder (const Esri::ArcGISRuntime::SpatialReference &spatialReference , QObject *parent = nullptr)
Initializes an envelope builder from a SpatialReference.
- spatialReference - The spatial reference.
- parent - An optional parent.
[override virtual]
EnvelopeBuilder::~EnvelopeBuilder ()
Destructor.
Esri::ArcGISRuntime::Point EnvelopeBuilder::center() const
Returns the center point of the Envelope being constructed.
void EnvelopeBuilder::centerAtPoint (const Esri::ArcGISRuntime::Point &point)
Centers the envelope at the specified point.
- point - The point to center on.
The point's spatial reference must be the same as the envelope builder's.
[since Esri::ArcGISRuntime 100.1]
double EnvelopeBuilder::depth() const
Returns the depth of the Envelope being constructed.
This is the difference between the minimum and maximum z values. A 2D envelope has zero depth.
This function was introduced in Esri::ArcGISRuntime 100.1.
void EnvelopeBuilder::expandByFactor (double factor)
Expands the envelope by the given scale factor.
- factor - The factor to scale the envelope by.
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.
void EnvelopeBuilder::expandByFactor (double factor, const Esri::ArcGISRuntime::Point &anchorPoint )
Expands the envelope at the anchor point by the given factor.
- anchorPoint - The point to anchor at.
- factor - The factor to scale the envelope by.
A factor of less than 1.0 shrinks the envelope and greater than 1.0 expands it.
double EnvelopeBuilder::height() const
Returns the height of the Envelope being constructed.
This is the difference between the minimum and maximum y coordinates.
double EnvelopeBuilder::mMax () const
Returns the m maximum value of the Envelope being constructed.
Returns NaN
if an error occurs.
See also setMMax().
double EnvelopeBuilder::mMin () const
Returns the m minimum value of the Envelope being constructed.
Returns NaN
if an error occurs.
See also setMMin().
void EnvelopeBuilder::offsetBy (double offsetX , double offsetY )
Moves the builder's envelope geometry by the given offsets in the x and y dimension.
- offsetX - The number of units to move the envelope on the x axis.
- offsetY - The number of units to move the envelope on the y axis.
void EnvelopeBuilder::reaspect(double width, double height)
Adjust the envelope's aspect ratio to match the ratio of the given width and height.
- width - A width.
- height - A 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.
void EnvelopeBuilder::setM (double mMin , double mMax )
Set the m-values for the envelope.
- mMin - The m minimum value for the envelope.
- mMax - The m maximum value for the envelope.
void EnvelopeBuilder::setMMax (double mMax )
Sets the mMax to mMax.
See also mMax.
void EnvelopeBuilder::setMMin (double mMin )
Sets the mMin to mMin.
See also mMin.
void EnvelopeBuilder::setXMax (double xMax )
Sets the xMax to xMax.
See also xMax.
void EnvelopeBuilder::setXMin (double xMin )
Sets the xMin to xMin.
See also xMin.
void EnvelopeBuilder::setXY (double xMin , double yMin , double xMax , double yMax )
Set the x,y coordinates for the envelope.
- xMin - The x minimum value for the envelope.
- yMin - The y minimum value for the envelope.
- xMax - The x maximum value for the envelope.
- yMax - The y maximum value for the envelope.
void EnvelopeBuilder::setYMax (double yMax )
Sets the yMax to yMax.
See also yMax.
void EnvelopeBuilder::setYMin (double yMin )
Sets the yMin to yMin.
See also yMin.
void EnvelopeBuilder::setZ (double zMin , double zMax )
Set the z-values for the envelope.
- zMin - The z minimum value for the envelope.
- zMax - The z maximum value for the envelope.
void EnvelopeBuilder::setZMax (double zMax )
Sets the zMax to zMax.
See also zMax.
void EnvelopeBuilder::setZMin (double zMin )
Sets the zMin to zMin.
See also zMin.
Esri::ArcGISRuntime::Envelope EnvelopeBuilder::toEnvelope () const
Returns the envelope this builder is constructing or modifying. This is a convenience method to avoid needing to cast the return value.
[override virtual]
Esri::ArcGISRuntime::Geometry EnvelopeBuilder::toGeometry () const
Reimplements: GeometryBuilder::toGeometry() const.
Returns the envelope this builder is constructing or modifying.
void EnvelopeBuilder::unionWithEnvelope (const Esri::ArcGISRuntime::Envelope &envelope)
Finds the union of the builder's envelope and the specified envelope and updates the envelope builder with the result.
- envelope - Another envelope to union with.
void EnvelopeBuilder::unionWithPoint (const Esri::ArcGISRuntime::Point &point)
Finds the union of the builder's envelope and the specified point and updates the envelope builder with the result.
- point - A point to union with.
double EnvelopeBuilder::width() const
Returns the width of the Envelope being constructed.
This is the difference between the minimum and maximum x coordinates.
double EnvelopeBuilder::xMax () const
Returns the x maximum value of the Envelope being constructed.
Returns NaN
if an error occurs.
See also setXMax().
double EnvelopeBuilder::xMin () const
Returns the x minimum value of the Envelope being constructed.
Returns NaN
if an error occurs.
See also setXMin().
double EnvelopeBuilder::yMax () const
Returns the y maximum value of the Envelope being constructed.
Returns NaN
if an error occurs.
See also setYMax().
double EnvelopeBuilder::yMin () const
Returns the y minimum value of the Envelope being constructed.
Returns NaN
if an error occurs.
See also setYMin().
double EnvelopeBuilder::zMax () const
Returns the z maximum value of the Envelope being constructed.
Returns NaN
if an error occurs.
See also setZMax().
double EnvelopeBuilder::zMin () const
Returns the z minimum value of the Envelope being constructed.
Returns NaN
if an error occurs.
See also setZMin().