osgEarth -> Qt

classic Classic list List threaded Threaded
5 messages Options
FF FF
Reply | Threaded
Open this post in threaded view
|

osgEarth -> Qt

Hi,
I can succesfully create and view map nodes on the fly, but if I try to view them in a Qt window, I can only see an initial frame, that disappears immediately.

Knowing that the method I use to "view" osg nodes into Qt generally works well (based on QOSGScene), is there any specific recommendation for using osgEarth with Qt?

A simplified code test is the following (if I replace the Q_code with an osgViewer::Viewer it works fine):

int main(int argc, char** argv)
{
        QApplication ap(argc, argv);
        osg::QGLGraphicsView * qw = new osg::QGLGraphicsView;

        osg::QOSGScene * viewer = new osg::QOSGScene(qw);
        viewer->setCameraManipulator(new osgEarthUtil::EarthManipulator);

        osgEarth::Map* map = new osgEarth::Map( osgEarth::Map::CSTYPE_GEOCENTRIC );

        osgEarth::Properties prop;
        prop["url"] = "http://labs.metacarta.com/wms-c/Basic.py/1.0.0/satellite/";
        osgEarth::MapLayer* layer = new osgEarth::MapLayer( "NASA", osgEarth::MapLayer::TYPE_IMAGE, "tms", prop);
        map->addMapLayer( layer );

        osg::ref_ptr<osgEarth::MapNode> mapNode = new osgEarth::MapNode( map );

        viewer->setSceneData(mapNode.get());
        qw->setScene(viewer);
        qw->show();

        return ap.exec();
}

Thanks.
Fausto
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth -> Qt

I've never used OSG/Qt so I cannot offer any particular advise.

Does "osgviewerQT --QOSGWidget something.earth" work?

Glenn
Glenn Waldron / Pelican Mapping
FF FF
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth -> Qt

Hi Glenn, yes it works, but I've always had flickering problems with the QOSGWidget solution proposed in the osgviewerQT.

But it should be easier to fix the flickering issue than the problem in my previous post.

Thanks.
Fausto
Adam Adam
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth -> Qt

There was a posting on the osg forum about a similar issue.  Take a look here: http://forum.openscenegraph.org/viewtopic.php?t=4432

I have always found the AdapterWidget method to work better, but are trade offs with both ways.

-Adam
FF FF
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth -> Qt

Thanks Adam,
I've found it half an hour ago and applied the suggested fix.
It works fine on a test code.

Fausto

On Thu, Feb 11, 2010 at 6:00 PM, Adam [via osgEarth] <[hidden email]> wrote:
There was a posting on the osg forum about a similar issue.  Take a look here: http://forum.openscenegraph.org/viewtopic.php?t=4432

I have always found the AdapterWidget method to work better, but are trade offs with both ways.

-Adam


View message @ http://n2.nabble.com/osgEarth-Qt-tp4554687p4555928.html
To unsubscribe from Re: osgEarth -> Qt, click here.