Marble

GeoDataLineString.h
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2008-2009 Torsten Rahn <[email protected]>
9 // Copyright 2009 Patrick Spendrin <[email protected]>
10 //
11 
12 
13 #ifndef MARBLE_GEODATALINESTRING_H
14 #define MARBLE_GEODATALINESTRING_H
15 
16 #include <QVector>
17 #include <QMetaType>
18 
19 #include "MarbleGlobal.h"
20 
21 #include "geodata_export.h"
22 #include "GeoDataGeometry.h"
23 
24 
25 namespace Marble
26 {
27 class GeoDataCoordinates;
28 class GeoDataLineStringPrivate;
29 
72 class GEODATA_EXPORT GeoDataLineString : public GeoDataGeometry
73 {
74 
75  public:
77  using ConstIterator = QVector<GeoDataCoordinates>::ConstIterator;
78  using const_iterator = QVector<GeoDataCoordinates>::const_iterator;
79 
80 
84  explicit GeoDataLineString( TessellationFlags f = NoTessellation );
85 
86 
90  explicit GeoDataLineString( const GeoDataGeometry &other );
91 
92 
96  ~GeoDataLineString() override;
97 
98  const char *nodeType() const override;
99 
100  EnumGeometryId geometryId() const override;
101 
102  GeoDataGeometry *copy() const override;
103 
109  virtual bool isClosed() const;
110 
111 
118  bool tessellate() const;
119 
120 
129  void setTessellate( bool tessellate );
130 
131 
135  TessellationFlags tessellationFlags() const;
136 
137 
141  void setTessellationFlags( TessellationFlags f );
142 
147  void reverse();
148 
155  const GeoDataLatLonAltBox& latLonAltBox() const override;
156 
165  virtual qreal length( qreal planetRadius, int offset = 0 ) const;
166 
174  virtual GeoDataLineString toRangeCorrected() const;
175 
176 
186  virtual GeoDataLineString toNormalized() const;
187 
188 
198  virtual GeoDataLineString toPoleCorrected() const;
199 
200 
209  virtual QVector<GeoDataLineString*> toDateLineCorrected() const;
210 
211 
212 
213  // "Reimplementation" of QVector API
219  bool isEmpty() const;
220 
221 
225  int size() const;
226 
227 
232  GeoDataCoordinates& at( int pos );
233 
234 
239  const GeoDataCoordinates& at( int pos ) const;
240 
241 
246  GeoDataCoordinates& operator[]( int pos );
247 
248 
254  GeoDataLineString mid(int pos, int length = -1) const;
255 
260  const GeoDataCoordinates& operator[]( int pos ) const;
261 
262 
267  GeoDataCoordinates& first();
268 
269 
274  const GeoDataCoordinates& first() const;
275 
276 
281  GeoDataCoordinates& last();
282 
283 
288  const GeoDataCoordinates& last() const;
289 
290 
294  void insert( int index, const GeoDataCoordinates& value );
295 
299  void reserve(int size);
300 
304  void append ( const GeoDataCoordinates& value );
305 
306 
310  void append(const QVector<GeoDataCoordinates>& values);
311 
312 
316  GeoDataLineString& operator << ( const GeoDataCoordinates& value );
317 
318 
322  GeoDataLineString& operator << ( const GeoDataLineString& lineString );
323 
324 
328  bool operator==( const GeoDataLineString &other ) const;
329  bool operator!=( const GeoDataLineString &other ) const;
330 
331 
337 
338 
344 
345 
350 
351 
356 
357 
361  void clear();
362 
363 
368 
369 
375 
376 
380  void remove ( int i );
381 
385  GeoDataLineString optimized() const;
386 
387  // Serialization
392  void pack( QDataStream& stream ) const override;
393 
394 
399  void unpack( QDataStream& stream ) override;
400 
401  protected:
402  explicit GeoDataLineString(GeoDataLineStringPrivate* priv);
403 
404  private:
405  Q_DECLARE_PRIVATE(GeoDataLineString)
406 };
407 
408 }
409 
410 Q_DECLARE_METATYPE( Marble::GeoDataLineString )
411 
412 #endif
A 3d point representation.
Binds a QML item to a specific geodetic location in screen coordinates.
A base class for all geodata features.
QVector< V > values(const QMultiHash< K, V > &c)
A LineString that allows to store a contiguous set of line segments.
A class that defines a 3D bounding box for geographic data.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 8 2020 23:18:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.