OpenCPN Partial API docs
Loading...
Searching...
No Matches
ChartDB Class Reference

Manages the chart database and provides access to chart data. More...

#include <chartdb.h>

Inheritance diagram for ChartDB:
ChartDatabase

Public Member Functions

bool LoadBinary (const wxString &filename, ArrayOfCDI &dir_array_check)
 Load the chart database from a binary file.
 
bool SaveBinary (const wxString &filename)
 
int BuildChartStack (ChartStack *cstk, float lat, float lon, int groupIndex)
 
int BuildChartStack (ChartStack *cstk, float lat, float lon, int db_add, int groupIndex)
 
bool EqualStacks (ChartStack *, ChartStack *)
 
bool CopyStack (ChartStack *pa, ChartStack *pb)
 
wxString GetFullPath (ChartStack *ps, int stackindex)
 
int GetStackChartScale (ChartStack *ps, int stackindex, char *buf, int nbuf)
 
int GetCSPlyPoint (ChartStack *ps, int stackindex, int plyindex, float *lat, float *lon)
 
ChartTypeEnum GetCSChartType (ChartStack *ps, int stackindex)
 
ChartFamilyEnum GetCSChartFamily (ChartStack *ps, int stackindex)
 
bool SearchForChartDir (const wxString &dir)
 
ChartBaseOpenStackChartConditional (ChartStack *ps, int start_index, bool bLargest, ChartTypeEnum New_Type, ChartFamilyEnum New_Family_Fallback)
 
wxArrayPtrVoid * GetChartCache (void)
 
std::vector< int > GetCSArray (ChartStack *ps)
 
int GetStackEntry (ChartStack *ps, wxString fp)
 
bool IsChartInCache (int dbindex)
 
bool IsChartInCache (wxString path)
 
bool IsChartInGroup (const int db_index, const int group)
 
bool IsENCInGroup (const int group)
 
bool IsNonMBTileInGroup (const int group)
 
bool IsChartDirectoryExcluded (const std::string &chart_file)
 
ChartBaseOpenChartFromStack (ChartStack *pStack, int StackEntry, ChartInitFlag iflag=FULL_INIT)
 
ChartBaseOpenChartFromDB (int index, ChartInitFlag init_flag)
 
ChartBaseOpenChartFromDBAndLock (int index, ChartInitFlag init_flag, bool lock=true)
 
ChartBaseOpenChartFromDBAndLock (wxString chart_path, ChartInitFlag init_flag)
 
ChartBaseOpenChartFromDB (wxString chart_path, ChartInitFlag init_flag)
 
void ApplyColorSchemeToCachedCharts (ColorScheme cs)
 
void PurgeCache ()
 
void PurgeCachePlugins ()
 
bool DeleteCacheChart (ChartBase *pChart)
 
void LockCache (bool bl)
 
void LockCache ()
 
void UnLockCache ()
 
bool IsCacheLocked ()
 
wxXmlDocument GetXMLDescription (int dbIndex, bool b_getGeom)
 
bool LockCacheChart (int index)
 
bool IsChartLocked (int index)
 
void UnLockCacheChart (int index)
 
void UnLockAllCacheCharts ()
 
void ClearCacheInUseFlags (void)
 
void PurgeCacheUnusedCharts (double factor)
 
bool IsBusy ()
 
bool CheckExclusiveTileGroup (int canvasIndex)
 
bool CheckAnyCanvasExclusiveTileGroup ()
 
- Public Member Functions inherited from ChartDatabase
bool Create (ArrayOfCDI &dir_array, wxGenericProgressDialog *pprog)
 Creates a new chart database from a list of directories.
 
bool Update (ArrayOfCDI &dir_array, bool bForce, wxGenericProgressDialog *pprog)
 Updates the chart database.
 
bool Read (const wxString &filePath)
 
bool Write (const wxString &filePath)
 
bool AddSingleChart (wxString &fullpath, bool b_force_full_search=true)
 
bool RemoveSingleChart (wxString &ChartFullPath)
 
const wxString & GetDBFileName () const
 
ArrayOfCDI & GetChartDirArray ()
 
wxArrayString & GetChartDirArrayString ()
 
void SetChartDirArray (ArrayOfCDI array)
 
bool CompareChartDirArray (ArrayOfCDI &test_array)
 
wxString GetMagicNumberCached (wxString dir)
 
void UpdateChartClassDescriptorArray (void)
 
int GetChartTableEntries () const
 
const ChartTableEntryGetChartTableEntry (int index) const
 
ChartTableEntryGetpChartTableEntry (int index) const
 
ChartTable & GetChartTable ()
 
bool IsValid () const
 
int DisableChart (wxString &PathToDisable)
 
bool GetCentroidOfLargestScaleChart (double *clat, double *clon, ChartFamilyEnum family)
 
int GetDBChartType (int dbIndex)
 
int GetDBChartFamily (int dbIndex)
 
float GetDBChartSkew (int dbIndex)
 
int GetDBChartProj (int dbIndex)
 
int GetDBChartScale (int dbIndex)
 
bool GetDBBoundingBox (int dbindex, LLBBox &box)
 
const LLBBox & GetDBBoundingBox (int dbIndex)
 
int GetnAuxPlyEntries (int dbIndex)
 
int GetDBPlyPoint (int dbIndex, int plyindex, float *lat, float *lon)
 
int GetDBAuxPlyPoint (int dbIndex, int plyindex, int iAuxPly, float *lat, float *lon)
 
int GetVersion ()
 
wxString GetFullChartInfo (ChartBase *pc, int dbIndex, int *char_width, int *line_count)
 
int FinddbIndex (wxString PathToFind)
 
wxString GetDBChartFileName (int dbIndex)
 
void ApplyGroupArray (ChartGroupArray *pGroupArray)
 
bool IsChartAvailable (int dbIndex)
 
std::vector< float > GetReducedPlyPoints (int dbIndex)
 
std::vector< float > GetReducedAuxPlyPoints (int dbIndex, int iTable)
 
bool IsBusy ()
 

Protected Member Functions

virtual ChartBaseGetChart (const wxChar *theFilePath, ChartClassDescriptor &chart_desc) const
 
- Protected Member Functions inherited from ChartDatabase
int AddChartDirectory (const wxString &theDir, bool bshow_prog)
 
void SetValid (bool valid)
 
ChartTableEntryCreateChartTableEntry (const wxString &filePath, wxString &utf8Path, ChartClassDescriptor &chart_desc)
 

Additional Inherited Members

- Public Attributes inherited from ChartDatabase
ChartTable active_chartTable
 
std::map< wxString, int > active_chartTable_pathindex
 
- Protected Attributes inherited from ChartDatabase
std::vector< ChartClassDescriptorm_ChartClassDescriptorArray
 
ArrayOfCDI m_dir_array
 
bool m_b_busy
 

Detailed Description

Manages the chart database and provides access to chart data.

Responsible for loading, saving, and managing the chart database. Provides methods for building chart stacks, opening charts, and managing the chart cache.

Definition at line 95 of file chartdb.h.

Constructor & Destructor Documentation

◆ ChartDB()

ChartDB::ChartDB ( )

Definition at line 196 of file chartdb.cpp.

◆ ~ChartDB()

ChartDB::~ChartDB ( )
virtual

Definition at line 222 of file chartdb.cpp.

Member Function Documentation

◆ ApplyColorSchemeToCachedCharts()

void ChartDB::ApplyColorSchemeToCachedCharts ( ColorScheme  cs)

Definition at line 1467 of file chartdb.cpp.

◆ BuildChartStack() [1/2]

int ChartDB::BuildChartStack ( ChartStack cstk,
float  lat,
float  lon,
int  db_add,
int  groupIndex 
)

Definition at line 453 of file chartdb.cpp.

◆ BuildChartStack() [2/2]

int ChartDB::BuildChartStack ( ChartStack cstk,
float  lat,
float  lon,
int  groupIndex 
)

Definition at line 462 of file chartdb.cpp.

◆ CheckAnyCanvasExclusiveTileGroup()

bool ChartDB::CheckAnyCanvasExclusiveTileGroup ( )

Definition at line 1805 of file chartdb.cpp.

◆ CheckExclusiveTileGroup()

bool ChartDB::CheckExclusiveTileGroup ( int  canvasIndex)

Definition at line 1764 of file chartdb.cpp.

◆ ClearCacheInUseFlags()

void ChartDB::ClearCacheInUseFlags ( void  )

Definition at line 306 of file chartdb.cpp.

◆ CopyStack()

bool ChartDB::CopyStack ( ChartStack pa,
ChartStack pb 
)

Definition at line 757 of file chartdb.cpp.

◆ DeleteCacheChart()

bool ChartDB::DeleteCacheChart ( ChartBase pChart)

Definition at line 1436 of file chartdb.cpp.

◆ EqualStacks()

bool ChartDB::EqualStacks ( ChartStack pa,
ChartStack pb 
)

Definition at line 742 of file chartdb.cpp.

◆ GetChart()

ChartBase * ChartDB::GetChart ( const wxChar *  theFilePath,
ChartClassDescriptor chart_desc 
) const
protectedvirtual

Reimplemented from ChartDatabase.

Definition at line 392 of file chartdb.cpp.

◆ GetChartCache()

wxArrayPtrVoid * ChartDB::GetChartCache ( void  )
inline

Definition at line 126 of file chartdb.h.

◆ GetCSArray()

std::vector< int > ChartDB::GetCSArray ( ChartStack ps)

Definition at line 863 of file chartdb.cpp.

◆ GetCSChartFamily()

ChartFamilyEnum ChartDB::GetCSChartFamily ( ChartStack ps,
int  stackindex 
)

Definition at line 835 of file chartdb.cpp.

◆ GetCSChartType()

ChartTypeEnum ChartDB::GetCSChartType ( ChartStack ps,
int  stackindex 
)

Definition at line 826 of file chartdb.cpp.

◆ GetCSPlyPoint()

int ChartDB::GetCSPlyPoint ( ChartStack ps,
int  stackindex,
int  plyindex,
float *  lat,
float *  lon 
)

Definition at line 779 of file chartdb.cpp.

◆ GetFullPath()

wxString ChartDB::GetFullPath ( ChartStack ps,
int  stackindex 
)

Definition at line 770 of file chartdb.cpp.

◆ GetStackChartScale()

int ChartDB::GetStackChartScale ( ChartStack ps,
int  stackindex,
char *  buf,
int  nbuf 
)

Definition at line 799 of file chartdb.cpp.

◆ GetStackEntry()

int ChartDB::GetStackEntry ( ChartStack ps,
wxString  fp 
)

Definition at line 814 of file chartdb.cpp.

◆ GetXMLDescription()

wxXmlDocument ChartDB::GetXMLDescription ( int  dbIndex,
bool  b_getGeom 
)

Definition at line 1534 of file chartdb.cpp.

◆ IsBusy()

bool ChartDB::IsBusy ( )
inline

Definition at line 166 of file chartdb.h.

◆ IsCacheLocked()

bool ChartDB::IsCacheLocked ( )
inline

Definition at line 154 of file chartdb.h.

◆ IsChartDirectoryExcluded()

bool ChartDB::IsChartDirectoryExcluded ( const std::string &  chart_file)

Definition at line 443 of file chartdb.cpp.

◆ IsChartInCache() [1/2]

bool ChartDB::IsChartInCache ( int  dbindex)

Definition at line 876 of file chartdb.cpp.

◆ IsChartInCache() [2/2]

bool ChartDB::IsChartInCache ( wxString  path)

Definition at line 896 of file chartdb.cpp.

◆ IsChartInGroup()

bool ChartDB::IsChartInGroup ( const int  db_index,
const int  group 
)

Definition at line 625 of file chartdb.cpp.

◆ IsChartLocked()

bool ChartDB::IsChartLocked ( int  index)

Definition at line 915 of file chartdb.cpp.

◆ IsENCInGroup()

bool ChartDB::IsENCInGroup ( const int  group)

Definition at line 643 of file chartdb.cpp.

◆ IsNonMBTileInGroup()

bool ChartDB::IsNonMBTileInGroup ( const int  group)

Definition at line 674 of file chartdb.cpp.

◆ LoadBinary()

bool ChartDB::LoadBinary ( const wxString &  filename,
ArrayOfCDI &  dir_array_check 
)

Load the chart database from a binary file.

Parameters
filenameName of the file to load
dir_array_checkArray to store directory information

Definition at line 229 of file chartdb.cpp.

◆ LockCache() [1/2]

void ChartDB::LockCache ( )
inline

Definition at line 152 of file chartdb.h.

◆ LockCache() [2/2]

void ChartDB::LockCache ( bool  bl)
inline

Definition at line 151 of file chartdb.h.

◆ LockCacheChart()

bool ChartDB::LockCacheChart ( int  index)

Definition at line 932 of file chartdb.cpp.

◆ OpenChartFromDB() [1/2]

ChartBase * ChartDB::OpenChartFromDB ( int  index,
ChartInitFlag  init_flag 
)

Definition at line 980 of file chartdb.cpp.

◆ OpenChartFromDB() [2/2]

ChartBase * ChartDB::OpenChartFromDB ( wxString  chart_path,
ChartInitFlag  init_flag 
)

Definition at line 984 of file chartdb.cpp.

◆ OpenChartFromDBAndLock() [1/2]

ChartBase * ChartDB::OpenChartFromDBAndLock ( int  index,
ChartInitFlag  init_flag,
bool  lock = true 
)

Definition at line 995 of file chartdb.cpp.

◆ OpenChartFromDBAndLock() [2/2]

ChartBase * ChartDB::OpenChartFromDBAndLock ( wxString  chart_path,
ChartInitFlag  init_flag 
)

Definition at line 1003 of file chartdb.cpp.

◆ OpenChartFromStack()

ChartBase * ChartDB::OpenChartFromStack ( ChartStack pStack,
int  StackEntry,
ChartInitFlag  iflag = FULL_INIT 
)

Definition at line 990 of file chartdb.cpp.

◆ OpenStackChartConditional()

ChartBase * ChartDB::OpenStackChartConditional ( ChartStack ps,
int  start_index,
bool  bLargest,
ChartTypeEnum  New_Type,
ChartFamilyEnum  New_Family_Fallback 
)

Definition at line 1490 of file chartdb.cpp.

◆ PurgeCache()

void ChartDB::PurgeCache ( )

Definition at line 266 of file chartdb.cpp.

◆ PurgeCachePlugins()

void ChartDB::PurgeCachePlugins ( )

Definition at line 281 of file chartdb.cpp.

◆ PurgeCacheUnusedCharts()

void ChartDB::PurgeCacheUnusedCharts ( double  factor)

Definition at line 320 of file chartdb.cpp.

◆ SaveBinary()

bool ChartDB::SaveBinary ( const wxString &  filename)
inline

Definition at line 106 of file chartdb.h.

◆ UnLockAllCacheCharts()

void ChartDB::UnLockAllCacheCharts ( )

Definition at line 965 of file chartdb.cpp.

◆ UnLockCache()

void ChartDB::UnLockCache ( )
inline

Definition at line 153 of file chartdb.h.

◆ UnLockCacheChart()

void ChartDB::UnLockCacheChart ( int  index)

Definition at line 950 of file chartdb.cpp.


The documentation for this class was generated from the following files: