Changeset 234 for osgVisual/trunk/src
- Timestamp:
- Feb 13, 2011, 7:25:16 PM (14 years ago)
- Location:
- osgVisual/trunk/src/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/src/core/core_manipulator.cpp
r231 r234 31 31 { 32 32 _rootNode = rootNode; 33 _viewer = viewer; 33 34 34 35 // Setup manipulators … … 87 88 viewer->addEventHandler(new osgViewer::ScreenCaptureHandler); // add the screen capture handler 88 89 89 90 // Install Callback 91 _callback = new core_manipulatorCallback(this); 92 viewer->getCamera()->addEventCallback(_callback); 90 93 91 94 return true; … … 94 97 void core_manipulator::shutdown() 95 98 { 99 // Remove and Delete Callback 100 _viewer->getCamera()->removeEventCallback(_callback); 101 _callback= NULL; 102 96 103 #ifdef USE_SPACENAVIGATOR 97 104 //Delete SpaceMouse driver … … 107 114 _nt = NULL; 108 115 _rootNode = NULL; 116 _viewer = NULL; 109 117 } 110 118 … … 160 168 } 161 169 } 170 171 void 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 } -
osgVisual/trunk/src/core/visual_core.cpp
r233 r234 215 215 std::string attr_value=reinterpret_cast<const char*>(attr->children->content); 216 216 if( attr_name == "id" ) manipulators->trackNode( util::strToInt(attr_value) ); 217 218 217 if( attr_name == "updater_slot" ) manipulators->setTrackingIdUpdaterSlot(attr_value); 219 218 attr = attr->next; 220 219 }
Note: See TracChangeset
for help on using the changeset viewer.