Added typedef and updated wrappers

This commit is contained in:
Robert Osfield
2009-04-10 10:07:13 +00:00
parent c7b981f0d6
commit 57f6f9f6df
3 changed files with 18 additions and 7 deletions

View File

@@ -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<Selection> > Selections;
/** Returns the selections connected to the dragger */
std::list< osg::ref_ptr<Selection> > getConnectedSelections(Dragger& dragger);
Selections getConnectedSelections(Dragger& dragger);
protected:

View File

@@ -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<Selection> > CommandManager::getConnectedSelections(Dragger& dragger)
CommandManager::Selections CommandManager::getConnectedSelections(Dragger& dragger)
{
std::list< osg::ref_ptr<Selection> > selections = std::list< osg::ref_ptr<Selection> >();
Selections selections = std::list< osg::ref_ptr<Selection> >();
//Test if the dragger is in the list
if (_draggerSelectionMap.count(&dragger) > 0)

View File

@@ -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 >)