- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgViewer/ViewerEventHandlers
r12950 r13041 109 109 virtual void getUsage(osg::ApplicationUsage& usage) const; 110 110 111 /** This allows the user to register additional stats lines that will 111 /** This allows the user to register additional stats lines that will 112 112 be added to the graph. The stats for these will be gotten from the 113 viewer (viewer->getViewerStats()). The stats can be displayed in 113 viewer (viewer->getViewerStats()). The stats can be displayed in 114 114 either or all of the following ways: 115 115 116 116 - A numeric time beside the stat name 117 Requires that an elapsed time be recorded in the viewer's stats 117 Requires that an elapsed time be recorded in the viewer's stats 118 118 for the "timeTakenName". 119 119 - A bar in the top bar graph 120 Requires that two times (relative to the viewer's start tick) be 121 recorded in the viewer's stats for the "beginTimeName" and 120 Requires that two times (relative to the viewer's start tick) be 121 recorded in the viewer's stats for the "beginTimeName" and 122 122 "endTimeName". 123 123 - A line in the bottom graph 124 Requires that an elapsed time be recorded in the viewer's stats 124 Requires that an elapsed time be recorded in the viewer's stats 125 125 for the "timeTakenName" and that the value be used as an average. 126 126 127 If you don't want a numeric value and a line in the bottom line 128 graph for your value, pass the empty string for timeTakenName. If 129 you don't want a bar in the graph, pass the empty string for 127 If you don't want a numeric value and a line in the bottom line 128 graph for your value, pass the empty string for timeTakenName. If 129 you don't want a bar in the graph, pass the empty string for 130 130 beginTimeName and endTimeName. 131 131 … … 141 141 @param maxValue The value to use as maximum in the bottom line graph. Stats will be clamped between 0 and that value, and it will be the highest visible value in the graph. 142 142 */ 143 void addUserStatsLine(const std::string& label, const osg::Vec4& textColor, const osg::Vec4& barColor, 144 const std::string& timeTakenName, float multiplier, bool average, bool averageInInverseSpace, 143 void addUserStatsLine(const std::string& label, const osg::Vec4& textColor, const osg::Vec4& barColor, 144 const std::string& timeTakenName, float multiplier, bool average, bool averageInInverseSpace, 145 145 const std::string& beginTimeName, const std::string& endTimeName, float maxValue); 146 146 … … 160 160 osg::Geometry* createTick(const osg::Vec3& pos, float height, const osg::Vec4& colour, unsigned int numTicks); 161 161 162 void createTimeStatsLine(const std::string& lineLabel, osg::Vec3 pos, 163 const osg::Vec4& textColor, const osg::Vec4& barColor, osg::Stats* viewerStats, osg::Stats* stats, 164 const std::string& timeTakenName, float multiplier, bool average, bool averageInInverseSpace, 162 void createTimeStatsLine(const std::string& lineLabel, osg::Vec3 pos, 163 const osg::Vec4& textColor, const osg::Vec4& barColor, osg::Stats* viewerStats, osg::Stats* stats, 164 const std::string& timeTakenName, float multiplier, bool average, bool averageInInverseSpace, 165 165 const std::string& beginTimeName, const std::string& endTimeName); 166 166 … … 216 216 float maxValue; 217 217 218 UserStatsLine(const std::string& label_, const osg::Vec4& textColor_, const osg::Vec4& barColor_, 219 const std::string& timeTakenName_, float multiplier_, bool average_, bool averageInInverseSpace_, 218 UserStatsLine(const std::string& label_, const osg::Vec4& textColor_, const osg::Vec4& barColor_, 219 const std::string& timeTakenName_, float multiplier_, bool average_, bool averageInInverseSpace_, 220 220 const std::string& beginTimeName_, const std::string& endTimeName_, float maxValue_) 221 : label(label_), textColor(textColor_), barColor(barColor_), 222 timeTakenName(timeTakenName_), multiplier(multiplier_), average(average_), averageInInverseSpace(averageInInverseSpace_), 221 : label(label_), textColor(textColor_), barColor(barColor_), 222 timeTakenName(timeTakenName_), multiplier(multiplier_), average(average_), averageInInverseSpace(averageInInverseSpace_), 223 223 beginTimeName(beginTimeName_), endTimeName(endTimeName_), maxValue(maxValue_) 224 224 {
