Moved Handled propety from GUIEventAdapter to Event base class.

Added CameraManipulator::finishAnimation() method to allow application code to stop any animation/throw of manipulators.
This commit is contained in:
Robert Osfield
2013-11-15 16:15:09 +00:00
parent 835d9455a9
commit c194e92df8
8 changed files with 33 additions and 12 deletions

View File

@@ -98,6 +98,18 @@ void KeySwitchMatrixManipulator::computeHomePosition()
}
}
void KeySwitchMatrixManipulator::finishAnimation()
{
OSG_NOTICE<<"KeySwitchMatrixManipulator::finishAnimation()"<<std::endl;
for(KeyManipMap::iterator itr=_manips.begin();
itr!=_manips.end();
++itr)
{
itr->second.second->finishAnimation();
}
}
void KeySwitchMatrixManipulator::home(const GUIEventAdapter& ee,GUIActionAdapter& aa)
{
// call home for all child manipulators
@@ -178,7 +190,7 @@ bool KeySwitchMatrixManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapt
{
CameraManipulator* selectedManipulator = it->second.second.get();
if (selectedManipulator!=_current)
{
{
OSG_INFO<<"Switching to manipulator: "<<it->second.first<<std::endl;
if ( !selectedManipulator->getNode() )
{
@@ -186,7 +198,7 @@ bool KeySwitchMatrixManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapt
}
selectedManipulator->setByMatrix(_current->getMatrix());
selectedManipulator->init(ea,aa);
_current = selectedManipulator;
}
handled = true;