Changeset 10671 for OpenSceneGraph/trunk/include/osg/StateAttribute
- Timestamp:
- 10/22/09 12:33:16 (4 years ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/StateAttribute (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/StateAttribute
r9599 r10671 17 17 #include <osg/Export> 18 18 #include <osg/Object> 19 #include <osg/StateAttributeCallback> 19 20 #include <osg/GL> 20 21 … … 191 192 192 193 StateAttribute(const StateAttribute& sa,const CopyOp& copyop=CopyOp::SHALLOW_COPY): 193 Object(sa,copyop) {} 194 Object(sa,copyop), 195 _updateCallback(copyop(sa._updateCallback.get())) 196 {} 194 197 195 198 … … 282 285 return true; 283 286 } 284 285 struct Callback : public virtual osg::Object 286 { 287 Callback() {} 288 289 Callback(const Callback&,const CopyOp&) {} 290 291 META_Object(osg,Callback); 292 293 /** do customized update code.*/ 294 virtual void operator () (StateAttribute*, NodeVisitor*) {} 295 }; 287 288 // provide callback for backwards compatibility. 289 typedef osg::StateAttributeCallback Callback; 296 290 297 291 /** Set the UpdateCallback which allows users to attach customize the updating of an object during the update traversal.*/ 298 void setUpdateCallback( Callback* uc);292 void setUpdateCallback(StateAttributeCallback* uc); 299 293 300 294 /** Get the non const UpdateCallback.*/ 301 Callback* getUpdateCallback() { return _updateCallback.get(); }295 StateAttributeCallback* getUpdateCallback() { return _updateCallback.get(); } 302 296 303 297 /** Get the const UpdateCallback.*/ 304 const Callback* getUpdateCallback() const { return _updateCallback.get(); }298 const StateAttributeCallback* getUpdateCallback() const { return _updateCallback.get(); } 305 299 306 300 307 301 /** Set the EventCallback which allows users to attach customize the updating of an object during the Event traversal.*/ 308 void setEventCallback( Callback* ec);302 void setEventCallback(StateAttributeCallback* ec); 309 303 310 304 /** Get the non const EventCallback.*/ 311 Callback* getEventCallback() { return _eventCallback.get(); }305 StateAttributeCallback* getEventCallback() { return _eventCallback.get(); } 312 306 313 307 /** Get the const EventCallback.*/ 314 const Callback* getEventCallback() const { return _eventCallback.get(); }308 const StateAttributeCallback* getEventCallback() const { return _eventCallback.get(); } 315 309 316 310 … … 344 338 friend class osg::StateSet; 345 339 346 ref_ptr< Callback> _updateCallback;347 ref_ptr< Callback> _eventCallback;340 ref_ptr<StateAttributeCallback> _updateCallback; 341 ref_ptr<StateAttributeCallback> _eventCallback; 348 342 }; 349 343
