Helper class for building immutable Envelope geometries. More...
Header: | #include <EnvelopeBuilder.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::GeometryBuilder |
This class was introduced in Esri::ArcGISRuntime 100.0.
Public Functions
EnvelopeBuilder(const Esri::ArcGISRuntime::SpatialReference &spatialReference, QObject *parent = nullptr) | |
EnvelopeBuilder(const Esri::ArcGISRuntime::Envelope &envelope, QObject *parent = nullptr) | |
EnvelopeBuilder(const Esri::ArcGISRuntime::Point ¢er, double width, double height, double depth, QObject *parent = nullptr) | |
EnvelopeBuilder(const Esri::ArcGISRuntime::Point ¢er, double width, double height, 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
Envelopes are straightforward geometries to define, and therefore Envelope class constructors provide many of the same options as available on this builder.
Some methods, such as unionWithPoint, return a reference to the builder so you can easily chain method calls.
// create an Envelope, then use an EnvelopeBuilder to move it. Envelope envelope(0.0, 0.0, 1.0, 1.0, SpatialReference(4326)); EnvelopeBuilder* eBuilder = new EnvelopeBuilder(envelope, this); eBuilder->offsetBy(10.0, 10.0); // move right and up by 10 envelope = eBuilder->toEnvelope();
Member Function Documentation
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.
EnvelopeBuilder::EnvelopeBuilder (const Esri::ArcGISRuntime::Envelope &envelope, QObject *parent = nullptr)
Initializes an envelope builder starting with a specified envelope and an optional parent.
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.
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.
[override virtual]
EnvelopeBuilder::~EnvelopeBuilder ()
Destructor.
Esri::ArcGISRuntime::Point EnvelopeBuilder::center() const
Gets the x,y-coordinates of the center.
void EnvelopeBuilder::centerAtPoint (const Esri::ArcGISRuntime::Point &point)
Moves the envelope to be centered at a specified point.
The point's spatial reference must be the same as the builder's.
double EnvelopeBuilder::depth() const
Returns the depth (zMax - zMin) of the envelope builder.
A 2D envelope builder has zero depth.
This function was introduced in Esri::ArcGISRuntime 100.1.
void EnvelopeBuilder::expandByFactor (double factor)
Expands the envelope at the anchor point by the given factor.
A factor < 1.0 shrinks the envelope and > 1.0 expands it. The envelope's center remains unchanged, but its corners change. This is the same as calling expandByFactor(double factor, const Point& center).
void EnvelopeBuilder::expandByFactor (double factor, const Esri::ArcGISRuntime::Point &anchorPoint )
Expands the builder's envelope geometry, while not moving specified anchor point.
A factor < 1.0 shrinks the envelope and > 1.0 expands it. A specified anchorPoint remains unchanged, but its corners change around it.
double EnvelopeBuilder::height() const
Gets the height (distance from yMin to yMax).
double EnvelopeBuilder::mMax () const
Gets the maximum m-value.
See also setMMax().
double EnvelopeBuilder::mMin () const
Gets the minimum m-value.
See also setMMin().
void EnvelopeBuilder::offsetBy (double offsetX , double offsetY )
Move the builder's geometry in the x/y plane.
- offsetX - The offset along x-axis (negative value moves the envelope west)
- offsetY - The offset along y-axis (negative value moves the envelope south)
void EnvelopeBuilder::reaspect(double width, double height)
Adjust the envelope's aspect ratio to match the ratio of the given width and height.
The envelope's center remains unchanged, but its corners change so the Envelope has the given width and height.
void EnvelopeBuilder::setM (double mMin , double mMax )
Sets the m-values to mMin and mMax.
void EnvelopeBuilder::setMMax (double mMax )
Sets the maximum m-value.
- mMax - The maximum m-value.
See also mMax().
void EnvelopeBuilder::setMMin (double mMin )
Sets the minimum m-value.
- mMin - The minimum m-value.
See also mMin().
void EnvelopeBuilder::setXMax (double xMax )
Sets the maximum x-coordinate.
- xMax - The maximum x-coordinate.
See also xMax().
void EnvelopeBuilder::setXMin (double xMin )
Sets the minimum x-coordinate.
- xMin - The minimum x-coordinate.
See also xMin().
void EnvelopeBuilder::setXY (double xMin , double yMin , double xMax , double yMax )
Sets the x,y-coordinate to xMin, yMin, xMax and yMax.
void EnvelopeBuilder::setYMax (double yMax )
Sets the maximum y-coordinate.
- yMax - The maximum y-coordinate.
See also yMax().
void EnvelopeBuilder::setYMin (double yMin )
Sets the minimum y-coordinate.
- yMin - The minimum y-coordinate.
See also yMin().
void EnvelopeBuilder::setZ (double zMin , double zMax )
Sets the z-coordinate to zMin and zMax.
void EnvelopeBuilder::setZMax (double zMax )
Sets the maximum z-coordinate.
- zMax - The maximum z-coordinate.
See also zMax().
void EnvelopeBuilder::setZMin (double zMin )
Sets the minimum z-coordinate.
- zMin - The minimum z-coordinate.
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)
Unions the builder's envelope with the given envelope.
The input envelope's spatial reference must be the same as the builder's.
void EnvelopeBuilder::unionWithPoint (const Esri::ArcGISRuntime::Point &point)
Unions the builder's envelope with the given point.
The input point's spatial reference must be the same as the builder's.
double EnvelopeBuilder::width() const
Gets the width (distance from xMin to xMax).
double EnvelopeBuilder::xMax () const
Gets the maximum x-coordinate.
See also setXMax().
double EnvelopeBuilder::xMin () const
Gets the minimum x-coordinate.
See also setXMin().
double EnvelopeBuilder::yMax () const
Gets the maximum y-coordinate.
See also setYMax().
double EnvelopeBuilder::yMin () const
Gets the minimum y-coordinate.
See also setYMin().
double EnvelopeBuilder::zMax () const
Gets the maximum z-coordinate.
See also setZMax().
double EnvelopeBuilder::zMin () const
Gets the minimum z-coordinate.
See also setZMin().