Indication of completed tile loading

classic Classic list List threaded Threaded
3 messages Options
eskay187 eskay187
Reply | Threaded
Open this post in threaded view
|

Indication of completed tile loading

Dear All,
  in my project I use setViewpoint to traverse to specific points on the map and automatically create/save screenshots of the resulting rendered image.

When using different .earth files (e.g. openstreetmap layer) the image layer is (of course) often not fully loaded at the required LOD after setting the view point.

Is there a clean way to wait on the terrain tiles being fully loaded, e.g. a flag if tile loading is still in progress or the number of active http requests?

Sorry if I ask a stupid question, but I was not able to find the answer in the documentation/forums/source.

Thanks in advance!
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Indication of completed tile loading

There's no "official" way to do this, but many people have used the osgDB::DatabasePager::getRequestsInProgress() method with success.
Glenn Waldron / Pelican Mapping
eskay187 eskay187
Reply | Threaded
Open this post in threaded view
|

Re: Indication of completed tile loading

Dear All,
  recommended option works like a charm.

Here's the code I used (I use QT with on-demand rendering):

"
    osgDB::DatabasePager* pager = getViewer()->getDatabasePager();
    if (pager) // not sure if required
    {
        while (pager->getRequestsInProgress())
        {
            QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
            QThread::msleep(10);
            drawSlot();
        }
    }
"

Thanks a bunch!