1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

LP-29 minor OSGSkyNode renaming

This commit is contained in:
Philippe Renon 2016-03-29 09:16:23 +02:00
parent 7c0e92fb1b
commit ae9c05a8e3
2 changed files with 9 additions and 8 deletions

View File

@ -88,22 +88,22 @@ public:
return true;
}
void updateSkyNode()
void updateScene()
{
if (!sceneNode || !sceneNode->node()) {
qWarning() << "OSGSkyNode::updateSkyNode - scene node not valid";
qWarning() << "OSGSkyNode::updateScene - scene node not valid";
self->setNode(NULL);
return;
}
qDebug() << "OSGSkyNode::updateSkyNode - scene node" << sceneNode->node();
qDebug() << "OSGSkyNode::updateScene - scene node" << sceneNode->node();
osgEarth::MapNode *mapNode = osgEarth::MapNode::findMapNode(sceneNode->node());
if (!mapNode) {
qWarning() << "OSGSkyNode::updateSkyNode - scene node does not contain a map node";
qWarning() << "OSGSkyNode::updateScene - scene node does not contain a map node";
self->setNode(NULL);
return;
}
if (!mapNode->getMap()->isGeocentric()) {
qWarning() << "OSGSkyNode::updateSkyNode - map node is not geocentric";
qWarning() << "OSGSkyNode::updateScene - map node is not geocentric";
self->setNode(NULL);
return;
}
@ -124,7 +124,7 @@ public:
} else {
skyNode->removeChild(0, 1);
skyNode->addChild(sceneNode->node());
self->emitNodeChanged();
// self->emitNodeChanged();
}
}
@ -217,7 +217,7 @@ private slots:
void onSceneNodeChanged(osg::Node *node)
{
qDebug() << "OSGSkyNode::onSceneNodeChanged" << node;
updateSkyNode();
updateScene();
}
};
@ -313,7 +313,7 @@ void OSGSkyNode::updateNode()
Inherited::updateNode();
if (isDirty(Scene)) {
h->updateSkyNode();
h->updateScene();
}
if (isDirty(Viewport)) {
h->updateViewport();

View File

@ -45,6 +45,7 @@ QT_END_NAMESPACE
namespace osgQtQuick {
class OSGViewport;
// TODO should derive from OSGGroup
class OSGQTQUICK_EXPORT OSGSkyNode : public OSGNode {
Q_OBJECT Q_PROPERTY(osgQtQuick::OSGNode *sceneNode READ sceneNode WRITE setSceneNode NOTIFY sceneNodeChanged)
Q_PROPERTY(osgQtQuick::OSGViewport * viewport READ viewport WRITE setViewport NOTIFY viewportChanged)