Hi Orhun,

On 1/5/07, Orhun Birsoy <[EMAIL PROTECTED]> wrote:
I was able to use the new osgViewer and its friends in a C++ VCF (my
choice in cross platform application framework -
http://vcf-online.org/) and Java SWT (infact an ecplise rcp
application). Please see the attached files.

Cool, nice to see some progress on other platforms beyond X11 ;-0


But, I have a couple of questions/problems/suggestions.

1. Default implementation of osg::GraphicsContext::valid (it returns a
hard coded false) caused several minutes of confusion. I think it will
be a good idea at least give a NOTICE about it, saying it is not valid
because I forgot to override it. It might be a pure virtual function
as well.

Perhaps it should be made pure virtual... or perhaps as you say
provide a notice about it as I have done from the GraphicsContext pure
virtual functions in the GraphicsWindow subclass.  I think the later
is a sensible first step so I'll check this in soon.

2. I am planning to have different resize algorithm(s) for different
windows I have. So my first expectation was to override
GraphicsContext::resize but unfortunately it is not virtual. Although
it is possible to do what I want to do in other ways, that was my
first reaction.

The resize functionality is still in its infancy.   My plan is to be
have callback for resize as well as the ability to override in in
GraphicsContext subclasses.  I most likely will go for having a
virtual resizeImplementation() and keep the resize non virtual, but
have this resize method call the callback if present else defer to
resizeImplementation.  You'll have see this pattern used before in the
OSG.

3.  As far as I can understand, there are two sets of requestRedraw,
requestContinuousUpdate. (for now just forget about
requestWarpPointer) functions. One in osgViewer::View and the other in
osgViewer::GraphicsWindow, and they are not exactly connected.
As I understand it, the ones in osgViewer::View are for the scene
graph its self, for uses like in TrackballManipulator etc. and the
ones in osgViewer::GraphicsWindow are for GUI events that require
those requests. ie Resize, maximizing, events that requires repainting
of the GUI window its self, (ie scenegraph is unchanged, it doesn't
actually need a redraw). If  this understanding is correct and I
didn't totally miss the point, I have this problem. I have to somehow
inform the osgViewer::Viewer that a GUI window requests a redraw, so I
have the following code in my osgViewer::GraphicsWindow derived class
(code is at the end). Basically, it tries to find its viewer through
its cameras and requests a redraw from it. My question is, is this
correct approach, or did I totally miss the point (it won't be the
first time :)?

The osgGA::GUIActionAdapter methods you are talking about are from
osgGA which is pretty old code that is around for compatibility with
the just as old osgGA EventHandlers/CameraManipulators.  These methods
are only partially used by osgViewer right now, for now non event
driven apps arn't actually required - as rendering will happen
continously anyway.

Once I get a bit further with osgViewer I'll turn my attention to
event driven usage and will then flesh out hwo the requestRedraw and
requestContinuous update will need to be handled.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to