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 <[email protected]> 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 > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

