marble
#include <GeoDataLineString.h>
Public Types | |
typedef QVector < GeoDataCoordinates > ::ConstIterator | ConstIterator |
typedef QVector < GeoDataCoordinates > ::Iterator | Iterator |
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
|
explicit |
Creates a new LineString.
Definition at line 24 of file GeoDataLineString.cpp.
|
explicit |
Creates a LineString from an existing geometry object.
Definition at line 36 of file GeoDataLineString.cpp.
|
virtual |
Destroys a LineString.
Definition at line 42 of file GeoDataLineString.cpp.
|
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.
|
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.
|
virtual |
Returns the smallest latLonAltBox that contains the LineString.
- See also
- GeoDataLatLonAltBox
Reimplemented from Marble::GeoDataGeometry.
Definition at line 545 of file GeoDataLineString.cpp.
|
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
-
planetRadius radius of the sphere offset position 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.
|
protected |
Definition at line 49 of file GeoDataLineString.cpp.
|
virtual |
Serialize the LineString to a stream.
- Parameters
-
stream the 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.
|
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.
|
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.
|
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.
|
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.
|
virtual |
Unserialize the LineString from a stream.
- Parameters
-
stream the stream.
Reimplemented from Marble::GeoDataGeometry.
Definition at line 627 of file GeoDataLineString.cpp.
The documentation for this class was generated from the following files:
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.