25#ifndef _NAVOBJECTCOLLECTION_H__
26#define _NAVOBJECTCOLLECTION_H__
31#include <wx/checkbox.h>
36#include "observable_evtvar.h"
46#define OUT_TYPE 1 << 1
47#define OUT_TIME 1 << 2
48#define OUT_NAME 1 << 3
49#define OUT_NAME_FORCE 1 << 4
50#define OUT_DESC 1 << 5
51#define OUT_DESC_FORCE 1 << 6
52#define OUT_SYM_FORCE 1 << 7
53#define OUT_GUID 1 << 8
55#define OUT_VIZ_NAME 1 << 10
56#define OUT_SHARED 1 << 11
57#define OUT_HYPERLINKS 1 << 13
58#define OUT_ACTION_ADD 1 << 14
59#define OUT_ACTION_DEL 1 << 15
60#define OUT_ACTION_UPD 1 << 16
61#define OUT_EXTENSION 1 << 17
62#define OUT_ARRIVAL_RADIUS 1 << 18
63#define OUT_WAYPOINT_RANGE_RINGS 1 << 19
64#define OUT_WAYPOINT_SCALE 1 << 20
65#define OUT_TIDE_STATION 1 << 21
66#define OUT_RTE_PROPERTIES 1 << 22
68#define OPT_TRACKPT OUT_TIME
70 (OUT_TYPE) + (OUT_TIME) + (OUT_NAME) + (OUT_DESC) + (OUT_SYM_FORCE) + \
71 (OUT_GUID) + (OUT_VIZ) + (OUT_VIZ_NAME) + (OUT_SHARED) + \
72 (OUT_HYPERLINKS) + (OUT_ARRIVAL_RADIUS) + (OUT_WAYPOINT_RANGE_RINGS) + \
73 (OUT_WAYPOINT_SCALE) + (OUT_TIDE_STATION)
74#define OPT_ROUTEPT OPT_WPT + (OUT_RTE_PROPERTIES)
78#define RT_OUT_ACTION_ADD 1 << 1
79#define RT_OUT_ACTION_DEL 1 << 2
80#define RT_OUT_ACTION_UPD 1 << 3
81#define RT_OUT_NO_RTPTS 1 << 4
86RoutePoint *WaypointExists(
const wxString &name,
double lat,
double lon);
87RoutePoint *WaypointExists(
const wxString &guid);
88Route *RouteExists(
const wxString &guid);
90Track *TrackExists(
const wxString &guid);
95 bool b_layerviz,
int layer_id,
bool b_change,
96 bool load_points =
true);
99 wxString GUID,
bool b_fullviz,
bool b_layer,
100 bool b_layerviz,
int layer_id);
103bool InsertTrack(
Track *pTentTrack,
bool bApplyChanges =
false);
104bool InsertWpt(
RoutePoint *pWp,
bool overwrite);
107 bool b_layerviz,
int layer_id);
114 bool CreateNavObjGPXPoints(
void);
115 bool CreateNavObjGPXRoutes(
void);
116 bool CreateNavObjGPXTracks(
void);
118 void AddGPXRoutesList(RouteList *pRoutes);
119 void AddGPXTracksList(std::vector<Track *> *pTracks);
120 bool AddGPXPointsList(RoutePointList *pRoutePoints);
121 bool AddGPXRoute(
Route *pRoute);
122 bool AddGPXTrack(
Track *pTrk);
125 bool CreateAllGPXObjects();
126 bool LoadAllGPXObjects(
bool b_full_viz,
int &wpt_duplicates,
127 bool b_compute_bbox =
false);
128 int LoadAllGPXObjectsAsLayer(
int layer_id,
bool b_layerviz,
129 wxCheckBoxState b_namesviz);
131 bool SaveFile(
const wxString filename);
133 void SetRootGPXNode(
void);
135 LLBBox &GetBBox() {
return BBox; };
138 bool m_bSkipChangeSetUpdate;
145 static std::unique_ptr<NavObjectChanges> getTempInstance() {
155 void Init(
const wxString &path) {
157 m_changes_file = fopen(m_filename.mb_str(),
"a");
164 void AddRoute(
Route *pr,
const char *action);
165 void AddTrack(
Track *pr,
const char *action);
166 void AddWP(
RoutePoint *pr,
const char *action);
167 void AddTrackPoint(
TrackPoint *pWP,
const char *action,
168 const wxString &parent_GUID);
170 virtual void AddNewRoute(
Route *pr);
171 virtual void UpdateRoute(
Route *pr);
172 virtual void DeleteConfigRoute(
Route *pr);
174 virtual void AddNewTrack(
Track *pt);
175 virtual void UpdateTrack(
Track *pt);
176 virtual void DeleteConfigTrack(
Track *pt);
178 virtual void AddNewWayPoint(
RoutePoint *pWP,
int ConfigRouteNum = -1);
181 virtual void AddNewTrackPoint(
TrackPoint *pWP,
const wxString &parent_GUID);
183 bool ApplyChanges(
void);
184 bool IsDirty() {
return m_bdirty; }
205 FILE *m_changes_file;
Generic event handling between MVC Model and Controller based on a shared EventVar variable.
EventVar evt_delete_track
Notified when Routeman (?) should delete a track.
EventVar evt_delete_route
Notified when Routeman (?) should delete a Route*.
Represents a single point in a track.
Represents a track, which is a series of connected track points.