StatsVisitor 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* -*-c++-*-
  2. * Copyright (C) 2009 Cedric Pinson <cedric.pinson@plopbyte.net>
  3. *
  4. * This library is open source and may be redistributed and/or modified under
  5. * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
  6. * (at your option) any later version. The full license is in LICENSE file
  7. * included with this distribution, and on the openscenegraph.org website.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * OpenSceneGraph Public License for more details.
  13. */
  14. #ifndef OSGANIMATION_STATSVISITOR_H
  15. #define OSGANIMATION_STATSVISITOR_H
  16. #include <osgAnimation/Export>
  17. #include <osgAnimation/ActionVisitor>
  18. #include <osg/Stats>
  19. #include <vector>
  20. namespace osgAnimation
  21. {
  22. class OSGANIMATION_EXPORT StatsActionVisitor : public osgAnimation::UpdateActionVisitor
  23. {
  24. protected:
  25. osg::ref_ptr<osg::Stats> _stats;
  26. std::vector<std::string> _channels;
  27. public:
  28. META_ActionVisitor(osgAnimation, StatsActionVisitor);
  29. StatsActionVisitor();
  30. StatsActionVisitor(osg::Stats* stats, unsigned int frame);
  31. void reset();
  32. const std::vector<std::string>& getChannels() const { return _channels; }
  33. osg::Stats* getStats() { return _stats.get(); }
  34. void setStats(osg::Stats* stats) { _stats = stats; }
  35. void setFrame(unsigned int frame) { _frame = frame; }
  36. void apply(Timeline& action);
  37. void apply(Action& action);
  38. void apply(ActionBlendIn& action);
  39. void apply(ActionBlendOut& action);
  40. void apply(ActionAnimation& action);
  41. void apply(ActionStripAnimation& action);
  42. };
  43. }
  44. #endif