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

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • projections
AbstractProjection.h
Go to the documentation of this file.
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 2007-2008 Inge Wallin <ingwa@kde.org>
9 // Copyright 2007-2012 Torsten Rahn <rahn@kde.org>
10 //
11 
12 
13 #ifndef MARBLE_ABSTRACTPROJECTION_H
14 #define MARBLE_ABSTRACTPROJECTION_H
15 
16 
24 #include <QRect>
25 #include <QVector>
26 #include <QPainterPath>
27 #include <QPolygonF>
28 
29 #include "GeoDataLatLonAltBox.h"
30 #include "GeoDataCoordinates.h"
31 #include "marble_export.h"
32 
33 namespace Marble
34 {
35 
36 // The manhattan distance in pixels at which extra nodes get created for tessellation.
37 static const int tessellationPrecision = 10;
38 static const int latLonAltBoxSamplingRate = 4;
39 
40 class GeoDataLineString;
41 class ViewportParams;
42 class AbstractProjectionPrivate;
43 
44 
49 class MARBLE_EXPORT AbstractProjection
50 {
51  // Not a QObject so far because we don't need to send signals.
52  public:
53  enum SurfaceType {
54  Cylindrical,
55  Pseudocylindrical,
56  Hybrid,
57  Conical,
58  Pseudoconical,
59  Azimuthal
60  };
61 
62  enum PreservationType {
63  NoPreservation,
64  Conformal,
65  EqualArea
66  };
67 
71  AbstractProjection();
72 
73  virtual ~AbstractProjection();
74 
75  virtual qreal maxValidLat() const;
76 
77  qreal maxLat() const;
78  void setMaxLat( qreal maxLat );
79 
80  virtual qreal minValidLat() const;
81 
82  qreal minLat() const;
83  void setMinLat( qreal minLat );
84 
85  virtual bool repeatableX() const;
86  virtual bool traversablePoles() const;
87  virtual bool traversableDateLine() const;
88 
89  virtual SurfaceType surfaceType() const = 0;
90 
91  virtual PreservationType preservationType() const;
92 
93  // The projection surface can have different orientations:
94  // - normal: the surface's axis of symmetry matches the Earth's axis
95  // - transverse: orthogonally oriented compared to the Earth's axis
96  // - oblique: somewhere in between
97 
98  virtual bool isOrientedNormal() const;
99 
112  bool screenCoordinates( const qreal lon, const qreal lat,
113  const ViewportParams *viewport,
114  qreal& x, qreal& y ) const;
115 
130  virtual bool screenCoordinates( const GeoDataCoordinates &geopoint,
131  const ViewportParams *viewport,
132  qreal &x, qreal &y,
133  bool &globeHidesPoint ) const = 0;
134 
135  // Will just call the virtual version with a dummy globeHidesPoint.
136  bool screenCoordinates( const GeoDataCoordinates &geopoint,
137  const ViewportParams *viewport,
138  qreal &x, qreal &y ) const;
139 
156  virtual bool screenCoordinates( const GeoDataCoordinates &coordinates,
157  const ViewportParams *viewport,
158  qreal *x, qreal &y, int &pointRepeatNum,
159  const QSizeF& size,
160  bool &globeHidesPoint ) const = 0;
161 
162  virtual bool screenCoordinates( const GeoDataLineString &lineString,
163  const ViewportParams *viewport,
164  QVector<QPolygonF*> &polygons ) const = 0;
165 
177  virtual bool geoCoordinates( const int x, const int y,
178  const ViewportParams *viewport,
179  qreal& lon, qreal& lat,
180  GeoDataCoordinates::Unit unit = GeoDataCoordinates::Degree ) const = 0;
181 
182 
183  virtual GeoDataLatLonAltBox latLonAltBox( const QRect& screenRect,
184  const ViewportParams *viewport ) const;
185 
186  virtual bool mapCoversViewport( const ViewportParams *viewport ) const = 0;
187 
188  virtual QPainterPath mapShape( const ViewportParams *viewport ) const = 0;
189 
190  QRegion mapRegion( const ViewportParams *viewport ) const;
191 
192  protected:
193  const QScopedPointer<AbstractProjectionPrivate> d_ptr;
194  AbstractProjection( AbstractProjectionPrivate* dd );
195 
196  private:
197  Q_DECLARE_PRIVATE(AbstractProjection)
198  Q_DISABLE_COPY( AbstractProjection )
199 };
200 
201 }
202 
203 #endif
Marble::GeoDataCoordinates::Unit
Unit
enum used constructor to specify the units used
Definition: GeoDataCoordinates.h:64
GeoDataCoordinates.h
Marble::AbstractProjectionPrivate
Definition: AbstractProjection_p.h:20
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::AbstractProjection::NoPreservation
Definition: AbstractProjection.h:63
Marble::AbstractProjection::Pseudoconical
Definition: AbstractProjection.h:58
Marble::GeoDataCoordinates::Degree
Definition: GeoDataCoordinates.h:66
QRect
Marble::AbstractProjection::d_ptr
const QScopedPointer< AbstractProjectionPrivate > d_ptr
Definition: AbstractProjection.h:193
Marble::tessellationPrecision
static const int tessellationPrecision
Definition: AbstractProjection.h:37
Marble::AbstractProjection::Hybrid
Definition: AbstractProjection.h:56
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
QScopedPointer
Marble::AbstractProjection::Conformal
Definition: AbstractProjection.h:64
Marble::AbstractProjection::Conical
Definition: AbstractProjection.h:57
Marble::GeoDataLineString
A LineString that allows to store a contiguous set of line segments.
Definition: GeoDataLineString.h:75
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::AbstractProjection::Pseudocylindrical
Definition: AbstractProjection.h:55
Marble::AbstractProjection::Cylindrical
Definition: AbstractProjection.h:54
Marble::AbstractProjection::PreservationType
PreservationType
Definition: AbstractProjection.h:62
Marble::AbstractProjection::SurfaceType
SurfaceType
Definition: AbstractProjection.h:53
QPainterPath
QVector
QSizeF
marble_export.h
GeoDataLatLonAltBox.h
Marble::AbstractProjection
A base class for all projections in Marble.
Definition: AbstractProjection.h:49
Marble::latLonAltBoxSamplingRate
static const int latLonAltBoxSamplingRate
Definition: AbstractProjection.h:38
Marble::GeoDataLatLonAltBox
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:49
QRegion
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 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
  • 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