[osg-users] Osg With Qt
Hi, I am new in OSG and I want to create a grid using Osg with Qt, how can i able to achieve this. If anyone know please help me on this i was stuck from a long time on this and any help on this will be appreciated Thank you! Cheers, Mohit :([/b] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=72896#72896 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG with Qt on Android fails to render anything
Hi kornerr, your reply seems to me quite an "off-topic"...anyway I'm writing my configuration below since it may be helpful to fully understand the problem. Qt version: 5.7.0 (OpenSource) for Android armeabi-v7a OSG version: 3.4.0, static build (as default for Android) ABI version: armeabi-v7a 3rd party: for several reasons I have used the statically built 3rdparty libraries of OpenCV (e. g. libjpeg, libtiff...etc...). For the other libraries (like freetype, curl...etc...) I have used the ones found here: http://www2.ai2.upv.es/difusion/osgAndroid/3rdpartyAndroid.zip With the exception of the 3rdparty libraries at the previous link I have built all by myself from scratch using cmake, without Android Studio. Clearly I have previously installed the Android SDK and NDK. Cheers, Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69153#69153 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG with Qt on Android fails to render anything
Hi. I'm actually here to ask for Android assistance. Can you please describe your build environment? 1. Did you build with Android Studio? 2. Did you build static or shared OSG libs? 3. Did you build dependencies (libpng and others) yourself? Thanks. 2016-10-24 16:32 GMT+07:00 Andrea Bracci: > Hi reedev, > > many thanks for your sudden reply. > > I am able to run osgviewerQt on Windows without problems and without any > patches to the GraphicsWindowQt.cpp code. > > However I have tried your solution on Android but it didn't solve the > problem: I still see the blue screen inside a Qt window, without any object > rendered on it. > > Thank you anyway! > > Andrea > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69136#69136 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG with Qt on Android fails to render anything
Hi reedev, many thanks for your sudden reply. I am able to run osgviewerQt on Windows without problems and without any patches to the GraphicsWindowQt.cpp code. However I have tried your solution on Android but it didn't solve the problem: I still see the blue screen inside a Qt window, without any object rendered on it. Thank you anyway! Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69136#69136 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG with Qt on Android fails to render anything
Hi Andrea, One question/test: have you been able to run osgviewerQt on Windows for instance? Usually, I need to patch src/osgQt/GraphicsWindowQt.cpp in 2 locations in order to prevent illegal values for scaled_width and/or scaled_height: void GLWidget::resizeEvent( QResizeEvent* event ) { const QSize& size = event->size(); int scaled_width = static_cast(size.width()*_devicePixelRatio); int scaled_height = static_cast(size.height()*_devicePixelRatio); if (scaled_width <= 0 || scaled_height <= 0) return; _gw->resized( x(), y(), scaled_width, scaled_height); _gw->getEventQueue()->windowResize( x(), y(), scaled_width, scaled_height ); _gw->requestRedraw(); } void GLWidget::moveEvent( QMoveEvent* event ) { const QPoint& pos = event->pos(); int scaled_width = static_cast(width()*_devicePixelRatio); int scaled_height = static_cast(height()*_devicePixelRatio); if (scaled_width <= 0 || scaled_height <= 0) return; _gw->resized( pos.x(), pos.y(), scaled_width, scaled_height ); _gw->getEventQueue()->windowResize( pos.x(), pos.y(), scaled_width, scaled_height ); } Without these checks nothing is rendered. Maybe this is the case for Android too? hth, Raymond On 10/24/2016 11:11 AM, Andrea Bracci wrote: Hi, I'm trying to run a simple application using OSG + Qt on Android. I have successfully built OSG Release 3.4.0 for Android (armeabi-v7a) and it successfully runs on Android as expected (I have run the example osgAndroidExampleGLES2 and it runs flawlessly). I have also successfully built osgQt for my Qt version 5.7.0, as well as the osgViewerQt example for Android armeabi-v7a. However if I run osgviewerQt on my Android device (version 5.0.2, API 21) it fails to render anything, in a way similar to what I found at the following link: http://lists.qt-project.org/pipermail/interest/2015-July/017869.html In order to simplify the application I allocate a single QWidget (instead of the four ones contained in the original osgviewerQt example) loading a single osg::Node* from a file cessna.osg. I have verified that the cessna.osg file is successfully loaded through a qDebug() logging message on the value of the loaded pointer. On my Android device I see the OSG-default blue screen without any object. As an additional information: I have successfully built and executed the Qt examples with OpenGLES on my Android device. I have done an extensive web search but I didn't find the solution to my problem, nor anyone that successfully ran OSG + Qt on Android. Can anyone tell me where am I wrong, or what steps shall I follow to make my OSG+Qt application to work on Android? Thank you in advance for your kind replies! Cheers, Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69134#69134 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG with Qt on Android fails to render anything
Hi, I'm trying to run a simple application using OSG + Qt on Android. I have successfully built OSG Release 3.4.0 for Android (armeabi-v7a) and it successfully runs on Android as expected (I have run the example osgAndroidExampleGLES2 and it runs flawlessly). I have also successfully built osgQt for my Qt version 5.7.0, as well as the osgViewerQt example for Android armeabi-v7a. However if I run osgviewerQt on my Android device (version 5.0.2, API 21) it fails to render anything, in a way similar to what I found at the following link: http://lists.qt-project.org/pipermail/interest/2015-July/017869.html In order to simplify the application I allocate a single QWidget (instead of the four ones contained in the original osgviewerQt example) loading a single osg::Node* from a file cessna.osg. I have verified that the cessna.osg file is successfully loaded through a qDebug() logging message on the value of the loaded pointer. On my Android device I see the OSG-default blue screen without any object. As an additional information: I have successfully built and executed the Qt examples with OpenGLES on my Android device. I have done an extensive web search but I didn't find the solution to my problem, nor anyone that successfully ran OSG + Qt on Android. Can anyone tell me where am I wrong, or what steps shall I follow to make my OSG+Qt application to work on Android? Thank you in advance for your kind replies! Cheers, Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69134#69134 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and Qt
Hi Inna, in osgGA library you can find several classes that derive from EventHandler. If you use Qt and osgQt library you can choose to handle events with osg or Qt. If you have something particular you are looking for please ask. Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=68793#68793 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and Qt
Hi, Thanks for your reply and that'S super. Hopefully, It will be good start for me. ... Thank you! Cheers, Inna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=68769#68769 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and Qt
Hi Inna, I use OSG in Qt applications for years and I've never had specific problems with event handling. Currently I'm on Qt 5.6 and OSG 3.4.0. Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=68744#68744 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG and Qt
Hi, I have started working on Qt5.7 and OSG 3.4. Is it safe to use osg with Qt without any issue like specially Event handling . ... Thank you! Cheers, InnaReddy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=68695#68695 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG 3.4.0/QT 5.5 Warning "QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined"
It quite possibly could be specific to my implementation. I took the code from the osg example , but had to massage it a bit. I might try QT 5.6 to see if it goes away as well. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66872#66872 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG 3.4.0/QT 5.5 Warning "QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined"
Hi Loopy, I moved to OSG 3.4.0 and Qt5.6.0 recently but I didn't get such a warning. It seems a particular case of your implementation. Did you try the osgviewerQt example? Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66866#66866 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG 3.4.0/QT 5.5 Warning "QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined"
Hi, When using OSG 3.4.0 and QT 5.5 and on the firstviewer->frame() of an OSGWidget I am getting this warning from QOpenGLContext. Subsequent calls to frame() do not show this warning. Mr. Google suggests that a fix is to check the isExposed() flag on the underlying QWindow - if it were possible to get to the QWindow via a public API. Any suggestions? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66726#66726 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG and QT under Android
Hi, I'd like to build osgQT (3.2.1-rc2) for Android but it seems that this is not supported really: or at least so it seems to me from line 556 in CMakeLists.txt: IF(OSG_USE_QT AND NOT ANDROID) Has anyone been able to build for Android and knows a solution? Or at least the real reason this is disabled :-) Thanks ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT under Android
Hi Edoardo, When the Android-OSG code was submited, Qt was not able yet to run on Android. I suppose that was the main reason, do not compile the osgQt libraries when compiling in android. If you try tell us what you get at the end. Cheers. 2014-03-10 18:45 GMT+01:00 Edoardo Tagome edo...@gmail.com: Hi, I'd like to build osgQT (3.2.1-rc2) for Android but it seems that this is not supported really: or at least so it seems to me from line 556 in CMakeLists.txt: IF(OSG_USE_QT AND NOT ANDROID) Has anyone been able to build for Android and knows a solution? Or at least the real reason this is disabled :-) Thanks ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT under Android
On 10/03/2014 19:41, Jordi Torres wrote: Hi Edoardo, When the Android-OSG code was submited, Qt was not able yet to run on Android. I suppose that was the main reason, do not compile the osgQt libraries when compiling in android. With do not compile you mean don't try to compile! or at that time it was not able to compile? If you try tell us what you get at the end. At the moment I'm getting errors in CMake: CMake Error at C:/Qt/Qt5.2.1_DROID/5.2.1/android_armv7/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:16 (message): Failed to find GLESv2 in with CMAKE_CXX_LIBRARY_ARCHITECTURE . But I'm not an expert... and I may be doing wrong :-) Any hint? Bye ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT under Android
2014-03-10 20:03 GMT+01:00 Edoardo Tagome edo...@gmail.com: On 10/03/2014 19:41, Jordi Torres wrote: Hi Edoardo, When the Android-OSG code was submited, Qt was not able yet to run on Android. I suppose that was the main reason, do not compile the osgQt libraries when compiling in android. With do not compile you mean don't try to compile! or at that time it was not able to compile? Any of the two answers is valid :) If you try tell us what you get at the end. At the moment I'm getting errors in CMake: CMake Error at C:/Qt/Qt5.2.1_DROID/5.2.1/android_armv7/lib/cmake/ Qt5Gui/Qt5GuiConfigExtras.cmake:16 (message): Failed to find GLESv2 in with CMAKE_CXX_LIBRARY_ARCHITECTURE . But I'm not an expert... and I may be doing wrong :-) Any hint? Sorry, right now I don't have the time to test. You are on your own. Maybe others can help. Bye ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG with Qt
Have a look at the osgviewerQt example. On 6 May 2013 02:51, Sujan Dasmahapatra sujan.dasmahapa...@gmail.com wrote: Can I control OSG viewer by Qt events. Like mouse press, mouse move etc can be used with OSG viewer??..Any suggestions highly appreciated. -- Regards Sujan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG with Qt
I am trying to build osgViewerQt example. Error is coming as osgQt run-time error. I am building it is debug mode. But I dont find any osgQtd.lib, but it is osgQt.lib Is it for release build??..I am using Visual studio 2010 and corresponding Qt version I have installed. Please suggest. Thank Sujan On Mon, May 6, 2013 at 4:51 PM, Robert Osfield robert.osfi...@gmail.comwrote: Have a look at the osgviewerQt example. On 6 May 2013 02:51, Sujan Dasmahapatra sujan.dasmahapa...@gmail.com wrote: Can I control OSG viewer by Qt events. Like mouse press, mouse move etc can be used with OSG viewer??..Any suggestions highly appreciated. -- Regards Sujan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Thanks Regards Sujan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG with Qt
Hi Sujan, I haven't touched Windows for development for well over a decade so can't help with detailed Windows specifics. In general if you add new dependencies then you'll need to go back to Cmake to regenerate the project files to reflect the new dependencies. VisualStudio also has this dumb feature/fail that you can't safely mix debug and optimized builds so if you build the OSG with debug the dependencies will need to be debug as well. Robert. On 6 May 2013 10:16, Sujan Dasmahapatra sujan.dasmahapa...@gmail.comwrote: I am trying to build osgViewerQt example. Error is coming as osgQt run-time error. I am building it is debug mode. But I dont find any osgQtd.lib, but it is osgQt.lib Is it for release build??..I am using Visual studio 2010 and corresponding Qt version I have installed. Please suggest. Thank Sujan On Mon, May 6, 2013 at 4:51 PM, Robert Osfield robert.osfi...@gmail.comwrote: Have a look at the osgviewerQt example. On 6 May 2013 02:51, Sujan Dasmahapatra sujan.dasmahapa...@gmail.com wrote: Can I control OSG viewer by Qt events. Like mouse press, mouse move etc can be used with OSG viewer??..Any suggestions highly appreciated. -- Regards Sujan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Thanks Regards Sujan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG with Qt
On Mon, May 6, 2013 at 3:51 AM, Sujan Dasmahapatra sujan.dasmahapa...@gmail.com wrote: Can I control OSG viewer by Qt events. Like mouse press, mouse move etc can be used with OSG viewer??..Any suggestions highly appreciated. You can do that, but basically you need to embed the OSG inside of a Qt windows (see the osgQt examples) and then forward the Qt events to the OSG event handling code. I think most are handled in the examples, so you should not have too many issues with that. Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG with Qt
On Mon, May 6, 2013 at 11:16 AM, Sujan Dasmahapatra sujan.dasmahapa...@gmail.com wrote: I am trying to build osgViewerQt example. Error is coming as osgQt run-time error. I am building it is debug mode. But I dont find any osgQtd.lib, but it is osgQt.lib Is it for release build??..I am using Visual studio 2010 and corresponding Qt version I have installed. Please suggest. Thank Sujan That means that you have built OSG in release mode only. You must build both release debug version of OSG if you want to build the examples (or your project) in Debug mode. Regards, J. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG with Qt
Can I control OSG viewer by Qt events. Like mouse press, mouse move etc can be used with OSG viewer??..Any suggestions highly appreciated. -- Regards Sujan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and Qt GLdouble typedef conflicts with OpenGL ES2
Hi Robert, Thanks for the quick reply. Just for anyone else who runs into this, another way to get aorund this without changing order of includes is just to add the osg defines before Qt is included in the application: #define GL_DOUBLE 0x140A #define GLdouble double It was a bit of a pain to change up order of includes everywhere in my application. Since both OSG and Qt have to check whether or not GLdouble is defined by the GL implementation, I think its safe to do this [and it seems to be working fine]. Regards, Preet On Wed, Dec 12, 2012 at 3:51 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Preet, On 12 December 2012 05:59, Preet prismatic.proj...@gmail.com wrote: Hiya I'm using OSG with Qt to create an OpenGL ES 2 application. GL ES2 does not have GLdoubles. When building witHh against ES2, Qt typedefs GLdouble to GLfloat. OSG typedefs GLdouble to just 'double'. As a result I get an error when trying to compile my application. How do I get around this? It will be an order of include issue, so just be careful which order you include files, or keep the Qt GL code seperate from the OSG Qt code. Personally I'm surprised by the Qt downcasting GLdoube to GLfloat, this could break codes that rely on doubles. On the OSG side we generally use floats for all key data that gets passed to OpenGL, it tends to be just things like glu (which is now part of the OSG) that uses doubles. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and Qt GLdouble typedef conflicts with OpenGL ES2
Hi Preet, On 12 December 2012 05:59, Preet prismatic.proj...@gmail.com wrote: Hiya I'm using OSG with Qt to create an OpenGL ES 2 application. GL ES2 does not have GLdoubles. When building witHh against ES2, Qt typedefs GLdouble to GLfloat. OSG typedefs GLdouble to just 'double'. As a result I get an error when trying to compile my application. How do I get around this? It will be an order of include issue, so just be careful which order you include files, or keep the Qt GL code seperate from the OSG Qt code. Personally I'm surprised by the Qt downcasting GLdoube to GLfloat, this could break codes that rely on doubles. On the OSG side we generally use floats for all key data that gets passed to OpenGL, it tends to be just things like glu (which is now part of the OSG) that uses doubles. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG and Qt GLdouble typedef conflicts with OpenGL ES2
Hiya I'm using OSG with Qt to create an OpenGL ES 2 application. GL ES2 does not have GLdoubles. When building with against ES2, Qt typedefs GLdouble to GLfloat. OSG typedefs GLdouble to just 'double'. As a result I get an error when trying to compile my application. How do I get around this? Preet ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG and Qt fullscreen problem
Hi, I am trying to integrate an osg viewer into a Qt user interface. To do this I am using the osg viewer widget from the OpenSceneGraph 3.0 Cookbook. If I set the widget to fullscreen with the Qt method showFullScreen(). If I do this I have a gray border around my viewport. To eliminate the border I try to set the margin of the layout which includes the osgviewer to 0. But if I do this the Qt widget with viewer is not shown anymore. If I set the margin value to 1 then it works but I have again a small gray border. I know that this is working with OpenSG. Is there maybe a problem with osg?? Does someone has a solution for this problem?? Here is my code (Sorry I don'T know why the tabs are shown like this): viewerwidget.h Code: #ifndef VIEWERWIDGET_H #define VIEWERWIDGET_H // C++ includes #include iostream // Qt includes #include QtCore/QtCore #include QtGui/QtGui // OSG includes #include osgDB/ReadFile #include osgGA/TrackballManipulator #include osgViewer/ViewerEventHandlers #include osgViewer/Viewer #include osgQt/GraphicsWindowQt class ViewerWidget : public QWidget { public: ViewerWidget( QWidget *parent = 0, Qt::WFlags flags = 0 ) : QWidget(parent, flags) { osg::Camera* camera = createCamera( 0, 0, 640, 480 ); osg::Node* scene = osgDB::readNodeFile(cow.osg); m_viewer.setCamera( camera ); m_viewer.setSceneData( scene ); m_viewer.addEventHandler( new osgViewer::StatsHandler ); m_viewer.setCameraManipulator( new osgGA::TrackballManipulator ); // Use single thread here to avoid known issues under Linux m_viewer.setThreadingModel( osgViewer::Viewer::SingleThreaded ); osgQt::GraphicsWindowQt* gw = dynamic_castosgQt::GraphicsWindowQt*( camera-getGraphicsContext() ); if ( gw ) { QVBoxLayout* layout = new QVBoxLayout; /// layout-setMargin(0); /// layout-addWidget( gw-getGLWidget() ); setLayout( layout ); } connect( m_timer, SIGNAL(timeout()), this, SLOT(update()) ); m_timer.start( 40 ); } ~ViewerWidget() {} osg::Camera* createCamera( int x, int y, int w, int h ) { osg::DisplaySettings* ds = osg::DisplaySettings::instance().get(); osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-windowDecoration = false; traits-x = x; traits-y = y; traits-width = w; traits-height = h; traits-doubleBuffer = true; osg::ref_ptrosg::Camera camera = new osg::Camera; camera-setGraphicsContext( new osgQt::GraphicsWindowQt(traits.get()) ); camera-setClearColor( osg::Vec4(0.2, 0.2, 0.6, 1.0) ); camera-setViewport( new osg::Viewport( 0, 0, traits-width, traits-height) ); camera-setProjectionMatrixAsPerspective( 30.0f, static_castdouble(traits-width)/static_castdouble(traits-height), 1.0f, 1.0f ); return camera.release(); } protected: virtual void paintEvent( QPaintEvent* event ) { m_viewer.frame(); } osgViewer::Viewer m_viewer; QTimer m_timer; }; #endif // VIEWERWIDGET_H main.cpp Code: #include QtGui/QApplication #include viewerwidget.h int main(int argc, char *argv[]) { QApplication app( argc, argv ); ViewerWidget* widget = new ViewerWidget(0,Qt::WindowStaysOnTopHint | Qt::SplashScreen); widget-setGeometry( 0, 0, 800, 600 ); widget-showFullScreen(); widget-show(); return app.exec(); } Thank you! Cheers, Markus -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47603#47603 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG with Qt fullscreen problem
Hi, I am using the code example from the book OpenSceneGraph 3 Cookbook to implement an OSG application with a Qt gui. If I set the widget which contains the viewerwideget to showFullscreen() I get a gray border around my osg scene widget. I found a solution to set the margin of the layout to 0 to eliminate the border. I tried to set it to 0 but the windows is not shown anymore. Otherwise if I set the margin to 1 then is the window shown, but I have again a small border. Does someone has a solution for this problem?? Thank you! Cheers, Markus -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47475#47475 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and Qt fullscreen problem
Hi, The paint event is never called if you have zero size margin in a layout. If you only have a single view then there's no point in having a layout anyway instead you can use a GLWidget widget directly Code: GraphicsWindowQt::getGLWidget() Cheers, jamie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47629#47629 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg and Qt
Hello, I want to use openscenegraph to render into a Qt QWidget. Has anyone of you ever successfully tried this or know a ressource/tutorial how this can be done? Thanks! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=38214#38214 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg and Qt
Hi Martin, In OpenSceneGraph sources, there is an *Example osgQtWidgets*. give it a try Cheers *--* *M. ALJI Mohamed* ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT example
Hi Benjamin, We have improved Qt integration checked into svn/trunk as part of the new osgQt library. Submissions would be best built upon this new work rather than introducing yet another variation of Qt integration. Cheers, Robert. On Thu, Jan 20, 2011 at 9:42 PM, Benjamin Wasty bennywa...@gmx.de wrote: Hi, I worked on a Qt-widget integration for my university based on the Delta3D files posted earlier by David Guthrie. I made a few changes - mainly to make multi-threaded rendering really work. We'd be willing to make a submission if there's interest. My current version is attached - feedback would be welcome as this is the first time I worked with OSG. Below are some details and open issues: The class QtViewer inherits from osgViewer::Viewer and OSGAdapterWidget. It does some setup and calls frame() in its updateGL() method. Context sharing between Qt and OSG didn't work when OSG was running multi-threaded - in the end (after quite a few hours of debugging) I just 'switched' the two contexts in OSGAdapterWidget - the QGLWidget keeps its original one and the additional one created in threadedInitializeGL() is used by the OSG draw thread (OSGGraphicsWindowQt directs the makeCurrent/doneCurrent()-calls to that context). Improved mapping from Traits/osg::DisplaySettings to QGLFormat Removed QtGuiWindowSystemWrapper and GLWidgetFactory because we don't need them (but only commented out) No rendering when Widget is hidden (otherwise some access violation occurs) One remaining problem is that there is quite a lag when the main window is moved or resized, because Qt apparently doesn't have enough time to render fluently due to the blocking caused by vsync. Increasing the interval for the update timer helps, but reduces the framerate and in my opinion the now used 10ms are already too much. Should the frame()-call maybe moved to a separate thread like there: forum . openscenegraph . org / viewtopic.php?p=17387#17387 ? (2 posts before I can post URLs? I don't have time for that...) A quick test with that code didn't work, but I didn't pursue it further so far. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35820#35820 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT example
Sounds quite interesting. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Benjamin Wasty Sent: Friday, January 21, 2011 3:13 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] OSG and QT example Hi, I worked on a Qt-widget integration for my university based on the Delta3D files posted earlier by David Guthrie. I made a few changes - mainly to make multi-threaded rendering really work. We'd be willing to make a submission if there's interest. My current version is attached - feedback would be welcome as this is the first time I worked with OSG. Below are some details and open issues: The class QtViewer inherits from osgViewer::Viewer and OSGAdapterWidget. It does some setup and calls frame() in its updateGL() method. Context sharing between Qt and OSG didn't work when OSG was running multi-threaded - in the end (after quite a few hours of debugging) I just 'switched' the two contexts in OSGAdapterWidget - the QGLWidget keeps its original one and the additional one created in threadedInitializeGL() is used by the OSG draw thread (OSGGraphicsWindowQt directs the makeCurrent/doneCurrent()-calls to that context). Improved mapping from Traits/osg::DisplaySettings to QGLFormat Removed QtGuiWindowSystemWrapper and GLWidgetFactory because we don't need them (but only commented out) No rendering when Widget is hidden (otherwise some access violation occurs) One remaining problem is that there is quite a lag when the main window is moved or resized, because Qt apparently doesn't have enough time to render fluently due to the blocking caused by vsync. Increasing the interval for the update timer helps, but reduces the framerate and in my opinion the now used 10ms are already too much. Should the frame()-call maybe moved to a separate thread like there: forum . openscenegraph . org / viewtopic.php?p=17387#17387 ? (2 posts before I can post URLs? I don't have time for that...) A quick test with that code didn't work, but I didn't pursue it further so far. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35820#35820 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT
http://www.easy-share.com/1913167873/qtgui_170.zip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34439#34439 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG and QT
Hi, how i can render scene in my QT dialog form? Can you help me. I read common manual ,there use console applications and viewer class. But i want render my scene in GUI. For example there is cow.osg. How it open in QT GUI application? Thank you! Cheers, kurt -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34334#34334 Attachments: http://forum.openscenegraph.org//files/cow_139.osg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT
Hi Kurt, Have you looked at any of the osgviewerQt* examples If no try there. Robert. On Wed, Dec 1, 2010 at 3:39 PM, Cracj Kurt couple...@mail.ru wrote: Hi, how i can render scene in my QT dialog form? Can you help me. I read common manual ,there use console applications and viewer class. But i want render my scene in GUI. For example there is cow.osg. How it open in QT GUI application? Thank you! Cheers, kurt -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34334#34334 Attachments: http://forum.openscenegraph.org//files/cow_139.osg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT
it example have 3 files. i`m not understand how open it in QT. I try create empty project and include it *.cpp there. INCLUDEPATH += D:/openscenegraph/OpenSceneGraph/include INCLUDEPATH += C:/Qt/2010.05/qt/src/opengl LIBS += D:/openscenegraph/OpenSceneGraph/lib INCLUDEPATH += C:/Qt/2010.05/qt/src/opengl for qgl.h but get list of errors mingw32-make: Entering directory `D:/OpenSceneGraph-2.8.3 (1)/OpenSceneGraph-2.8.3/examples/osgviewerQT/untitled1-build-desktop' C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory `D:/OpenSceneGraph-2.8.3 (1)/OpenSceneGraph-2.8.3/examples/osgviewerQT/untitled1-build-desktop' g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -Ic:\Qt\2010.05\qt\include\QtCore -Ic:\Qt\2010.05\qt\include\QtGui -Ic:\Qt\2010.05\qt\include -Id:\openscenegraph\OpenSceneGraph\include -Ic:\Qt\2010.05\qt\src\opengl -Ic:\Qt\2010.05\qt\include\ActiveQt -Idebug -I..\untitled1 -I. -Ic:\Qt\2010.05\qt\mkspecs\win32-g++ -o debug\AdapterWidget.o ..\AdapterWidget.cpp ..\AdapterWidget.cpp:55: error: 'WFlags' has not been declared ..\AdapterWidget.cpp:76: error: 'WFlags' has not been declared ..\AdapterWidget.cpp: In constructor 'AdapterWidget::AdapterWidget(QWidget*, const char*, const QGLWidget*, int)': ..\AdapterWidget.cpp:80: error: no matching function for call to 'QGLWidget::QGLWidget(QWidget*, const char*, const QGLWidget*, int)' c:\Qt\2010.05\qt\src\opengl/qgl.h:570: note: candidates are: QGLWidget::QGLWidget(const QGLWidget) c:\Qt\2010.05\qt\src\opengl/qgl.h:461: note: QGLWidget::QGLWidget(const QGLFormat, QWidget*, const QGLWidget*, Qt::WindowFlags) c:\Qt\2010.05\qt\src\opengl/qgl.h:459: note: QGLWidget::QGLWidget(QGLContext*, QWidget*, const QGLWidget*, Qt::WindowFlags) c:\Qt\2010.05\qt\src\opengl/qgl.h:457: note: QGLWidget::QGLWidget(QWidget*, const QGLWidget*, Qt::WindowFlags) ..\AdapterWidget.cpp:87: error: 'ClickFocus' is not a member of 'QWidget' ..\AdapterWidget.cpp: In member function 'virtual void AdapterWidget::keyPressEvent(QKeyEvent*)': ..\AdapterWidget.cpp:102: error: invalid use of incomplete type 'struct QKeyEvent' c:\Qt\2010.05\qt\include/QtGui/../../src/gui/kernel/qwidget.h:79: error: forward declaration of 'struct QKeyEvent' ..\AdapterWidget.cpp: In member function 'virtual void AdapterWidget::keyReleaseEvent(QKeyEvent*)': ..\AdapterWidget.cpp:111: error: invalid use of incomplete type 'struct QKeyEvent' c:\Qt\2010.05\qt\include/QtGui/../../src/gui/kernel/qwidget.h:79: error: forward declaration of 'struct QKeyEvent' ..\AdapterWidget.cpp: In member function 'virtual void AdapterWidget::mousePressEvent(QMouseEvent*)': ..\AdapterWidget.cpp:118: error: invalid use of incomplete type 'struct QMouseEvent' c:\Qt\2010.05\qt\include/QtGui/../../src/gui/kernel/qwidget.h:76: error: forward declaration of 'struct QMouseEvent' ..\AdapterWidget.cpp:126: error: invalid use of incomplete type 'struct QMouseEvent' c:\Qt\2010.05\qt\include/QtGui/../../src/gui/kernel/qwidget.h:76: error: forward declaration of 'struct QMouseEvent' ..\AdapterWidget.cpp:126: error: invalid use of incomplete type 'struct QMouseEvent' c:\Qt\2010.05\qt\include/QtGui/../../src/gui/kernel/qwidget.h:76: error: forward declaration of 'struct QMouseEvent' ..\AdapterWidget.cpp: In member function 'virtual void AdapterWidget::mouseReleaseEvent(QMouseEvent*)': ..\AdapterWidget.cpp:132: error: invalid use of incomplete type 'struct QMouseEvent' c:\Qt\2010.05\qt\include/QtGui/../../src/gui/kernel/qwidget.h:76: error: forward declaration of 'struct QMouseEvent' ..\AdapterWidget.cpp:140: error: invalid use of incomplete type 'struct QMouseEvent' c:\Qt\2010.05\qt\include/QtGui/../../src/gui/kernel/qwidget.h:76: error: forward declaration of 'struct QMouseEvent' ..\AdapterWidget.cpp:140: error: invalid use of incomplete type 'struct QMouseEvent' c:\Qt\2010.05\qt\include/QtGui/../../src/gui/kernel/qwidget.h:76: error: forward declaration of 'struct QMouseEvent' ..\AdapterWidget.cpp: In member function 'virtual void AdapterWidget::mouseMoveEvent(QMouseEvent*)': ..\AdapterWidget.cpp:145: error: invalid use of incomplete type 'struct QMouseEvent' c:\Qt\2010.05\qt\include/QtGui/../../src/gui/kernel/qwidget.h:76: error: forward declaration of 'struct QMouseEvent' ..\AdapterWidget.cpp:145: error: invalid use of incomplete type 'struct QMouseEvent' c:\Qt\2010.05\qt\include/QtGui/../../src/gui/kernel/qwidget.h:76: error: forward declaration of 'struct QMouseEvent' ..\AdapterWidget.cpp: At global scope: ..\AdapterWidget.cpp:153: error: 'WFlags' has not been declared ..\AdapterWidget.cpp:180: error: 'WFlags' has not been declared mingw32-make[1]:
Re: [osg-users] OSG and QT
Hi, That is how a typical .pro file should look like if you want to compile osg with qt. /7 TEMPLATE = app QT += opengl INCLUDEPATH += . INCLUDEPATH += /usr/include/osg INCLUDEPATH += /usr/include/osgAnimation INCLUDEPATH += /usr/include/osgDB INCLUDEPATH += /usr/include/osgGA INCLUDEPATH += /usr/include/osgManipulator INCLUDEPATH += /usr/include/osgViewer INCLUDEPATH += /usr/include/osgUtil LIBS += -L/usr/lib64 -losgViewer -losgDB -losgUtil -losg -losgSim HEADERS += \ ViewerQT.h \ AdapterWidget.h \ OSGQtMainWindow.h \ Teapot.h \ SnapImage.h \ SnapImageHandler.h SOURCES += \ AdapterWidget.cpp \ main.cpp \ OSGQtMainWindow.cpp \ ViewerQT.cpp FORMS += \ OSGQtWindow.ui RESOURCES += 7 Hope it helps. Cheers, Sajjadul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34386#34386 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT example
Hi, is there meanwhile a sort of standard way of integration osg views as qt widgets in a way that allows to handle them like normal widgets on the qt side ? Thank you! Cheers, Jan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30486#30486 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT example
The best overview comes from examples/osgQtWidgets/osgQtWidgets.cpp... //We would need to document the following somewhere in order to guide people on //what they need to use... // //-- //There are two angles to consider. // //1. If someone wants a widget in their Qt app to be an OSG-rendered scene, they //need GraphicsWindowQt (in the osgViewerQtContext example) or QOSGWidget (in the //osgViewerQt example). These two allow both OSG and Qt to manage their threads //in a way which is optimal to them. We've used QOSGWidget in the past and had //trouble when Qt tried to overlay other widgets over the QOSGWidget (since OSG //did its rendering independently of Qt, it would overwrite what Qt had drawn). I //haven't tried GraphicsWindowQt yet, but I expect since it uses QGLWidget, it //will result in Qt knowing when OSG has drawn and be able to do overlays at the //right time. Eventually GraphicsWindowQt can be brought into osgViewer I imagine... // //2. If someone wants to bring Qt widgets inside their OSG scene (to do HUDs or //an interface on a computer screen which is inside the 3D scene, or even //floating Qt widgets, for example). That's where QGraphicsViewAdapter + //QWidgetImage will be useful. //-- I've used both QOSGWidget and GraphicsWindowQt in full blown Qt applications. In both cases I made classes that inherited one of the above along with osgViewer::View. QOSGWidget works pretty well as is. I had to break the GraphicsWindowQt constructor into parts to use a QWidget created elsewhere in the Qt application. -Don Leich Hi, is there meanwhile a sort of standard way of integration osg views as qt widgets in a way that allows to handle them like normal widgets on the qt side ? Thank you! Cheers, Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT example
mgb_osg wrote: Not sure if it's what you mean but you can easily create multiple OSGWidget windows with the same osg scene data in each of them and have different views into the same model in different windows. There are issues thut must be addressed: multi-threading, thread-safety, Qt keyboard mapping, and context management. The Delta3D dtQt plug-in provides a wrapper for these issues. I was wondering if someone had a simple example using these (or similar). -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=26531#26531 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT example
LEgregius wrote: Hi, Yes, it does fix the keyboard issues, at least most of them, and I have done some minor testing with the threading and it seems to work. Hey David, I'm not sure if this thread is still alive, but have you tested the case of rendering a single OSG scene-graph in multiple Qt windows (i.e. sharing the same graphics context)? If so, do you have a Hello, World example of this with the dtQt elements you referenced? Cheers, Ben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=26498#26498 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT problem
Thank you for your answer. I've tried everything you said, but the problem remains... I went on with experiments and discovered that replacing osgViewer::Viewer-setDone( true); with osgViewer::Viewer - setSceneData(0); osgViewer::Viewer -frame(); osgViewer::Viewer-setDone(true); solves all discussed issues. I'm not sure though that the call of setSceneData(0) is a correct solution... More over, textures on objects are good now, but textures on osgText still have the same problems. On Widget destruction (in QT) and it's recreation there are filled sqares insted of text (osgText)... I wonder what else could be done? Maxim Gammer 2009/10/29 Eric ZAREMBA eric.zare...@ersa-france.com Hi, I experiment this. I used an already displayed scene in another viewer. (I think you do not reload your nodes). So, they are a marker in the osg::Texture which indicates to unref the image after apply. I thinks it a save memory trick. But in our case, the image does not exist anymore when the scene is set to the second view. So, I wrote a visitor which look into each node of my graph and check the stateset. I apply it just after loading before insert it in my scene. So, my code: // osg::StateSet* stateset = … osg::StateAttribute* attribute = NULL; while( (attribute = stateset-getTextureAttribute(i, osg::StateAttribute::TEXTURE)) ) { ++i; osg::Texture* tex = dynamic_castosg::Texture*(attribute); if( tex ) tex-setUnRefImageDataAfterApply( false ); } And all should work fine. Eric Z. -- *De :* osg-users-boun...@lists.openscenegraph.org [mailto: osg-users-boun...@lists.openscenegraph.org] *De la part de* Maxim Gammer *Envoyé :* jeudi 29 octobre 2009 12:41 *À :* OpenSceneGraph Users *Objet :* [osg-users] OSG and QT problem Hello, There is one problem while using OSGViewer in QT: first run of Widget goes just fine (1.jpg). After I close it and then create it again there is an incorrect picture (2.jpg). There is a suspicious chancks in debug info (1.txt and 2.txt): returning cached instanced of - tells us that an object wasn't deleted. I closed widget though. At the first run there are following strings in debug, but they dissapear at second run: -- RegisterWindowingSystemInterfa ceProxy() X11WindowingSystemInterface() GraphicsContext::setWindowingSystemInterface() 0x1b26f200x7f39a7ccc890 --- The following strings appear at the moment when I delete OSGViewer: Warning: deleting still referenced object 0x6b8d378 of type 'PN3osg10ReferencedE' the final reference count was 2, memory corruption possible. OSG 2.8.2. QT 4.5.0 Where to dig for a solution? Thanx in advance. -- Maxim Gammer ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Maxim Gammer ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT problem
Hi Maxim, More over, textures on objects are good now, but textures on osgText still have the same problems. On Widget destruction (in QT) and it's recreation there are filled sqares insted of text (osgText)... I've seen this before on osgText, and the solution for me was to explicitly call releaseGLObjects() on the nodes that contain osgText objects. You can also try to call it on your scene root. This ensures that no stale OpenGL objects relating to the old graphics context exist, and will force the OSG objects to create new OpenGL objects for the new context on the first frame. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT problem
Thank you! ) 2009/10/30 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com Hi Maxim, More over, textures on objects are good now, but textures on osgText still have the same problems. On Widget destruction (in QT) and it's recreation there are filled sqares insted of text (osgText)... I've seen this before on osgText, and the solution for me was to explicitly call releaseGLObjects() on the nodes that contain osgText objects. You can also try to call it on your scene root. This ensures that no stale OpenGL objects relating to the old graphics context exist, and will force the OSG objects to create new OpenGL objects for the new context on the first frame. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Maxim Gammer ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT problem
Hi, I experiment this. I used an already displayed scene in another viewer. (I think you do not reload your nodes). So, they are a marker in the osg::Texture which indicates to unref the image after apply. I thinks it a save memory trick. But in our case, the image does not exist anymore when the scene is set to the second view. So, I wrote a visitor which look into each node of my graph and check the stateset. I apply it just after loading before insert it in my scene. So, my code: // osg::StateSet* stateset = ... osg::StateAttribute* attribute = NULL; while( (attribute = stateset-getTextureAttribute(i, osg::StateAttribute::TEXTURE)) ) { ++i; osg::Texture* tex = dynamic_castosg::Texture*(attribute); if( tex ) tex-setUnRefImageDataAfterApply( false ); } And all should work fine. Eric Z. De : osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] De la part de Maxim Gammer Envoyé : jeudi 29 octobre 2009 12:41 À : OpenSceneGraph Users Objet : [osg-users] OSG and QT problem Hello, There is one problem while using OSGViewer in QT: first run of Widget goes just fine (1.jpg). After I close it and then create it again there is an incorrect picture (2.jpg). There is a suspicious chancks in debug info (1.txt and 2.txt): returning cached instanced of - tells us that an object wasn't deleted. I closed widget though. At the first run there are following strings in debug, but they dissapear at second run: -- RegisterWindowingSystemInterfa ceProxy() X11WindowingSystemInterface() GraphicsContext::setWindowingSystemInterface() 0x1b26f200x7f39a7ccc890 --- The following strings appear at the moment when I delete OSGViewer: Warning: deleting still referenced object 0x6b8d378 of type 'PN3osg10ReferencedE' the final reference count was 2, memory corruption possible. OSG 2.8.2. QT 4.5.0 Where to dig for a solution? Thanx in advance. -- Maxim Gammer ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG and QT integration problem
Hi. There is a problem of my program and QT integration. Problem occurs when I'm trying to use OSG ModularEmitter for particle creation. In process of compilation I get the following: ... /usr/local/include/ osgParticle/ModularEmitter:89: error: expected unqualified-id before ‘double’ ... ModularEmitter, line 89 : virtual void emit(double dt); I think the problem is in the name of method virtual void emit(double dt), because emit is a preprocessor word in QT, (like slot, signal, emit...) Any ideas how could I compile my project? ) -- Gammer Maxim TSOGU, Tyumen, Russia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT example
hi David, I'm also interested in your work. Like Simon I had problems with QOSGWidget and was frustrated with the limitations of AdapterWidget. Richard On Mon, May 11, 2009 at 11:19 PM, Simon Loic simon1l...@gmail.com wrote: Hi David, Just to answer your point, I would be personally interested in such an integration. So far I'm using the AdapterWidget of the ViewerQt example but I'm not fully satisfied. Indeed it suffers a couple of problems as : - the lack of multiple thread support - a bad translation between QT keyboard events and OSG one. I had a quick look to the code you pointed and both seems to be handled in it (tell me if I'm wrong). As for the QOSGWidget, I tried to embed it in a QtDesigner based GUI and I must confess I couldn't make it. May be I dind't try hard enough. Yet if someone could provide such an example (ie without the trick to avoid the moc steps and so on), that would be hell of a tip. Thanks On Thu, May 7, 2009 at 8:43 PM, David Guthrie dguth...@alionscience.comwrote: Hi, We wrote a QT/OSG integration that implements the windowing system interface for qt. It's in the delta3d dtQt library. It seems like the sort of thing that should be part of OSG, we just haven't submitted it. If there is interest, we can look at what the code should look like and where it should go... Look at https://delta3d.svn.sourceforge.net/svnroot/delta3d/trunk/delta3d/inc/dtQt https://delta3d.svn.sourceforge.net/svnroot/delta3d/trunk/delta3d/src/dtQt at the files osgadapterwidget.h osggraphicswindowqt.h qtguiwindowsystemwrapper.h osgadapterwidget.cpp osggraphicswindowqt.cpp qtguiwindowsystemwrapper.cpp Thank you! David Guthrie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=11639#11639 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT integration problem
On Wed, May 13, 2009 at 9:02 AM, Максим Гаммер maxgam...@gmail.com wrote: Hi. There is a problem of my program and QT integration. Problem occurs when I'm trying to use OSG ModularEmitter for particle creation. In process of compilation I get the following: ... /usr/local/include/ osgParticle/ModularEmitter:89: error: expected unqualified-id before ‘double’ ... ModularEmitter, line 89 : virtual void emit(double dt); I think the problem is in the name of method virtual void emit(double dt), because emit is a preprocessor word in QT, (like slot, signal, emit...) Any ideas how could I compile my project? ) -- Gammer Maxim TSOGU, Tyumen, Russia ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Hi Gammer, try to include QT _after_ OSG headers in all translation units. Alternatively, you may temporarily undef macro then set it back. I am not sure about its side effects; ensure that no header file directly or indirectly loads an include file that has requires macro. #ifdef MACRO1 #define MACRO1_SAVE MACRO1 #endif #undef MACRO1 // include osg code here, may be? #ifdef MACRO1_SAVE #define MACRO1 UIQ_SAVE #undef MACRO1_SAVE #endif MACRO1, in your case, is emit. HTH Ismail ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT integration problem
Hi Maxim. BTW - in order everyone can address you properly, make some effort which makes it easier. example - do not use Cyrillic letters in mail header - it is not russian mail list. Next - sign so that is was clear what is your name and what is your surname. as you could see from your sign it follows that your name is Gammer. I call to you as here maintainers try to keep a special developer atmosphere. So too much impersonal mails harms discussions. Спасибо за понимание. Regards Sergey On Wed, May 13, 2009 at 11:02 AM, Максим Гаммер maxgam...@gmail.com wrote: Hi. There is a problem of my program and QT integration. Problem occurs when I'm trying to use OSG ModularEmitter for particle creation. In process of compilation I get the following: ... /usr/local/include/ osgParticle/ModularEmitter:89: error: expected unqualified-id before 'double' ... ModularEmitter, line 89 : virtual void emit(double dt); I think the problem is in the name of method virtual void emit(double dt), because emit is a preprocessor word in QT, (like slot, signal, emit...) Any ideas how could I compile my project? ) -- Gammer Maxim TSOGU, Tyumen, Russia ___ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT integration problem
Thanks! 13 мая 2009 г. 17:15 пользователь Sergey Kurdakov sergey.fo...@gmail.com написал: Hi Maxim. BTW - in order everyone can address you properly, make some effort which makes it easier. example - do not use Cyrillic letters in mail header - it is not russian mail list. Next - sign so that is was clear what is your name and what is your surname. as you could see from your sign it follows that your name is Gammer. I call to you as here maintainers try to keep a special developer atmosphere. So too much impersonal mails harms discussions. Спасибо за понимание. Regards Sergey On Wed, May 13, 2009 at 11:02 AM, Максим Гаммер maxgam...@gmail.com wrote: Hi. There is a problem of my program and QT integration. Problem occurs when I'm trying to use OSG ModularEmitter for particle creation. In process of compilation I get the following: ... /usr/local/include/ osgParticle/ModularEmitter:89: error: expected unqualified-id before 'double' ... ModularEmitter, line 89 : virtual void emit(double dt); I think the problem is in the name of method virtual void emit(double dt), because emit is a preprocessor word in QT, (like slot, signal, emit...) Any ideas how could I compile my project? ) -- Gammer Maxim TSOGU, Tyumen, Russia ___ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Гаммер Максим Дмитриевич Начальник отдела ИТ НИИ ЭОР ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT integration problem
Thanks! 13 мая 2009 г. 18:08 пользователь Maxim Gammer maxgam...@gmail.com написал: Thanks! 13 мая 2009 г. 17:15 пользователь Sergey Kurdakov sergey.fo...@gmail.com написал: Hi Maxim. BTW - in order everyone can address you properly, make some effort which makes it easier. example - do not use Cyrillic letters in mail header - it is not russian mail list. Next - sign so that is was clear what is your name and what is your surname. as you could see from your sign it follows that your name is Gammer. I call to you as here maintainers try to keep a special developer atmosphere. So too much impersonal mails harms discussions. Спасибо за понимание. Regards Sergey On Wed, May 13, 2009 at 11:02 AM, Максим Гаммер maxgam...@gmail.com wrote: Hi. There is a problem of my program and QT integration. Problem occurs when I'm trying to use OSG ModularEmitter for particle creation. In process of compilation I get the following: ... /usr/local/include/ osgParticle/ModularEmitter:89: error: expected unqualified-id before 'double' ... ModularEmitter, line 89 : virtual void emit(double dt); I think the problem is in the name of method virtual void emit(double dt), because emit is a preprocessor word in QT, (like slot, signal, emit...) Any ideas how could I compile my project? ) -- Gammer Maxim TSOGU, Tyumen, Russia ___ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Гаммер Максим Дмитриевич Начальник отдела ИТ НИИ ЭОР -- Maxim Gammer ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT example
Hi David, Just to answer your point, I would be personally interested in such an integration. So far I'm using the AdapterWidget of the ViewerQt example but I'm not fully satisfied. Indeed it suffers a couple of problems as : - the lack of multiple thread support - a bad translation between QT keyboard events and OSG one. I had a quick look to the code you pointed and both seems to be handled in it (tell me if I'm wrong). As for the QOSGWidget, I tried to embed it in a QtDesigner based GUI and I must confess I couldn't make it. May be I dind't try hard enough. Yet if someone could provide such an example (ie without the trick to avoid the moc steps and so on), that would be hell of a tip. Thanks On Thu, May 7, 2009 at 8:43 PM, David Guthrie dguth...@alionscience.comwrote: Hi, We wrote a QT/OSG integration that implements the windowing system interface for qt. It's in the delta3d dtQt library. It seems like the sort of thing that should be part of OSG, we just haven't submitted it. If there is interest, we can look at what the code should look like and where it should go... Look at https://delta3d.svn.sourceforge.net/svnroot/delta3d/trunk/delta3d/inc/dtQt https://delta3d.svn.sourceforge.net/svnroot/delta3d/trunk/delta3d/src/dtQt at the files osgadapterwidget.h osggraphicswindowqt.h qtguiwindowsystemwrapper.h osgadapterwidget.cpp osggraphicswindowqt.cpp qtguiwindowsystemwrapper.cpp Thank you! David Guthrie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=11639#11639 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Loïc Simon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT example
Hi, Yes, it does fix the keyboard issues, at least most of them, and I have done some minor testing with the threading and it seems to work. ... Thank you! Cheers, David -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=11839#11839 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG and QT example
Is there a more complex example of using QT (4.5) with OSG (2.8) than the osgviewerQT example? I want to use the AdapterWidget and interface an OSG viewer to a QT form which has been designed with buttons/controls using QT Designer. Thanks in advance, Paul P. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG and QT example
Unless I'm misunderstanding there are already two ways to integrate osg with Qt (QOSGWidget and adapterWidget - plus a few composite versions) The osgviewerQT example is a little artificial to avoid the moc step. which is what I thought the OP was asking about. It would be nice to integrate the Qt widgets into QOSGWidget so that you can have Qt controls drawn (eg with transparency) onto the OSG view - as described here http://labs.trolltech.com/blogs/2008/06/27/accelerate-your-widgets-with-opengl/ I was taking a look at it but more important stuff came up ;-( It does seem that doing everything in OpenGL is part of the Qt future strategy - which can only be good for OSG. Cheers, Martin Beckett -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=11645#11645 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org