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_AUTO_NAME \
59#define OUT_HYPERLINKS 1 << 13
60#define OUT_ACTION_ADD 1 << 14
61#define OUT_ACTION_DEL 1 << 15
62#define OUT_ACTION_UPD 1 << 16
63#define OUT_EXTENSION 1 << 17
64#define OUT_ARRIVAL_RADIUS 1 << 18
65#define OUT_WAYPOINT_RANGE_RINGS 1 << 19
66#define OUT_WAYPOINT_SCALE 1 << 20
67#define OUT_TIDE_STATION 1 << 21
68#define OUT_RTE_PROPERTIES 1 << 22
70#define OPT_TRACKPT OUT_TIME
72 (OUT_TYPE) + (OUT_TIME) + (OUT_NAME) + (OUT_DESC) + (OUT_SYM_FORCE) + \
73 (OUT_GUID) + (OUT_VIZ) + (OUT_VIZ_NAME) + (OUT_SHARED) + \
74 (OUT_AUTO_NAME) + (OUT_HYPERLINKS) + (OUT_ARRIVAL_RADIUS) + \
75 (OUT_WAYPOINT_RANGE_RINGS) + (OUT_WAYPOINT_SCALE) + (OUT_TIDE_STATION)
76#define OPT_ROUTEPT OPT_WPT + (OUT_RTE_PROPERTIES)
80#define RT_OUT_ACTION_ADD 1 << 1
81#define RT_OUT_ACTION_DEL 1 << 2
82#define RT_OUT_ACTION_UPD 1 << 3
83#define RT_OUT_NO_RTPTS 1 << 4
87RoutePoint *WaypointExists(
const wxString &name,
double lat,
double lon);
88RoutePoint *WaypointExists(
const wxString &guid);
89Route *RouteExists(
const wxString &guid);
91Track *TrackExists(
const wxString &guid);
100 bool CreateNavObjGPXPoints(
void);
101 bool CreateNavObjGPXRoutes(
void);
102 bool CreateNavObjGPXTracks(
void);
104 void AddGPXRoutesList(RouteList *pRoutes);
105 void AddGPXTracksList(std::vector<Track*> *pTracks);
106 bool AddGPXPointsList(RoutePointList *pRoutePoints);
107 bool AddGPXRoute(
Route *pRoute);
108 bool AddGPXTrack(
Track *pTrk);
111 bool CreateAllGPXObjects();
112 bool LoadAllGPXObjects(
bool b_full_viz,
int &wpt_duplicates,
113 bool b_compute_bbox =
false);
114 int LoadAllGPXObjectsAsLayer(
int layer_id,
bool b_layerviz,
115 wxCheckBoxState b_namesviz);
117 bool SaveFile(
const wxString filename);
119 void SetRootGPXNode(
void);
121 LLBBox &GetBBox() {
return BBox; };
124 bool m_bSkipChangeSetUpdate;
131 static std::unique_ptr<NavObjectChanges> getTempInstance() {
141 void Init(
const wxString& path) {
143 m_changes_file = fopen(m_filename.mb_str(),
"a");
150 void AddRoute(
Route *pr,
const char *action);
151 void AddTrack(
Track *pr,
const char *action);
152 void AddWP(
RoutePoint *pr,
const char *action);
153 void AddTrackPoint(
TrackPoint *pWP,
const char *action,
154 const wxString &parent_GUID);
156 virtual void AddNewRoute(
Route *pr);
157 virtual void UpdateRoute(
Route *pr);
158 virtual void DeleteConfigRoute(
Route *pr);
160 virtual void AddNewTrack(
Track *pt);
161 virtual void UpdateTrack(
Track *pt);
162 virtual void DeleteConfigTrack(
Track *pt);
164 virtual void AddNewWayPoint(
RoutePoint *pWP,
int ConfigRouteNum = -1);
167 virtual void AddNewTrackPoint(
TrackPoint *pWP,
const wxString &parent_GUID);
169 bool ApplyChanges(
void);
170 bool IsDirty() {
return m_bdirty; }
192 FILE *m_changes_file;
Generic event handling between between two parties like MVC Model and Controller using a shared Event...
EventVar evt_delete_track
Notified when Routeman (?) should delete a track.
EventVar evt_delete_route
Notified when Routeman (?) should delete a Route*.