• 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
  • routing
RouteSegment.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 2011 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 #ifndef MARBLE_ROUTESEGMENT_H
12 #define MARBLE_ROUTESEGMENT_H
13 
14 #include "Maneuver.h"
15 #include "GeoDataLineString.h"
16 #include "GeoDataLatLonBox.h"
17 
18 #include <Qt>
19 
20 namespace Marble
21 {
22 
23 class MARBLE_EXPORT RouteSegment
24 {
25 public:
26  RouteSegment();
27 
28  bool isValid() const;
29 
30  qreal distance() const;
31 
32  const Maneuver & maneuver() const;
33 
34  void setManeuver( const Maneuver &maneuver );
35 
36  const GeoDataLineString & path() const;
37 
38  void setPath( const GeoDataLineString &path );
39 
40  int travelTime() const;
41 
42  void setTravelTime( int seconds );
43 
44  GeoDataLatLonBox bounds() const;
45 
46  const RouteSegment & nextRouteSegment() const;
47 
48  void setNextRouteSegment( const RouteSegment* segment );
49 
50  qreal distanceTo( const GeoDataCoordinates &point, GeoDataCoordinates &closest, GeoDataCoordinates &interpolated ) const;
51 
52  qreal minimalDistanceTo( const GeoDataCoordinates &point ) const;
53 
54  bool operator==( const RouteSegment &other ) const;
55 
56  bool operator!=( const RouteSegment &other ) const;
57 
58 private:
59  static qreal distancePointToLine(const GeoDataCoordinates &p, const GeoDataCoordinates &a, const GeoDataCoordinates &b);
60 
61  static GeoDataCoordinates projected(const GeoDataCoordinates &p, const GeoDataCoordinates &a, const GeoDataCoordinates &b);
62 
63  bool m_valid;
64 
65  qreal m_distance;
66 
67  Maneuver m_maneuver;
68 
69  GeoDataLineString m_path;
70 
71  int m_travelTime;
72 
73  GeoDataLatLonBox m_bounds;
74 
75  const RouteSegment *m_nextRouteSegment;
76 };
77 
78 
79 }
80 
81 #endif
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::operator==
bool operator==(const DownloadPolicyKey &lhs, const DownloadPolicyKey &rhs)
Definition: DownloadPolicy.h:49
Maneuver.h
Marble::Maneuver
Definition: Maneuver.h:22
MARBLE_EXPORT
#define MARBLE_EXPORT
Definition: marble_export.h:20
GeoDataLineString.h
Marble::operator!=
bool operator!=(GeoDataLatLonBox const &lhs, GeoDataLatLonBox const &rhs)
Definition: GeoDataLatLonBox.cpp:59
Marble::GeoDataLineString
A LineString that allows to store a contiguous set of line segments.
Definition: GeoDataLineString.h:75
GeoDataLatLonBox.h
Marble::RouteSegment
Definition: RouteSegment.h:23
Marble::GeoDataLatLonBox
A class that defines a 2D bounding box for geographic data.
Definition: GeoDataLatLonBox.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 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