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 char *GetpFullPath()
const {
return pFullPath; }
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;
272 float **pAuxPlyTable;
277 int nNoCovrPlyEntries;
278 int *pNoCovrCntTable;
279 float **pNoCovrPlyTable;
281 std::vector<int> m_GroupArray;
282 wxString *m_pfilename;
283 wxString *m_psFullPath;
284 wxString m_fullSystemPath;
285 std::string m_FullPath;
290 std::vector<float> m_reducedPlyPoints;
292 std::vector<std::vector<float>> m_reducedAuxPlyPointsVector;
313 void OnAnyEvent(wxEvent &event);
320 bool Create(ArrayOfCDI &dir_array, wxGenericProgressDialog *pprog);
328 bool Update(ArrayOfCDI &dir_array,
bool bForce,
329 wxGenericProgressDialog *pprog);
330 void FinalizeChartUpdate();
332 bool Read(
const wxString &filePath);
333 bool Write(
const wxString &filePath);
335 bool AddSingleChart(wxString &fullpath,
bool b_force_full_search =
true);
336 bool RemoveSingleChart(wxString &ChartFullPath);
338 const wxString &GetDBFileName()
const {
return m_DBFileName; }
339 ArrayOfCDI &GetChartDirArray() {
return m_dir_array; }
340 wxArrayString &GetChartDirArrayString() {
return m_chartDirs; }
341 void SetChartDirArray(ArrayOfCDI array) { m_dir_array = array; }
342 bool CompareChartDirArray(ArrayOfCDI &test_array);
343 wxString GetMagicNumberCached(wxString dir);
345 void UpdateChartClassDescriptorArray(
void);
346 bool UpdateChartDatabaseInplace(ArrayOfCDI &DirArray,
bool b_force,
347 wxGenericProgressDialog *_prog);
349 inline std::vector<std::shared_ptr<ChartTableEntry>> &GetChartTable() {
350 return active_chartTable;
352 int GetChartTableEntries()
const {
return active_chartTable.size(); }
355 bool IsValid()
const {
return bValid; }
356 int DisableChart(wxString &PathToDisable);
357 bool GetCentroidOfLargestScaleChart(
double *clat,
double *clon,
358 ChartFamilyEnum family);
359 int GetDBChartType(
int dbIndex);
360 int GetDBChartFamily(
int dbIndex);
361 float GetDBChartSkew(
int dbIndex);
362 int GetDBChartProj(
int dbIndex);
363 int GetDBChartScale(
int dbIndex);
365 bool GetDBBoundingBox(
int dbindex, LLBBox &box);
366 const LLBBox &GetDBBoundingBox(
int dbIndex);
368 int GetnAuxPlyEntries(
int dbIndex);
369 int GetDBPlyPoint(
int dbIndex,
int plyindex,
float *lat,
float *lon);
370 int GetDBAuxPlyPoint(
int dbIndex,
int plyindex,
int iAuxPly,
float *lat,
372 int GetVersion() {
return m_dbversion; }
373 wxString GetFullChartInfo(
ChartBase *pc,
int dbIndex,
int *char_width,
375 int FinddbIndex(wxString PathToFind);
376 wxString GetDBChartFileName(
int dbIndex);
377 void ApplyGroupArray(ChartGroupArray *pGroupArray);
378 bool IsChartAvailable(
int dbIndex);
379 std::map<wxString, int> active_chartTable_pathindex;
381 std::vector<float> GetReducedPlyPoints(
int dbIndex);
382 std::vector<float> GetReducedAuxPlyPoints(
int dbIndex,
int iTable);
384 bool IsBusy() {
return m_b_busy; }
385 void SetBusy(
bool _busy) { m_b_busy = _busy; }
386 bool ScrubGroupArray();
392 std::vector<std::shared_ptr<ChartTableEntry>> active_chartTable;
393 void OnDBSProgressUpdate(wxCommandEvent &evt);
396 virtual ChartBase *GetChart(
const wxChar *theFilePath,
398 int AddChartDirectory(
const wxString &theDir,
bool bshow_prog);
399 void SetValid(
bool valid) { bValid = valid; }
401 std::vector<ChartClassDescriptor> m_ChartClassDescriptorArray;
402 ArrayOfCDI m_dir_array;
406 bool IsChartDirUsed(
const wxString &theDir);
408 int SearchDirAndAddCharts(wxString &dir_name_base,
410 wxGenericProgressDialog *pprog);
413 wxGenericProgressDialog *pprog,
414 wxString &dir_magic,
bool bForce);
415 bool DetectDirChange(
const wxString &dir_path,
const wxString &prog_label,
416 const wxString &magic, wxString &new_magic,
417 wxGenericProgressDialog *pprog);
420 wxGenericProgressDialog *pprog,
int isearch,
421 bool bthis_dir_in_dB);
423 bool Check_CM93_Structure(wxString dir_name);
424 void OnProgessTimer(wxTimerEvent &event);
425 void OnUpdateComplete(wxTimerEvent &event);
427 void ProcessThreadQueueEmpty();
430 wxArrayString m_chartDirs;
434 m_ChartTableEntryDummy;
436 wxString m_DBFileName;
444 std::atomic<int> m_jobsRemaining{0};
448 std::vector<std::shared_ptr<ChartTableEntryJobTicket>> m_ticket_vector;
449 std::vector<std::shared_ptr<ChartTableEntryJobTicket>>
450 m_deferred_ticket_vector;
451 ChartCollisionsHashMap m_full_collision_map;
454 wxGenericProgressDialog *m_pprog;
455 wxTimer m_progress_timer;
456 std::atomic<bool> m_progress_dirty{
false};
457 int m_progress_value = 0;
458 wxString m_progress_message;
459 wxTimer m_update_competion_timer;
462 int m_nFileProgressQuantum;
463 wxString m_gshhg_chart_loc;
Represents an entry in the chart table, containing information about a single chart.