Changeset 2702 for GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
- Timestamp:
- 05/23/08 17:47:22 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2697 r2702 551 551 glPopMatrix(); 552 552 553 if ( 1)554 { 555 // testthe box of the object553 if (0) 554 { 555 // render the box of the object 556 556 AxisAlignedBox3 box = leaf->GetBox(); 557 557 RenderBox(box); … … 590 590 Intersectable::NewMail(); 591 591 592 #if DYNAMIC_OBJECTS_HACK593 592 Preprocessor *p = mViewCellsManager->GetPreprocessor(); 594 593 // handle dynamic objects … … 599 598 _RenderDynamicObject(*dit); 600 599 } 601 #endif 600 602 601 _RenderSceneTrianglesWithDrawArrays(); 603 602 … … 606 605 607 606 608 void 609 GlRendererBuffer::EvalQueryWithItemBuffer() 610 { 611 // read back the texture 612 glReadPixels(0, 0, 613 GetWidth(), GetHeight(), 614 GL_RGBA, 615 GL_UNSIGNED_BYTE, 616 mPixelBuffer); 617 618 619 unsigned int *p = mPixelBuffer; 620 621 for (int y = 0; y < GetHeight(); y++) 622 { 623 for (int x = 0; x < GetWidth(); x++, p++) 624 { 625 unsigned int id = (*p) & 0xFFFFFF; 626 627 if (id != 0xFFFFFF) 628 { 629 ++ mObjects[id]->mCounter; 630 } 631 } 632 } 633 } 634 607 608 Preprocessor *GlRenderer::GetPreprocessor() 609 { 610 return mViewCellsManager->GetPreprocessor(); 611 } 635 612 636 613 … … 648 625 mPixelBuffer = NULL; 649 626 // implement width and height in subclasses 627 } 628 629 630 void 631 GlRendererBuffer::EvalQueryWithItemBuffer() 632 { 633 // read back the texture 634 glReadPixels(0, 0, 635 GetWidth(), GetHeight(), 636 GL_RGBA, 637 GL_UNSIGNED_BYTE, 638 mPixelBuffer); 639 640 641 unsigned int *p = mPixelBuffer; 642 643 for (int y = 0; y < GetHeight(); y++) 644 { 645 for (int x = 0; x < GetWidth(); x++, p++) 646 { 647 unsigned int id = (*p) & 0xFFFFFF; 648 649 if (id != 0xFFFFFF) 650 { 651 ++ mObjects[id]->mCounter; 652 } 653 } 654 } 650 655 } 651 656
Note: See TracChangeset
for help on using the changeset viewer.