Robert,
Yeah, it’s a bit complex for a “simple”
example J The main reason is that I’ve used DialogBlocks to put the
example together, which auto-generates a LOT
of code – but it made getting the example up much quicker.
For the osgsimpleviewerWx example I’ve
stripping out all the comments etc and putting the whole thing into a single
file, much like your Qt example. Actually, I started out using the osgsimpleviewerGLUT
code, but that’s not the best fit for wx, which is why it’s taking
me a little longer than expected …
Should have time tomorrow night to put
something together. I’ll try and keep it as close to the Qt example as
possible so you should be able to slip it in with the others with minimal
effort.
Gian
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Robert Osfield
Sent: Sunday, 15 October 2006 9:29
PM
To: osg
users
Subject: Re: [osg-users] Another
wxWidgets example
Hi Gian,
On 10/14/06, Gian Lorenzetto <[EMAIL PROTECTED]> wrote:
I'll do this today/tomorrow and update the wiki.
Thanks for posting this example. I have just download and read through
it. I'm a bit suprised at the number of lines of code required for
the full app, is this normal for WxWindows?
Looking at the example porting across to osgGA::SimpleViewer would certainly
reduce the line count a bit and make it a bit more flexbile and powerful (i.e.
adds database paging support).
The way I'm thinking about going with this type of integration is to make a
subclass of WxGLCanavas and the new osgGA::GraphicsWindow - I have done this in
the Qt osgsimleviewer examples. The GraphicsWindow provides the windowing
generic interface, while things like WxGLCanvas and QGLWidget provide the
implementations.
Then to implement a SimpleViewerWindow with the scene graph renderered and with
a camera manipulator etc you use multiple inheritance from osgGA::SimpleViewer
and the windowing specific GraphicsWindow implementation - again as the
osgsimpleviewerQT* does.
Potentially you could have a GraphicsWindowProxy class as well that has a
pointer to an actual implementation of GraphicsWindow such as
GraphicsWindowQT/GraphicsWindowWxWindows etc, using this Proxy would allow one
to dynamically assign a viewer to a graphics window implementation which is
useful for some app types.
Once I have quieter spell I'll have bash at getting WxWindows configured and
installed on my system and attempt a osgsimpleviewerWxWindows, an do so by
writing a GraphicsWindowWxWindows subclassed from wxGLCanvas. A quiet
spell might take a while to come by though, so others are welcome to jump in
and have a bash at this.
Robert.
|
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/