Exemple #1
0
/*
  This is called when a configuration is loaded, and updates the plugin's settings.
  Careful: the plugin is already drawn before the loadConfiguration method is called the
  first time, so you have to be careful not to assume all the plugin values are initialized
  the first time you use them
 */
void PfdQmlGadget::loadConfiguration(IUAVGadgetConfiguration* config)
{
    PfdQmlGadgetConfiguration *m = qobject_cast<PfdQmlGadgetConfiguration*>(config);
    m_widget->setOpenGLEnabled(m->openGLEnabled());
    m_widget->setQmlFile(m->qmlFile());
    m_widget->setEarthFile(m->earthFile());
    m_widget->setTerrainEnabled(m->terrainEnabled());
    m_widget->setActualPositionUsed(m->actualPositionUsed());
    m_widget->setLatitude(m->latitude());
    m_widget->setLongitude(m->longitude());
    m_widget->setAltitude(m->altitude());

    //setting OSGEARTH_CACHE_ONLY seems to work the most reliably
    //between osgEarth versions I tried
    if (m->cacheOnly()) {
        qputenv("OSGEARTH_CACHE_ONLY", "true");
    } else {
#ifdef Q_OS_WIN32
        qputenv("OSGEARTH_CACHE_ONLY", "");
#else
        unsetenv("OSGEARTH_CACHE_ONLY");
#endif
    }
}
Exemple #2
0
/*
  This is called when a configuration is loaded, and updates the plugin's settings.
  Careful: the plugin is already drawn before the loadConfiguration method is called the
  first time, so you have to be careful not to assume all the plugin values are initialized
  the first time you use them
 */
void PfdQmlGadget::loadConfiguration(IUAVGadgetConfiguration* config)
{
    PfdQmlGadgetConfiguration *m = qobject_cast<PfdQmlGadgetConfiguration*>(config);
    m_widget->setQmlFile(m->qmlFile());
    m_widget->setSettingsMap(m->settings());
}