static bool writeDraggers( osgDB::OutputStream& os, const osgManipulator::CompositeDragger& dragger )
{
    unsigned int size = dragger.getNumDraggers();
    os << size << os.BEGIN_BRACKET << std::endl;
    for ( unsigned int i=0; i<size; ++i )
    {
        os << dragger.getDragger(i);
    }
    os << os.END_BRACKET << std::endl;
    return true;
}
static bool readDraggers( osgDB::InputStream& is, osgManipulator::CompositeDragger& dragger )
{
    unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osg::ref_ptr<osgManipulator::Dragger> child = is.readObjectOfType<osgManipulator::Dragger>();
        if ( child ) dragger.addDragger( child );
    }
    is >> is.END_BRACKET;
    return true;
}
Example #3
0
static bool readDraggers( osgDB::InputStream& is, osgManipulator::CompositeDragger& dragger )
{
    unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osgManipulator::Dragger* child = dynamic_cast<osgManipulator::Dragger*>( is.readObject() );
        if ( child ) dragger.addDragger( child );
    }
    is >> is.END_BRACKET;
    return true;
}
static bool checkDraggers( const osgManipulator::CompositeDragger& dragger )
{
    return dragger.getNumDraggers()>0;
}