diff --git a/include/osgManipulator/CommandManager b/include/osgManipulator/CommandManager index 898fa3a75..6f793b785 100644 --- a/include/osgManipulator/CommandManager +++ b/include/osgManipulator/CommandManager @@ -47,8 +47,10 @@ class OSGMANIPULATOR_EXPORT CommandManager : public osg::Referenced /** Add all selections connected to the dragger to the command. */ void addSelectionsToCommand(MotionCommand& command, Dragger& dragger); + typedef std::list osg::ref_ptr > Selections; + /** Returns the selections connected to the dragger */ - std::list< osg::ref_ptr > getConnectedSelections(Dragger& dragger); + Selections getConnectedSelections(Dragger& dragger); protected: diff --git a/src/osgManipulator/CommandManager.cpp b/src/osgManipulator/CommandManager.cpp index 45b38350a..5736bf1f4 100644 --- a/src/osgManipulator/CommandManager.cpp +++ b/src/osgManipulator/CommandManager.cpp @@ -39,7 +39,7 @@ bool CommandManager::connect(Dragger& dragger, Selection& selection) { if (iter->second == &selection) return false; - } + } } // Associate selection with dragger @@ -62,7 +62,7 @@ bool CommandManager::connect(Dragger& dragger, Constraint& constraint) { if (iter->second == &constraint) return false; - } + } } // Associate selection with dragger @@ -101,10 +101,10 @@ void CommandManager::addSelectionsToCommand(MotionCommand& command, Dragger& dra } } } - + // Add the dragger to the selection list first. command.addSelection(&dragger); - + // Add the remaining selections. if (_draggerSelectionMap.count(&dragger) > 0) { @@ -124,9 +124,9 @@ void CommandManager::addSelectionsToCommand(MotionCommand& command, Dragger& dra } -std::list< osg::ref_ptr > CommandManager::getConnectedSelections(Dragger& dragger) +CommandManager::Selections CommandManager::getConnectedSelections(Dragger& dragger) { - std::list< osg::ref_ptr > selections = std::list< osg::ref_ptr >(); + Selections selections = std::list< osg::ref_ptr >(); //Test if the dragger is in the list if (_draggerSelectionMap.count(&dragger) > 0) diff --git a/src/osgWrappers/osgManipulator/CommandManager.cpp b/src/osgWrappers/osgManipulator/CommandManager.cpp index af9b9795a..ea4905177 100644 --- a/src/osgWrappers/osgManipulator/CommandManager.cpp +++ b/src/osgWrappers/osgManipulator/CommandManager.cpp @@ -24,6 +24,8 @@ #undef OUT #endif +TYPE_NAME_ALIAS(std::list osg::ref_ptr< osgManipulator::Selection >, osgManipulator::CommandManager::Selections) + BEGIN_OBJECT_REFLECTOR(osgManipulator::CommandManager) I_DeclaringFile("osgManipulator/CommandManager"); I_BaseType(osg::Referenced); @@ -55,5 +57,12 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::CommandManager) __void__addSelectionsToCommand__MotionCommand_R1__Dragger_R1, "Add all selections connected to the dragger to the command. ", ""); + I_Method1(osgManipulator::CommandManager::Selections, getConnectedSelections, IN, osgManipulator::Dragger &, dragger, + Properties::NON_VIRTUAL, + __Selections__getConnectedSelections__Dragger_R1, + "Returns the selections connected to the dragger. ", + ""); END_REFLECTOR +STD_LIST_REFLECTOR(std::list osg::ref_ptr< osgManipulator::Selection >) +