Show
Ignore:
Timestamp:
07/01/09 16:50:08 (5 years ago)
Author:
robert
Message:

Removed old references to CommandManager?

Files:
1 modified

Legend:

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

    r10436 r10439  
    2323#include <osgText/Text> 
    2424 
    25 #include <osgManipulator/CommandManager> 
    2625#include <osgManipulator/TabBoxDragger> 
    2726#include <osgManipulator/TabPlaneDragger> 
     
    3938#include <iostream> 
    4039 
    41 // #define USE_COMMAND_MANAGER 
    42  
    4340osgManipulator::Dragger* createDragger(const std::string& name) 
    4441{ 
     
    9390 
    9491 
    95 osg::Node* addDraggerToScene(osg::Node* scene, osgManipulator::CommandManager* cmdMgr, const std::string& name) 
     92osg::Node* addDraggerToScene(osg::Node* scene, const std::string& name) 
    9693{ 
    9794    scene->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON); 
    9895 
    99     osgManipulator::Selection* selection = new osgManipulator::Selection; 
     96    osg::MatrixTransform* selection = new osg::MatrixTransform; 
    10097    selection->addChild(scene); 
    10198 
     
    112109                       osg::Matrix::translate(scene->getBound().center())); 
    113110 
    114 #ifdef USE_COMMAND_MANAGER 
    115     cmdMgr->connect(*dragger, *selection); 
    116 #else 
    117111    dragger->addTransformUpdating(selection); 
    118 #endif 
     112 
    119113    return root; 
    120114} 
    121115 
    122 osg::Node* createDemoScene(osgManipulator::CommandManager* cmdMgr) { 
     116osg::Node* createDemoScene() { 
    123117  
    124118    osg::Group* root = new osg::Group; 
     
    196190    root->getOrCreateStateSet()->setAttributeAndModes(matirial.get(), osg::StateAttribute::ON); 
    197191 
    198       transform_1.get()->addChild(addDraggerToScene(geode_1.get(),cmdMgr,"TabBoxDragger")); 
    199     transform_2.get()->addChild(addDraggerToScene(geode_2.get(),cmdMgr,"TabPlaneDragger")); 
    200     transform_3.get()->addChild(addDraggerToScene(geode_3.get(),cmdMgr,"TabPlaneTrackballDragger")); 
    201     transform_4.get()->addChild(addDraggerToScene(geode_4.get(),cmdMgr,"TrackballDragger")); 
    202     transform_5.get()->addChild(addDraggerToScene(geode_5.get(),cmdMgr,"Translate1DDragger")); 
    203     transform_6.get()->addChild(addDraggerToScene(geode_6.get(),cmdMgr,"Translate2DDragger")); 
    204     transform_7.get()->addChild(addDraggerToScene(geode_7.get(),cmdMgr,"TranslateAxisDragger")); 
     192      transform_1.get()->addChild(addDraggerToScene(geode_1.get(),"TabBoxDragger")); 
     193    transform_2.get()->addChild(addDraggerToScene(geode_2.get(),"TabPlaneDragger")); 
     194    transform_3.get()->addChild(addDraggerToScene(geode_3.get(),"TabPlaneTrackballDragger")); 
     195    transform_4.get()->addChild(addDraggerToScene(geode_4.get(),"TrackballDragger")); 
     196    transform_5.get()->addChild(addDraggerToScene(geode_5.get(),"Translate1DDragger")); 
     197    transform_6.get()->addChild(addDraggerToScene(geode_6.get(),"Translate2DDragger")); 
     198    transform_7.get()->addChild(addDraggerToScene(geode_7.get(),"TranslateAxisDragger")); 
    205199 
    206200    root->addChild(transform_1.get()); 
     
    268262    osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); 
    269263 
    270     // create a command manager 
    271     osg::ref_ptr<osgManipulator::CommandManager> cmdMgr; 
    272  
    273  
    274 #ifdef USE_COMMAND_MANAGER 
    275     cmdMgr = new osgManipulator::CommandManager; 
    276 #endif 
    277  
    278264    // if no model has been successfully loaded report failure. 
    279265    bool tragger2Scene(true); 
     
    282268        //std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; 
    283269        //return 1; 
    284         loadedModel = createDemoScene(cmdMgr.get()); 
     270        loadedModel = createDemoScene(); 
    285271        tragger2Scene=false; 
    286272    } 
     
    307293    // pass the loaded scene graph to the viewer. 
    308294    if ( tragger2Scene ) { 
    309         viewer.setSceneData(addDraggerToScene(loadedModel.get(), cmdMgr.get(), dragger_name)); 
     295        viewer.setSceneData(addDraggerToScene(loadedModel.get(), dragger_name)); 
    310296    } else {  
    311297        viewer.setSceneData(loadedModel.get());