Public Member Functions | Protected Member Functions

VgEngine::VgIDatabase Interface Reference

The VgIDatabase interface is used to load and select the data that will be displayed in the 3D view. More...

List of all members.

Public Member Functions

virtual ~VgIDatabase ()
 Destructor.
virtual bool loadConfiguration (const std::string &pConfigFilename, UInt pSecretKey, const std::string &pLicenseGeneratorURL=VgEngine::msEmptyString)=0
 Loads a database configuration from a mass storage.
virtual void unloadConfiguration ()=0
 unloads the current configuration if there is one.
virtual bool getCachedLicenseFilenameForConfiguration (const std::string &pConfigFilename, std::string &pOutLicenseFilename)=0
 returns the name of the cached license path for a given configuration filename.
virtual bool selectDataset (const std::string &pDatasetName)=0
 Selects a dataset using its name.
virtual bool selectDataset (int pIndex)=0
 Selects a dataset using its index.
virtual const
VgIDatabaseDatasetDescriptor
getCurrentDatasetDescriptor () const =0
 Retrieves the descriptor of the current dataset.
virtual const std::vector
< VgIDatabaseDatasetDescriptor > & 
getDatasetDescriptors () const =0
 Retrieves the vector of all available datasets.

Protected Member Functions

 VgIDatabase ()
 Constructor.

Detailed Description

The VgIDatabase interface is used to load and select the data that will be displayed in the 3D view.

This interface depends on how databases are bundled. First, the data structure, with all available datasets, is described in a configuration file. This file must be loaded (using the VgIDatabase::loadConfiguration method), then a particular dataset can be selected to be displayed in the 3D view (using the VgIDatabase::selectDataset method).

Example:

     ...
     editEngine()->editDatabase()->loadConfiguration("vg_config.xml", 0, "http://license.visioglobe.com/renew/secret-string-to-retreive-my-license");
     ...
     if (pUserSelectedWashington) {
     editEngine()->editDatabase()->selectDataset("Washington");
     } else if (pUserSelectedParis) {
     editEngine()->editDatabase()->selectDataset("Paris");
     }
     editEngine()->editDatabase()->getCurrentDatasetDescriptor();
     ...
Date:
25/02/2010

Constructor & Destructor Documentation

VgEngine::VgIDatabase::VgIDatabase (  ) [inline, protected]

Constructor.

virtual VgEngine::VgIDatabase::~VgIDatabase (  ) [inline, virtual]

Destructor.


Member Function Documentation

virtual bool VgEngine::VgIDatabase::getCachedLicenseFilenameForConfiguration ( const std::string &  pConfigFilename,
std::string &  pOutLicenseFilename 
) [pure virtual]

returns the name of the cached license path for a given configuration filename.

Parameters:
pConfigFilenamepath to vg_config file. must be an absolute filename
[out]pOutLicenseFilenamereference to a string, will receive the license file path if there is one.
Returns:
true if a cached license exists for the given configuration, in which case it fills the pOutLicenseFilename parameter.
Remarks:
this function is used to cleanup after removing a locally stored map.
virtual const VgIDatabaseDatasetDescriptor* VgEngine::VgIDatabase::getCurrentDatasetDescriptor (  ) const [pure virtual]

Retrieves the descriptor of the current dataset.

Returns:
Descriptor of the currently loaded dataset. If there isn't a valid current database dataset descriptor, then NULL will be returned.
virtual const std::vector< VgIDatabaseDatasetDescriptor >& VgEngine::VgIDatabase::getDatasetDescriptors (  ) const [pure virtual]

Retrieves the vector of all available datasets.

Returns:
Vector of descriptors for all available datasets.
virtual bool VgEngine::VgIDatabase::loadConfiguration ( const std::string &  pConfigFilename,
UInt  pSecretKey,
const std::string &  pLicenseGeneratorURL = VgEngine::msEmptyString 
) [pure virtual]

Loads a database configuration from a mass storage.

Parameters:
pConfigFilenameThe name of the configuration file to be loaded.
pSecretKeyThe secret key that matches the secret key that was used to generate the associated licence xml file's hash code.
pLicenseGeneratorURLThe URL that will be reached to get the license if missing.
Returns:
true if the configuration file was loaded successfully, otherwise false.
Remarks:
If loadConfiguration() returns false, the VgIEngine::getLastError() and VgIEngine::getErrorString() can be used in conjunction to find the reason.
If loadConfiguration() needs to update the license file from the network it will create a cached license. This filename can be retrieved with bool getCachedLicenseFilenameForConfiguration()
virtual bool VgEngine::VgIDatabase::selectDataset ( const std::string &  pDatasetName ) [pure virtual]

Selects a dataset using its name.

Visual data will be rendered on the view during the preceding display.

Parameters:
pDatasetNameThe name of the dataset. Needs to match the name of a dataset defined within the currently loaded configuration file.
Returns:
true if a new dataset was loaded, otherwise false. In case of failure, the previous dataset remains active.
virtual bool VgEngine::VgIDatabase::selectDataset ( int  pIndex ) [pure virtual]

Selects a dataset using its index.

Visual data will be rendered on the view during the preceding display.

Parameters:
pIndexIndex of dataset, indicated by it's position relative to other datasets within the configuration file (starting at 0).
Returns:
true if a new dataset was loaded, otherwise false. In case of failure, the previous dataset is still active.
virtual void VgEngine::VgIDatabase::unloadConfiguration (  ) [pure virtual]

unloads the current configuration if there is one.

It releases the resources and stops any threads created

Version:
2.0.7865

The documentation for this interface was generated from the following file:
VisioDevKit 2.0, Visioglobe® 2013