• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • Marble
  • GeoDataLineString
Public Types | Public Member Functions | Protected Member Functions | List of all members
Marble::GeoDataLineString Class Reference

#include <GeoDataLineString.h>

Inheritance diagram for Marble::GeoDataLineString:
Inheritance graph
[legend]

Public Types

typedef QVector
< GeoDataCoordinates >
::ConstIterator 
ConstIterator
 
typedef QVector
< GeoDataCoordinates >
::Iterator 
Iterator
 

Public Member Functions

 GeoDataLineString (TessellationFlags f=NoTessellation)
 
 GeoDataLineString (const GeoDataGeometry &other)
 
virtual ~GeoDataLineString ()
 
void append (const GeoDataCoordinates &position)
 
GeoDataCoordinates & at (int pos)
 
const GeoDataCoordinates & at (int pos) const
 
QVector< GeoDataCoordinates >
::Iterator 
begin ()
 
QVector< GeoDataCoordinates >
::ConstIterator 
begin () const
 
void clear ()
 
QVector< GeoDataCoordinates >
::ConstIterator 
constBegin () const
 
QVector< GeoDataCoordinates >
::ConstIterator 
constEnd () const
 
QVector< GeoDataCoordinates >
::Iterator 
end ()
 
QVector< GeoDataCoordinates >
::ConstIterator 
end () const
 
QVector< GeoDataCoordinates >
::Iterator 
erase (QVector< GeoDataCoordinates >::Iterator position)
 
QVector< GeoDataCoordinates >
::Iterator 
erase (QVector< GeoDataCoordinates >::Iterator begin, QVector< GeoDataCoordinates >::Iterator end)
 
GeoDataCoordinates & first ()
 
const GeoDataCoordinates & first () const
 
virtual bool isClosed () const
 
bool isEmpty () const
 
GeoDataCoordinates & last ()
 
const GeoDataCoordinates & last () const
 
virtual const GeoDataLatLonAltBox & latLonAltBox () const
 
virtual qreal length (qreal planetRadius, int offset=0) const
 
GeoDataLineString & operator<< (const GeoDataCoordinates &position)
 
GeoDataLineString & operator<< (const GeoDataLineString &lineString)
 
GeoDataCoordinates & operator[] (int pos)
 
const GeoDataCoordinates & operator[] (int pos) const
 
virtual void pack (QDataStream &stream) const
 
void remove (int i)
 
void setTessellate (bool tessellate)
 
void setTessellationFlags (TessellationFlags f)
 
int size () const
 
bool tessellate () const
 
TessellationFlags tessellationFlags () const
 
virtual QVector
< GeoDataLineString * > 
toDateLineCorrected () const
 
virtual GeoDataLineString toNormalized () const
 
virtual GeoDataLineString toPoleCorrected () const
 
virtual GeoDataLineString toRangeCorrected () const
 
virtual void unpack (QDataStream &stream)
 
- Public Member Functions inherited from Marble::GeoDataGeometry
 GeoDataGeometry ()
 
 GeoDataGeometry (const GeoDataGeometry &other)
 
virtual ~GeoDataGeometry ()
 
AltitudeMode altitudeMode () const
 
void detach ()
 
bool extrude () const
 
virtual EnumGeometryId geometryId () const
 
virtual const char * nodeType () const
 
GeoDataGeometry & operator= (const GeoDataGeometry &other)
 
void setAltitudeMode (const AltitudeMode altitudeMode)
 
void setExtrude (bool extrude)
 
- Public Member Functions inherited from Marble::GeoDataObject
 GeoDataObject ()
 
 GeoDataObject (const GeoDataObject &)
 
virtual ~GeoDataObject ()
 
int id () const
 
GeoDataObject & operator= (const GeoDataObject &)
 
virtual GeoDataObject * parent () const
 
QString resolvePath (const QString &relativePath) const
 
void setId (int value)
 
virtual void setParent (GeoDataObject *parent)
 
void setTargetId (int value)
 
int targetId () const
 
- Public Member Functions inherited from Marble::GeoNode
 GeoNode ()
 
virtual ~GeoNode ()
 
- Public Member Functions inherited from Marble::Serializable
virtual ~Serializable ()
 

Protected Member Functions

 GeoDataLineString (GeoDataLineStringPrivate *priv)
 
GeoDataLineStringPrivate * p () const
 

Detailed Description

A LineString that allows to store a contiguous set of line segments.

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

GeoDataLineString extends GeoDataGeometry to store and edit LineStrings.

In the QPainter API "pure" LineStrings are also referred to as "polylines". As such they are similar to the outline of a non-closed QPolygon.

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

A GeoDataLineString 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 QVector.

GeoDataLineString allows LineStrings 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 LineString that connects each two nodes directly and straight in screen coordinate space.
  • A tessellated line: Each line segment is bent so that the LineString 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 LineString.

Definition at line 75 of file GeoDataLineString.h.

Member Typedef Documentation

typedef QVector<GeoDataCoordinates>::ConstIterator Marble::GeoDataLineString::ConstIterator

Definition at line 80 of file GeoDataLineString.h.

typedef QVector<GeoDataCoordinates>::Iterator Marble::GeoDataLineString::Iterator

Definition at line 79 of file GeoDataLineString.h.

Constructor & Destructor Documentation

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

Creates a new LineString.

Definition at line 24 of file GeoDataLineString.cpp.

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

Creates a LineString from an existing geometry object.

Definition at line 36 of file GeoDataLineString.cpp.

Marble::GeoDataLineString::~GeoDataLineString ( )
virtual

Destroys a LineString.

Definition at line 42 of file GeoDataLineString.cpp.

Marble::GeoDataLineString::GeoDataLineString ( GeoDataLineStringPrivate *  priv)
protected

Definition at line 30 of file GeoDataLineString.cpp.

Member Function Documentation

void Marble::GeoDataLineString::append ( const GeoDataCoordinates &  position)

Appends a given geodesic position as a new node to the LineString.

Definition at line 221 of file GeoDataLineString.cpp.

GeoDataCoordinates & Marble::GeoDataLineString::at ( int  pos)

Returns a reference to the coordinates of a node at a given position. This method detaches the returned coordinate object from the line string.

Definition at line 139 of file GeoDataLineString.cpp.

const GeoDataCoordinates & Marble::GeoDataLineString::at ( int  pos) const

Returns a reference to the coordinates of a node at a given position. This method does not detach the returned coordinate object from the line string.

Definition at line 147 of file GeoDataLineString.cpp.

QVector< GeoDataCoordinates >::Iterator Marble::GeoDataLineString::begin ( )

Returns an iterator that points to the begin of the LineString.

Definition at line 189 of file GeoDataLineString.cpp.

QVector< GeoDataCoordinates >::ConstIterator Marble::GeoDataLineString::begin ( ) const

Definition at line 195 of file GeoDataLineString.cpp.

void Marble::GeoDataLineString::clear ( )

Destroys all nodes in a LineString.

Definition at line 263 of file GeoDataLineString.cpp.

QVector< GeoDataCoordinates >::ConstIterator Marble::GeoDataLineString::constBegin ( ) const

Returns a const iterator that points to the begin of the LineString.

Definition at line 211 of file GeoDataLineString.cpp.

QVector< GeoDataCoordinates >::ConstIterator Marble::GeoDataLineString::constEnd ( ) const

Returns a const iterator that points to the end of the LineString.

Definition at line 216 of file GeoDataLineString.cpp.

QVector< GeoDataCoordinates >::Iterator Marble::GeoDataLineString::end ( )

Returns an iterator that points to the end of the LineString.

Definition at line 200 of file GeoDataLineString.cpp.

QVector< GeoDataCoordinates >::ConstIterator Marble::GeoDataLineString::end ( ) const

Definition at line 206 of file GeoDataLineString.cpp.

QVector< GeoDataCoordinates >::Iterator Marble::GeoDataLineString::erase ( QVector< GeoDataCoordinates >::Iterator  position)

Removes the node at the given position and returns it.

Definition at line 577 of file GeoDataLineString.cpp.

QVector< GeoDataCoordinates >::Iterator Marble::GeoDataLineString::erase ( QVector< GeoDataCoordinates >::Iterator  begin,
QVector< GeoDataCoordinates >::Iterator  end 
)

Removes the nodes within the given range and returns them.

Definition at line 588 of file GeoDataLineString.cpp.

GeoDataCoordinates & Marble::GeoDataLineString::first ( )

Returns a reference to the first node in the LineString. This method detaches the returned coordinate object from the line string.

Definition at line 173 of file GeoDataLineString.cpp.

const GeoDataCoordinates & Marble::GeoDataLineString::first ( ) const

Returns a reference to the first node in the LineString. This method does not detach the returned coordinate object from the line string.

Definition at line 184 of file GeoDataLineString.cpp.

bool Marble::GeoDataLineString::isClosed ( ) const
virtual

Returns whether a LineString is a closed polygon.

Returns
false if the LineString is not a LinearRing.

Reimplemented in Marble::GeoDataLinearRing.

Definition at line 275 of file GeoDataLineString.cpp.

bool Marble::GeoDataLineString::isEmpty ( ) const

Returns whether the LineString has no nodes at all.

Returns
true if there are no nodes inside the line string.

Definition at line 129 of file GeoDataLineString.cpp.

GeoDataCoordinates & Marble::GeoDataLineString::last ( )

Returns a reference to the last node in the LineString. This method detaches the returned coordinate object from the line string.

Definition at line 165 of file GeoDataLineString.cpp.

const GeoDataCoordinates & Marble::GeoDataLineString::last ( ) const

Returns a reference to the last node in the LineString. This method does not detach the returned coordinate object from the line string.

Definition at line 179 of file GeoDataLineString.cpp.

const GeoDataLatLonAltBox & Marble::GeoDataLineString::latLonAltBox ( ) const
virtual

Returns the smallest latLonAltBox that contains the LineString.

See also
GeoDataLatLonAltBox

Reimplemented from Marble::GeoDataGeometry.

Definition at line 545 of file GeoDataLineString.cpp.

qreal Marble::GeoDataLineString::length ( qreal  planetRadius,
int  offset = 0 
) const
virtual

Returns the length of LineString across a sphere starting from a coordinate in LineString This method can be used as an approximation for distances along LineStrings.

The unit used for the resulting length matches the unit of the planet radius.

Parameters
planetRadiusradius of the sphere
offsetposition of coordinate within LineString

Reimplemented in Marble::GeoDataLinearRing.

Definition at line 559 of file GeoDataLineString.cpp.

GeoDataLineString & Marble::GeoDataLineString::operator<< ( const GeoDataCoordinates &  position)

Appends a given geodesic position as a new node to the LineString.

Definition at line 232 of file GeoDataLineString.cpp.

GeoDataLineString & Marble::GeoDataLineString::operator<< ( const GeoDataLineString &  lineString)

Appends a given LineString to the end of the LineString.

Definition at line 244 of file GeoDataLineString.cpp.

GeoDataCoordinates & Marble::GeoDataLineString::operator[] ( int  pos)

Returns a reference to the coordinates of a node at a given position. This method detaches the returned coordinate object from the line string.

Definition at line 152 of file GeoDataLineString.cpp.

const GeoDataCoordinates & Marble::GeoDataLineString::operator[] ( int  pos) const

Returns a reference to the coordinates of a node at a given position. This method does not detach the returned coordinate object from the line string.

Definition at line 160 of file GeoDataLineString.cpp.

GeoDataLineStringPrivate * Marble::GeoDataLineString::p ( ) const
protected

Definition at line 49 of file GeoDataLineString.cpp.

void Marble::GeoDataLineString::pack ( QDataStream &  stream) const
virtual

Serialize the LineString to a stream.

Parameters
streamthe stream.

Reimplemented from Marble::GeoDataGeometry.

Definition at line 609 of file GeoDataLineString.cpp.

void Marble::GeoDataLineString::remove ( int  i)

Removes the node at the given position and destroys it.

Definition at line 600 of file GeoDataLineString.cpp.

void Marble::GeoDataLineString::setTessellate ( bool  tessellate)

Sets the tessellation property for the LineString.

If tessellate is true then the LineString's line segments are bent and follow the earth's surface and terrain along great circles. If tessellate is false then the LineString's line segments are rendered as straight lines in screen coordinate space.

Definition at line 285 of file GeoDataLineString.cpp.

void Marble::GeoDataLineString::setTessellationFlags ( TessellationFlags  f)

Sets the given tessellation flags for a LineString.

Definition at line 307 of file GeoDataLineString.cpp.

int Marble::GeoDataLineString::size ( ) const

Returns the number of nodes in a LineString.

Definition at line 134 of file GeoDataLineString.cpp.

bool Marble::GeoDataLineString::tessellate ( ) const

Returns whether the LineString follows the earth's surface.

Returns
true if the LineString's line segments follow the earth's surface and terrain along great circles.

Definition at line 280 of file GeoDataLineString.cpp.

TessellationFlags Marble::GeoDataLineString::tessellationFlags ( ) const

Returns the tessellation flags for a LineString.

Definition at line 302 of file GeoDataLineString.cpp.

QVector< GeoDataLineString * > Marble::GeoDataLineString::toDateLineCorrected ( ) const
virtual

The line string corrected for date line crossing.

Returns
A set of LineStrings that don't cross the dateline and which resemble the original linestring.

Deprecation Warning: This method will likely be removed from the public API.

Definition at line 358 of file GeoDataLineString.cpp.

GeoDataLineString Marble::GeoDataLineString::toNormalized ( ) const
virtual

The line string with nodes that have proper longitude/latitude ranges.

Returns
A LineString that resembles the original linestring with nodes that have longitude values between -180 and +180 deg and that feature latitude values between -90 and +90 deg.

Deprecation Warning: This method will likely be removed from the public API.

Definition at line 312 of file GeoDataLineString.cpp.

GeoDataLineString Marble::GeoDataLineString::toPoleCorrected ( ) const
virtual

The line string with more generic pole values.

Returns
A LineString that resembles the original linestring. Nodes that represent one of the poles are duplicated to allow for a better visualization of flat projections.

Deprecation Warning: This method will likely be removed from the public API.

Definition at line 367 of file GeoDataLineString.cpp.

GeoDataLineString Marble::GeoDataLineString::toRangeCorrected ( ) const
virtual

Provides a more generic representation of the LineString.

The LineString is normalized, and pole corrected.

Deprecation Warning: This method will likely be removed from the public API.

Definition at line 341 of file GeoDataLineString.cpp.

void Marble::GeoDataLineString::unpack ( QDataStream &  stream)
virtual

Unserialize the LineString from a stream.

Parameters
streamthe stream.

Reimplemented from Marble::GeoDataGeometry.

Definition at line 627 of file GeoDataLineString.cpp.


The documentation for this class was generated from the following files:
  • GeoDataLineString.h
  • GeoDataLineString.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal