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:
parent
7c0e92fb1b
commit
ae9c05a8e3
@ -88,22 +88,22 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateSkyNode()
|
void updateScene()
|
||||||
{
|
{
|
||||||
if (!sceneNode || !sceneNode->node()) {
|
if (!sceneNode || !sceneNode->node()) {
|
||||||
qWarning() << "OSGSkyNode::updateSkyNode - scene node not valid";
|
qWarning() << "OSGSkyNode::updateScene - scene node not valid";
|
||||||
self->setNode(NULL);
|
self->setNode(NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qDebug() << "OSGSkyNode::updateSkyNode - scene node" << sceneNode->node();
|
qDebug() << "OSGSkyNode::updateScene - scene node" << sceneNode->node();
|
||||||
osgEarth::MapNode *mapNode = osgEarth::MapNode::findMapNode(sceneNode->node());
|
osgEarth::MapNode *mapNode = osgEarth::MapNode::findMapNode(sceneNode->node());
|
||||||
if (!mapNode) {
|
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);
|
self->setNode(NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!mapNode->getMap()->isGeocentric()) {
|
if (!mapNode->getMap()->isGeocentric()) {
|
||||||
qWarning() << "OSGSkyNode::updateSkyNode - map node is not geocentric";
|
qWarning() << "OSGSkyNode::updateScene - map node is not geocentric";
|
||||||
self->setNode(NULL);
|
self->setNode(NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
skyNode->removeChild(0, 1);
|
skyNode->removeChild(0, 1);
|
||||||
skyNode->addChild(sceneNode->node());
|
skyNode->addChild(sceneNode->node());
|
||||||
self->emitNodeChanged();
|
// self->emitNodeChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ private slots:
|
|||||||
void onSceneNodeChanged(osg::Node *node)
|
void onSceneNodeChanged(osg::Node *node)
|
||||||
{
|
{
|
||||||
qDebug() << "OSGSkyNode::onSceneNodeChanged" << node;
|
qDebug() << "OSGSkyNode::onSceneNodeChanged" << node;
|
||||||
updateSkyNode();
|
updateScene();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ void OSGSkyNode::updateNode()
|
|||||||
Inherited::updateNode();
|
Inherited::updateNode();
|
||||||
|
|
||||||
if (isDirty(Scene)) {
|
if (isDirty(Scene)) {
|
||||||
h->updateSkyNode();
|
h->updateScene();
|
||||||
}
|
}
|
||||||
if (isDirty(Viewport)) {
|
if (isDirty(Viewport)) {
|
||||||
h->updateViewport();
|
h->updateViewport();
|
||||||
|
@ -45,6 +45,7 @@ QT_END_NAMESPACE
|
|||||||
namespace osgQtQuick {
|
namespace osgQtQuick {
|
||||||
class OSGViewport;
|
class OSGViewport;
|
||||||
|
|
||||||
|
// TODO should derive from OSGGroup
|
||||||
class OSGQTQUICK_EXPORT OSGSkyNode : public OSGNode {
|
class OSGQTQUICK_EXPORT OSGSkyNode : public OSGNode {
|
||||||
Q_OBJECT Q_PROPERTY(osgQtQuick::OSGNode *sceneNode READ sceneNode WRITE setSceneNode NOTIFY sceneNodeChanged)
|
Q_OBJECT Q_PROPERTY(osgQtQuick::OSGNode *sceneNode READ sceneNode WRITE setSceneNode NOTIFY sceneNodeChanged)
|
||||||
Q_PROPERTY(osgQtQuick::OSGViewport * viewport READ viewport WRITE setViewport NOTIFY viewportChanged)
|
Q_PROPERTY(osgQtQuick::OSGViewport * viewport READ viewport WRITE setViewport NOTIFY viewportChanged)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user