I am trying to have the examples/osgmanipulator run in a Qt viewer. I have kept 
most of the code including createDragger(), addeDraggerToScene()..., only the 
main() was replaced

by cMainWindow below. Whenever I select the dragger, it corrupts. When I trace 
it back, it goes to _draggerSelectionMap.count(&dragger) in  
CommandManager::addSelectionsToCommand(MotionCommand& command, Dragger& 
dragger).

What is the problem and how to fix it? Thanks in advance.



//----------------------------------------------------------------------------------------------------------------------
cMainWindow::cMainWindow(QWidget * parent, Qt::WindowFlags flags) : 
QMainWindow(parent, flags)
{
    MainWindow.setupUi(this);

    pViewerWindow=new ViewerQT;
    pViewerWindow->setFocusPolicy(Qt::StrongFocus);
     setCentralWidget(pViewerWindow);
  
     osg::ref_ptr<osgManipulator::CommandManager> cmdMgr = new 
osgManipulator::CommandManager;
    
    osg::ref_ptr<osg::Geode> sphereGeode = new osg::Geode;
    osg::ref_ptr<osg::Sphere>    mysphere= new osg::Sphere(osg::Vec3(0.0, 0.0 
,0.0), 0.2);
    osg::ref_ptr<osg::ShapeDrawable> sphereDrawable = new 
osg::ShapeDrawable(mysphere.get());
    sphereGeode->addDrawable(sphereDrawable.get());


     osg::Node * root = addDraggerToScene(sphereGeode.get(), cmdMgr.get(), 
"Translate2DDragger");
     pViewerWindow->setSceneData(root);

      pViewerWindow->addEventHandler(new PickModeHandler());        
      pViewerWindow->setCameraManipulator(new osgGA::TrackballManipulator);
}


      
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to