OpenSceneGraph/examples
Robert Osfield 6cbce93aa4 From Jean-Sebastien Guay, "I've been working in the last few days
to get QWidgetImage to a point where it can fill a need we have: to be
able to use Qt to make HUDs and to display widgets over / inside an OSG
scene.

---------------
Current results
---------------
I've attached what I have at this point. The modified QWidgetImage +
QGraphicsViewAdapter classes can be rendered fullscreen (i.e. the Qt
QGraphicsView's size follows the size of the OSG window) or on a quad in
the scene as before. It will let events go through to OSG if no widget
is under the mouse when they happen (useful when used as a HUD with
transparent parts - a click-focus scheme could be added later too). It
also supercedes Martin Scheffler's submission because it adds a
getter/setter for the QGraphicsViewAdapter's background color (and the
user can set their widget to be transparent using
widget->setAttribute(Qt::WA_TranslucentBackground) themselves).

The included osgQtBrowser example has been modified to serve as a test
bed for these changes. It has lots more command line arguments than
before, some of which can be removed eventually (once things are
tested). Note that it may be interesting to change its name or split it
into two examples. Though if things go well, the specific QWebViewImage
class can be removed completely and we can consolidate to using
QWidgetImage everywhere, and then a single example to demonstrate it
would make more sense, albeit not named osgQtBrowser... You can try this
path by using the --useWidgetImage --useBrowser command line arguments -
this results in an equivalent setup to QWebViewImage, but using
QWidgetImage, and doesn't work completely yet for some unknown reason,
see below.

----------------
Remaining issues
----------------
There are a few issues left to fix, and for these I request the
community's assistance. They are not blockers for me, and with my
limited Qt experience I don't feel like I'm getting any closer to fixing
them, so if someone else could pitch in and see what they can find, it
would be appreciated. It would be really nice to get them fixed, that
way we'd really have a first-class integration of Qt widgets in an OSG
scene. The issues are noted in the osgQtBrowser.cpp source file, but
here they are too:

-------------------------------------------------------------------
  QWidgetImage still has some issues, some examples are:

  1. Editing in the QTextEdit doesn't work. Also when started with
     --useBrowser, editing in the search field on YouTube doesn't
     work. But that same search field when using QWebViewImage
     works... And editing in the text field in the pop-up getInteger
     dialog works too. All these cases use QGraphicsViewAdapter
     under the hood, so why do some work and others don't?

     a) osgQtBrowser --useWidgetImage [--fullscreen] (optional)
     b) Try to click in the QTextEdit and type, or to select text
        and drag-and-drop it somewhere else in the QTextEdit. These
        don't work.
     c) osgQtBrowser --useWidgetImage --sanityCheck
     d) Try the operations in b), they all work.
     e) osgQtBrowser --useWidgetImage --useBrowser [--fullscreen]
     f) Try to click in the search field and type, it doesn't work.
     g) osgQtBrowser
     h) Try the operation in f), it works.

  2. Operations on floating windows (--numFloatingWindows 1 or more).
     Moving by dragging the titlebar, clicking the close button,
     resizing them, none of these work. I wonder if it's because the
     OS manages those functions (they're functions of the window
     decorations) so we need to do something special for that? But
     in --sanityCheck mode they work.

     a) osgQtBrowser --useWidgetImage --numFloatingWindows 1
                     [--fullscreen]
     b) Try to drag the floating window, click the close button, or
        drag its sides to resize it. None of these work.
     c) osgQtBrowser --useWidgetImage --numFloatingWindows 1
                     --sanityCheck
     d) Try the operations in b), all they work.
     e) osgQtBrowser --useWidgetImage [--fullscreen]
     f) Click the button so that the getInteger() dialog is
        displayed, then try to move that dialog or close it with the
        close button, these don't work.
     g) osgQtBrowser --useWidgetImage --sanityCheck
     h) Try the operation in f), it works.

  3. (Minor) The QGraphicsView's scrollbars don't appear when
     using QWidgetImage or QWebViewImage. QGraphicsView is a
     QAbstractScrollArea and it should display scrollbars as soon as
     the scene is too large to fit the view.

     a) osgQtBrowser --useWidgetImage --fullscreen
     b) Resize the OSG window so it's smaller than the QTextEdit.
        Scrollbars should appear but don't.
     c) osgQtBrowser --useWidgetImage --sanityCheck
     d) Try the operation in b), scrollbars appear. Even if you have
        floating windows (by clicking the button or by adding
        --numFloatingWindows 1) and move them outside the view,
        scrollbars appear too. You can't test that case in OSG for
        now because of problem 2 above, but that's pretty cool.

  4. (Minor) In sanity check mode, the widget added to the
     QGraphicsView is centered. With QGraphicsViewAdapter, it is not.

     a) osgQtBrowser --useWidgetImage [--fullscreen]
     b) The QTextEdit and button are not in the center of the image
        generated by the QGraphicsViewAdapter.
     c) osgQtBrowser --useWidgetImage --sanityCheck
     d) The QTextEdit and button are in the center of the
        QGraphicsView.
-------------------------------------------------------------------

As you can see I've put specific repro steps there too, so it's clear
what I mean by a given problem. The --sanityCheck mode is useful to see
what should happen in a "normal" Qt app that demonstrates the same
situation, so hopefully we can get to a point where it behaves the same
with --sanityCheck and without."
2010-06-15 13:57:44 +00:00
..
osg2cpp From Jean-Sebastien Guay, Explanation: 2009-11-27 15:39:07 +00:00
osganimate
osganimationeasemotion Fixed warning 2010-03-25 14:12:28 +00:00
osganimationhardware From Cedric Pinson, "Here a list of changes: 2010-01-27 12:24:55 +00:00
osganimationmakepath Fixed warnings 2009-01-07 11:24:47 +00:00
osganimationmorph From Wang Rui, "Attached is the osgAnimation wrappers for serialize IO operations. A 2010-04-19 10:35:18 +00:00
osganimationnode Fixed warnings 2009-01-07 11:24:47 +00:00
osganimationskinning From Cedric Pinson, "Here a list of changes: 2010-01-27 12:24:55 +00:00
osganimationsolid From Wang Rui, "Attached is the osgAnimation wrappers for serialize IO operations. A 2010-04-19 10:35:18 +00:00
osganimationtimeline From Cedric Pinson, updates to osganimation example to keep in sync with changes with osgAnimation, and introduction of a hardware skinning example 2009-10-28 13:31:24 +00:00
osganimationviewer From Bryan Thrall, "Attached files fix typos, from svn 9791: 2009-02-20 11:53:49 +00:00
osgautocapture Fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF. 2010-05-12 11:37:27 +00:00
osgautotransform
osgbillboard
osgblendequation
osgbrowser Fixed empty lines 2009-09-04 09:11:49 +00:00
osgcallback From Chris Hanson, comment fix 2010-02-26 09:40:11 +00:00
osgcamera Added check for Geometry pointer being valid 2009-11-26 10:12:38 +00:00
osgcatch Updated wrappers 2009-10-16 17:22:20 +00:00
osgcegui
osgclip
osgcluster From Mathias Froechlich, "Attached the collected fixes I needed to compile with all of them. 2009-11-18 12:15:29 +00:00
osgcompositeviewer From Paul Melis, "While trying out the osgbrowser example (where I had forgotten to update 2009-02-08 15:56:35 +00:00
osgcopy
osgcubemap
osgdatabaserevisions Implemented updating of revision files as new data is writing to the FileCache 2009-06-04 14:07:12 +00:00
osgdelaunay
osgdepthpartition Fixed build error by replacing M_PI with osg::PI. 2009-04-10 11:19:34 +00:00
osgdepthpeeling From Michael Platings, Converted std::fstream/ifstream/ofstream to osgDB::fstream/ifstream/ofstream and 2008-11-07 15:08:08 +00:00
osgdistortion
osgdrawinstanced Tweaks to shader to fix warnings on with ATI drivers 2009-04-03 09:54:15 +00:00
osgfadetext
osgfont Added StateSet event handler to osgfont and osgtext to aid with debugging 2010-03-18 17:10:48 +00:00
osgforest Replaced glColor4fv call with osg::State::Color(..) 2009-11-03 16:48:48 +00:00
osgfpdepth Changed the ref_ptr<T> observer_ptr<>::lock() method to be 2010-05-28 08:57:48 +00:00
osgfxbrowser From Ulrich Hertlein, "attached is a stencil buffer-based constant-width outline f/x with example. I've also modified osgfxbrowser to setup the stencil buffer accordingly." 2009-12-08 17:41:44 +00:00
osggameoflife Removed geomoflife_frag.cpp experiement from CMakeList.txt file 2008-10-14 15:10:10 +00:00
osggeodemo From Gary Quinn, spelling fixes 2009-02-06 15:17:49 +00:00
osggeometry Improved compatibility with GLES2 2009-11-12 12:07:13 +00:00
osggeometryshaders Added missing *. 2009-01-08 12:47:20 +00:00
osggpx Added support for a wider range of gpx files 2010-05-31 15:51:59 +00:00
osghangglide Renamed osgGA::MatrixManipualtor to osgGA::CameraManipulator so its name better reflects it's function 2010-05-27 15:54:37 +00:00
osghud Fixed typo 2009-05-19 15:11:49 +00:00
osgimagesequence Warning fixes 2009-02-03 15:28:53 +00:00
osgimpostor Renamed osgGA::MatrixManipualtor to osgGA::CameraManipulator so its name better reflects it's function 2010-05-27 15:54:37 +00:00
osgintersection
osgintrospection Fixed build 2009-11-19 10:47:42 +00:00
osgkdtree Cleaned up osgkdtree example 2008-07-12 11:19:25 +00:00
osgkeyboard
osgkeyboardmouse
osglauncher From Jean-Sebastien Guay, warning fixes 2009-02-05 10:14:49 +00:00
osglight
osglightpoint
osglogicop
osglogo Fixed positioning of wings 2008-10-27 10:40:13 +00:00
osgmanipulator Introduced TabBoxTrackballDragger 2009-08-05 16:02:44 +00:00
osgmemorytest From Gary Quinn, spelling fixes 2009-02-06 15:17:49 +00:00
osgmotionblur
osgmovie From Jean-Sebastien Guay, build fixes for Mingw 2010-01-18 14:27:20 +00:00
osgmultiplerendertargets From J.P Delport, "I changed the default HDR mode to the ARB format and put in comments for some other possible modes. 2008-12-17 17:23:17 +00:00
osgmultitexture From Gary Quinn, spelling fixes 2009-02-06 15:17:49 +00:00
osgmultitexturecontrol Fixed handling of Terrain/CoordinateSystem node so that the code now handles the fact that Terrain now subclasses from CoordinateSystemNode. 2010-04-29 09:46:14 +00:00
osgmultiviewpaging Refactored the PagedLODList implementation so that it's now done via a base class that enables different implementations to be easily tried. Initial concrete PagedLODList is the SetBasedPagedLODList. 2010-06-03 14:14:40 +00:00
osgoccluder Replaced usage of depreacted IntersectVisitor with IntersectionVisitor 2008-10-07 14:01:14 +00:00
osgocclusionquery From Paul Melis, "While trying out the osgbrowser example (where I had forgotten to update 2009-02-08 15:56:35 +00:00
osgoutline Added missing .get()'s 2010-01-13 13:09:48 +00:00
osgpackeddepthstencil Fix for build with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION off 2008-11-25 15:57:27 +00:00
osgpagedlod
osgparametric Fixed compile warnings 2009-12-15 14:45:33 +00:00
osgparticle From Martin Scheffler, "osgParticle: method to set start and end tile for particle texture (for animated particles). I also updated examples/osgParticle to show the feature. 2009-11-24 15:00:11 +00:00
osgparticleeffects Replaced usage of depreacted IntersectVisitor with IntersectionVisitor 2008-10-07 14:01:14 +00:00
osgpdf Cleaned up osgWidget::VncClient and osgWidget::Browser so that their implementations are all more consitent with the osgWidget::PdfReader. 2008-12-09 11:05:04 +00:00
osgphotoalbum Where possible moved redundent C header includes from headers to source files 2008-12-12 18:47:30 +00:00
osgpick From Chris Denham, added transform to cube to test picking fixes 2008-11-06 13:36:25 +00:00
osgplanets
osgpoints From Paul Martz, added --points option for forcing points rendering of polygonal models 2009-01-05 17:06:09 +00:00
osgpointsprite Fixed permissions 2010-06-03 15:04:58 +00:00
osgprecipitation Added support for user defined clipping of the precipitation effect, to test use: 2008-12-19 16:13:19 +00:00
osgprerender Added support for Camera::PACKED_DEPTH_STENCIL_BUFFER to .osg and .ive formats 2008-11-09 11:56:02 +00:00
osgprerendercubemap
osgQtBrowser Fixes for warning from qt headers 2010-03-05 15:08:03 +00:00
osgQtWidgets From Jean-Sebastien Guay, "I've been working in the last few days 2010-06-15 13:57:44 +00:00
osgreflect
osgrobot From Jean-Sebastien Guay, replaced M_PI with osg::PI. 2008-11-08 17:53:51 +00:00
osgscalarbar
osgscreencapture Introduced new BufferObject design + implementation in preperation of implementing a pool system for buffer objects 2009-10-01 20:19:42 +00:00
osgscribe
osgsequence
osgshadercompositor From Wojciech Lewandowski, "ref_ptr usage changes made on 9th of June broke VirtualProgram used in osgShaderCompositor example. Taking the opportunity I modified the code a little to use earth sphere as default model. Cow.osg used previously was not looking good in advanced example. I also changed default to advanced example, because its more informative with labels describing virtual programs used to render the objects." 2009-10-10 09:53:10 +00:00
osgshadergen From Maciej Krol, "As promised to Roland I assembled simple shader generator. ShaderGenVisitor converts accumulated fixed function pipeline state sets to ones with shader programs. Generated state sets are attached to geometries and stored in ShaderGenCache for reuse. 2009-03-23 11:53:06 +00:00
osgshaders
osgshaderterrain Replaced usage of depreacted IntersectVisitor with IntersectionVisitor 2008-10-07 14:01:14 +00:00
osgshadow Added StandardShadowMap to list to test cases 2008-12-19 12:28:53 +00:00
osgshape Added enabling of lighting, and disabling of mipmapping to help out testing of GLES2 target 2009-11-10 12:01:28 +00:00
osgsharedarray
osgsidebyside Fixed warnings 2008-12-18 13:56:30 +00:00
osgsimplifier
osgsimulation From Michael Platings, Converted std::fstream/ifstream/ofstream to osgDB::fstream/ifstream/ofstream and 2008-11-07 15:08:08 +00:00
osgslice
osgspacewarp
osgspheresegment From Luc Frauciel, added extra test case accessible via -t 7. 2010-06-14 16:30:43 +00:00
osgspotlight
osgstaticviewer Fixed warnings 2009-05-28 13:26:06 +00:00
osgstereoimage Added shader to convert images into greyscale when rendering in anaglyphic 2009-03-30 09:55:40 +00:00
osgstereomatch
osgteapot
osgterrain Added window size event handler 2010-04-01 21:04:36 +00:00
osgtessellate
osgtext Added StateSet event handler to osgfont and osgtext to aid with debugging 2010-03-18 17:10:48 +00:00
osgtext3D
osgtexture1D From Eduardo Alberto Hernández Muñoz, change to using TexGenNode for setting up tex coordinates 2009-04-22 11:00:20 +00:00
osgtexture2D Added setDataVariance(DYNAMIC) to text label as it's being updated dynamically 2009-02-03 12:47:41 +00:00
osgtexture3D
osgtexturecompression Added osgtexturecompression example to demonstate the quality difference between 2009-03-26 17:24:28 +00:00
osgtexturerectangle
osgthirdpersonview
osgthreadedterrain From Wojciech Lewandowski, "Support for compressed texture arrays + mipmaps + auto mipmap generation. Changes vs OSG trunk. Thanks to Ricardo Corsi I was able to add last time tweaks and remove few issues. This version was so well tested that it has to be posted for inclusion into OSG ;-) 2010-05-21 09:34:25 +00:00
osgunittests Fixed warning 2010-03-11 10:17:50 +00:00
osgvertexattributes Changed default enabling of vertex attribute mapping 2009-11-10 12:03:03 +00:00
osgvertexprogram From Mathias Froehlich, "This is a generic optimization that does not depend on any cpu or instruction 2008-09-17 16:14:28 +00:00
osgviewerCocoa From Eric Sokolowski, Cmake support for osgviewerCocoa 2008-06-26 13:08:24 +00:00
osgviewerFLTK
osgviewerFOX
osgviewerGLUT From Jean-Sebastien Guay, warning fixes 2009-02-05 10:14:49 +00:00
osgviewerGTK Removed std:: from in front of strcmp and added a string.h 2008-09-01 10:19:06 +00:00
osgviewerMFC From Wang Rui, "For a long time, the osgviewerMFC example uses addSlave() to setup the 2010-06-14 15:25:05 +00:00
osgviewerQT Fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF. 2010-05-12 11:37:27 +00:00
osgviewerQtContext Fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF. 2010-05-12 11:37:27 +00:00
osgviewerQtWidget Fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF. 2010-05-12 11:37:27 +00:00
osgviewerSDL From Jean-Sebastien Guay, build fixes for Mingw 2010-01-18 14:27:20 +00:00
osgviewerWX From J.P. Delport, "simple addition to make the scroll wheel work in the example." 2009-11-19 11:21:05 +00:00
osgvnc Cleaned up osgWidget::VncClient and osgWidget::Browser so that their implementations are all more consitent with the osgWidget::PdfReader. 2008-12-09 11:05:04 +00:00
osgvolume Renamed the osgVolume::Layer/ImageDetails parameters RescaleIntercept and RescaleSlope to more general TexelOffset and TexelScale, and changed type to Vec4. 2009-09-03 13:40:50 +00:00
osgwidgetaddremove From Jeremy Moles, updates to osgwidget examples. 2008-11-28 14:36:39 +00:00
osgwidgetbox Form Roland Smeenk, "Attached is a small change to the osgWidget::EventInterface so it matches the NotifyWidget and NullWidget interface (added const). Due to this mismatch these widgets never received events. 2009-11-19 11:30:22 +00:00
osgwidgetcanvas From Cedric Pinson and Jeremey Moles, Changes to OpenSceneGraph-osgWidget-dev branch. 2008-12-16 20:29:00 +00:00
osgwidgetframe From Jeremy Moles, updates to osgwidget examples. 2008-11-28 14:36:39 +00:00
osgwidgetinput From Jeremy Moles, updates to osgwidget examples. 2008-11-28 14:36:39 +00:00
osgwidgetlabel From Jeremy Moles, updates to osgwidget examples. 2008-11-28 14:36:39 +00:00
osgwidgetmenu From Jeremy Moles, updates to osgwidget examples. 2008-11-28 14:36:39 +00:00
osgwidgetmessagebox From Cedric Pinson and Jeremey Moles, Changes to OpenSceneGraph-osgWidget-dev branch. 2008-12-16 20:29:00 +00:00
osgwidgetnotebook From Jeremy Moles, updates to osgwidget examples. 2008-11-28 14:36:39 +00:00
osgwidgetperformance From Jeremy Moles, updates to osgwidget examples. 2008-11-28 14:36:39 +00:00
osgwidgetprogress From Cedric Pinson and Jeremey Moles, Changes to OpenSceneGraph-osgWidget-dev branch. 2008-12-16 20:29:00 +00:00
osgwidgetscrolled Intoduce new osgWidget::PdfReader and osgWidget::VncClient front ends to osgWidget, 2008-12-07 17:02:30 +00:00
osgwidgetshader Renamed enums in osgWidget from ALLCAPITALS to normal OSG conventional of AllCapital 2008-07-25 20:50:42 +00:00
osgwidgetstyled Fixed warnings 2008-12-18 13:56:30 +00:00
osgwidgettable From Cedric Pinson and Jeremey Moles, Changes to OpenSceneGraph-osgWidget-dev branch. 2008-12-16 20:29:00 +00:00
osgwidgetwindow Fixed warnings 2008-12-18 13:56:30 +00:00
osgwindows
CMakeLists.txt From Jean-Sebastien Guay, "I've been working in the last few days 2010-06-15 13:57:44 +00:00