Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::RectangleGeographicArea Class Reference

RectangleGeographicArea object. More...

Inheritance diagram for gem::RectangleGeographicArea:
Collaboration diagram for gem::RectangleGeographicArea:

Public Member Functions

 RectangleGeographicArea ()
 Default constructor.
 RectangleGeographicArea (double minLat, double maxLat, double minLon, double maxLon)
 Constructs a RectangleGeographicArea object with minimum and maximum latitudes and longitudes.
 RectangleGeographicArea (const Coordinates &coords1, const Coordinates &coords2)
 Constructs a RectangleGeographicArea object from top-left and bottom-right coordinates.
 RectangleGeographicArea (const Coordinates &coords, double horizRadius, double vertRadius)
 Constructs a RectangleGeographicArea object from center coordinates and horizontal/vertical radii.
 RectangleGeographicArea (const RectangleGeographicArea &other)=default
 Default copy constructor.
 RectangleGeographicArea (RectangleGeographicArea &&obj) noexcept
 Default move constructor.
RectangleGeographicAreaoperator= (const RectangleGeographicArea &other)=default
 Default copy assignment.
RectangleGeographicAreaoperator= (RectangleGeographicArea &&obj) noexcept
 Default move assignment.
Coordinates getTopLeft () const noexcept
 Retrieves the coordinates of the top-left point of the rectangle.
RectangleGeographicAreasetTopLeft (const Coordinates &point) noexcept
 Sets the top-left point of the rectangle.
Coordinates getBottomRight () const noexcept
 Retrieves the coordinates of the bottom-right point of the rectangle.
RectangleGeographicAreasetBottomRight (const Coordinates &point) noexcept
 Sets the bottom-right point of the rectangle.
RectangleGeographicAreaset (double minLatitude, double maxLatitude, double minLongitude, double maxLongitude) noexcept
 Defines the rectangle using latitude and longitude ranges.
RectangleGeographicAreaset (const Coordinates &coords, double horizRadius, double vertRadius) noexcept
 Defines the rectangle based on a central point and dimensions.
RectangleGeographicAreaset (const Coordinates &coords1, const Coordinates &coords2)
 Defines teh rectangle from top-left and bottom-right coordinates.
bool intersects (const RectangleGeographicArea &area) const noexcept
 Checks if this rectangle intersects with another rectangle.
bool contains (const RectangleGeographicArea &area) const noexcept
 Checks if this rectangle completely contains another rectangle.
RectangleGeographicAreasetIntersection (const RectangleGeographicArea &area) noexcept
 Sets this rectangle to the intersection of itself and another rectangle.
RectangleGeographicAreasetUnion (const RectangleGeographicArea &area) noexcept
 Sets this rectangle to the union of itself and another rectangle.
RectangleGeographicArea makeIntersection (const RectangleGeographicArea &area) const noexcept
 Creates a new RectangleGeographicArea as the intersection of this rectangle and another.
RectangleGeographicArea makeUnion (const RectangleGeographicArea &area) const noexcept
 Creates a new RectangleGeographicArea as the union of this rectangle and another.
EGeographicAreaType type () const
 Retrieves the specific type of the geographic area.
bool containsCoordinates (Coordinates const &point) const
 Checks if the specified point is contained within the geographic area.
RectangleGeographicArea getBoundingBox () const noexcept
 Get the bounding box.
Coordinates getCenterPoint () const noexcept
 Retrieves the center point of the geographic area.
bool equals (GeographicArea const &other) const noexcept
 Checks if two geographic areas are considered equal.
bool operator== (const GeographicArea &area) const noexcept
 Equality comparison operator for geographic areas.
bool operator!= (const GeographicArea &area) const noexcept
 Inequality comparison operator for geographic areas.
template<typename TSubclass>
TSubclass cast () const noexcept
 Attempts to cast the current geographic area object to a specified subclass.
bool isDefault () const override
 Determines if the current geographic area object is in its default state (unaltered since creation).
 operator bool () const noexcept
 Boolean conversion operator indicating if the geographic area is valid and not in its default state.
bool isEmpty () const noexcept
 Checks if the geographic area is empty.
void reset () noexcept
 Resets the geographic area object to its default state.
int convert (GeographicArea &area) const noexcept
 Converts the geographic area to another type, if possible.

Static Public Member Functions

static constexpr EGeographicAreaType type () noexcept
 Get the type of the geographic area.

Detailed Description

RectangleGeographicArea object.

Implements share-read / copy-on-write Api object over IRectangleGeographicArea.

Constructor & Destructor Documentation

◆ RectangleGeographicArea() [1/5]

gem::RectangleGeographicArea::RectangleGeographicArea ( double minLat,
double maxLat,
double minLon,
double maxLon )
inline

Constructs a RectangleGeographicArea object with minimum and maximum latitudes and longitudes.

Parameters
minLatMinimum latitude of the rectangle.
maxLatMaximum latitude of the rectangle.
minLonMinimum longitude of the rectangle.
maxLonMaximum longitude of the rectangle. Ensures that the coordinates form a valid rectangle by sorting the inputs.

◆ RectangleGeographicArea() [2/5]

gem::RectangleGeographicArea::RectangleGeographicArea ( const Coordinates & coords1,
const Coordinates & coords2 )
inline

Constructs a RectangleGeographicArea object from top-left and bottom-right coordinates.

Parameters
coords1Coordinates of the top-left corner.
coords2Coordinates of the bottom-right corner. Ensures that the coordinates form a valid rectangle.

◆ RectangleGeographicArea() [3/5]

gem::RectangleGeographicArea::RectangleGeographicArea ( const Coordinates & coords,
double horizRadius,
double vertRadius )
inline

Constructs a RectangleGeographicArea object from center coordinates and horizontal/vertical radii.

Parameters
coordsCenter coordinates of the rectangle.
horizRadiusHorizontal radius in meters.
vertRadiusVertical radius in meters.

◆ RectangleGeographicArea() [4/5]

gem::RectangleGeographicArea::RectangleGeographicArea ( const RectangleGeographicArea & other)
default

Default copy constructor.

Creates a copy of an existing RectangleGeographicArea object.

Parameters
otherThe object to copy.

◆ RectangleGeographicArea() [5/5]

gem::RectangleGeographicArea::RectangleGeographicArea ( RectangleGeographicArea && obj)
inlinenoexcept

Default move constructor.

Moves an existing RectangleGeographicArea object into a new instance.

Parameters
objThe object to move into this new instance.

Member Function Documentation

◆ cast()

template<typename TSubclass>
TSubclass gem::GeographicArea::cast ( ) const
inlinenoexceptinherited

Attempts to cast the current geographic area object to a specified subclass.

This is a template method.

Template Parameters
TSubclassThe subclass type to cast to.
Returns
An object of type TSubclass if the cast is successful; otherwise, a default-constructed object of TSubclass.

◆ contains()

bool gem::RectangleGeographicArea::contains ( const RectangleGeographicArea & area) const
inlinenoexcept

Checks if this rectangle completely contains another rectangle.

Parameters
areaThe RectangleGeographicArea to check containment of.
Returns
True if this rectangle contains the other, false otherwise.

◆ containsCoordinates()

bool gem::GeographicArea::containsCoordinates ( Coordinates const & point) const
inlineinherited

Checks if the specified point is contained within the geographic area.

Parameters
pointA Coordinates object representing the point to check.
Returns
True if the point is within the geographic area, false otherwise.

◆ convert()

int gem::GeographicArea::convert ( GeographicArea & area) const
inlinenoexceptinherited

Converts the geographic area to another type, if possible.

Parameters
areaA GeographicArea object to convert to.
Returns
An integer indicating the success or failure of the conversion.

◆ equals()

bool gem::GeographicArea::equals ( GeographicArea const & other) const
inlinenoexceptinherited

Checks if two geographic areas are considered equal.

Parameters
otherAnother GeographicArea object for comparison.
Returns
true if the areas are equal, false otherwise.

◆ getBottomRight()

Coordinates gem::RectangleGeographicArea::getBottomRight ( ) const
inlinenoexcept

Retrieves the coordinates of the bottom-right point of the rectangle.

Returns
A Coordinates object representing the bottom-right point.

◆ getBoundingBox()

RectangleGeographicArea gem::GeographicArea::getBoundingBox ( ) const
inlinenoexceptinherited

Get the bounding box.

This is the smallest rectangle that can be drawn around the area such that it surrounds this geographic area completely.

If the area is bigger than what is allowed in the WGS 84 coordinate system, the rectangle is truncated to valid WGS 84 coordinate values. The RectangleGeographicArea is always aligned with parallels and meridians.

Returns
A RectangleGeographicArea object representing the bounding box.

◆ getCenterPoint()

Coordinates gem::GeographicArea::getCenterPoint ( ) const
inlinenoexceptinherited

Retrieves the center point of the geographic area.

Calculates and returns the geographic center of the area.

Returns
Coordinates object representing the center point of the area.

◆ getTopLeft()

Coordinates gem::RectangleGeographicArea::getTopLeft ( ) const
inlinenoexcept

Retrieves the coordinates of the top-left point of the rectangle.

Returns
A Coordinates object representing the top-left point.

◆ intersects()

bool gem::RectangleGeographicArea::intersects ( const RectangleGeographicArea & area) const
inlinenoexcept

Checks if this rectangle intersects with another rectangle.

Parameters
areaThe RectangleGeographicArea to check intersection with.
Returns
True if the rectangles intersect, false otherwise.

◆ isDefault()

bool gem::GeographicArea::isDefault ( ) const
inlineoverrideinherited

Determines if the current geographic area object is in its default state (unaltered since creation).

Returns
true if the object is default, false otherwise.

◆ isEmpty()

bool gem::GeographicArea::isEmpty ( ) const
inlinenoexceptinherited

Checks if the geographic area is empty.

Returns
true if the area is empty, false otherwise.

◆ makeIntersection()

RectangleGeographicArea gem::RectangleGeographicArea::makeIntersection ( const RectangleGeographicArea & area) const
inlinenoexcept

Creates a new RectangleGeographicArea as the intersection of this rectangle and another.

Parameters
areaThe RectangleGeographicArea to intersect with.
Returns
A new RectangleGeographicArea object representing the intersection.

◆ makeUnion()

RectangleGeographicArea gem::RectangleGeographicArea::makeUnion ( const RectangleGeographicArea & area) const
inlinenoexcept

Creates a new RectangleGeographicArea as the union of this rectangle and another.

Parameters
areaThe RectangleGeographicArea to unite with.
Returns
A new RectangleGeographicArea object representing the union.

◆ operator bool()

gem::GeographicArea::operator bool ( ) const
inlineexplicitnoexceptinherited

Boolean conversion operator indicating if the geographic area is valid and not in its default state.

Returns
true if the object is valid and not default, false otherwise.

◆ operator!=()

bool gem::GeographicArea::operator!= ( const GeographicArea & area) const
inlinenoexceptinherited

Inequality comparison operator for geographic areas.

Parameters
areaAnother GeographicArea object to compare against.
Returns
true if the areas are not equal, false otherwise.

◆ operator=() [1/2]

RectangleGeographicArea & gem::RectangleGeographicArea::operator= ( const RectangleGeographicArea & other)
default

Default copy assignment.

Replaces the contents of this object with a copy of another RectangleGeographicArea object.

Parameters
otherThe object to copy.
Returns
A reference to this updated instance.

◆ operator=() [2/2]

RectangleGeographicArea & gem::RectangleGeographicArea::operator= ( RectangleGeographicArea && obj)
inlinenoexcept

Default move assignment.

Moves another RectangleGeographicArea object into this instance.

Parameters
objThe object to move into this instance.
Returns
A reference to this updated instance.

◆ operator==()

bool gem::GeographicArea::operator== ( const GeographicArea & area) const
inlinenoexceptinherited

Equality comparison operator for geographic areas.

Parameters
areaAnother GeographicArea object to compare against.
Returns
true if the areas are equal, false otherwise.

◆ set() [1/3]

RectangleGeographicArea & gem::RectangleGeographicArea::set ( const Coordinates & coords,
double horizRadius,
double vertRadius )
inlinenoexcept

Defines the rectangle based on a central point and dimensions.

Parameters
coordsCenter coordinates of the rectangle.
horizRadiusHorizontal radius in meters from the center.
vertRadiusVertical radius in meters from the center.
Returns
Reference to the current RectangleGeographicArea object.

◆ set() [2/3]

RectangleGeographicArea & gem::RectangleGeographicArea::set ( const Coordinates & coords1,
const Coordinates & coords2 )
inline

Defines teh rectangle from top-left and bottom-right coordinates.

Parameters
coords1Coordinates of the top-left corner.
coords2Coordinates of the bottom-right corner.
Returns
Reference to the current RectangleGeographicArea object. Ensures that the coordinates form a valid rectangle.

◆ set() [3/3]

RectangleGeographicArea & gem::RectangleGeographicArea::set ( double minLatitude,
double maxLatitude,
double minLongitude,
double maxLongitude )
inlinenoexcept

Defines the rectangle using latitude and longitude ranges.

Parameters
minLatitudeMinimum latitude of the rectangle.
maxLatitudeMaximum latitude of the rectangle.
minLongitudeMinimum longitude of the rectangle.
maxLongitudeMaximum longitude of the rectangle.
Returns
Reference to the current RectangleGeographicArea object.

◆ setBottomRight()

RectangleGeographicArea & gem::RectangleGeographicArea::setBottomRight ( const Coordinates & point)
inlinenoexcept

Sets the bottom-right point of the rectangle.

Parameters
pointCoordinates of the new bottom-right point.
Returns
Reference to the current RectangleGeographicArea object.

◆ setIntersection()

RectangleGeographicArea & gem::RectangleGeographicArea::setIntersection ( const RectangleGeographicArea & area)
inlinenoexcept

Sets this rectangle to the intersection of itself and another rectangle.

Parameters
areaThe RectangleGeographicArea to intersect with.
Returns
Reference to the current RectangleGeographicArea object.

◆ setTopLeft()

RectangleGeographicArea & gem::RectangleGeographicArea::setTopLeft ( const Coordinates & point)
inlinenoexcept

Sets the top-left point of the rectangle.

Parameters
pointCoordinates of the new top-left point.
Returns
Reference to the current RectangleGeographicArea object.

◆ setUnion()

RectangleGeographicArea & gem::RectangleGeographicArea::setUnion ( const RectangleGeographicArea & area)
inlinenoexcept

Sets this rectangle to the union of itself and another rectangle.

Parameters
areaThe RectangleGeographicArea to unite with.
Returns
Reference to the current RectangleGeographicArea object.

◆ type() [1/2]

EGeographicAreaType gem::GeographicArea::type ( ) const
inlineinherited

Retrieves the specific type of the geographic area.

Returns
The type of the geographic area as an EGeographicAreaType enumeration.

◆ type() [2/2]

constexpr EGeographicAreaType gem::RectangleGeographicArea::type ( )
inlinestaticconstexprnoexcept

Get the type of the geographic area.

Returns
The type of the geographic area as a rectangle.