OpenCPN Partial API docs
Loading...
Searching...
No Matches
kml.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2012 by David S. Register *
3 * Copyright (C) 2012 Jesper Weissglass *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
26#ifndef KML_H
27#define KML_H
28
29#include "tinyxml.h"
30
31#define KML_INSERT_EXTRADATA true // For QtVlm Routing.
32
33enum KmlPastebufferType {
34 KML_PASTE_WAYPOINT,
35 KML_PASTE_ROUTE,
36 KML_PASTE_TRACK,
37 KML_PASTE_ROUTE_TRACK,
38 KML_PASTE_INVALID,
39 KML_COPY_STANDARD,
40 KML_COPY_EXTRADATA
41};
42
43class dPoint {
44public:
45 double x, y, z;
46};
47
48typedef std::vector<dPoint> dPointList;
49
50class Kml {
51public:
52 Kml();
53 ~Kml();
54 KmlPastebufferType ParsePasteBuffer();
55 Route* GetParsedRoute() { return parsedRoute; }
56 Track* GetParsedTrack() { return parsedTrack; }
57 RoutePoint* GetParsedRoutePoint() { return parsedRoutePoint; }
58
59 static wxString MakeKmlFromRoute(Route* route, bool insertSeqNames = false);
60 static wxString MakeKmlFromTrack(Track* track);
61 static wxString MakeKmlFromWaypoint(RoutePoint* routepoint);
62 static void CopyWaypointToClipboard(RoutePoint* routepoint);
63 static void CopyRouteToClipboard(Route* route);
64 static void CopyTrackToClipboard(Track* route);
65
66private:
67 KmlPastebufferType ParseOnePlacemarkPoint(TiXmlNode* node, wxString& name);
68 KmlPastebufferType ParseTrack(TiXmlNode* node, wxString& name);
69 int ParseCoordinates(TiXmlNode* node, dPointList& points);
70 static TiXmlElement* StandardHead(TiXmlDocument& xmlDoc, wxString name);
71 static std::string PointPlacemark(TiXmlElement* document,
72 RoutePoint* routepoint);
73
74 wxString kmlText;
75 RoutePoint* parsedRoutePoint;
76 Route* parsedRoute;
77 Track* parsedTrack;
78 static bool insertQtVlmExtendedData;
79 static int seqCounter;
80};
81
82//---------------------------------------------------------------------------
83
84class KmlFormatDialog : public wxDialog {
85private:
86 std::vector<wxRadioButton*> choices;
87
88public:
89 KmlFormatDialog(wxWindow* parent);
90 int GetSelectedFormat();
91};
92
93#endif
Definition kml.h:50
Represents a waypoint or mark within the navigation system.
Definition route_point.h:71
Represents a navigational route in the navigation system.
Definition route.h:99
Represents a track, which is a series of connected track points.
Definition track.h:117
Definition kml.h:43