Changeset 13041 for OpenSceneGraph/trunk/include/osgAnimation/StatsHandler
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgAnimation/StatsHandler
r12139 r13041 1 /* -*-c++-*- 1 /* -*-c++-*- 2 2 * Copyright (C) 2009 Cedric Pinson <mornifle@plopbyte.net> 3 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 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 6 * (at your option) any later version. The full license is in LICENSE file 7 7 * included with this distribution, and on the openscenegraph.org website. 8 * 8 * 9 9 * This library is distributed in the hope that it will be useful, 10 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 12 * OpenSceneGraph Public License for more details. 13 13 */ … … 27 27 struct StatAction 28 28 { 29 29 30 30 std::string _name; 31 31 osg::ref_ptr<osg::Group> _group; … … 42 42 43 43 /** Event handler for adding on screen stats reporting to Viewers.*/ 44 class OSGANIMATION_EXPORT StatsHandler : public osgGA::GUIEventHandler 44 class OSGANIMATION_EXPORT StatsHandler : public osgGA::GUIEventHandler 45 45 { 46 public: 46 public: 47 47 48 48 StatsHandler(); … … 54 54 LAST = 2 55 55 }; 56 56 57 57 void setKeyEventTogglesOnScreenStats(int key) { _keyEventTogglesOnScreenStats = key; } 58 58 int getKeyEventTogglesOnScreenStats() const { return _keyEventTogglesOnScreenStats; } 59 59 60 60 void setKeyEventPrintsOutStats(int key) { _keyEventPrintsOutStats = key; } 61 61 int getKeyEventPrintsOutStats() const { return _keyEventPrintsOutStats; } … … 84 84 85 85 osg::Geometry* createTick(const osg::Vec3& pos, float height, const osg::Vec4& colour, unsigned int numTicks); 86 86 87 87 osg::Node* createCameraTimeStats(const std::string& font, osg::Vec3& pos, float startBlocks, bool acquireGPUStats, float characterSize, osg::Stats* viewerStats, osg::Camera* camera); 88 88 89 89 void setUpScene(osgViewer::Viewer* viewer); 90 90 91 91 int _keyEventTogglesOnScreenStats; 92 92 int _keyEventPrintsOutStats; … … 96 96 bool _initialized; 97 97 osg::ref_ptr<osg::Camera> _camera; 98 98 99 99 osg::ref_ptr<osg::Switch> _switch; 100 100 osg::ref_ptr<osg::Group> _group; 101 101 102 102 unsigned int _frameRateChildNum; 103 103 unsigned int _numBlocks; 104 104 double _blockMultiplier; 105 105 106 106 float _statsWidth; 107 107 float _statsHeight;
