GL Studio C++ Runtime API
MapChartCell Class Referenceabstract

The MapChartCell class represents an area within a 2D map. More...

#include <gls_map_chart_data_source.h>

Public Member Functions

 MapChartCell ()
 
virtual void AddRef ()
 Use this method to increment the reference count of the MapDataSource.
 
virtual void Release ()
 
virtual bool AllowOutlines () const
 
virtual bool IsCellValid () const
 
virtual GlsMapChartDataSourceGetSource () const =0
 Returns the MapDataSource for this MapCell.
 
virtual unsigned long GetLayerID () const
 
const GeoRectGetGeoRect () const
 
virtual void SetLoadPriority (unsigned int val)
 
virtual bool HasTexture () const =0
 
virtual bool TextureIsReady () const =0
 
virtual void BindTexture ()=0
 
virtual void InvalidateTexture ()=0
 Use this method to force the texture to be recreated on the next call to BindTexture().
 
virtual void PostDraw (GlsMapView *view, GlsMapChart *chart)
 
virtual bool IsSameCell (const MapChartCell &other) const =0
 

Protected Member Functions

virtual ~MapChartCell ()
 
virtual void Write (std::ostream &os) const
 Method to override for printing to a stream.
 

Friends

std::ostream & operator<< (std::ostream &os, const MapChartCell &cell)
 

Detailed Description

The MapChartCell class represents an area within a 2D map.

MapChartCells are obtained from a GlsMapChartDataSource by calling the GlsMapChartDataSource::GetCellList() method. Each MapChartCell may provide a texture for rendering or it may use it's own custom rendering method to draw its data. The data needed to render the cell may not have been loaded yet, the caller can set the priority of various cells to control the order in which they are loaded.

Constructor & Destructor Documentation

MapChartCell ( )
inline

Constructor

Parameters
logicalHeightThe viewing height in logical space.
virtual ~MapChartCell ( )
inlineprotectedvirtual

Destructor for abstract base class

Note
Protected for proper reference counting – call Release() instead of destroying directly.

Member Function Documentation

virtual bool AllowOutlines ( ) const
inlinevirtual

Instructs the MapChart Cell Manager whether to calculate and display cell outlines.

Returns
True if the outlines should be drawn.
virtual void BindTexture ( )
pure virtual

If TextureIsReady() is true, this method will bind the texture for the cell. You must call UnbindTexture() to unbind the texture If TextureIsReady() is false, this method does nothing.

const GeoRect& GetGeoRect ( ) const
inline
Returns
The GeoRect that describes the coverage area for the cell.
virtual unsigned long GetLayerID ( ) const
inlinevirtual

Integer representing the layer of this image. Images from the same MapDataSource with the same Layer number all contain data at the same resolution (i.e. 'zoom level') and can be drawn together.

virtual bool HasTexture ( ) const
pure virtual

Determine if this cell displays a texture. If this returns true, you should call TextureIsReady() to determine if the texture data has loaded and BindTexture() to bind the texture to the current OpenGL context.

Returns
true if this cell is capable of loading a texture
virtual bool IsCellValid ( ) const
inlinevirtual

Determine if this cell is still valid. Invalid cells are cells that are no longer relevant for a given data source (e.g. backing data for cell is unloaded).

Returns
true if the cell is valid, false if the cell is not valid
virtual bool IsSameCell ( const MapChartCell other) const
pure virtual

Determine if two MapCells are equivalent

Parameters
otherReference to the MapChartCell to compare to
Returns
true if the cells are equivalent, false otherwise
virtual void PostDraw ( GlsMapView view,
GlsMapChart chart 
)
inlinevirtual

The post draw callback for each cell should be called after all of the MapCell textures have been drawn to allow the MapCells to render any overlay geometry

Parameters
viewThe GlsMapView used to draw the chart
chartThe GlsMapChart that is being drawn
virtual void Release ( )
inlinevirtual

MapCells cannot be deleted directly Use this method to decrement the reference count of the MapDataSource.

virtual void SetLoadPriority ( unsigned int  val)
inlinevirtual

The priority of this cell in the loading order. 0 is the highest priority. This is typically set by the CellMgr.

virtual bool TextureIsReady ( ) const
pure virtual
Returns
true if BindTexture will apply a texture when called.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const MapChartCell cell 
)
friend

Prints some information about the cell

See also
MapChartCell::Write()

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