![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
The TSLAPP6AHelper class should be used to manipulate the APP6ASymbols. It provides methods for creating symbols as HBITMAPs, Entity Sets or TSLAPP6ASymbol objects.
Either the app6aConfig.csv or 2525bConfig.csv configuration files are required for this class to operate correctly. These files define the symbols for the APP6A or 2525B specifications respectively. These files can normally be found in your MapLink home config folder. During construction of a TSLAPP6AHelper instance an attempt will be made to find and load the app6aConfig.csv file at the default location. If you wish to load the alternate configuration file, specify the full path to the file, including the filename.
Note: There is no internal reference counting provided within the internal implementation; each instance of this call will attempt to load the config file once.
You can check that the configuration file has been successfully loaded by calling the 'valid()' method after construction.
Check the TSLErrorStack::lastError() method for a description of the problem.
Public Member Functions | |
TSLAPP6AHelper (const char *configPath="") | |
void | destroy () |
TSLEntitySet * | getSymbolAsEntitySet (const TSLAPP6ASymbol *symbol) |
TSLEntitySet * | getSymbolAsEntitySet (const char *symbol) |
bool | getSymbolAsBitmap (const TSLAPP6ASymbol *symbol, TSLBitmapHandle bitmap, bool clear=true) |
bool | getSymbolAsBitmap (const char *symbol, TSLBitmapHandle bitmap, bool clear=true) |
bool | getSymbolAsBitmap (const TSLEntitySet *es, TSLBitmapHandle bitmap, bool clear=true) |
bool | getSymbol (const TSLEntitySet *es, TSLAPP6ASymbol &symbol) |
bool | getSymbol (int index, TSLAPP6ASymbol &symbol) |
bool | getSymbolFromID (const char *id, TSLAPP6ASymbol &symbol) |
bool | isAPP6A (const TSLEntitySet *es) |
int | numOfSymbols () |
bool | valid () |
void * | operator new (size_t size) TSL_NO_THROW |
void * | operator new (size_t size, char *filename, int line) |
bool | getSymbolFromSIDCAPP6A (const char *sidc, TSLAPP6ASymbol &symbol) |
bool | getSymbolFromSIDC2525B (const char *sidc, TSLAPP6ASymbol &symbol) |
Static Public Member Functions | |
static void | getDefaultConfigPath (TSLSimpleString &configPath) |
static void | setDefaultConfigPath (const char *path) |
Protected Member Functions | |
~TSLAPP6AHelper () | |
TSLAPP6AHelper::TSLAPP6AHelper | ( | const char * | configPath = "" | ) |
Constructor. Use this to create instances of this class.
configPath | Can be used to specify a different configuration file location. If left empty the class will attempt to use a default file. |
Check the result of 'valid()' to ensure that the configuration file loaded correctly. If false the TSLErrorStack can be queried for a reason for the problem.
|
protected |
Destructor.
This method is protected to force the user to created instances of the helper on the heap. This enables the API redirection to work correctly.
Use 'destroy()' to remove instances of this class.
void TSLAPP6AHelper::destroy | ( | ) |
Removes instances of this class. Use this method instead of the 'delete' keyword.
|
static |
Use this method to query the default location of the configuration file.
configPath | : Returns the configuration path (this may be empty). |
bool TSLAPP6AHelper::getSymbol | ( | const TSLEntitySet * | es, |
TSLAPP6ASymbol & | symbol ) |
Use this method to populate a TSLAPP6ASymbol object with the information from a valid entity set. This allows symbols that have been placed on the map surface to be reloaded into a TSLAPP6ASymbol object for further manipulation.
es | A pointer to the entity set which should be loaded. |
symbol | The symbol which should be populated with the information. |
bool TSLAPP6AHelper::getSymbol | ( | int | index, |
TSLAPP6ASymbol & | symbol ) |
Use this method to populate a TSLAPP6ASymbol object with the symbol information add position 'index' in the configuration file.
index | The index of the symbol to load. |
symbol | The symbol which should be populated with the information. |
bool TSLAPP6AHelper::getSymbolAsBitmap | ( | const char * | symbol, |
TSLBitmapHandle | bitmap, | ||
bool | clear = true ) |
Use this method to write a valid APP6A string into a bitmap.
NOTE: On X11 targets a typedef has been created for TSLBitmapHandle. The structure needs to be filled in by the caller.
symbol | The source APP6A string containing the symbol. |
bitmap | The handle to a bitmap object. This must be a HBITMAP. |
clear | If set to true the bitmap will be cleared (to white) before it is populated, otherwise the symbol will be drawn over the existing background. |
bool TSLAPP6AHelper::getSymbolAsBitmap | ( | const TSLAPP6ASymbol * | symbol, |
TSLBitmapHandle | bitmap, | ||
bool | clear = true ) |
Use this method to write a TSLAPP6ASymbol object into a bitmap.
NOTE: On X11 targets a typedef has been created for TSLBitmapHandle. The structure needs to be filled in by the caller.
symbol | The source symbol. |
bitmap | The handle to a bitmap object. This must be a HBITMAP. |
clear | If set to true the bitmap will be cleared (to white) before it is populated, otherwise the symbol will be drawn over the existing background. |
bool TSLAPP6AHelper::getSymbolAsBitmap | ( | const TSLEntitySet * | es, |
TSLBitmapHandle | bitmap, | ||
bool | clear = true ) |
Use this method to write an TSLEntitySet object into a bitmap.
NOTE: On X11 targets a typedef has been created for TSLBitmapHandle. The structure needs to be filled in by the caller.
es | The source entity set. |
bitmap | The handle to a bitmap object. |
clear | If set to true the bitmap will be cleared (to white) before it is populated, otherwise the symbol will be drawn over the existing background. |
TSLEntitySet * TSLAPP6AHelper::getSymbolAsEntitySet | ( | const char * | symbol | ) |
Use this method to convert a valid APP6A string into an entity set, which can be displayed on a map.
(You can check TSLErrorStack for a description of the error if the pointer is NULL).
TSLEntitySet * TSLAPP6AHelper::getSymbolAsEntitySet | ( | const TSLAPP6ASymbol * | symbol | ) |
Use this method to convert a TSLAPP6ASymbol object into an entity set, which can be displayed on a map.
symbol | The symbol to convert into an entity set. |
(You can check TSLErrorStack for a description of the error if the pointer is NULL).
bool TSLAPP6AHelper::getSymbolFromID | ( | const char * | id, |
TSLAPP6ASymbol & | symbol ) |
Use this method to construct a symbol from its symbol ID.
id | A string containing the id of the symbol required. For example passing "1.x.1.1" would construct the satellite symbol. |
symbol | The TSLAPP6ASymbol object to be populated. |
bool TSLAPP6AHelper::getSymbolFromSIDC2525B | ( | const char * | sidc, |
TSLAPP6ASymbol & | symbol ) |
bool TSLAPP6AHelper::getSymbolFromSIDCAPP6A | ( | const char * | sidc, |
TSLAPP6ASymbol & | symbol ) |
bool TSLAPP6AHelper::isAPP6A | ( | const TSLEntitySet * | es | ) |
Use this method to check is an entity set is a valid APP6A symbol.
es | A pointer to the entity set which should be checked. |
int TSLAPP6AHelper::numOfSymbols | ( | ) |
Use this method to get the number of symbols in the configuration file.
void * TSLAPP6AHelper::operator new | ( | size_t | size | ) |
void * TSLAPP6AHelper::operator new | ( | size_t | size, |
char * | filename, | ||
int | line ) |
When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.
|
static |
Use this method to set the default location of the configuration file you wish to use. This can either be the path to a directory, in which case the class will attempt to load the app6aConfig.csv file from that directory, or the full path to the configuration file to use including filename.
When a TSLAPP6AHelper class is constructed it will first check if a path has been passed in the constructor and attempt to load that. However, if no path has been passed, the default config path will be used to locate the symbols.
path | The location of the configuration file. |
bool TSLAPP6AHelper::valid | ( | ) |
Use this method to check if the configuration file loaded successfully.