Changeset 2736 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 06/04/08 11:13:41 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2730 r2736 377 377 im.save(qstr, "PNG"); 378 378 379 if ( 0)379 if (1) 380 380 { 381 381 /////////// … … 391 391 392 392 KdNode::NewMail2(); 393 //Intersectable::NewMail();394 393 395 394 ++ mCurrentFrame; 396 395 397 396 // render pvs once 398 RenderPvs(pvs); 397 //RenderPvs(pvs); 398 _RenderColoredPvs(pvs); 399 399 // hack for gvs visualization 400 400 //RenderTrianglePvs(); … … 405 405 406 406 im = toImage(); 407 sprintf_s(filename, "error-frame-%0 4d-%04d-%08d-pvs.png", mFrame, viewcell->GetId(), pixelCount);407 sprintf_s(filename, "error-frame-%05d-%05d-%08d-pvs.png", viewcell->GetId(), mFrame, pixelCount); 408 408 str = mSnapPrefix + filename; 409 409 qstr = str.c_str(); … … 713 713 _RenderPvs(); 714 714 else 715 _RenderColoredPvs( );715 _RenderColoredPvs(mPvsCache.mPvs); 716 716 } 717 717 … … 2634 2634 2635 2635 2636 void QtGlRendererWidget::_RenderColoredPvs()2637 {2638 // note: could be done more efficiently using color buffers2639 mPvsSize = mPvsCache.mPvs.GetSize();2640 2641 ObjectPvsIterator it = mPvsCache.mPvs.GetIterator();2642 2643 PvsData pvsData;2644 2645 while (it.HasMoreEntries())2646 {2647 Intersectable *obj = it.Next(pvsData);2648 2649 RgbColor color;2650 2651 //cerr << "sumpdf: " << pvsData.mSumPdf << endl;2652 if (mUseRandomColorPerPvsObject)2653 {2654 if (obj->Type() == Intersectable::KD_INTERSECTABLE)2655 {2656 KdIntersectable *kdint = static_cast<KdIntersectable *>(obj);2657 2658 if (kdint->mGenericIdx == -1)2659 {2660 kdint->mGenericIdx = (int)mColors.size();2661 mColors.push_back(RandomColor(0, 1));2662 }2663 color = mColors[kdint->mGenericIdx];2664 }2665 }2666 else2667 {2668 color = RainbowColorMapping(mTransferFunction * log10(pvsData.mSumPdf + 1));2669 }2670 2671 glColor3f(color.r, color.g, color.b);2672 2673 mUseForcedColors = true;2674 RenderIntersectable(obj);2675 mUseForcedColors = false;2676 }2677 }2678 2679 2636 2680 2637 void QtGlRendererWidget::UpdateDynamicObjects() -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2730 r2736 239 239 int mCurrentPvsCost; 240 240 241 vector<RgbColor> mColors;242 243 241 bool mUseRandomColorPerPvsObject; 244 242 … … 590 588 */ 591 589 void _RenderPvs(); 592 /** Render pvs using false colors.593 */594 void _RenderColoredPvs();595 590 596 591 float ComputeRenderCost(ViewCell *vc);
Note: See TracChangeset
for help on using the changeset viewer.