GlsMap Toolkit  1.3.1
disti::AifMapChartDataSource Class Reference

#include <gls_map_aif.h>

+ Inheritance diagram for disti::AifMapChartDataSource:

Public Member Functions

 AifMapChartDataSource (bool UseDefaultCache=true)
 
virtual ~AifMapChartDataSource ()
 
void LoadAifFile (std::string filename)
 
virtual void SetCache (AIFMapChartLayerCache &cache)
 
virtual bool GetAvailableCoverage (GeoRect *dest)
 
virtual unsigned long GetBestLayer (GlsMapView *view, GlsMapChart *chart)
 
virtual void GetCellList (const GeoRect &coverage, unsigned long layerID, MapChartCellList *viewList)
 
virtual void PostDraw (GlsMapView *view, GlsMapChart *chart)
 
void AddOverlay (std::string overlay, double resolution)
 
void InsertOverlay (int index, std::string overlay, double resolution)
 
void RemoveOverlay (std::string overlay, double resolution)
 
void RemoveOverlay (std::string overlay)
 
void RemoveOverlay (double resolution)
 
void SetCacheSize (const float memSize)
 
float GetCacheSize (void) const
 
float GetCurrentCacheAllocated (void)
 
void InstallViewManager (AIFViewManager &mgr)
 
void UninstallViewManager ()
 
void PreCache (const GeoRect &area)
 
void PreCache (const double resolution)
 
void SetTargetCellLoadRate (const double targetCellLoadRate)
 
double GetTargetCellLoadRate (void) const
 
- Public Member Functions inherited from disti::GlsMapChartDataSource
virtual ~GlsMapChartDataSource ()
 
virtual bool AreAllCellsLoaded (GlsMapView *view, GlsMapChart *chart)
 

Protected Attributes

OverlayCellMultiMap _cells
 
ResolutionList _resolutionList
 
GeoRect _extents
 
OverlayListType _overlayList
 
AIFMapChartLayerCache_pCache
 
AIFViewManager * _pViewMgr
 
double _viewHeight
 
bool _usingDefaultCache
 

Additional Inherited Members

- Protected Member Functions inherited from disti::GlsMapChartDataSource
 GlsMapChartDataSource ()
 

Detailed Description

Runtime implementation of an AifMapChartDataSource

Constructor & Destructor Documentation

AifMapChartDataSource::AifMapChartDataSource ( bool  UseDefaultCache = true)

Create a new AifMapChartDataSource.

Parameters
UseDefaultCachewhether to use the default caching system. See AIFMapChartLayerCache for more information

Member Function Documentation

void AifMapChartDataSource::AddOverlay ( std::string  overlay,
double  resolution 
)

Add an overlay layer to the list of layers to display.

Parameters
overlayThe name of the overlay layer to display. Must correspond to an overlay defined in the AIF file.
resolutionThe resolution of the overlay to display. Must correspond to a resolution of an overlay defined in the AIF file.
bool AifMapChartDataSource::GetAvailableCoverage ( GeoRect dest)
virtual

Sets a GeoRect to describe the area containing all areas covered by this MapDataSource. This area may change as different databases are loaded. Calling this method may be slow.

Parameters
destPointer to a GeoRect to recieve the coverage.
Returns
true on success (dest contains the coverage description) or false if there was an error (dest is undefined)

Implements disti::GlsMapChartDataSource.

unsigned long AifMapChartDataSource::GetBestLayer ( GlsMapView view,
GlsMapChart chart 
)
virtual

Returns the cell layer ('zoom level') that best matches the given area.

Parameters
viewThe GlsMapView used to draw the chart
chartThe GlsMapChart that is being drawn
Returns
The recommended layer to use.

Implements disti::GlsMapChartDataSource.

void AifMapChartDataSource::GetCellList ( const GeoRect coverage,
unsigned long  layerID,
MapChartCellList *  viewList 
)
virtual

Get the list of the available cells in a given coverage area. The caller will AddRef() any of the cells that it will be holding a reference to.

Parameters
coverageGeoRect describing the requested area.
layerIDWhich layer to return MapCells from.
viewListPointer MapChartCellList to recieve the list of available cells

Implements disti::GlsMapChartDataSource.

double AifMapChartDataSource::GetTargetCellLoadRate ( void  ) const

Get the target rate in hz at which cells will be loaded

Returns
target rate in hz else 0.0 for no target rate ( i.e. load as quickly as possible )
void AifMapChartDataSource::InsertOverlay ( int  index,
std::string  overlay,
double  resolution 
)

Insert an overlay layer to the list of layers to display at the given position.

Parameters
indexThe index to insert the overlay at, if -1 or greater than the length of the overlay list then inserts at end.
overlayThe name of the overlay layer to display. Must correspond to an overlay defined in the AIF file.
resolutionThe resolution of the overlay to display. Must correspond to a resolution of an overlay defined in the AIF file.
void AifMapChartDataSource::InstallViewManager ( AIFViewManager &  mgr)

Install the view manager. The view manager (after being initialized by the user) will set this class up to add/remove overlays automatically based on the view height

Parameters
mgrManager to install
void AifMapChartDataSource::LoadAifFile ( std::string  filename)

Load an AIF File with the given file name.

Parameters
filenameThe name of the AIF file to load. Can be absolute or relative to the executing directory.
virtual void disti::AifMapChartDataSource::PostDraw ( GlsMapView view,
GlsMapChart chart 
)
inlinevirtual

Called after all the cells have been drawn to allow the data source to perform additional rendering if needed.

Parameters
viewThe GlsMapView used to draw the chart
chartThe GlsMapChart that is being drawn

Reimplemented from disti::GlsMapChartDataSource.

void AifMapChartDataSource::PreCache ( const GeoRect area)

Precache based on geo-rect area. This uses the AIFMapChartCache as the mechanism to precache images

Parameters
areaGeometric rect area to pre-cache
void AifMapChartDataSource::PreCache ( const double  resolution)

Precache based on resolution

Parameters
resolutionResolution to precache at.
void AifMapChartDataSource::RemoveOverlay ( std::string  overlay,
double  resolution 
)

Remove an overlay layer from the list of layers to display.

Parameters
overlayThe name of the overlay layer to remove. Must correspond to an overlay defined in the AIF file.
resolutionThe resolution of the overlay to remove. Must correspond to a resolution of an overlay defined in the AIF file.
void AifMapChartDataSource::RemoveOverlay ( std::string  overlay)

Remove all overlay layers with the given overlay name.

Parameters
overlayThe name of the set of overlay layers to remove.
void AifMapChartDataSource::RemoveOverlay ( double  resolution)

Remove all overlay layers with the given resolution.

Parameters
resolutionThe resolution of the set of overlay layers to remove.
void AifMapChartDataSource::SetCache ( AIFMapChartLayerCache cache)
virtual

If using custom cache, set it here. Caller responsible for its deallocation if necessary

Parameters
cacheCustom cache to use
void AifMapChartDataSource::SetCacheSize ( const float  memSize)
Parameters
memSizeSet the cached size (megabytes) of images

Set the size of the cache in MB

void AifMapChartDataSource::SetTargetCellLoadRate ( const double  targetCellLoadRate)

Set the target rate in hz at which cells will be loaded

Parameters
targetCellLoadRatetarget rate in hz else 0.0 for no target rate ( i.e. load as quickly as possible )

Member Data Documentation

ResolutionList disti::AifMapChartDataSource::_resolutionList
protected

A list of the resolutions in this AIF file for speeding up the selection of a resolution at cell load list time.


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