Hallo!

I tried to create the OpenSG + QT example from the OpenSGStarterGuide and I
CAN RUN IT!!!!!! (after three weeks it was a very exciting moment for me!)

But after the first delight I tried the function of the button and it did
not work. The problem is, I can not load the scene file. 

This is the code of the function, that is called, when the button is
clicked:
void MainForm::load()
{
    QString s (QFileDialog::getOpenFileName(QString::null, "Szenenformate
(*.wrl)"));
    if (!s.isEmpty())
    {
        char *filename;
        filename = (char *)s.latin1();
        NodePtr n = SceneFileHandler::the().read(filename);
        //NodePtr n = SceneFileHandler::the().read("data/terrain.wrl");
        if (n != NullFC)
            osgWidget->getManager().setRoot(n);
        else
            osgWidget->getManager().setRoot(makeTorus(0.5, 2, 16, 16));
        
        osgWidget->getManager().useOpenSGLogo();
        osgWidget->getManager().showAll();
        osgWidget->updateGL();
        
        

    }
}

I found out, that it is possible to load the .wrl scene when I give the
SceneFileHandler a relativ path (you find it in the comment of the code).
But when I try to use the filename which I get from the FileDialog the
SceneFileHandler cannot open the scene and n is a NullFC.

Do someone know what's wrong. Is it perhaps a problem of the different
pathes under windows in equation to Linux (I run it under WindowsXP and use
VisualStudio.Net 2003)?

Kornelia



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to