Hi, I'm using OSG & Qt to build a visualizer for my thesis. I'm completely new 
to OSG and almost as new to Computer Graphics Programming too, so please don't 
mad on me and be patient ;-) 

I need to know how to get the list of supported file formats in order to use 
QFileDialog with the proper extension filters. I'm trying this in a slot of my 
main window:


Code:

void MainWindow::loadFile()
{
    osg::ref_ptr<osgDB::Registry> registry = osgDB::Registry::instance();
    osgDB::Registry::ReaderWriterList readers = registry->getReaderWriterList();
    osgDB::Registry::ReaderWriterList::iterator it;
    osgDB::ReaderWriter::FormatDescriptionMap descrMap;
    osgDB::ReaderWriter::FormatDescriptionMap::iterator descrMapIt;


    qDebug() << readers.size() << " registered ReaderWriters";

    for (it = readers.begin(); it != readers.end(); it++) {
        descrMap = (*it)->supportedOptions();

        for( descrMapIt = descrMap.begin(); descrMapIt != descrMap.end(); 
descrMapIt++) {
            //std::cout << (*descrMapIt);
        }
    }


    QString filename = QFileDialog::getOpenFileName(
                            this, tr("Load a File:"),
                            QDir::homePath(), "OpenSceneGraph (*.osg)"
                        );

    if ( !filename.isNull() ) {
        this->osgWidget->loadModel(filename);
    }
}




But qDebug() always says that there are no registered ReaderWriters. I'd expect 
to get the native osg ReaderWriter as a minimum, but I can't get that even. 


Thank you!

Cheers,
Daniel :D  :D  :?  :(  :( [/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41002#41002





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to