![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure |
#include <MultiLevelJsonBase.hpp>
Inherited by StelSkyImageTile, and StelSkyPolygon.
Signals | |
void | loadingStateChanged (bool b) |
void | percentLoadedChanged (int percentage) |
Public Member Functions | |
MultiLevelJsonBase (MultiLevelJsonBase *parent=NULL) | |
void | initFromUrl (const QString &url) |
void | initFromQVariantMap (const QVariantMap &map) |
~MultiLevelJsonBase () | |
QString | getShortName () const |
bool | hasErrorOccured () const |
int | getLevel () const |
QVariantMap | toQVariantMap () const |
void | scheduleChildsDeletion () |
Protected Member Functions | |
bool | isDeletionScheduled () const |
virtual void | loadFromQVariantMap (const QVariantMap &map)=0 |
void | updatePercent (int tot, int numToBeLoaded) |
void | deleteUnusedSubTiles () |
void | cancelDeletion () |
Static Protected Member Functions | |
static QVariantMap | loadFromJSON (QIODevice &input, bool qZcompressed=false, bool gzCompressed=false) |
Protected Attributes | |
QString | shortName |
QString | baseUrl |
QString | contructorUrl |
QVariantList | subTilesUrls |
QList< MultiLevelJsonBase * > | subTiles |
bool | errorOccured |
bool | downloading |
MultiLevelJsonBase::MultiLevelJsonBase | ( | MultiLevelJsonBase * | parent = NULL |
) |
Default constructor.
MultiLevelJsonBase::~MultiLevelJsonBase | ( | ) |
Destructor.
void MultiLevelJsonBase::initFromUrl | ( | const QString & | url | ) |
Init the element from a URL This method should be called by the constructors of the subclass.
void MultiLevelJsonBase::initFromQVariantMap | ( | const QVariantMap & | map | ) |
Init the element from a QVariantMap This method should be called by the constructors of the subclass.
QString MultiLevelJsonBase::getShortName | ( | ) | const [inline] |
Return the short name for this image to be used in the loading bar.
bool MultiLevelJsonBase::hasErrorOccured | ( | ) | const [inline] |
Return true if an error occured while loading the data.
int MultiLevelJsonBase::getLevel | ( | ) | const [inline] |
Get the depth level in the tree.
QVariantMap MultiLevelJsonBase::toQVariantMap | ( | ) | const |
Convert the image informations to a map following the JSON structure.
It can be saved as JSON using the StelJsonParser methods.
Reimplemented in StelSkyImageTile, and StelSkyPolygon.
void MultiLevelJsonBase::scheduleChildsDeletion | ( | ) |
Schedule a deletion for all the childs. It will practically occur after the delay passed as argument to deleteUnusedTiles() has expired.
void MultiLevelJsonBase::loadingStateChanged | ( | bool | b | ) | [signal] |
Emitted when loading of data started or stopped.
b | true if data loading started, false if finished |
void MultiLevelJsonBase::percentLoadedChanged | ( | int | percentage | ) | [signal] |
Emitted when the percentage of loading tiles/tiles to be displayed changed.
percentage | the percentage of loaded data |
bool MultiLevelJsonBase::isDeletionScheduled | ( | ) | const [inline, protected] |
Return true if a deletion is currently scheduled.
virtual void MultiLevelJsonBase::loadFromQVariantMap | ( | const QVariantMap & | map | ) | [protected, pure virtual] |
void MultiLevelJsonBase::deleteUnusedSubTiles | ( | ) | [protected] |
Delete all the subtiles which were not displayed since more than lastDrawTrigger seconds.
void MultiLevelJsonBase::cancelDeletion | ( | ) | [protected] |
If a deletion was scheduled, cancel it.
static QVariantMap MultiLevelJsonBase::loadFromJSON | ( | QIODevice & | input, | |
bool | qZcompressed = false , |
|||
bool | gzCompressed = false | |||
) | [static, protected] |
Load the element information from a JSON file.
QString MultiLevelJsonBase::shortName [protected] |
The very short name for this image set to be used in loading bar.
QString MultiLevelJsonBase::baseUrl [protected] |
Base URL to prefix to relative URL.
QString MultiLevelJsonBase::contructorUrl [protected] |
The relative URL passed to the constructor.
QVariantList MultiLevelJsonBase::subTilesUrls [protected] |
The list of all the subTiles URL or already loaded JSON map for this tile.
QList<MultiLevelJsonBase*> MultiLevelJsonBase::subTiles [protected] |
The list of all the created subtiles for this tile.
bool MultiLevelJsonBase::errorOccured [protected] |
Set to true if an error occured with this tile and it should not be displayed.
bool MultiLevelJsonBase::downloading [protected] |
true if the JSON descriptor file is currently downloading