Changeset 867
- Timestamp:
- 08/01/07 17:19:11 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/fcptr_stable_jun07/Source/System/Statistics/Foregrounds/OSGPerfMonitorForeground.cpp
r858 r867 209 209 if(NULL == _face) 210 210 { 211 initText(getFamily(), 10); //getSize()); 211 initText(getFamily(), 10); //getSize()); 212 212 } 213 213 … … 343 343 Real32 panelWidth = textBlockWidth + chartBlockWidth + size + (getTextMargin().x() * 2.0f); 344 344 Real32 panelHeight = textBlockHeight + + size + (getTextMargin().y() * 2.0f); 345 // XXX: Todo, make it auto-scale to some limit based on a setting 346 //Real32 surfaceWidth = panelHeight * vpAspectRatio; //vpWidth; 347 //Real32 surfaceHeight = panelHeight; //vpHeight; 348 Real32 surfaceWidth = vpWidth; 349 Real32 surfaceHeight = vpHeight; 345 346 // Scale the size of the virtual surfaced based on what can fit 347 float surf_mult(1.0); 348 if (panelHeight > vpHeight) 349 { surf_mult = (panelHeight/vpHeight); } 350 351 Real32 surfaceWidth = vpWidth * surf_mult; 352 Real32 surfaceHeight = vpHeight * surf_mult; 350 353 351 354 // ---- SETUP THE VIRTUAL VIEWPORT ---- // branches/fcptr_stable_jun07/Source/System/Statistics/Foregrounds/testPerfMonitorForeground.cpp
r858 r867 187 187 } 188 188 189 void recursiveFunc(unsigned depth= 0)189 void recursiveFunc(unsigned depth=3) 190 190 { 191 191 PerfMonitorGuard g("recursiveFunc"); 192 192 193 if (depth >= 3) 193 //osgSleep(10); 194 //std::cout << "depth: " << depth << std::endl; 195 196 if (depth == 0) 194 197 { return; } 195 196 osgSleep(10);198 else 199 { recursiveFunc(depth-1); } 197 200 } 198 201 … … 210 213 PerfMonitorGuard g("doStuff"); 211 214 212 recursiveFunc();213 215 { 214 216 PerfMonitorGuard g("Work1"); 217 recursiveFunc(); 215 218 randWork(unsigned(10.0*x), 1, "10*x"); 216 219 randWork(unsigned(10.0*(1.0-x)), 1, "10*(1-x)"); 217 220 } 218 221 219 /*220 recursiveFunc();221 222 { 222 223 PerfMonitorGuard g("Work2"); 223 r andWork(unsigned(400.0*x), 1, "400*x");224 randWork( 5, 30, "5-30");225 }226 227 recursiveFunc();224 recursiveFunc(); 225 randWork(unsigned(5.0*x), 1, "5x-1"); 226 randWork(2, 10, "2-10"); 227 } 228 228 229 { 229 230 PerfMonitorGuard g("Work3"); 230 randWork( 5, unsigned(30.0*x), "5-30x"); 231 randWork(10, 0, "10"); 232 } 233 */ 234 } 231 recursiveFunc(); 232 randWork( 1, unsigned(5.0*x), "1-5x"); 233 randWork(2, 0, "2-0"); 234 } 235 236 { 237 PerfMonitorGuard g("Work4"); 238 recursiveFunc(3); 239 } 240 241 { 242 PerfMonitorGuard g("Work5"); 243 recursiveFunc(3); 244 } 245 246 { 247 PerfMonitorGuard g("Work6"); 248 recursiveFunc(3); 249 } 250 251 { 252 PerfMonitorGuard g("Work7"); 253 recursiveFunc(3); 254 } 255 }
