Hello everyone,

I've been working with OpenSG for some months now, building a VR-tool for a 
microassembly station during my diploma thesis here at the "Swiss Federal 
Institute of Technology" in Zürich.

So far I've been pretty satisfied with OpenSG but I recently ran into some 
problems, which I can't seem to manage myself anymore.
Therefore any hint or help would be deeply appreciated. (Especially since I 
have to finish the project in three weeks...).

I am using one of the recent OpenSG cvs builds (from last week).
In my project I use a GUI created with Qt and Qt-Designer Version 4.2.1.
Furthermore I have a plugin widget for the designer which creates a graphical 
widget to render OpenSG content into the GUI. (SGWidgetPlugin returns "class 
SGWidgetOSG : public OSG::OSGQGLWidget" to designer ).
-> In SGWidgetOSG I use my own helper classes (which themselfs use OpenSG) to 
perform setting up the scenegraph, picking, navigating and so forth... (because 
the OSG::SimpleSceneManager is a little bit to restrictive for me).
I managed to get my plugin showing up in designer, so it can be used just like 
any other widget in designer. (Designer even shows the OSG::Viewport with a 
gradient background I setup in my widget).

But now I have 2 probs:

1.) ###################################################################
The problem I have now when starting my test-applications is that I get a

>terminate called after throwing an instance of 'std::logic_error'
>  what():  basic_string::_S_construct NULL not valid
>Aborted

error as soon as I'm calling

"/*OSGQT(4)WindowPtr*/_window->init();"

I'm really not sure if this error has anything to do with my widgets because I 
get the same error with another one of my VR-applications where I'm testing a 
collision detection library.
There I get the same error when calling

"OSG::traverse(  node, 
OSG::osgTypedFunctionFunctor1CPtrRef<OSG::Action::ResultE, OSG::NodePtr>( 
&StaticCollector::enter ),
                                  
OSG::osgTypedFunctionFunctor2CPtrRef<OSG::Action::ResultE, OSG::NodePtr>( 
&StaticCollector::leave ) );"

Both my widget and the scenegraph traversing worked fine when I was still using 
libOSGWindowQT instead of libOSGWindowQT4. 
As far as I know this comes form something like "std::string s(NULL);"
 
What I do before calling either function is:
 
In my GUI-Application 
before "OSG::QT(4)Window::init()"
 
int 
main( int argc, char ** argv )
{
  SGWidgetOSG::initOSG(argc, argv); //osgInit( argc, argv );
  QApplication app( argc, argv );
  SGDockingWidget sgdw;  // comes form SGDockingWidget.ui which uses 
SGWidgetOSGs
  // app.setMainWidget(& sgdw);
  sgdw.show();
  /*
     within show() SGWidgetOSG::initializeGL() is called where I setup my 
OSG::Viewport, navigators, cameras and lights (nothing's wrong here, because it 
worked perfectly with libOSGWindowQT)
     and after that _window->init() is called -> crash ...
  */
 
  return app.exec();
} 
 
In my collision detection testapplication
before "OSG::traverse()":
int 
main( int argc, char ** argv )
{
  osgInit( argc, argv );
  QApplication( argc, argv ) app;
  QMainWindow win; 
  //QGLWidget qgl(&win);// crash also with the QGLWidget
  win.show();
 
  OSG::NodePtr node = OSG::makeCoredNode<OSG::Group>();
  OSG::beginEditCP( node );
  node->addChild( OSG::makeNodeFor( OSG::makeBoxGeo( 1, 1, 1, 1, 1, 1) ) ); // 
was also tested with complete vrml model
  OSG::endEditCP(  node );
 
  VRControlCenter vr_ctrl( node );
  vr_ctrl.configure( "path/to/my/xml/configuration/file" );
  /*
      One of the first things the VRControlCenter does when its configuring, is 
to call OSG::traverse() on the node its been constructed with to check
      what kinds of nodes are around in the scenegraph and on calling 
OSG::traverse() the std::logic_error crash appears...
  */
 
  return app.exec();
} 
 
I must be doing something wrong during setup, but I have been staring to long 
at all my code and I just can't figure it out.
 
2.) ###################################################################
I then also tried to put some debugging messages into OSGQT4Window.cpp 
"WindowQT::init()" and tried to recompile, but I always get the same compile 
errors when compiling libOSGWindowQT4.
I use:
g++ -v = gcc version 4.2.1 20061115 (prerelease) (Debian 4.1.1-21)
moc -v = Qt Meta Object Compiler version 59 (Qt 4.2.1)
OpenSG cvs version of today (22. Jan. 2007).
 
>./configure --enable-glut --enable-tif --enable-png --enable-jpg --enable-qt4 
>--with-qt4=/usr 
>--with-add-incdir=/usr/include/qt4/Qt:/usr/include/qt4/QtCore:/usr/include/qt4/QtGui:/usr/include/qt4/QtNetwork:/usr/include/qt4/QtOpenGL:/usr/include/qt4/Qt3Support:/usr/include/qt4/QtDBus:/usr/include/qt4/QtDesigner:/usr/include/qt4/QtSql:/usr/include/qt4/QtSvg:/usr/include/qt4/QtTest:/usr/include/qt4/QtUiTools:/usr/include/qt4/QtXml

Then when trying to compile I get:
>OpenSG/Source/WindowSystem/QT4/OSGWindowQT4Plugin_qt.h: 92: Error: Undefined 
>interface
 
and if I add the <QDesignerExportWidget> and QDESIGNER_EXPORT and 
Q_EXPORT_PLUGIN2(...) stuff to OSGWindowQT4Plugin_qt.* I get:
 
>OpenSG/Source/WindowSystem/QT4/OSGWindowQT4Plugin_qt.h: 0: Warning: No 
>relevant classes found. No output generated.
>obj-dbg/OSGQ4SceneGraphView_qt_moc.cpp:11:2: error #error "The header file 
>'OSGQ4SceneGraphView_qt.h'  doesn't include <QObject>"
 
The "doesn't include <QObject>" error also appears for OSGQ4NodeTreeView, 
OSGQ4GLWidget, OSGQ4GLManagedWidget, OSGQ4GLManagedDesignerWidget, 
OSGQ4FieldEditor, OSGQ4FieldContainerView,...
 
I got the same problems when compiling the first time, but I'm not sure any 
more how I finally got it to compile -> doing some magic "sudo and su" special 
permissions things in /tmp/OpenSG.
I found something on the topic on: 
http://lists.trolltech.com/qt4-preview-feedback/2005-04/thread00475-0.html
But I'm not sure what to make of it...
 
Thank you very much for any help.
 
Regards,
Christoph
 
PS: I get the same compile errors on my laptop using fedora and Qt 4.1







-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to