From Thomas Wedner, "use osgViewer::CompositeViewer with several views. All views share
parts of their scene graphs. Within these common part some nodes have event handlers which use the action adapter argument to the event handler to determinate which view received the event. Here is the problem, osgViewer::CompositeViewer::eventTraversal sets the action adapter field in the EventVisitor always to the last view which received an event, instead of using the view which actually received the event, so determination of the correct view does not work. I looked at the code a bit, and moved the code for setting the action adapter to a IMO better place"
This commit is contained in:
parent
c7c1913561
commit
bfec6546ce
@ -838,6 +838,8 @@ void CompositeViewer::eventTraversal()
|
|||||||
++veitr)
|
++veitr)
|
||||||
{
|
{
|
||||||
View* view = veitr->first;
|
View* view = veitr->first;
|
||||||
|
_eventVisitor->setActionAdapter(view);
|
||||||
|
|
||||||
if (view->getSceneData())
|
if (view->getSceneData())
|
||||||
{
|
{
|
||||||
for(osgGA::EventQueue::Events::iterator itr = veitr->second.begin();
|
for(osgGA::EventQueue::Events::iterator itr = veitr->second.begin();
|
||||||
@ -877,7 +879,6 @@ void CompositeViewer::eventTraversal()
|
|||||||
++veitr)
|
++veitr)
|
||||||
{
|
{
|
||||||
View* view = veitr->first;
|
View* view = veitr->first;
|
||||||
_eventVisitor->setActionAdapter(view);
|
|
||||||
|
|
||||||
for(osgGA::EventQueue::Events::iterator itr = veitr->second.begin();
|
for(osgGA::EventQueue::Events::iterator itr = veitr->second.begin();
|
||||||
itr != veitr->second.end();
|
itr != veitr->second.end();
|
||||||
@ -899,7 +900,6 @@ void CompositeViewer::eventTraversal()
|
|||||||
++veitr)
|
++veitr)
|
||||||
{
|
{
|
||||||
View* view = veitr->first;
|
View* view = veitr->first;
|
||||||
_eventVisitor->setActionAdapter(view);
|
|
||||||
|
|
||||||
for(osgGA::EventQueue::Events::iterator itr = veitr->second.begin();
|
for(osgGA::EventQueue::Events::iterator itr = veitr->second.begin();
|
||||||
itr != veitr->second.end();
|
itr != veitr->second.end();
|
||||||
|
Loading…
Reference in New Issue
Block a user