Marble::GeoDataLinearRing

Search for usage in LXR

Marble::GeoDataLinearRing Class Reference

#include <GeoDataLinearRing.h>

Inheritance diagram for Marble::GeoDataLinearRing:

Public Member Functions

 GeoDataLinearRing (const GeoDataGeometry &other)
 
 GeoDataLinearRing (TessellationFlags f=NoTessellation)
 
 ~GeoDataLinearRing () override
 
virtual bool contains (const GeoDataCoordinates &coordinates) const
 
GeoDataGeometrycopy () const override
 
EnumGeometryId geometryId () const override
 
virtual bool isClockwise () const
 
bool isClosed () const override
 
qreal length (qreal planetRadius, int offset=0) const override
 
const char * nodeType () const override
 
bool operator!= (const GeoDataLinearRing &other) const
 
bool operator== (const GeoDataLinearRing &other) const
 
- Public Member Functions inherited from Marble::GeoDataLineString
 GeoDataLineString (const GeoDataGeometry &other)
 
 GeoDataLineString (TessellationFlags f=NoTessellation)
 
 ~GeoDataLineString () override
 
void append (const GeoDataCoordinates &value)
 
void append (const QList< GeoDataCoordinates > &values)
 
GeoDataCoordinatesat (int pos)
 
const GeoDataCoordinatesat (int pos) const
 
QList< GeoDataCoordinates >::Iterator begin ()
 
QList< GeoDataCoordinates >::ConstIterator begin () const
 
void clear ()
 
QList< GeoDataCoordinates >::ConstIterator constBegin () const
 
QList< GeoDataCoordinates >::ConstIterator constEnd () const
 
GeoDataGeometrycopy () const override
 
QList< GeoDataCoordinates >::Iterator end ()
 
QList< GeoDataCoordinates >::ConstIterator end () const
 
QList< GeoDataCoordinates >::Iterator erase (const QList< GeoDataCoordinates >::Iterator &begin, const QList< GeoDataCoordinates >::Iterator &end)
 
QList< GeoDataCoordinates >::Iterator erase (const QList< GeoDataCoordinates >::Iterator &position)
 
GeoDataCoordinatesfirst ()
 
const GeoDataCoordinatesfirst () const
 
EnumGeometryId geometryId () const override
 
void insert (int index, const GeoDataCoordinates &value)
 
bool isEmpty () const
 
GeoDataCoordinateslast ()
 
const GeoDataCoordinateslast () const
 
const GeoDataLatLonAltBoxlatLonAltBox () const override
 
GeoDataLineString mid (int pos, int length=-1) const
 
const char * nodeType () const override
 
bool operator!= (const GeoDataLineString &other) const
 
GeoDataLineStringoperator<< (const GeoDataCoordinates &value)
 
GeoDataLineStringoperator<< (const GeoDataLineString &lineString)
 
bool operator== (const GeoDataLineString &other) const
 
GeoDataCoordinatesoperator[] (int pos)
 
const GeoDataCoordinatesoperator[] (int pos) const
 
GeoDataLineString optimized () const
 
void pack (QDataStream &stream) const override
 
void remove (int i)
 
void reserve (int size)
 
void reverse ()
 
void setTessellate (bool tessellate)
 
void setTessellationFlags (TessellationFlags f)
 
int size () const
 
bool tessellate () const
 
TessellationFlags tessellationFlags () const
 
virtual QList< GeoDataLineString * > toDateLineCorrected () const
 
virtual GeoDataLineString toNormalized () const
 
virtual GeoDataLineString toPoleCorrected () const
 
virtual GeoDataLineString toRangeCorrected () const
 
QVariantList toVariantList () const
 
void unpack (QDataStream &stream) override
 
- Public Member Functions inherited from Marble::GeoDataGeometry
AltitudeMode altitudeMode () const
 
void detach ()
 
bool extrude () const
 
bool operator!= (const GeoDataGeometry &other) const
 
bool operator== (const GeoDataGeometry &other) const
 
void pack (QDataStream &stream) const override
 
void setAltitudeMode (const AltitudeMode altitudeMode)
 
void setExtrude (bool extrude)
 
void unpack (QDataStream &stream) override
 
- 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
 
- Public Member Functions inherited from Marble::GeoNode

Additional Inherited Members

- Public Types inherited from Marble::GeoDataLineString
using ConstIterator = QList<GeoDataCoordinates>::ConstIterator
 
using Iterator = QList<GeoDataCoordinates>::Iterator
 
- Protected Member Functions inherited from Marble::GeoDataLineString
 GeoDataLineString (GeoDataLineStringPrivate *priv)
 
- Protected Member Functions inherited from Marble::GeoDataGeometry
 GeoDataGeometry (const GeoDataGeometry &other)
 
 GeoDataGeometry (GeoDataGeometryPrivate *priv)
 
bool equals (const GeoDataGeometry &other) const
 
virtual bool equals (const GeoDataObject &other) const
 
GeoDataGeometryoperator= (const GeoDataGeometry &other)
 
- Protected Member Functions inherited from Marble::GeoDataObject
- Protected Attributes inherited from Marble::GeoDataGeometry
GeoDataGeometryPrivate * d_ptr
 

Detailed Description

A LinearRing that allows to store a closed, contiguous set of line segments.

GeoDataLinearRing is a tool class that implements the LinearRing tag/class of the Open Geospatial Consortium standard KML 2.2.

Unlike suggested in the KML spec GeoDataLinearRing extends GeoDataLineString to store a closed LineString (the KML specification suggests to inherit from the Geometry class directly).

In the QPainter API LinearRings are also referred to as "polygons". As such they are similar to QPolygons.

Whenever a LinearRing is painted GeoDataLineStyle should be used to assign a color and line width.

A GeoDataLinearRing consists of several (geodetic) nodes which are each connected through line segments. The nodes are stored as GeoDataCoordinates objects.

The API which provides access to the nodes is similar to the API of QList.

GeoDataLinearRing allows LinearRings to be tessellated in order to make them follow the terrain and the curvature of the earth. The tessellation options allow for different ways of visualization:

  • Not tessellated: A LinearRing that connects each two nodes directly and straight in screen coordinate space.
  • A tessellated line: Each line segment is bent so that the LinearRing follows the curvature of the earth and its terrain. A tessellated line segment connects two nodes at the shortest possible distance ("along great circles").
  • A tessellated line that follows latitude circles whenever possible: In this case Latitude circles are followed as soon as two subsequent nodes have exactly the same amount of latitude. In all other places the line segments follow great circles.

Some convenience methods have been added that allow to calculate the geodesic bounding box or the length of a LinearRing.

Definition at line 59 of file GeoDataLinearRing.h.

Constructor & Destructor Documentation

◆ GeoDataLinearRing() [1/2]

Marble::GeoDataLinearRing::GeoDataLinearRing ( TessellationFlags f = NoTessellation)
explicit

Creates a new LinearRing.

Definition at line 15 of file GeoDataLinearRing.cpp.

◆ GeoDataLinearRing() [2/2]

Marble::GeoDataLinearRing::GeoDataLinearRing ( const GeoDataGeometry & other)
explicit

Creates a LinearRing from an existing geometry object.

Definition at line 20 of file GeoDataLinearRing.cpp.

◆ ~GeoDataLinearRing()

Marble::GeoDataLinearRing::~GeoDataLinearRing ( )
overridedefault

Destroys a LinearRing.

Member Function Documentation

◆ contains()

bool Marble::GeoDataLinearRing::contains ( const GeoDataCoordinates & coordinates) const
virtual

Returns whether the given coordinates lie within the polygon.

Returns
true if the coordinates lie within the polygon, false otherwise.

Definition at line 64 of file GeoDataLinearRing.cpp.

◆ copy()

GeoDataGeometry * Marble::GeoDataLinearRing::copy ( ) const
overridevirtual

Implements Marble::GeoDataGeometry.

Definition at line 37 of file GeoDataLinearRing.cpp.

◆ geometryId()

EnumGeometryId Marble::GeoDataLinearRing::geometryId ( ) const
overridevirtual

Implements Marble::GeoDataGeometry.

Definition at line 32 of file GeoDataLinearRing.cpp.

◆ isClockwise()

bool Marble::GeoDataLinearRing::isClockwise ( ) const
virtual

Returns whether the orientaion of ring is coloskwise or not.

Returns
Return value is true if ring is clockwise orientated

Definition at line 93 of file GeoDataLinearRing.cpp.

◆ isClosed()

bool Marble::GeoDataLinearRing::isClosed ( ) const
overridevirtual

Returns whether a LinearRing is a closed polygon.

Returns
true for a LinearRing.

Reimplemented from Marble::GeoDataLineString.

Definition at line 52 of file GeoDataLinearRing.cpp.

◆ length()

qreal Marble::GeoDataLinearRing::length ( qreal planetRadius,
int offset = 0 ) const
overridevirtual

Returns the length of the LinearRing across a sphere.

As a parameter the planetRadius needs to be passed.

Returns
The return value is the length of the LinearRing. The unit used for the resulting length matches the unit of the planet radius.

This method can be used as an approximation for the circumference of a LinearRing.

Reimplemented from Marble::GeoDataLineString.

Definition at line 57 of file GeoDataLinearRing.cpp.

◆ nodeType()

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

Provides type information for downcasting a GeoNode.

Implements Marble::GeoNode.

Definition at line 27 of file GeoDataLinearRing.cpp.

◆ operator!=()

bool Marble::GeoDataLinearRing::operator!= ( const GeoDataLinearRing & other) const

Definition at line 47 of file GeoDataLinearRing.cpp.

◆ operator==()

bool Marble::GeoDataLinearRing::operator== ( const GeoDataLinearRing & other) const

Returns true/false depending on whether this and other are/are not equal.

Definition at line 42 of file GeoDataLinearRing.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 Mon Nov 18 2024 12:15:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.