mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
LP-29 remove commented out code and other minor cleanups
This commit is contained in:
parent
d9a0a3e84a
commit
c33c3c9b99
@ -267,11 +267,7 @@ public:
|
||||
break;
|
||||
}
|
||||
ntm->setTrackNode(trackNode->node());
|
||||
// ntm->setRotationMode(trackRotationMode)
|
||||
// ntm->setMinimumDistance(2, false);
|
||||
ntm->setVerticalAxisFixed(false);
|
||||
// ntm->setAutoComputeHomePosition(true);
|
||||
// ntm->setDistance(100);
|
||||
cm = ntm;
|
||||
} else {
|
||||
qWarning() << "OSGCamera::attachManipulator - no track node provided.";
|
||||
|
@ -206,8 +206,6 @@ public:
|
||||
mapNode->addCullCallback(cullCallback);
|
||||
}
|
||||
|
||||
// view->getCamera()->setSmallFeatureCullingPixelSize(-1.0f);
|
||||
|
||||
view->setSceneData(node);
|
||||
|
||||
return true;
|
||||
@ -331,9 +329,6 @@ public:
|
||||
viewer = new osgViewer::CompositeViewer();
|
||||
viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
|
||||
|
||||
osg::ref_ptr<osgUtil::IncrementalCompileOperation> ico = new osgUtil::IncrementalCompileOperation();
|
||||
ico->setTargetFrameRate(30.0f);
|
||||
viewer->setIncrementalCompileOperation(ico);
|
||||
|
||||
// disable the default setting of viewer.done() by pressing Escape.
|
||||
viewer->setKeyEventSetsDone(0);
|
||||
@ -492,8 +487,6 @@ public:
|
||||
osgQtQuick::openGLContextInfo(QOpenGLContext::currentContext(), "ViewportRenderer::ViewportRenderer");
|
||||
|
||||
h->initializeResources();
|
||||
|
||||
requestRedraw = false;
|
||||
}
|
||||
|
||||
~ViewportRenderer()
|
||||
@ -533,14 +526,11 @@ public:
|
||||
// needed to properly render models without terrain (Qt bug?)
|
||||
QOpenGLContext::currentContext()->functions()->glUseProgram(0);
|
||||
|
||||
if (checkNeedToDoFrame()) {
|
||||
if (h->viewer->checkNeedToDoFrame()) {
|
||||
// TODO scene update should NOT be done here
|
||||
h->viewer->frame();
|
||||
requestRedraw = false;
|
||||
}
|
||||
|
||||
// h->self->window()->resetOpenGLState();
|
||||
|
||||
if (h->updateMode == OSGViewport::Continuous) {
|
||||
// trigger next update
|
||||
update();
|
||||
@ -565,20 +555,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
bool checkNeedToDoFrame()
|
||||
{
|
||||
// if (requestRedraw) {
|
||||
// return true;
|
||||
// }
|
||||
// if (getDatabasePager()->requiresUpdateSceneGraph() || getDatabasePager()->getRequestsInProgress()) {
|
||||
// return true;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
OSGViewport::Hidden *h;
|
||||
|
||||
bool requestRedraw;
|
||||
};
|
||||
|
||||
osg::ref_ptr<osg::GraphicsContext> OSGViewport::Hidden::dummy;
|
||||
|
@ -144,19 +144,6 @@ void OsgEarth::initializeCache()
|
||||
} else {
|
||||
qWarning() << "OsgEarth::initializeCache - Failed to initialize cache";
|
||||
}
|
||||
|
||||
// osgDB::SharedStateManager::ShareMode shareMode = osgDB::SharedStateManager::SHARE_NONE;// =osgDB::SharedStateManager::SHARE_ALL;
|
||||
// shareMode = true ? static_cast<osgDB::SharedStateManager::ShareMode>(shareMode | osgDB::SharedStateManager::SHARE_STATESETS) : shareMode;
|
||||
// shareMode = true ? static_cast<osgDB::SharedStateManager::ShareMode>(shareMode | osgDB::SharedStateManager::SHARE_TEXTURES) : shareMode;
|
||||
// osgDB::Registry::instance()->getOrCreateSharedStateManager()->setShareMode(shareMode);
|
||||
|
||||
// osgDB::Options::CacheHintOptions cacheHintOptions = osgDB::Options::CACHE_NONE;
|
||||
// cacheHintOptions = static_cast<osgDB::Options::CacheHintOptions>(cacheHintOptions | osgDB::Options::CACHE_IMAGES);
|
||||
// cacheHintOptions = static_cast<osgDB::Options::CacheHintOptions>(cacheHintOptions | osgDB::Options::CACHE_NODES);
|
||||
// if (osgDB::Registry::instance()->getOptions() == 0) {
|
||||
// osgDB::Registry::instance()->setOptions(new osgDB::Options());
|
||||
// }
|
||||
// osgDB::Registry::instance()->getOptions()->setObjectCacheHint(cacheHintOptions);
|
||||
}
|
||||
|
||||
void OsgEarth::displayInfo()
|
||||
|
@ -298,9 +298,9 @@ QSurfaceFormat traitsToFormat(const osg::GraphicsContext::Traits *traits)
|
||||
// format.setSampleBuffers(traits->sampleBuffers);
|
||||
format.setSamples(traits->samples);
|
||||
|
||||
// format.setAlpha(traits->alpha > 0);
|
||||
// format.setDepth(traits->depth > 0);
|
||||
// format.setStencil(traits->stencil > 0);
|
||||
// format.setAlpha(traits->alpha > 0);
|
||||
// format.setDepth(traits->depth > 0);
|
||||
// format.setStencil(traits->stencil > 0);
|
||||
|
||||
format.setStereo(traits->quadBufferStereo ? 1 : 0);
|
||||
|
||||
|
@ -62,9 +62,6 @@ void PfdQmlGadgetWidget::init()
|
||||
// to expose settings values
|
||||
m_pfdQmlContext = new PfdQmlContext(this);
|
||||
m_pfdQmlContext->apply(engine()->rootContext());
|
||||
|
||||
// connect(this, &QQuickWidget::statusChanged, this, &PfdQmlGadgetWidget::onStatusChanged);
|
||||
// connect(this, &QQuickWidget::sceneGraphError, this, &PfdQmlGadgetWidget::onSceneGraphError);
|
||||
}
|
||||
|
||||
void PfdQmlGadgetWidget::setSource(const QUrl &url)
|
||||
@ -99,19 +96,6 @@ void PfdQmlGadgetWidget::loadConfiguration(PfdQmlGadgetConfiguration *config)
|
||||
init();
|
||||
}
|
||||
|
||||
// here we first clear the Qml file
|
||||
// then set all the properties
|
||||
// and finally set the desired Qml file
|
||||
// TODO this is a work around... some OSG Quick items don't yet handle properties updates well
|
||||
|
||||
// clear widget
|
||||
// setQmlFile("");
|
||||
|
||||
// no need to go further is Qml file is empty
|
||||
// if (config->qmlFile().isEmpty()) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
m_pfdQmlContext->loadConfiguration(config);
|
||||
|
||||
// go!
|
||||
@ -129,10 +113,7 @@ void PfdQmlGadgetWidget::loadConfiguration(PfdQmlGadgetConfiguration *config)
|
||||
|
||||
void PfdQmlGadgetWidget::setQmlFile(QString fn)
|
||||
{
|
||||
// if (m_qmlFileName == fn) {
|
||||
// return;
|
||||
// }
|
||||
qDebug() << Q_FUNC_INFO << fn;
|
||||
qDebug() << "PfdQmlGadgetWidget::setQmlFile" << fn;
|
||||
|
||||
m_qmlFileName = fn;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user