Ignore:
Timestamp:
Feb 13, 2011, 7:25:16 PM (13 years ago)
Author:
Torben Dannhauer
Message:

Now the trackingID can be updated by the external Link.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/core/core_manipulator.cpp

    r231 r234  
    3131{
    3232        _rootNode = rootNode;
     33        _viewer = viewer;
    3334
    3435        // Setup manipulators
     
    8788    viewer->addEventHandler(new osgViewer::ScreenCaptureHandler);                       // add the screen capture handler
    8889
    89 
     90        // Install Callback
     91        _callback = new core_manipulatorCallback(this);
     92        viewer->getCamera()->addEventCallback(_callback);
    9093
    9194        return true;
     
    9497void core_manipulator::shutdown()
    9598{
     99        // Remove and Delete Callback
     100        _viewer->getCamera()->removeEventCallback(_callback);
     101        _callback= NULL;
     102
    96103#ifdef USE_SPACENAVIGATOR
    97104        //Delete SpaceMouse driver
     
    107114        _nt = NULL;
    108115        _rootNode = NULL;
     116        _viewer = NULL;
    109117}
    110118
     
    160168        }
    161169}
     170
     171void core_manipulator::core_manipulatorCallback::operator()(osg::Node* node, osg::NodeVisitor* nv)
     172{
     173        //OSG_NOTIFY( osg::ALWAYS ) << "---- Executing core_manipulatorCallback .." <<  std::endl;
     174
     175        if(!_manipulators->_updaterSlot.empty())
     176        {
     177                int idToTrack = visual_dataIO::getInstance()->getSlotDataAsDouble(_manipulators->_updaterSlot, osgVisual::dataIO_slot::TO_OBJ );
     178                if(idToTrack!=_manipulators->_currentTrackingID)
     179                        _manipulators->trackNode(idToTrack);
     180        }
     181
     182        traverse(node, nv);
     183}
Note: See TracChangeset for help on using the changeset viewer.