[osg-users] some questions about Frame Scheme ON_DEMAND

Glenn Waldron gwaldron at gmail.com
Fri Jul 17 07:22:19 PDT 2015


Gianni,

osgViewer::View inherits from GUIActionAdapter, so you can call
requestRedraw() on that directly.


Glenn Waldron / @glennwaldron

On Fri, Jul 17, 2015 at 10:03 AM, Gianni Ambrosio <g.ambrosio+osg at gmail.com>
wrote:

> Hi All,
> I was using the default CONTINUOUS Frame Scheme but I got CPU consumption
> even if the application was idle.
> I'm developing a Qt application (but my question is not strictly related
> to that).
> So, I moved to ON_DEMAND frame scheme.
>
> I use a Qt timer connected to the QWidget::update() slot so that the paint
> event is triggered.
>
> Here in my viewer widget constructor:
>
> connect(&timer, SIGNAL(timeout()), this, SLOT(update()));
>
> Then the QPaintEvent handled as follows:
>
> void ViewerWidget::paintEvent(QPaintEvent* iEvent)
> {
>    if (osgViewer::ViewerBase::CONTINUOUS == getRunFrameScheme() || true ==
> checkNeedToDoFrame()) {
>       frame();
>    }
> }
>
> I added a custom NodeTrackerManipulator, derived from the OSG one, to the
> viewer. Mouse interactions work fine because of us.requestRedraw() calls
> implemented on the OSG side of the manipulator.
>
> But I have some cases not working.
>
> 1) I implemented some methods to fit the whole 3D scene, to set views
> along X/Y/Z axes, or to switch from perspective to orthographic views. In
> those cases I don't have a GUIActionAdapter to call a requestRedraw() on
> to. So is there a way from the manipulator to get the view?
>
> 2) If a node (with geometry) is added to the scene (as child of an
> existing node) the view is not updated. I expected that case was
> automatically handled. How could I solve this issue?
>
> Regards,
> Gianni
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=64344#64344
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150717/c48450fe/attachment-0003.htm>


More information about the osg-users mailing list