Changeset 713 for GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
- Timestamp:
- 03/22/06 14:15:07 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r685 r713 301 301 302 302 float 303 GlRendererBuffer::GetPixelError( )303 GlRendererBuffer::GetPixelError(int &pvsSize) 304 304 { 305 305 float pErrorPixels = -1.0f; 306 306 307 307 glReadBuffer(GL_BACK); 308 308 … … 351 351 352 352 353 ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 354 353 ViewCell *viewcell = NULL; 354 355 PrVs prvs; 356 // mViewCellsManager->SetMaxFilterSize(1); 357 mViewCellsManager->GetPrVS(mViewPoint, prvs); 358 viewcell = prvs.mViewCell; 359 360 // ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 361 pvsSize = 0; 355 362 if (viewcell) { 356 363 SetupCamera(); … … 363 370 PvsData<Intersectable *>, 364 371 LtSample<Intersectable *> >::const_iterator it = viewcell->GetPvs().mEntries.begin(); 372 373 pvsSize = viewcell->GetPvs().mEntries.size(); 365 374 366 375 for (; it != viewcell->GetPvs().mEntries.end(); ++ it) { … … 436 445 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 437 446 } 447 448 if (viewcell) 449 mViewCellsManager->DeleteLocalMergeTree(viewcell); 438 450 439 451 return pErrorPixels; … … 487 499 RenderIntersectable(*oi); 488 500 489 ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 501 ViewCell *viewcell; 502 // viewcell = mViewCellsManager->GetViewCell(mViewPoint); 503 504 PrVs prvs; 505 // mViewCellsManager->SetMaxFilterSize(1); 506 mViewCellsManager->GetPrVS(mViewPoint, prvs); 507 viewcell = prvs.mViewCell; 490 508 491 509 QImage im1, im2; … … 587 605 glDisable(GL_CLIP_PLANE0); 588 606 607 if (viewcell) 608 mViewCellsManager->DeleteLocalMergeTree(viewcell); 609 589 610 return pErrorPixels; 590 611 } … … 615 636 { 616 637 for (int i=0; i < mPvsStatFrames; i++) { 617 mPvsErrorBuffer[i] = 1.0f;638 mPvsErrorBuffer[i].mError = 1.0f; 618 639 } 619 640 } … … 646 667 } 647 668 #endif 648 if (mPvsErrorBuffer[i] > 0.0f) { 649 mPvsErrorBuffer[i] = GetPixelError(); 650 cout<<"("<<i<<","<<mPvsErrorBuffer[i]<<")"; 669 if (mPvsErrorBuffer[i].mError > 0.0f) { 670 int pvsSize; 671 float error = GetPixelError(pvsSize); 672 mPvsErrorBuffer[i].mError = error; 673 mPvsErrorBuffer[i].mPvsSize = pvsSize; 674 675 cout<<"("<<i<<","<<mPvsErrorBuffer[i].mError<<")"; 651 676 // swapBuffers(); 652 677 } 653 678 654 err = mPvsErrorBuffer[i] ;679 err = mPvsErrorBuffer[i].mError; 655 680 656 681 if (err >= 0.0f) { … … 658 683 mPvsStat.maxError = err; 659 684 mPvsStat.sumError += err; 685 mPvsStat.sumPvsSize += mPvsErrorBuffer[i].mPvsSize; 686 660 687 if (err == 0.0f) 661 688 mPvsStat.errorFreeFrames++; … … 820 847 vl = new QVBoxLayout; 821 848 vbox->setLayout(vl); 822 849 850 QLabel *label = new QLabel("Granularity"); 851 vbox->layout()->addWidget(label); 852 823 853 QSlider *slider = new QSlider(Qt::Horizontal, vbox); 824 854 vl->addWidget(slider); 825 855 slider->show(); 826 slider->setRange(1, 5000);856 slider->setRange(1, 200); 827 857 slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 828 slider->setValue( 500);858 slider->setValue(200); 829 859 830 860 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetViewCellGranularity(int))); 861 862 label = new QLabel("Filter size"); 863 vbox->layout()->addWidget(label); 864 865 slider = new QSlider(Qt::Horizontal, vbox); 866 vbox->layout()->addWidget(slider); 867 slider->show(); 868 slider->setRange(1, 100); 869 slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 870 slider->setValue(3); 871 872 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetVisibilityFilterSize(int))); 831 873 832 874 … … 881 923 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetTopDistance(int))); 882 924 925 926 927 883 928 cb = new QCheckBox("Top View", vbox); 884 929 vbox->layout()->addWidget(cb); … … 886 931 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetTopView(bool))); 887 932 888 933 setWindowTitle("Preprocessor Control Widget"); 889 934 adjustSize(); 890 935 } … … 910 955 connect(cw, SIGNAL(SetSceneCut(int)), this, SLOT(SetSceneCut(int))); 911 956 connect(cw, SIGNAL(SetTopDistance(int)), this, SLOT(SetTopDistance(int))); 957 958 //connect(cw, SIGNAL(SetViewCellGranularity(int)), this, SLOT(SetMaxFilterSize(int))); 959 // connect(cw, SIGNAL(SetVisibilityFilterSize(int)), this, SLOT(SetVisibilityFilterSize(int))); 960 //connect(cw, SIGNAL(SetVisibilityFilterSize(int)), this, SLOT(SetViewCellGranularity(int))); 961 912 962 connect(cw, SIGNAL(SetShowViewCells(bool)), this, SLOT(SetShowViewCells(bool))); 913 963 connect(cw, SIGNAL(SetTopView(bool)), this, SLOT(SetTopView(bool))); … … 921 971 GlRendererWidget::SetViewCellGranularity(int number) 922 972 { 923 mViewCellsManager->CollectViewCells(number); 973 if (mViewCellsManager) 974 mViewCellsManager->SetMaxFilterSize(number); 975 // mViewCellsManager->CollectViewCells(number); 976 updateGL(); 977 } 978 979 void 980 GlRendererWidget::SetVisibilityFilterSize(int number) 981 { 982 if (mViewCellsManager) 983 mViewCellsManager->SetMaxFilterSize(number); 924 984 updateGL(); 925 985 }
Note: See TracChangeset
for help on using the changeset viewer.