marble
#include <GeoDataLineString.h>
Public Types | |
typedef QVector < GeoDataCoordinates > ::ConstIterator | ConstIterator |
typedef QVector < GeoDataCoordinates > ::Iterator | Iterator |
Protected Member Functions | |
GeoDataLineString (GeoDataLineStringPrivate *priv) | |
Protected Member Functions inherited from Marble::GeoDataGeometry | |
bool | equals (const GeoDataGeometry &other) const |
Protected Member Functions inherited from Marble::GeoDataObject | |
virtual bool | equals (const GeoDataObject &other) 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
Definition at line 80 of file GeoDataLineString.h.
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 225 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 143 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 151 of file GeoDataLineString.cpp.
QVector< GeoDataCoordinates >::Iterator Marble::GeoDataLineString::begin | ( | ) |
Returns an iterator that points to the begin of the LineString.
Definition at line 193 of file GeoDataLineString.cpp.
QVector< GeoDataCoordinates >::ConstIterator Marble::GeoDataLineString::begin | ( | ) | const |
Definition at line 199 of file GeoDataLineString.cpp.
void Marble::GeoDataLineString::clear | ( | ) |
Destroys all nodes in a LineString.
Definition at line 298 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 215 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 220 of file GeoDataLineString.cpp.
QVector< GeoDataCoordinates >::Iterator Marble::GeoDataLineString::end | ( | ) |
Returns an iterator that points to the end of the LineString.
Definition at line 204 of file GeoDataLineString.cpp.
QVector< GeoDataCoordinates >::ConstIterator Marble::GeoDataLineString::end | ( | ) | const |
Definition at line 210 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 612 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 623 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 177 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 188 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 310 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 133 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 169 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 183 of file GeoDataLineString.cpp.
|
virtual |
Returns the smallest latLonAltBox that contains the LineString.
- See also
- GeoDataLatLonAltBox
Reimplemented from Marble::GeoDataGeometry.
Definition at line 580 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 594 of file GeoDataLineString.cpp.
bool Marble::GeoDataLineString::operator!= | ( | const GeoDataLineString & | other | ) | const |
Definition at line 293 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 236 of file GeoDataLineString.cpp.
GeoDataLineString & Marble::GeoDataLineString::operator<< | ( | const GeoDataLineString & | lineString | ) |
Appends a given LineString to the end of the LineString.
Definition at line 248 of file GeoDataLineString.cpp.
bool Marble::GeoDataLineString::operator== | ( | const GeoDataLineString & | other | ) | const |
Returns true/false depending on whether this and other are/are not equal.
Definition at line 267 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 156 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 164 of file GeoDataLineString.cpp.
|
virtual |
Serialize the LineString to a stream.
- Parameters
-
stream the stream.
Reimplemented from Marble::GeoDataGeometry.
Definition at line 644 of file GeoDataLineString.cpp.
void Marble::GeoDataLineString::remove | ( | int | i | ) |
Removes the node at the given position and destroys it.
Definition at line 635 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 320 of file GeoDataLineString.cpp.
void Marble::GeoDataLineString::setTessellationFlags | ( | TessellationFlags | f | ) |
Sets the given tessellation flags for a LineString.
Definition at line 342 of file GeoDataLineString.cpp.
int Marble::GeoDataLineString::size | ( | ) | const |
Returns the number of nodes in a LineString.
Definition at line 138 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 315 of file GeoDataLineString.cpp.
TessellationFlags Marble::GeoDataLineString::tessellationFlags | ( | ) | const |
Returns the tessellation flags for a LineString.
Definition at line 337 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 393 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 347 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 402 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 376 of file GeoDataLineString.cpp.
|
virtual |
Unserialize the LineString from a stream.
- Parameters
-
stream the stream.
Reimplemented from Marble::GeoDataGeometry.
Definition at line 662 of file GeoDataLineString.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.