Changeset 342 for branches/Dirk_RenderTraversalWork/Source/System/Action/RenderTraversal/OSGRenderPartition.cpp
- Timestamp:
- 10/21/06 13:50:48 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Dirk_RenderTraversalWork/Source/System/Action/RenderTraversal/OSGRenderPartition.cpp
r285 r342 64 64 #include "OSGOcclusionCullingTreeBuilder.h" 65 65 66 #include "OSGGeoStatsAttachment.h" 67 66 68 OSG_USING_NAMESPACE 67 69 … … 174 176 _oStatistics ( ), 175 177 _uiNumMatrixChanges ( 0), 178 _uiNumTriangles ( 0), 176 179 _visibilityStack ( ), 177 180 … … 283 286 } 284 287 288 _uiNumTriangles = 0; 285 289 /* 286 290 static FrustumVolume empty; … … 385 389 386 390 _uiNumMatrixChanges = 0; 387 391 388 392 while(mapIt != mapEnd) 389 393 { … … 447 451 if(_eMode == SimpleCallback) 448 452 return; 453 449 454 RenderTraversalAction *rt = dynamic_cast<RenderTraversalAction *>(_oDrawEnv.getRTAction()); 450 455 456 NodePtr actNode = rt->getActNode(); 457 458 // Add Stats 459 GeoStatsAttachmentPtr st; 460 st = GeoStatsAttachment::get(actNode); 461 if(st == NullFC) 462 { 463 GeoStatsAttachment::addTo(actNode); 464 465 st = GeoStatsAttachment::get(actNode); 466 } 467 468 st->validate(); 469 470 _oStatistics.getElem(RenderTraversalAction::statNTriangles)-> 471 add(st->getTriangles()); 472 _uiNumTriangles += st->getTriangles(); 473 474 475 451 476 if(_bSortTrans == true && pState->isTransparent() == true) 452 477 { … … 475 500 Pnt3f objPos; 476 501 477 _oDrawEnv.getRTAction()->getActNode()->getVolume().getCenter(objPos);502 actNode->getVolume().getCenter(objPos); 478 503 479 504 _currMatrix.second.mult(objPos); 480 505 481 pNewElem->setNode (&* _oDrawEnv.getRTAction()->getActNode());506 pNewElem->setNode (&*actNode); 482 507 pNewElem->setFunctor ( func ); 483 508 pNewElem->setMatrixStore(_currMatrix); … … 528 553 529 554 DynamicVolume objVol; 530 objVol = _oDrawEnv.getRTAction()->getActNode()->getVolume();555 objVol = actNode->getVolume(); 531 556 Pnt3r min,max; 532 557 objVol.getBounds(min,max); … … 554 579 555 580 pNewElem->setVol ( objVol ); 556 pNewElem->setNode (&* _oDrawEnv.getRTAction()->getActNode());581 pNewElem->setNode (&*actNode); 557 582 558 583 pNewElem->setFunctor ( func ); … … 599 624 StateOverride *pOverride = NULL; 600 625 601 pNewElem->setNode (&* _oDrawEnv.getRTAction()->getActNode());626 pNewElem->setNode (&*actNode); 602 627 pNewElem->setFunctor (func ); 603 628 pNewElem->setMatrixStore(_currMatrix ); … … 665 690 return true; 666 691 667 _oStatistics.getElem(statCullTestedNodes)->inc(); 692 _oStatistics.getElem(statCullTestedNodes)->inc(); 693 _oDrawEnv.getRTAction()->getStatistics()->getElem(statCullTestedNodes)->inc(); 668 694 669 695 DynamicVolume vol; … … 682 708 683 709 _oStatistics.getElem(statCulledNodes)->inc(); 710 _oDrawEnv.getRTAction()->getStatistics()->getElem(statCulledNodes)->inc(); 684 711 685 712 // fprintf(stderr,"%p: node 0x%p invis\n", Thread::getCurrent(), node); … … 722 749 723 750 _oStatistics.getElem(statCullTestedNodes)->inc(); 751 _oDrawEnv.getRTAction()->getStatistics()->getElem(statCullTestedNodes)->inc(); 724 752 725 753 if(intersect(frustum, vol, inplanes) == false) … … 730 758 731 759 _oStatistics.getElem(statCulledNodes)->inc(); 760 _oDrawEnv.getRTAction()->getStatistics()->getElem(statCulledNodes)->inc(); 732 761 733 762 // fprintf(stderr,"node 0x%p invis %0xp\n", &(*pNode), this);
