Marble::GeoDataLatLonBox

Search for usage in LXR

Marble::GeoDataLatLonBox Class Reference

#include <GeoDataLatLonBox.h>

Inheritance diagram for Marble::GeoDataLatLonBox:

Public Member Functions

 GeoDataLatLonBox (const GeoDataLatLonBox &)
 
 GeoDataLatLonBox (qreal north, qreal south, qreal east, qreal west, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
 
void boundaries (qreal &north, qreal &south, qreal &east, qreal &west, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
 
virtual GeoDataCoordinates center () const
 
virtual void clear ()
 
virtual bool contains (const GeoDataCoordinates &) const
 
bool contains (const GeoDataLatLonBox &) const
 
bool contains (qreal lon, qreal lat) const
 
bool containsPole (Pole pole=AnyPole) const
 
bool crossesDateLine () const
 
qreal east (GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
 
qreal height (GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
 
virtual bool intersects (const GeoDataLatLonBox &) const
 
virtual bool isEmpty () const
 
virtual bool isNull () const
 
const char * nodeType () const override
 
qreal north (GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
 
GeoDataLatLonBoxoperator= (const GeoDataLatLonBox &other)
 
GeoDataLatLonBox operator| (const GeoDataLatLonBox &other) const
 
GeoDataLatLonBoxoperator|= (const GeoDataLatLonBox &other)
 
void pack (QDataStream &stream) const override
 
qreal rotation (GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
 
void scale (qreal verticalFactor, qreal horizontalFactor) const
 
GeoDataLatLonBox scaled (qreal verticalFactor, qreal horizontalFactor) const
 
void setBoundaries (qreal north, qreal south, qreal east, qreal west, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
 
void setEast (const qreal east, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
 
void setNorth (const qreal north, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
 
void setRotation (const qreal rotation, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
 
void setSouth (const qreal south, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
 
void setWest (const qreal west, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
 
qreal south (GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
 
GeoDataLatLonBox toCircumscribedRectangle () const
 
GeoDataLatLonBox united (const GeoDataLatLonBox &other) const
 
void unpack (QDataStream &stream) override
 
qreal west (GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
 
qreal width (GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
 
- Public Member Functions inherited from Marble::GeoDataObject
 GeoDataObject (const GeoDataObject &)
 
QString id () const
 
GeoDataObjectoperator= (const GeoDataObject &)
 
void pack (QDataStream &stream) const override
 
GeoDataObjectparent ()
 
const GeoDataObjectparent () const
 
QString resolvePath (const QString &relativePath) const
 
void setId (const QString &value)
 
void setParent (GeoDataObject *parent)
 
void setTargetId (const QString &value)
 
QString targetId () const
 
void unpack (QDataStream &steam) override
 

Static Public Member Functions

static bool crossesDateLine (qreal east, qreal west)
 
static GeoDataLatLonBox fromLineString (const GeoDataLineString &lineString)
 
static bool fuzzyCompare (const GeoDataLatLonBox &lhs, const GeoDataLatLonBox &rhs, const qreal factor=0.01)
 
static qreal height (qreal north, qreal south, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
 
static qreal width (qreal east, qreal west, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
 

Additional Inherited Members

- Protected Member Functions inherited from Marble::GeoDataObject
virtual bool equals (const GeoDataObject &other) const
 

Detailed Description

A class that defines a 2D bounding box for geographic data.

GeoDataLatLonBox is a 2D bounding box that describes a geographic area in terms of latitude and longitude.

The bounding box gets described by assigning the northern, southern, eastern and western boundary. So usually the value of the eastern boundary is bigger than the value of the western boundary.

This is also true if the GeoDataLatLonBox covers the whole longitude range from 180 deg West to 180 deg East. Notably in this case the bounding box crosses the date line.

If the GeoDataLatLonBox does not cover the whole longitude range but still crosses the date line then the eastern boundary has got a smaller value than the western one.

Definition at line 46 of file GeoDataLatLonBox.h.

Constructor & Destructor Documentation

◆ GeoDataLatLonBox() [1/3]

Marble::GeoDataLatLonBox::GeoDataLatLonBox ( )

Definition at line 55 of file GeoDataLatLonBox.cpp.

◆ GeoDataLatLonBox() [2/3]

Marble::GeoDataLatLonBox::GeoDataLatLonBox ( qreal north,
qreal south,
qreal east,
qreal west,
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )

Definition at line 61 of file GeoDataLatLonBox.cpp.

◆ GeoDataLatLonBox() [3/3]

Marble::GeoDataLatLonBox::GeoDataLatLonBox ( const GeoDataLatLonBox & other)

Definition at line 68 of file GeoDataLatLonBox.cpp.

◆ ~GeoDataLatLonBox()

Marble::GeoDataLatLonBox::~GeoDataLatLonBox ( )
override

Definition at line 74 of file GeoDataLatLonBox.cpp.

Member Function Documentation

◆ boundaries()

void Marble::GeoDataLatLonBox::boundaries ( qreal & north,
qreal & south,
qreal & east,
qreal & west,
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian ) const

Definition at line 189 of file GeoDataLatLonBox.cpp.

◆ center()

GeoDataCoordinates Marble::GeoDataLatLonBox::center ( ) const
virtual

returns the center of this box

Returns
a coordinate, face-center of the box

Reimplemented in Marble::GeoDataLatLonAltBox.

Definition at line 301 of file GeoDataLatLonBox.cpp.

◆ clear()

void Marble::GeoDataLatLonBox::clear ( )
virtual

Resets the bounding box to its uninitialised state (and thus contains nothing).

Reimplemented in Marble::GeoDataLatLonAltBox.

Definition at line 838 of file GeoDataLatLonBox.cpp.

◆ contains() [1/3]

bool Marble::GeoDataLatLonBox::contains ( const GeoDataCoordinates & point) const
virtual

Definition at line 346 of file GeoDataLatLonBox.cpp.

◆ contains() [2/3]

bool Marble::GeoDataLatLonBox::contains ( const GeoDataLatLonBox & other) const

Definition at line 355 of file GeoDataLatLonBox.cpp.

◆ contains() [3/3]

bool Marble::GeoDataLatLonBox::contains ( qreal lon,
qreal lat ) const

Detect whether the bounding box contains a point of given lon and lat.

Parameters
lonlongitude in radians.
latlatitude in radians.
Returns
true if the box contains given point, false otherwise

Definition at line 331 of file GeoDataLatLonBox.cpp.

◆ containsPole()

bool Marble::GeoDataLatLonBox::containsPole ( Pole pole = AnyPole) const

Detect whether the bounding box contains one of the poles.

Returns
true the bounding box contains one of the poles. false the bounding box doesn't contain one of the poles.

Definition at line 314 of file GeoDataLatLonBox.cpp.

◆ crossesDateLine() [1/2]

bool Marble::GeoDataLatLonBox::crossesDateLine ( ) const

Detect whether the bounding box crosses the IDL.

Returns
true the bounding box crosses the +/-180 deg longitude. false the bounding box doesn't cross the +/-180 deg longitude.

Definition at line 291 of file GeoDataLatLonBox.cpp.

◆ crossesDateLine() [2/2]

bool Marble::GeoDataLatLonBox::crossesDateLine ( qreal east,
qreal west )
static

Detect whether the bounding box crosses the IDL.

Parameters
eastradians east.
westradians west.
Returns
true the bounding box crosses the +/-180 deg longitude. false the bounding box doesn't cross the +/-180 deg longitude.

Definition at line 296 of file GeoDataLatLonBox.cpp.

◆ east()

qreal Marble::GeoDataLatLonBox::east ( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian) const

Get the eastern boundary of the bounding box.

Returns
the longitude of the eastern boundary.

Definition at line 126 of file GeoDataLatLonBox.cpp.

◆ fromLineString()

GeoDataLatLonBox Marble::GeoDataLatLonBox::fromLineString ( const GeoDataLineString & lineString)
static

Create the smallest bounding box from a line string.

Returns
the smallest bounding box that contains the linestring.

Definition at line 629 of file GeoDataLatLonBox.cpp.

◆ fuzzyCompare()

bool Marble::GeoDataLatLonBox::fuzzyCompare ( const GeoDataLatLonBox & lhs,
const GeoDataLatLonBox & rhs,
const qreal factor = 0.01 )
static

Indicates whether two bounding boxes are roughly equal.

The factor specifies the margin threshold relative to the left handside bounding box within which both bounding boxes are considered equal.

Returns
Return value is true if both bounding box are approximately equal.

Definition at line 782 of file GeoDataLatLonBox.cpp.

◆ height() [1/2]

qreal Marble::GeoDataLatLonBox::height ( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian) const

Get the height of the latitude interval.

Returns
the angle covered by the latitude range.

Definition at line 275 of file GeoDataLatLonBox.cpp.

◆ height() [2/2]

qreal Marble::GeoDataLatLonBox::height ( qreal north,
qreal south,
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )
static

Get the height of the latitude interval.

North and south parameters are in radians.

Returns
the angle covered by the latitude range in given unit.

Definition at line 280 of file GeoDataLatLonBox.cpp.

◆ intersects()

bool Marble::GeoDataLatLonBox::intersects ( const GeoDataLatLonBox & other) const
virtual

Definition at line 413 of file GeoDataLatLonBox.cpp.

◆ isEmpty()

bool Marble::GeoDataLatLonBox::isEmpty ( ) const
virtual

Indicates whether the bounding box is not initialised (and contains nothing).

Returns
Return value is true if bounding box is not initialised.

Definition at line 777 of file GeoDataLatLonBox.cpp.

◆ isNull()

bool Marble::GeoDataLatLonBox::isNull ( ) const
virtual

Indicates whether the bounding box only contains a single 2D point ("singularity").

Returns
Return value is true if the height and the width of the bounding box equal zero.

Reimplemented in Marble::GeoDataLatLonAltBox.

Definition at line 772 of file GeoDataLatLonBox.cpp.

◆ nodeType()

const char * Marble::GeoDataLatLonBox::nodeType ( ) const
overridevirtual

Provides type information for downcasting a GeoData.

Implements Marble::GeoNode.

Definition at line 79 of file GeoDataLatLonBox.cpp.

◆ north()

qreal Marble::GeoDataLatLonBox::north ( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian) const

Get the northern boundary of the bounding box.

Returns
the latitude of the northern boundary.

Definition at line 84 of file GeoDataLatLonBox.cpp.

◆ operator=()

GeoDataLatLonBox & Marble::GeoDataLatLonBox::operator= ( const GeoDataLatLonBox & other)

Definition at line 595 of file GeoDataLatLonBox.cpp.

◆ operator|()

GeoDataLatLonBox Marble::GeoDataLatLonBox::operator| ( const GeoDataLatLonBox & other) const

Definition at line 603 of file GeoDataLatLonBox.cpp.

◆ operator|=()

GeoDataLatLonBox & Marble::GeoDataLatLonBox::operator|= ( const GeoDataLatLonBox & other)

Unites this bounding box with the given one.

Returns
Returns a reference to self.

Definition at line 608 of file GeoDataLatLonBox.cpp.

◆ pack()

void Marble::GeoDataLatLonBox::pack ( QDataStream & stream) const
override

Serialize the contents of the feature to stream.

Definition at line 615 of file GeoDataLatLonBox.cpp.

◆ rotation()

qreal Marble::GeoDataLatLonBox::rotation ( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian) const

Get the rotation of the bounding box.

Returns
the rotation of the bounding box.

Definition at line 181 of file GeoDataLatLonBox.cpp.

◆ scale()

void Marble::GeoDataLatLonBox::scale ( qreal verticalFactor,
qreal horizontalFactor ) const

Changes the differences between the boundaries and the center by the given factor, keeping the center unchanged.

Parameters
verticalFactorVertical scale factor (affects north and south boundaries)
horizontalFactorHorizontal scale factor (affects west and east boundaries)

Definition at line 227 of file GeoDataLatLonBox.cpp.

◆ scaled()

GeoDataLatLonBox Marble::GeoDataLatLonBox::scaled ( qreal verticalFactor,
qreal horizontalFactor ) const

Definition at line 244 of file GeoDataLatLonBox.cpp.

◆ setBoundaries()

void Marble::GeoDataLatLonBox::setBoundaries ( qreal north,
qreal south,
qreal east,
qreal west,
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )

Definition at line 208 of file GeoDataLatLonBox.cpp.

◆ setEast()

void Marble::GeoDataLatLonBox::setEast ( const qreal east,
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )

Definition at line 134 of file GeoDataLatLonBox.cpp.

◆ setNorth()

void Marble::GeoDataLatLonBox::setNorth ( const qreal north,
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )

Definition at line 92 of file GeoDataLatLonBox.cpp.

◆ setRotation()

void Marble::GeoDataLatLonBox::setRotation ( const qreal rotation,
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )

Definition at line 168 of file GeoDataLatLonBox.cpp.

◆ setSouth()

void Marble::GeoDataLatLonBox::setSouth ( const qreal south,
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )

Definition at line 113 of file GeoDataLatLonBox.cpp.

◆ setWest()

void Marble::GeoDataLatLonBox::setWest ( const qreal west,
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )

Definition at line 155 of file GeoDataLatLonBox.cpp.

◆ south()

qreal Marble::GeoDataLatLonBox::south ( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian) const

Get the southern boundary of the bounding box.

Returns
the latitude of the southern boundary.

Definition at line 105 of file GeoDataLatLonBox.cpp.

◆ toCircumscribedRectangle()

GeoDataLatLonBox Marble::GeoDataLatLonBox::toCircumscribedRectangle ( ) const
Returns
Returns the smallest bounding box that contains this LatLonBox rotated with its given angle.

Definition at line 534 of file GeoDataLatLonBox.cpp.

◆ united()

GeoDataLatLonBox Marble::GeoDataLatLonBox::united ( const GeoDataLatLonBox & other) const

Returns the bounding LatLonBox of this box with the given one.

Definition at line 474 of file GeoDataLatLonBox.cpp.

◆ unpack()

void Marble::GeoDataLatLonBox::unpack ( QDataStream & stream)
override

Unserialize the contents of the feature from stream.

Definition at line 622 of file GeoDataLatLonBox.cpp.

◆ west()

qreal Marble::GeoDataLatLonBox::west ( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian) const

Get the western boundary of the bounding box.

Returns
the longitude of the western boundary.

Definition at line 147 of file GeoDataLatLonBox.cpp.

◆ width() [1/2]

qreal Marble::GeoDataLatLonBox::width ( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian) const

Get the width of the longitude interval.

Returns
the angle covered by the longitude range.

Definition at line 251 of file GeoDataLatLonBox.cpp.

◆ width() [2/2]

qreal Marble::GeoDataLatLonBox::width ( qreal east,
qreal west,
GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )
static

Get the width of the longitude interval.

East and west parameters are in radians.

Returns
the angle covered by the longitude range in given unit.

Definition at line 256 of file GeoDataLatLonBox.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:18 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.