203 void SetValid(
bool valid) { bValid = valid; }
204 time_t GetFileTime()
const {
return file_date; }
205 time_t GetChartEditionDate()
const {
return edition_date; }
207 int GetnPlyEntries()
const {
return nPlyEntries; }
208 float *GetpPlyTable()
const {
return pPlyTable; }
210 int GetnAuxPlyEntries()
const {
return nAuxPlyEntries; }
211 float *GetpAuxPlyTableEntry(
int index)
const {
return pAuxPlyTable[index]; }
212 int GetAuxCntTableEntry(
int index)
const {
return pAuxCntTable[index]; }
214 int GetnNoCovrPlyEntries()
const {
return nNoCovrPlyEntries; }
215 float *GetpNoCovrPlyTableEntry(
int index)
const {
216 return pNoCovrPlyTable[index];
218 int GetNoCovrCntTableEntry(
int index)
const {
return pNoCovrCntTable[index]; }
220 const LLBBox &GetBBox()
const {
return m_bbox; }
222 const char *GetpFullPath()
const {
return m_FullPath.c_str(); }
223 float GetLonMax()
const {
return LonMax; }
224 float GetLonMin()
const {
return LonMin; }
225 float GetLatMax()
const {
return LatMax; }
226 float GetLatMin()
const {
return LatMin; }
227 int GetScale()
const {
return Scale; }
228 int GetChartType()
const {
return ChartType; }
229 int GetChartFamily()
const {
return ChartFamily; }
230 int GetChartProjectionType()
const {
return ProjectionType; }
231 float GetChartSkew()
const {
return Skew; }
233 bool GetbValid() {
return bValid; }
234 void SetEntryOffset(
int n) { EntryOffset = n; }
235 const wxString *GetpFileName(
void)
const {
return m_pfilename; }
236 wxString *GetpsFullPath(
void)
const {
return m_psFullPath; }
237 wxString GetFullSystemPath()
const {
return m_fullSystemPath; }
238 const std::string &GetFullPath()
const {
return m_FullPath; }
240 const std::vector<int> &GetGroupArray(
void)
const {
return m_GroupArray; }
241 void ClearGroupArray(
void) { m_GroupArray.clear(); }
242 void AddIntToGroupArray(
int val) { m_GroupArray.push_back(val); }
243 void SetAvailable(
bool avail) { m_bavail = avail; }
245 std::vector<float> GetReducedPlyPoints();
246 std::vector<float> GetReducedAuxPlyPoints(
int iTable);
248 LLRegion quilt_candidate_region;
250 void SetScale(
int scale);
251 bool Scale_eq(
int b)
const {
return abs(Scale - b) <= rounding; }
252 bool Scale_ge(
int b)
const {
return Scale_eq(b) || Scale > b; }
253 bool Scale_gt(
int b)
const {
return Scale > b && !Scale_eq(b); }
254 bool IsBasemap()
const;
271 float **pAuxPlyTable;
276 int nNoCovrPlyEntries;
277 int *pNoCovrCntTable;
278 float **pNoCovrPlyTable;
280 std::vector<int> m_GroupArray;
281 wxString *m_pfilename;
282 wxString *m_psFullPath;
283 wxString m_fullSystemPath;
284 std::string m_FullPath;
289 std::vector<float> m_reducedPlyPoints;
291 std::vector<std::vector<float>> m_reducedAuxPlyPointsVector;
312 void OnAnyEvent(wxEvent &event);
319 bool Create(ArrayOfCDI &dir_array, wxGenericProgressDialog *pprog);
327 bool Update(ArrayOfCDI &dir_array,
bool bForce,
328 wxGenericProgressDialog *pprog);
329 void FinalizeChartUpdate();
331 bool Read(
const wxString &filePath);
332 bool Write(
const wxString &filePath);
334 bool AddSingleChart(wxString &fullpath,
bool b_force_full_search =
true);
335 bool RemoveSingleChart(wxString &ChartFullPath);
337 const wxString &GetDBFileName()
const {
return m_DBFileName; }
338 ArrayOfCDI &GetChartDirArray() {
return m_dir_array; }
339 wxArrayString &GetChartDirArrayString() {
return m_chartDirs; }
340 void SetChartDirArray(ArrayOfCDI array) { m_dir_array = array; }
341 bool CompareChartDirArray(ArrayOfCDI &test_array);
342 wxString GetMagicNumberCached(wxString dir);
344 void UpdateChartClassDescriptorArray(
void);
345 bool UpdateChartDatabaseInplace(ArrayOfCDI &DirArray,
bool b_force,
346 wxGenericProgressDialog *_prog);
348 inline std::vector<std::shared_ptr<ChartTableEntry>> &GetChartTable() {
349 return active_chartTable;
351 int GetChartTableEntries()
const {
return active_chartTable.size(); }
354 bool IsValid()
const {
return bValid; }
355 int DisableChart(wxString &PathToDisable);
356 bool GetCentroidOfLargestScaleChart(
double *clat,
double *clon,
357 ChartFamilyEnum family);
358 int GetDBChartType(
int dbIndex);
359 int GetDBChartFamily(
int dbIndex);
360 float GetDBChartSkew(
int dbIndex);
361 int GetDBChartProj(
int dbIndex);
362 int GetDBChartScale(
int dbIndex);
364 bool GetDBBoundingBox(
int dbindex, LLBBox &box);
365 const LLBBox &GetDBBoundingBox(
int dbIndex);
367 int GetnAuxPlyEntries(
int dbIndex);
368 int GetDBPlyPoint(
int dbIndex,
int plyindex,
float *lat,
float *lon);
369 int GetDBAuxPlyPoint(
int dbIndex,
int plyindex,
int iAuxPly,
float *lat,
371 int GetVersion() {
return m_dbversion; }
372 wxString GetFullChartInfo(
ChartBase *pc,
int dbIndex,
int *char_width,
374 int FinddbIndex(wxString PathToFind);
375 wxString GetDBChartFileName(
int dbIndex);
376 void ApplyGroupArray(ChartGroupArray *pGroupArray);
377 bool IsChartAvailable(
int dbIndex);
378 std::map<wxString, int> active_chartTable_pathindex;
380 std::vector<float> GetReducedPlyPoints(
int dbIndex);
381 std::vector<float> GetReducedAuxPlyPoints(
int dbIndex,
int iTable);
383 bool IsBusy() {
return m_b_busy; }
384 void SetBusy(
bool _busy) { m_b_busy = _busy; }
385 bool ScrubGroupArray();
391 std::vector<std::shared_ptr<ChartTableEntry>> active_chartTable;
392 void OnDBSProgressUpdate(wxCommandEvent &evt);
395 virtual ChartBase *GetChart(
const wxChar *theFilePath,
397 int AddChartDirectory(
const wxString &theDir,
bool bshow_prog);
398 void SetValid(
bool valid) { bValid = valid; }
400 std::vector<ChartClassDescriptor> m_ChartClassDescriptorArray;
401 ArrayOfCDI m_dir_array;
405 bool IsChartDirUsed(
const wxString &theDir);
407 int SearchDirAndAddCharts(wxString &dir_name_base,
409 wxGenericProgressDialog *pprog);
412 wxGenericProgressDialog *pprog,
413 wxString &dir_magic,
bool bForce);
414 bool DetectDirChange(
const wxString &dir_path,
const wxString &prog_label,
415 const wxString &magic, wxString &new_magic,
416 wxGenericProgressDialog *pprog);
419 wxGenericProgressDialog *pprog,
int isearch,
420 bool bthis_dir_in_dB);
422 bool Check_CM93_Structure(wxString dir_name);
423 void OnProgessTimer(wxTimerEvent &event);
424 void OnUpdateComplete(wxTimerEvent &event);
426 void ProcessThreadQueueEmpty();
429 wxArrayString m_chartDirs;
433 m_ChartTableEntryDummy;
435 wxString m_DBFileName;
443 std::atomic<int> m_jobsRemaining{0};
447 std::vector<std::shared_ptr<ChartTableEntryJobTicket>> m_ticket_vector;
448 std::vector<std::shared_ptr<ChartTableEntryJobTicket>>
449 m_deferred_ticket_vector;
450 ChartCollisionsHashMap m_full_collision_map;
453 wxGenericProgressDialog *m_pprog;
454 wxTimer m_progress_timer;
455 std::atomic<bool> m_progress_dirty{
false};
456 int m_progress_value = 0;
457 wxString m_progress_message;
458 wxTimer m_update_competion_timer;
461 int m_nFileProgressQuantum;
462 wxString m_gshhg_chart_loc;
Represents an entry in the chart table, containing information about a single chart.