Re: [osg-users] some questions about Frame Scheme ON_DEMAND
Hi All, is there a way to get the osgViewer::View related to a manipulator? I can see a us.requestRedraw() but I need to force a requestRedraw() inside a manipulator when I'm not in an event handling. Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64407#64407 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] some questions about Frame Scheme ON_DEMAND
wernerM wrote: Hi Gianni, I solved it for me by deriving the viewer class and setting a local variable needsUpdate with any mod of the sceene. This works pretty good. OK, so there isn't any way in OSG. I think it would be a nice improvement for the OSG code to add the scene modification flag to be handled by checkNeedToDoFrame(). I can understand your modification and I thought to implement a class for that so it can be injected where needed, it can be more testable and the viewer would have less resposibilities. Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64379#64379 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] some questions about Frame Scheme ON_DEMAND
Hi Gianni, I solved it for me by deriving the viewer class and setting a local variable needsUpdate with any mod of the sceene. This works pretty good. - Werner - Am 20.07.2015 um 10:51 schrieb Gianni Ambrosio: Hi All, can anybody tell me please if there is a way to know if the OSG scene has been modified (i.e. node added or removed) so that I can check if osgViewer::ViewerBase::frame() must be called in a setRunFrameScheme(ON_DEMAND) case? Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64373#64373 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- *TEXION Software Solutions, Rotter Bruch 26a, D-52068 Aachen* Phone: +49 241 475757-0 Fax: +49 241 475757-29 Web: http://texion.eu eMail: i...@texion.eu ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] some questions about Frame Scheme ON_DEMAND
Hi All, can anybody tell me please if there is a way to know if the OSG scene has been modified (i.e. node added or removed) so that I can check if osgViewer::ViewerBase::frame() must be called in a setRunFrameScheme(ON_DEMAND) case? Regards Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64373#64373 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] some questions about Frame Scheme ON_DEMAND
Which is the relation between view and manipulator? I mean, is a manipulator instance supposed to be related to just one view? Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64356#64356 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] some questions about Frame Scheme ON_DEMAND
gwaldron wrote: osgViewer::View inherits from GUIActionAdapter, so you can call requestRedraw() on that directly. I'm inside a NodeTrackerManipulator not in the viewer. Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64346#64346 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] some questions about Frame Scheme ON_DEMAND
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+...@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@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] some questions about Frame Scheme ON_DEMAND
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@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org