Commit Graph

89 Commits

Author SHA1 Message Date
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
Robert Osfield
6d046e9fa1 From Wang Rui, "I've just made another OSG+Qt (GUI) examples to demonstrate how to create OSG views, add them to a CompositeViewer, and add corresponding widgets to Qt layouts or as popup windows. The example inherits a GraphicsWindowQt from the GraphicsWindow base class and implements most of the virtual methods. A QGLWidget is created at the same time to perform keyboards and mouse events, who is also added as the main widget's child.
The new example, named osgviewerQtContext (because of deriving from GraphicsContext), works fine on Windows XP SP3 and Qt 4.5.0, with 4 widgets in QGridLayout and a popup window and 60Hz frame rate. I haven't tested it on Unix/Linux and Mac OSX yet. So any feedback from these platforms is appreciated. I wish this example be a useful complement to current osgviewerQt and osgviewerQtWidgets ones. :)

Some unfinished functionalities: inheritedWindowData, sharedContext, and more tests needed."
2010-04-30 12:22:31 +00:00
Robert Osfield
c0e9fcbb67 From Tim Moore, "This contains a couple of fixes to support changing FrameBufferObject configurations on the fly; the user changes the camera attachments and calls Renderer::setCameraRequiresSetUp(). The major part of this submission is a comprehensive example of setting up floating point depth buffers. The user can change the near plane value and cycle through the available combinations of depth format and multisample buffer formats." 2010-04-19 11:43:06 +00:00
Robert Osfield
04e4fa74cc Added new osgterrain example that is simplified to just basic setup and control osgTerrain nodes, leaving the osgthreadedterrain as the more complex example. 2010-03-19 16:31:48 +00:00
Robert Osfield
515e421e1e Renamed osgterrain to osgthreadedterrain to better reflect it's functionality. 2010-03-19 14:55:35 +00:00
Robert Osfield
74687953be From Jeremy Moles, submitted by Cedric Pinson "Here an new example from Jeremy Moles that demonstrate EaseMotion from
osgAnimation, i have updated EaseMotion with new type, so for users of
EaseMotion just have look, it's a great example."
2010-02-25 17:58:50 +00:00
Robert Osfield
2a6719b7d8 From Jean-Sebastien Guay, build fixes for Mingw 2010-01-18 14:27:20 +00:00
Robert Osfield
8670be33c3 Added checked against QT webkit being available 2009-12-14 12:50:57 +00:00
Robert Osfield
e0154c2d28 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
Robert Osfield
f1009763fc Added osggpx example to demonstate how to use the XmlParser and create line models.
To use :

  osggpx myterrainmodel.ive -t mytrack.gpx
2009-12-02 12:37:22 +00:00
Robert Osfield
2f72c29bd4 From Sergey Leontyev, example for testing of DatabasePaging and CompositeView usage 2009-11-25 11:31:52 +00:00
Robert Osfield
79f766efab Added OSG_CPP_EXCEPTIONS_AVAILABLE cmake option to enable optional build of plugins and examples that required C++ exceptions 2009-11-17 12:55:52 +00:00
Robert Osfield
d7d6d2b215 Moved glColor/glNormal definitions for GLES1.x from include/osg/GL to src/osg/ArrayDispatchers.cpp to avoid import/export issues on functions.
Fixed typo of GLES1 in disabling the build of OpenGL1.x/2.x specific examples
2009-11-04 17:26:59 +00:00
Robert Osfield
12ca5156f8 Disabled osgteaport for GLES1, GLES2 and GL3 builds 2009-11-03 16:49:13 +00:00
Robert Osfield
8d67c9bb33 Disabled the build of plugins that aren't supported under GLES. 2009-11-03 15:22:14 +00:00
Robert Osfield
7e7135be59 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
Robert Osfield
3f55f3f140 New osgvertexattributes example designed to test conversion of fixed function scene graphs to use vertex shaders
and vertex attributes.
2009-10-08 14:29:54 +00:00
Robert Osfield
2d26cbe7ab Introduced optional build against the GLU library, using optional compile paths to enable/disable GLU related function.
To toggle the use of the GLU library adjust the OSG_GLU_AVAILABLE variable via ccmake . or CMakeSetup.
2009-10-07 19:42:32 +00:00
Robert Osfield
3c03682b4c Introduced new osgQtBrowser example. 2009-09-17 13:40:53 +00:00
Robert Osfield
9d792c279b From Don Liech, Qt/OSG integration example 2009-06-19 11:31:15 +00:00
Robert Osfield
cf976e956d Added osgdatabaserevisions example to server as a testbed for new osgDB::DatabaseRevisions functionality 2009-06-02 16:58:32 +00:00
Robert Osfield
dc67dab42e Renamed osgvirtualprogram to osgshadercompositor to better reflect it's function 2009-05-27 13:00:58 +00:00
Robert Osfield
2d542d683a From Wojciech Lewandowski, VirtualProgram example that illustrates how one can create a custom system for composing shaders within the scene graph. 2009-05-25 13:02:14 +00:00
Robert Osfield
90f77c43d5 Added osgtexturecompression example to demonstate the quality difference between
different compression techniques.
2009-03-26 17:24:28 +00:00
Robert Osfield
1fd5eefbcf 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.
Very simple cases of state configuration are supported (all the ones I really need):
- single per pixel not attenuated non spot light source ON/OFF
- exp2 fog ON/OFF
- diffuse texture in rgb + optional specular gloss in alpha (Texture unit 0) ON/OFF
- normal map texture (Texture unit 1 and Tangent in VertexAttribArray 6) ON/OFF
- blending and alpha testing (not in shader pipeline)

To view fixed function pipeline files and paged databases simply run >osgshadergen myfile.osg"
2009-03-23 11:53:06 +00:00
Robert Osfield
ae50d8d956 From Roland Smeenk & Cedric Pinson,
"Summary of changes:
From Roland
-Added MorphGeometry
-Bone Bindmatrix is only calculated if needed
-osgAnimation plugin now supports all available channel types (before only linear vec3 or quat channels)
-osgAnimation plugin now supports MorphGeometry
-osgAnimation plugin now supports animation and channel weights, animation playmode, duration and starttime
-removed osgAnimationManager.cpp from CMakeList

From Cedric
-fixed the last_update field (it was only updated at the first update) in BasicAnimationManager.cpp
- Refactore some part of MorphGeometry minor changes
- Add osganimationmorph as example
"
2009-03-09 17:38:39 +00:00
Robert Osfield
9b64144a2f Added osgcluster example into build system 2009-01-29 13:17:48 +00:00
Robert Osfield
af7bb82175 From Paul Martz, example demonstating new draw instanced primitive funcitonality. 2009-01-06 15:11:54 +00:00
Robert Osfield
4896fe6e05 From Mattias Helsing, "When building osg static on Windows the _declspec's wasn't escaped for
applications, examples or wrappers. Attached are the CMakeLists I had
to change to make these compile.
"
2008-12-11 17:00:40 +00:00
Robert Osfield
6f356aeb97 Intoduce new osgWidget::PdfReader and osgWidget::VncClient front ends to osgWidget,
with new pdf plugin and updated vnc plugin that now support these front ends.

Updated osgpdf and osgvnc examples to new these new interfaces.
2008-12-07 17:02:30 +00:00
Robert Osfield
cd4b4b8bfe Added new examples 2008-11-28 14:37:58 +00:00
Robert Osfield
270fd48536 From John Vidar Larring, osgautocapture example that captures an image from a paged database by frame loop to the paging is complete, then takes a snapshot. 2008-11-26 11:23:06 +00:00
Robert Osfield
6ae07ce0e2 From Roland Smeenk, "This application can be used for testing plugins that can both read and write a certain file format. It will display the original file next to the written and reread file.
Example:
osgsidebyside -o cow.dae cow.osg
 
This example will read cow.osg, write cow.dae, read cow.dae and display cow.osg on the left side and cow.dae on the right side of the view.
 
Possible interactions:
KEY_UP   Speedup DOF animation
KEY_DOWN SlowDown DOF animation
KEY_RIGHT Toggle all MultiSwitches"
2008-11-24 14:37:15 +00:00
Robert Osfield
9f55408ca3 Removed the optional build for osgWidget and plugins as these are options that are appropriate for building all the time 2008-11-22 14:30:21 +00:00
Robert Osfield
56a2cc65d0 From Cedric Pinson, Pulled in osgAnimation from OpenSceneGraph-osgWidget-dev into svn/trunk. 2008-11-22 12:14:19 +00:00
Robert Osfield
d903423ded From Jaromir Vitek, osgpackeddepthstencil example as a test case. 2008-11-21 12:38:22 +00:00
Robert Osfield
beae8ab67f Clean up osgbrowser after moving browser implementation into gecko plugin 2008-11-20 11:28:20 +00:00
Robert Osfield
297dd32011 Changed osgbrowser example to use a local CMakeModules/FindXUL.cmake script,
and specialization of GTK dependencies to only non Windows/OSX platforms.
2008-11-18 23:38:18 +00:00
Robert Osfield
ca5c93a983 Removed dependency on GLUT. 2008-11-17 15:53:04 +00:00
Robert Osfield
2a1f7f0f7a Added GTK and GLUT guards to osgbrowser include 2008-11-14 16:54:07 +00:00
Robert Osfield
d75cc7f84d An "attempt" at using LLMozLib sources as a base for a gecko based embedded browser. 2008-11-13 15:35:08 +00:00
Robert Osfield
771dc7d645 Introduced new osgpdf example that use Cario + Poppler libraries to provide a means of rendering a pdf document to an osg::Image. 2008-11-12 14:21:05 +00:00
Robert Osfield
915a645761 First cut of osgmemorytest example that is written to allocate many windows/pbuffer/GL objects as test of how many objects can be allocated on a machine. 2008-11-10 20:06:27 +00:00
Robert Osfield
c7c1913561 From Ulrich Hertleinm "cmake 2.6 is having trouble on Mac OS X because example/CMakeLists.txt addes subdirectory osgviewerGLUT twice. I took the liberty to remove the second occurrence.
"
2008-11-06 13:40:35 +00:00
Robert Osfield
bad9854d71 Added very basic osgvnc example that uses the LibVNCServer client libries for implementing a vnc client
as an osg::Image with the vnc data stream going to it.
2008-10-31 12:03:44 +00:00
Robert Osfield
8c6f65caca From James Moliere,
"   The code below is to show how a heirarchy of objects can be made within a scenegraph.
    In other words, how there can be a parent/child relationship between objects such
    that when a parent is rotated or translated, the children move is respect to it's
    parent movement.  A robotic arm is used in this example because this is what I'm
    using OSG for."
2008-10-14 15:24:39 +00:00
Robert Osfield
3aebed206e From J.P Delport, game of life example that demonstrates ping pong render to texture rendering 2008-10-14 14:58:10 +00:00
Robert Osfield
a3d25add27 Added osg2cpp example into build 2008-09-25 14:41:27 +00:00
Robert Osfield
ac61676368 Initial cut of osgimagesequence example 2008-07-21 10:57:06 +00:00
Robert Osfield
b343cbfc5f Removed now redundent example 2008-07-15 19:23:48 +00:00