Changeset 1613 for GTP/trunk/Lib
- Timestamp:
- 10/11/06 23:54:56 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r1579 r1613 1715 1715 "true"); 1716 1716 1717 RegisterOption("Preprocessor.delayVisibilityComputation", 1718 optBool, 1719 "preprocessor_delay_computation=", 1720 "true"); 1721 1717 1722 RegisterOption("Preprocessor.pvsRenderErrorSamples", 1718 1723 optInt, -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.h
r1594 r1613 98 98 public: 99 99 100 101 100 static int sMailId; 101 static int sReservedMailboxes; 102 102 int mMailbox; 103 103 -
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r1608 r1613 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.2) on: út 10. X 22:38:4620063 # Generated by qmake (2.00a) (Qt 4.1.2) on: st 11. X 21:13:40 2006 4 4 # Project: preprocessor.pro 5 5 # Template: app -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1608 r1613 134 134 mPass(0), 135 135 mSceneGraph(NULL), 136 mRayCaster(NULL) 136 mRayCaster(NULL), 137 mStopComputation(false) 137 138 { 138 139 Environment::GetSingleton()->GetBoolValue("Preprocessor.useGlRenderer", mUseGlRenderer); … … 141 142 renderer = NULL; 142 143 144 Environment::GetSingleton()->GetBoolValue("Preprocessor.delayVisibilityComputation", 145 mDelayVisibilityComputation); 146 143 147 Environment::GetSingleton()->GetBoolValue("Preprocessor.useGlDebugger", mUseGlDebugger); 144 148 Environment::GetSingleton()->GetBoolValue("Preprocessor.loadMeshes", mLoadMeshes); -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r1564 r1613 202 202 203 203 int mPass; 204 204 205 bool mDelayVisibilityComputation; 206 bool mStopComputation; 207 205 208 protected: 206 209 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer.cpp
r1608 r1613 13 13 #include "RssTree.h" 14 14 #include "Trackball.h" 15 #include "QtPreprocessorThread.h" 15 16 16 17 … … 1253 1254 if (mShowRays) { 1254 1255 RssPreprocessor *p = (RssPreprocessor *)mViewCellsManager->GetPreprocessor(); 1255 VssRayContainer rays; 1256 p->mRssTree->CollectRays(rays, 10000); 1257 RenderRays(rays); 1256 if (p->mRssTree) { 1257 VssRayContainer rays; 1258 p->mRssTree->CollectRays(rays, 10000); 1259 RenderRays(rays); 1260 } 1258 1261 } 1259 1262 … … 1365 1368 GlRendererWidget(sceneGraph, viewcells, tree), QGLWidget(parent, shareWidget, f) 1366 1369 { 1370 mPreprocessorThread = NULL; 1367 1371 mTopView = false; 1368 1372 mRenderViewCells = false; … … 1396 1400 1397 1401 connect(mControlWidget, SIGNAL(SetViewCellGranularity(int)), this, SLOT(SetViewCellGranularity(int))); 1402 connect(mControlWidget, SIGNAL(UpdateAllPvs()), this, SLOT(UpdateAllPvs())); 1403 connect(mControlWidget, SIGNAL(ComputeVisibility()), this, SLOT(ComputeVisibility())); 1404 connect(mControlWidget, SIGNAL(StopComputation()), this, SLOT(StopComputation())); 1405 1398 1406 connect(mControlWidget, SIGNAL(SetSceneCut(int)), this, SLOT(SetSceneCut(int))); 1399 1407 connect(mControlWidget, SIGNAL(SetTopDistance(int)), this, SLOT(SetTopDistance(int))); … … 1424 1432 resize(1000, 500); 1425 1433 mControlWidget->show(); 1434 } 1435 1436 void 1437 QtGlRendererWidget::UpdateAllPvs() 1438 { 1439 // $$ does not work so far:( 1440 mViewCellsManager->UpdatePvsForEvaluation(); 1441 // mViewCellsManager->FinalizeViewCells(false); 1442 } 1443 1444 void 1445 QtGlRendererWidget::ComputeVisibility() 1446 { 1447 cerr<<"Compute Visibility called!\n"<<endl; 1448 if (!mPreprocessorThread->isRunning()) 1449 mPreprocessorThread->RunThread(); 1450 } 1451 1452 void 1453 QtGlRendererWidget::StopComputation() 1454 { 1455 cerr<<"stop computation called!\n"<<endl; 1456 mViewCellsManager->GetPreprocessor()->mStopComputation = true; 1426 1457 } 1427 1458 … … 1763 1794 QLabel *label = new QLabel("Granularity"); 1764 1795 vbox->layout()->addWidget(label); 1765 1796 1766 1797 QSlider *slider = new QSlider(Qt::Horizontal, vbox); 1767 1798 vl->addWidget(slider); … … 1771 1802 slider->setValue(200); 1772 1803 1804 1773 1805 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetViewCellGranularity(int))); 1774 1806 1807 { 1808 QPushButton *button = new QPushButton("Update all PVSs", vbox); 1809 vbox->layout()->addWidget(button); 1810 connect(button, SIGNAL(clicked()), SLOT(UpdateAllPvs())); 1811 } 1812 1813 1775 1814 label = new QLabel("Filter size"); 1776 1815 vbox->layout()->addWidget(label); … … 1910 1949 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetTopView(bool))); 1911 1950 1951 1952 1912 1953 vbox = new QGroupBox("PVS Errors", this); 1913 1954 layout()->addWidget(vbox); 1914 1955 1915 1956 vl = new QVBoxLayout; 1916 1957 vbox->setLayout(vl); 1917 1958 1918 mPvsErrorWidget = new QListWidget(vbox); 1919 vbox->layout()->addWidget(mPvsErrorWidget); 1920 1921 connect(mPvsErrorWidget, 1922 SIGNAL(doubleClicked(const QModelIndex &)), 1923 this, 1924 SLOT(PvsErrorClicked(const QModelIndex &))); 1925 1926 QPushButton *button = new QPushButton("Next Error Frame", vbox); 1959 QPushButton *button = new QPushButton("Compute Visibility", vbox); 1927 1960 vbox->layout()->addWidget(button); 1928 connect(button, SIGNAL(clicked(void)), SLOT(FocusNextPvsErrorFrame(void))); 1929 1961 connect(button, SIGNAL(clicked()), SLOT(ComputeVisibility())); 1962 1963 button = new QPushButton("Stop Computation", vbox); 1964 vbox->layout()->addWidget(button); 1965 connect(button, SIGNAL(clicked()), SLOT(StopComputation())); 1966 1967 1968 if (0) { 1969 vbox = new QGroupBox("PVS Errors", this); 1970 layout()->addWidget(vbox); 1971 1972 vl = new QVBoxLayout; 1973 vbox->setLayout(vl); 1974 1975 mPvsErrorWidget = new QListWidget(vbox); 1976 vbox->layout()->addWidget(mPvsErrorWidget); 1977 1978 connect(mPvsErrorWidget, 1979 SIGNAL(doubleClicked(const QModelIndex &)), 1980 this, 1981 SLOT(PvsErrorClicked(const QModelIndex &))); 1982 1983 QPushButton *button = new QPushButton("Next Error Frame", vbox); 1984 vbox->layout()->addWidget(button); 1985 connect(button, SIGNAL(clicked(void)), SLOT(FocusNextPvsErrorFrame(void))); 1986 } 1987 1930 1988 setWindowTitle("Preprocessor Control Widget"); 1931 1989 adjustSize(); 1932 1990 } 1991 1933 1992 1934 1993 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer.h
r1594 r1613 13 13 #include "GlRenderer.h" 14 14 #include "Beam.h" 15 15 #include "QtPreprocessorThread.h" 16 16 class QWidget; 17 //class QtPreprocessorThread; 17 18 18 19 namespace GtpVisibilityPreprocessor { … … 143 144 144 145 signals: 145 146 147 void ComputeVisibility(); 148 void StopComputation(); 149 void UpdateAllPvs(); 146 150 void SetViewCellGranularity(int); 147 151 void SetSceneCut(int); … … 202 206 203 207 QtRendererControlWidget *mControlWidget; 208 209 QtPreprocessorThread *mPreprocessorThread; 204 210 205 211 QtGlRendererWidget(SceneGraph *sceneGraph, … … 211 217 QtGlRendererWidget() {}; 212 218 219 void SetThread(QtPreprocessorThread *t) { 220 mPreprocessorThread = t; 221 } 213 222 void 214 223 RenderRenderCost(); … … 263 272 264 273 public slots: 274 275 void UpdateAllPvs(); 276 void ComputeVisibility(); 277 void StopComputation(); 265 278 266 279 void SetRenderErrors(bool b) { -
GTP/trunk/Lib/Vis/Preprocessing/src/QtPreprocessorThread.h
r1457 r1613 10 10 class Preprocessor; 11 11 12 class QtPreprocessorThread : public PreprocessorThread, QThread12 class QtPreprocessorThread : public PreprocessorThread, public QThread 13 13 { 14 14 public: -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r1585 r1613 627 627 628 628 // now evaluate the ratios for the next pass 629 #define TIMES 1 630 631 #if TIMES 632 ratios[0] = sqr(contributions[0]/times[0]); 633 ratios[1] = sqr(contributions[1]/times[1]); 634 ratios[2] = sqr(contributions[2]/times[2]); 635 #else 636 ratios[0] = sqr(contributions[0]/nrays[0]); 637 ratios[1] = sqr(contributions[1]/nrays[1]); 638 ratios[2] = sqr(contributions[2]/nrays[2]); 639 #endif 640 NormalizeRatios(ratios); 629 #define TIME_WEIGHT 0.5f 630 631 ratios[0] = sqr(contributions[0]/(TIME_WEIGHT*times[0] + (1 - TIME_WEIGHT)*nrays[0])); 632 ratios[1] = sqr(contributions[1]/(TIME_WEIGHT*times[1] + (1 - TIME_WEIGHT)*nrays[1])); 633 ratios[2] = sqr(contributions[2]/(TIME_WEIGHT*times[2] + (1 - TIME_WEIGHT)*nrays[2])); 634 635 NormalizeRatios(ratios); 641 636 642 637 cout<<"New ratios: "<<ratios[0]<<" "<<ratios[1]<<" "<<ratios[2]<<endl; … … 772 767 if (totalSamples >= mRssSamples + mInitialSamples) 773 768 break; 774 769 775 770 776 771 rssPass++; 777 772 mPass++; 778 773 mRssTree->SetPass(mPass); 774 775 779 776 } 780 777 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1608 r1613 30 30 31 31 // $$JB HACK 32 #define USE_KD_PVS 033 #define KD_PVS_AREA 1e- 4f32 #define USE_KD_PVS 1 33 #define KD_PVS_AREA 1e-3f 34 34 35 35 namespace GtpVisibilityPreprocessor { … … 230 230 } 231 231 } 232 232 233 233 234 -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r1608 r1613 7 7 8 8 #filename ../data/arena/export.obj 9 10 9 # filename ../data/City4M/City4M.obj 11 10 # filename ../data/CityModel/CityModel.obj … … 15 14 # filename ../data/vienna/vienna-simple.x3d 16 15 # filename ../data/vienna/vienna-buildings.x3d 17 # filename ../data/vienna/city1500_flat_1.x3d18 #filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d19 20 # 16 #filename ../data/vienna/city1500_flat_1.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d 17 filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d 18 19 #;../data/vienna/vienna-plane.x3d; 21 20 # filename ../data/vienna/viewcells-25-sel.x3d 22 21 #filename ../data/atlanta/atlanta2.x3d 23 filename ../data/soda/soda.dat22 # filename ../data/soda/soda.dat 24 23 #filename ../data/test1/test2.x3d 25 24 #filename ../data/soda/soda5.dat … … 35 34 36 35 Preprocessor { 36 delayVisibilityComputation false 37 37 # stored sample rays 38 38 samplesFilename rays.out … … 79 79 samplesPerPass 1000 80 80 initialSamples 1000000 81 vssSamples 1000000082 vssSamplesPerPass 100000081 vssSamples 20000000 82 vssSamplesPerPass 500000 83 83 useImportanceSampling true 84 84 … … 148 148 minCost 4 149 149 maxDepth 30 150 maxCostRatio 1. 0150 maxCostRatio 1.1 151 151 ct_div_ci 0.5 152 maxNodes 300000152 maxNodes 500000 153 153 #500000 154 154 } … … 192 192 #type vspKdTree 193 193 #type bspTree 194 type vspBspTree195 #type vspOspTree194 #type vspBspTree 195 type vspOspTree 196 196 #type sceneDependent 197 197 … … 260 260 # filename ../data/soda/soda5-viewcells.xml 261 261 # filename ../scripts/viewcells_atlanta.xml 262 filename ../data/soda/soda-viewcells-5000.xml262 # filename ../data/soda/soda-viewcells-5000.xml 263 263 # filename ../data/test1/test-viewcells.xml 264 264 … … 280 280 # filename ../data/vienna/vienna_simple-21-04-avs2-viewCells.xml 281 281 # filename ../data/vienna/vienna-viewcells-5000.xml 282 #filename ../data/vienna/vienna-viewcells-1000.xml.zip282 filename ../data/vienna/vienna-viewcells-1000.xml.zip 283 283 # filename ../data/vienna/vsposp-seq-viewCells.xml.gz 284 284 … … 383 383 } 384 384 385 386 385 # random polygon = 1 387 386 # axis aligned = 2 -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1595 r1613 197 197 #if USE_THREADS 198 198 pt->InitThread(); 199 pt->RunThread(); 199 if (!preprocessor->mDelayVisibilityComputation) 200 pt->RunThread(); 200 201 #endif 201 202 … … 217 218 preprocessor->mViewCellsManager, 218 219 preprocessor->mKdTree); 219 220 221 ((QtGlRendererWidget *)rendererWidget)->SetThread((QtPreprocessorThread *)pt); 220 222 rendererWidget->Show(); 221 223 guiSupported = true;
Note: See TracChangeset
for help on using the changeset viewer.