Show
Ignore:
Timestamp:
02/01/12 18:10:48 (2 years ago)
Author:
robert
Message:

Added example usage of teh new DraggerTransforCallback?'s HandleCommandMask? which is tied to the TabPlaneDragger? example.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgmanipulator/osgmanipulator.cpp

    r12930 r12932  
    5050        virtual bool constrain(osgManipulator::TranslateInLineCommand& command) const 
    5151        { 
    52             OSG_NOTICE<<"TranslateInLineCommand "<<command.getTranslation()<<std::endl; 
     52            OSG_NOTICE<<"PlaneConstraint TranslateInLineCommand "<<command.getTranslation()<<std::endl; 
    5353            return true;             
    5454        } 
     
    5656        { 
    5757            //command.setTranslation(osg::Vec3(0.0f,0.0f,0.0f)); 
    58             OSG_NOTICE<<"TranslateInPlaneCommand "<<command.getTranslation()<<std::endl; 
     58            OSG_NOTICE<<"PlaneConstraint TranslateInPlaneCommand "<<command.getTranslation()<<std::endl; 
    5959            return true; 
    6060        } 
     
    6262        { 
    6363            //command.setScale(1.0f); 
    64             OSG_NOTICE<<"Scale1DCommand"<<command.getScale()<<std::endl; 
     64            OSG_NOTICE<<"PlaneConstraint Scale1DCommand"<<command.getScale()<<std::endl; 
    6565            return true;             
    6666        } 
     
    6868        { 
    6969            //command.setScale(osg::Vec2d(1.0,1.0)); 
    70             OSG_NOTICE<<"Scale2DCommand "<<command.getScale()<<std::endl; 
     70            OSG_NOTICE<<"PlaneConstraint Scale2DCommand "<<command.getScale()<<std::endl; 
    7171            return true; 
    7272        } 
    7373        virtual bool constrain(osgManipulator::ScaleUniformCommand& command) const 
    7474        { 
    75             OSG_NOTICE<<"ScaleUniformCommand"<<command.getScale()<<std::endl; 
     75            OSG_NOTICE<<"PlaneConstraint ScaleUniformCommand"<<command.getScale()<<std::endl; 
    7676            return true;             
    7777        } 
    7878}; 
     79 
     80 
    7981 
    8082osgManipulator::Dragger* createDragger(const std::string& name) 
     
    235237                       osg::Matrix::translate(scene->getBound().center())); 
    236238 
    237     dragger->addTransformUpdating(selection); 
     239    if (dynamic_cast<osgManipulator::TabPlaneDragger*>(dragger)) 
     240    { 
     241        dragger->addTransformUpdating(selection, osgManipulator::DraggerTransformCallback::HANDLE_TRANSLATE_IN_LINE); 
     242    } 
     243    else 
     244    { 
     245        dragger->addTransformUpdating(selection); 
     246    } 
    238247 
    239248    // we want the dragger to handle it's own events automatically