33#include <wx/xml/xml.h>
61 CurrentStackEntry = 0;
67 int CurrentStackEntry;
68 int GetCurrentEntrydbIndex(
void);
69 void SetCurrentEntryFromdbIndex(
int current_db_index);
70 int GetDBIndex(
int stack_index);
71 void SetDBIndex(
int stack_index,
int db_index);
72 bool DoesStackContaindbIndex(
int db_index);
73 void AddChart(
int db_add);
76 int DBIndex[MAXSTACK];
98 bool LoadBinary(
const wxString &filename, ArrayOfCDI &dir_array_check);
99 bool SaveBinary(
const wxString &filename) {
100 return ChartDatabase::Write(filename);
103 int BuildChartStack(
ChartStack *cstk,
float lat,
float lon,
int groupIndex);
104 int BuildChartStack(
ChartStack *cstk,
float lat,
float lon,
int db_add,
108 wxString GetFullPath(
ChartStack *ps,
int stackindex);
109 int GetStackChartScale(
ChartStack *ps,
int stackindex,
char *buf,
int nbuf);
110 int GetCSPlyPoint(
ChartStack *ps,
int stackindex,
int plyindex,
float *lat,
112 ChartTypeEnum GetCSChartType(
ChartStack *ps,
int stackindex);
113 ChartFamilyEnum GetCSChartFamily(
ChartStack *ps,
int stackindex);
114 bool SearchForChartDir(
const wxString &dir);
116 bool bLargest, ChartTypeEnum New_Type,
117 ChartFamilyEnum New_Family_Fallback);
119 wxArrayPtrVoid *GetChartCache(
void) {
return pChartCache; }
122 int GetStackEntry(
ChartStack *ps, wxString fp);
123 bool IsChartInCache(
int dbindex);
124 bool IsChartInCache(wxString path);
125 bool IsChartInGroup(
const int db_index,
const int group);
126 bool IsENCInGroup(
const int group);
127 bool IsNonMBTileInGroup(
const int group);
130 ChartInitFlag iflag = FULL_INIT);
131 ChartBase *OpenChartFromDB(
int index, ChartInitFlag init_flag);
132 ChartBase *OpenChartFromDBAndLock(
int index, ChartInitFlag init_flag,
134 ChartBase *OpenChartFromDBAndLock(wxString chart_path,
135 ChartInitFlag init_flag);
136 ChartBase *OpenChartFromDB(wxString chart_path, ChartInitFlag init_flag);
138 void ApplyColorSchemeToCachedCharts(ColorScheme cs);
140 void PurgeCachePlugins();
141 bool DeleteCacheChart(
ChartBase *pChart);
143 void LockCache(
bool bl) { m_b_locked = bl; }
144 void LockCache() { m_b_locked =
true; }
145 void UnLockCache() { m_b_locked =
false; }
146 bool IsCacheLocked() {
return m_b_locked; }
147 wxXmlDocument GetXMLDescription(
int dbIndex,
bool b_getGeom);
149 bool LockCacheChart(
int index);
150 bool IsChartLocked(
int index);
152 void UnLockCacheChart(
int index);
153 void UnLockAllCacheCharts();
155 void ClearCacheInUseFlags(
void);
156 void PurgeCacheUnusedCharts(
double factor);
158 bool IsBusy() {
return m_b_busy; }
159 bool CheckExclusiveTileGroup(
int canvasIndex);
160 bool CheckAnyCanvasExclusiveTileGroup();
163 virtual ChartBase *GetChart(
const wxChar *theFilePath,
167 InitReturn CreateChartTableEntry(wxString full_name,
ChartTableEntry *pEntry);
169 int SearchDirAndAddSENC(wxString &dir,
bool bshow_prog,
bool bupdate);
170 bool CreateS57SENCChartTableEntry(wxString full_name,
ChartTableEntry *pEntry,
172 bool CheckPositionWithinChart(
int index,
float lat,
float lon);
173 ChartBase *OpenChartUsingCache(
int dbindex, ChartInitFlag init_flag);
174 CacheEntry *FindOldestDeleteCandidate(
bool blog);
175 void DeleteCacheEntry(
int i,
bool bDelTexture =
false,
176 const wxString &msg = wxEmptyString);
177 void DeleteCacheEntry(
CacheEntry *pce,
bool bDelTexture =
false,
178 const wxString &msg = wxEmptyString);
180 wxArrayPtrVoid *pChartCache;
186 wxCriticalSection m_critSect;
187 wxMutex m_cache_mutex;
188 int m_checkGroupIndex[2];
189 bool m_checkedTileOnly[2];