- Timestamp:
- 05/14/09 15:40:02 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/applications/present3D/SlideEventHandler.cpp
r10132 r10207 137 137 virtual void setPause(bool pause) 138 138 { 139 osg::AnimationPathCallback* apc = dynamic_cast<osg::AnimationPathCallback*>(_callback.get());140 osgUtil::TransformCallback* tc = dynamic_cast<osgUtil::TransformCallback*>(_callback.get());141 ss3d::AnimationMaterialCallback* amc = dynamic_cast<ss3d::AnimationMaterialCallback*>(_callback.get());142 if (apc)143 {139 osg::AnimationPathCallback* apc = dynamic_cast<osg::AnimationPathCallback*>(_callback.get()); 140 osgUtil::TransformCallback* tc = dynamic_cast<osgUtil::TransformCallback*>(_callback.get()); 141 ss3d::AnimationMaterialCallback* amc = dynamic_cast<ss3d::AnimationMaterialCallback*>(_callback.get()); 142 if (apc) 143 { 144 144 osg::notify(osg::INFO)<<"apc->setPause("<<pause<<")"<<std::endl; 145 145 apc->setPause(pause); 146 }147 if (tc)148 {146 } 147 if (tc) 148 { 149 149 osg::notify(osg::INFO)<<"tc->setPause("<<pause<<")"<<std::endl; 150 150 tc->setPause(pause); 151 }152 if (amc)153 {151 } 152 if (amc) 153 { 154 154 osg::notify(osg::INFO)<<"amc->setPause("<<pause<<")"<<std::endl; 155 155 amc->setPause(pause); 156 }156 } 157 157 } 158 158 159 159 virtual void reset() 160 160 { 161 osg::AnimationPathCallback* apc = dynamic_cast<osg::AnimationPathCallback*>(_callback.get());162 osgUtil::TransformCallback* tc = dynamic_cast<osgUtil::TransformCallback*>(_callback.get());163 ss3d::AnimationMaterialCallback* amc = dynamic_cast<ss3d::AnimationMaterialCallback*>(_callback.get());164 if (apc)165 {161 osg::AnimationPathCallback* apc = dynamic_cast<osg::AnimationPathCallback*>(_callback.get()); 162 osgUtil::TransformCallback* tc = dynamic_cast<osgUtil::TransformCallback*>(_callback.get()); 163 ss3d::AnimationMaterialCallback* amc = dynamic_cast<ss3d::AnimationMaterialCallback*>(_callback.get()); 164 if (apc) 165 { 166 166 apc->reset(); 167 167 apc->update(*_node); 168 }169 if (tc)170 {171 }172 if (amc)173 {168 } 169 if (tc) 170 { 171 } 172 if (amc) 173 { 174 174 amc->reset(); 175 175 amc->update(*_node); 176 }176 } 177 177 } 178 178 … … 221 221 int result = system(itr->c_str()); 222 222 223 osg::notify(osg::INFO)<<"system("<<*itr<<") result "<<result<<std::endl;223 osg::notify(osg::INFO)<<"system("<<*itr<<") result "<<result<<std::endl; 224 224 225 225 double timeForRun = osg::Timer::instance()->delta_s(startTick, osg::Timer::instance()->tick()); … … 267 267 osg::NodeVisitor(tm), 268 268 _operatorList(operatorList) {} 269 270 void apply(osg::Node& node) 271 { 272 if (node.getStateSet()) process(node.getStateSet());273 274 if (node.getUpdateCallback())275 {269 270 void apply(osg::Node& node) 271 { 272 if (node.getStateSet()) process(node.getStateSet()); 273 274 if (node.getUpdateCallback()) 275 { 276 276 _operatorList.insert(new CallbackOperator(&node, node.getUpdateCallback())); 277 }277 } 278 278 279 279 LayerAttributes* la = dynamic_cast<LayerAttributes*>(node.getUserData()); … … 282 282 _operatorList.insert(new LayerAttributesOperator(&node, la)); 283 283 } 284 284 285 285 traverse(node); 286 286 } … … 289 289 { 290 290 apply((osg::Node&)node); 291 292 291 for(unsigned int i=0;i<node.getNumDrawables();++i) 293 292 { … … 309 308 } 310 309 } 311 } 312 310 } 311 313 312 ActiveOperators::OperatorList& _operatorList; 314 313 };
