Changeset 746 for GTP/trunk/Lib
- Timestamp:
- 04/11/06 15:33:37 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r744 r746 1272 1272 optFloat, 1273 1273 "view_cells_filter_width=", 1274 " 10.0");1274 "200.0"); 1275 1275 1276 1276 RegisterOption("ViewCells.loadFromFile", -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r713 r746 54 54 mWireFrame = false; 55 55 environment->GetBoolValue("Preprocessor.detectEmptyViewSpace", mDetectEmptyViewSpace); 56 mSnapErrorFrames = false;57 mSnapPrefix = " ";58 56 mSnapErrorFrames = true; 57 mSnapPrefix = "snap/"; 58 mUseForcedColors = false; 59 59 } 60 60 … … 162 162 int i = 0; 163 163 164 if (!mUseFalseColors )164 if (!mUseFalseColors && !mUseForcedColors) 165 165 SetupMaterial(mesh->mMaterial); 166 166 … … 202 202 wglGetProcAddress("glGetOcclusionQueryuivNV"); 203 203 204 glClearColor(0.0f, 0.0f, 0.0f, 1.0f); 205 204 205 206 #if 0 207 GLfloat mat_ambient[] = { 0.5, 0.5, 0.5, 1.0 }; 208 /* mat_specular and mat_shininess are NOT default values */ 209 GLfloat mat_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; 210 GLfloat mat_specular[] = { 0.3, 0.3, 0.3, 1.0 }; 211 GLfloat mat_shininess[] = { 1.0 }; 212 213 GLfloat light_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; 214 GLfloat light_diffuse[] = { 0.4, 0.4, 0.4, 1.0 }; 215 GLfloat light_specular[] = { 0.3, 0.3, 0.3, 1.0 }; 216 217 GLfloat lmodel_ambient[] = { 0.3, 0.3, 0.3, 1.0 }; 218 219 220 // default Material 221 glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); 222 glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); 223 glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); 224 glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); 225 226 // a light 227 glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); 228 glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); 229 glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); 230 231 glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient); 232 glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse); 233 glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular); 234 235 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); 236 237 glEnable(GL_LIGHTING); 238 glEnable(GL_LIGHT0); 239 glEnable(GL_LIGHT1); 240 241 242 // set position of the light 243 GLfloat infinite_light[] = { 1.0, 0.8, 1.0, 0.0 }; 244 glLightfv (GL_LIGHT0, GL_POSITION, infinite_light); 245 246 // set position of the light2 247 GLfloat infinite_light2[] = { -0.3, 1.5, 1.0, 0.0 }; 248 glLightfv (GL_LIGHT1, GL_POSITION, infinite_light2); 249 250 glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); 251 // glColorMaterial( GL_FRONT_AND_BACK, GL_SPECULAR); 252 glEnable(GL_COLOR_MATERIAL); 253 254 glShadeModel( GL_FLAT ); 255 256 glDepthFunc( GL_LESS ); 257 glEnable( GL_DEPTH_TEST ); 258 #endif 259 260 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); 261 262 glEnable( GL_NORMALIZE ); 263 264 glClearColor(0.0f, 0.0f, 1.0f, 1.0f); 206 265 } 207 266 … … 213 272 if (mViewCellsManager) 214 273 vc = mViewCellsManager->GetViewCells().size(); 215 s.sprintf("frame:%04d viewpoint:(%4.1f,%4.1f,%4.1f) dir:(%4.1f,%4.1f,%4.1f) viewcells:%04d", 274 int filter = 0; 275 if (mViewCellsManager) 276 filter = mViewCellsManager->GetMaxFilterSize(); 277 278 s.sprintf("frame:%04d viewpoint:(%4.1f,%4.1f,%4.1f) dir:(%4.1f,%4.1f,%4.1f) viewcells:%04d filter:%04d pvs:%04d error:%5.5f\%", 216 279 mFrame, 217 280 mViewPoint.x, … … 221 284 mViewDirection.y, 222 285 mViewDirection.z, 223 vc 286 vc, 287 288 filter, 289 mPvsSize, 290 mRenderError*100.0f 224 291 ); 292 293 glColor3f(0.0f,0.0f,0.0f); 225 294 renderText(0,20,s); 295 296 if (mShowRenderCost) { 297 static vector<float> costFunction; 298 static float maxCost = -1; 299 if (costFunction.size()==0) { 300 ViewCellsTree *tree = mViewCellsManager->GetViewCellsTree(); 301 if (tree) { 302 tree->GetCostFunction(costFunction); 303 maxCost = -1; 304 for (int i=0; i < costFunction.size(); i++) { 305 // cout<<i<<":"<<costFunction[i]<<" "; 306 if (costFunction[i] > maxCost) 307 maxCost = costFunction[i]; 308 } 309 } 310 } 311 312 313 int currentPos = mViewCellsManager->GetViewCells().size(); 314 float currentCost=-1; 315 316 if (currentPos < costFunction.size()) 317 currentCost = costFunction[currentPos]; 318 #if 0 319 cout<<"costFunction.size()="<<costFunction.size()<<endl; 320 cout<<"CP="<<currentPos<<endl; 321 cout<<"MC="<<maxCost<<endl; 322 cout<<"CC="<<currentCost<<endl; 323 #endif 324 if (costFunction.size()) { 325 glDisable(GL_DEPTH_TEST); 326 // init ortographic projection 327 glMatrixMode(GL_PROJECTION); 328 glPushMatrix(); 329 330 glLoadIdentity(); 331 gluOrtho2D(0, 1.0f, 0, 1.0f); 332 333 glTranslatef(0.1f, 0.1f, 0.0f); 334 glScalef(0.8f, 0.8f, 1.0f); 335 glMatrixMode(GL_MODELVIEW); 336 glLoadIdentity(); 337 338 glColor3f(1.0f,0,0); 339 glBegin(GL_LINE_STRIP); 340 // glVertex3f(0,0,0); 341 342 for (int i=0; i < costFunction.size(); i++) { 343 float x = i/(float)costFunction.size(); 344 float y = costFunction[i]/(maxCost*0.5f); 345 glVertex3f(x,y,0.0f); 346 } 347 glEnd(); 348 349 glColor3f(1.0f,0,0); 350 glBegin(GL_LINES); 351 float x = currentPos/(float)costFunction.size(); 352 glVertex3f(x,0.0,0.0f); 353 glVertex3f(x,1.0f,0.0f); 354 glEnd(); 355 356 glColor3f(0.0f,0,0); 357 // show a grid 358 glBegin(GL_LINE_LOOP); 359 glVertex3f(0,0,0.0f); 360 glVertex3f(1,0,0.0f); 361 glVertex3f(1,1,0.0f); 362 glVertex3f(0,1,0.0f); 363 glEnd(); 364 365 glBegin(GL_LINES); 366 for (int i=0; i < 50000 && i < costFunction.size(); i+=10000) { 367 float x = i/(float)costFunction.size(); 368 glVertex3f(x,0.0,0.0f); 369 glVertex3f(x,1.0f,0.0f); 370 } 371 372 for (int i=0; i < maxCost; i+=100) { 373 float y = i/(maxCost*0.5f); 374 glVertex3f(0,y,0.0f); 375 glVertex3f(1,y,0.0f); 376 } 377 378 glEnd(); 379 380 381 // restore the projection matrix 382 glMatrixMode(GL_PROJECTION); 383 glPopMatrix(); 384 glMatrixMode(GL_MODELVIEW); 385 glEnable(GL_DEPTH_TEST); 386 387 } 388 } 226 389 } 227 390 … … 365 528 366 529 glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE); 367 530 368 531 // Render PVS 369 532 std::map<Intersectable *, … … 467 630 } 468 631 632 void 633 GlRendererWidget::RenderPvs() 634 { 635 SetupCamera(); 636 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 637 638 ViewCell *viewcell; 639 // viewcell = mViewCellsManager->GetViewCell(mViewPoint); 640 641 PrVs prvs; 642 // mViewCellsManager->SetMaxFilterSize(1); 643 mViewCellsManager->GetPrVS(mViewPoint, prvs); 644 viewcell = prvs.mViewCell; 645 646 if (viewcell) { 647 ObjectPvs &pvs = viewcell->GetPvs(); 648 649 // read back the texture 650 std::map<Intersectable *, 651 PvsData<Intersectable *>, 652 LtSample<Intersectable *> >::const_iterator it = pvs.mEntries.begin(); 653 654 mPvsSize = pvs.mEntries.size(); 655 656 for (; it != pvs.mEntries.end(); ++ it) { 657 Intersectable *object = (*it).first; 658 float visibility = log10((*it).second.mSumPdf + 1)/5.0f; 659 glColor3f(visibility, 0.0f, 0.0f); 660 mUseForcedColors = true; 661 RenderIntersectable(object); 662 mUseForcedColors = false; 663 } 664 665 if (mRenderFilter) { 666 mWireFrame = true; 667 RenderIntersectable(viewcell); 668 mWireFrame = false; 669 } 670 mViewCellsManager->DeleteLocalMergeTree(viewcell); 671 } else { 672 ObjectContainer::const_iterator oi = mObjects.begin(); 673 for (; oi != mObjects.end(); oi++) 674 RenderIntersectable(*oi); 675 } 676 } 677 469 678 float 470 679 GlRendererWidget::RenderErrors() … … 520 729 PvsData<Intersectable *>, 521 730 LtSample<Intersectable *> >::const_iterator it = viewcell->GetPvs().mEntries.begin(); 522 731 732 mPvsSize = viewcell->GetPvs().mEntries.size(); 733 523 734 for (; it != viewcell->GetPvs().mEntries.end(); ++ it) { 524 735 Intersectable *object = (*it).first; … … 540 751 diff.setPixel(x, y, qRgba(255,128,128,255)); 541 752 errorPixels++; 542 543 753 } 544 754 pErrorPixels = ((float)errorPixels)/(im1.height()*im1.width()); … … 556 766 // now render im1 557 767 if (viewcell) { 558 if ( 1 ||mTopView) {768 if (0 && mTopView) { 559 769 mWireFrame = true; 560 770 RenderIntersectable(viewcell); … … 608 818 mViewCellsManager->DeleteLocalMergeTree(viewcell); 609 819 820 mRenderError = pErrorPixels; 610 821 return pErrorPixels; 611 822 } … … 673 884 mPvsErrorBuffer[i].mPvsSize = pvsSize; 674 885 886 emit UpdatePvsErrorItem(i, 887 mPvsErrorBuffer[i]); 888 675 889 cout<<"("<<i<<","<<mPvsErrorBuffer[i].mError<<")"; 676 890 // swapBuffers(); … … 762 976 763 977 if (!mRenderViewCells) { 764 RenderErrors(); 978 if (mRenderErrors) 979 RenderErrors(); 980 else 981 RenderPvs(); 765 982 RenderInfo(); 766 983 } else { 767 984 RenderViewCells(); 768 985 769 986 mWireFrame = true; 770 987 RenderScene(); 771 988 mWireFrame = false; 989 772 990 RenderInfo(); 773 991 } … … 854 1072 vl->addWidget(slider); 855 1073 slider->show(); 856 slider->setRange(1, 200);1074 slider->setRange(1, 10000); 857 1075 slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 858 1076 slider->setValue(200); … … 884 1102 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowViewCells(bool))); 885 1103 1104 cb = new QCheckBox("Show render cost", hbox); 1105 hlayout->addWidget(cb); 1106 cb->setChecked(false); 1107 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowRenderCost(bool))); 1108 1109 cb = new QCheckBox("Show pvs sizes", hbox); 1110 hlayout->addWidget(cb); 1111 cb->setChecked(false); 1112 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowPvsSizes(bool))); 1113 886 1114 vbox->resize(800,100); 887 1115 … … 892 1120 vl = new QVBoxLayout; 893 1121 vbox->setLayout(vl); 894 1122 1123 1124 895 1125 slider = new QSlider(Qt::Horizontal, vbox); 896 1126 vbox->layout()->addWidget(slider); … … 902 1132 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetSceneCut(int))); 903 1133 1134 cb = new QCheckBox("Render errors", vbox); 1135 vbox->layout()->addWidget(cb); 1136 cb->setChecked(true); 1137 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetRenderErrors(bool))); 1138 1139 cb = new QCheckBox("Render filter", vbox); 1140 vbox->layout()->addWidget(cb); 1141 cb->setChecked(true); 1142 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetRenderFilter(bool))); 904 1143 905 1144 cb = new QCheckBox("Cut view cells", vbox); … … 922 1161 923 1162 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetTopDistance(int))); 924 925 926 927 1163 928 1164 cb = new QCheckBox("Top View", vbox); … … 930 1166 cb->setChecked(false); 931 1167 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetTopView(bool))); 932 1168 1169 vbox = new QGroupBox("PVS Errors", this); 1170 layout()->addWidget(vbox); 1171 1172 vl = new QVBoxLayout; 1173 vbox->setLayout(vl); 1174 1175 mPvsErrorWidget = new QListWidget(vbox); 1176 vbox->layout()->addWidget(mPvsErrorWidget); 1177 1178 connect(mPvsErrorWidget, 1179 SIGNAL(doubleClicked(const QModelIndex &)), 1180 this, 1181 SLOT(PvsErrorClicked(const QModelIndex &))); 1182 1183 QPushButton *button = new QPushButton("Next Error Frame", vbox); 1184 vbox->layout()->addWidget(button); 1185 connect(button, SIGNAL(clicked(void)), SLOT(FocusNextPvsErrorFrame(void))); 1186 933 1187 setWindowTitle("Preprocessor Control Widget"); 934 1188 adjustSize(); 1189 } 1190 1191 1192 1193 void 1194 RendererControlWidget::FocusNextPvsErrorFrame(void) 1195 { 1196 1197 1198 } 1199 1200 void 1201 RendererControlWidget::UpdatePvsErrorItem(int row, 1202 GlRendererBuffer::PvsErrorEntry &pvsErrorEntry) 1203 { 1204 1205 QListWidgetItem *i = mPvsErrorWidget->item(row); 1206 QString s; 1207 s.sprintf("%5.5f", pvsErrorEntry.mError); 1208 if (i) { 1209 i->setText(s); 1210 } else { 1211 new QListWidgetItem(s, mPvsErrorWidget); 1212 } 1213 mPvsErrorWidget->update(); 935 1214 } 936 1215 … … 950 1229 mCutViewCells = false; 951 1230 mCutScene = false; 952 953 RendererControlWidget *cw = new RendererControlWidget(NULL); 954 connect(cw, SIGNAL(SetViewCellGranularity(int)), this, SLOT(SetViewCellGranularity(int))); 955 connect(cw, SIGNAL(SetSceneCut(int)), this, SLOT(SetSceneCut(int))); 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 962 connect(cw, SIGNAL(SetShowViewCells(bool)), this, SLOT(SetShowViewCells(bool))); 963 connect(cw, SIGNAL(SetTopView(bool)), this, SLOT(SetTopView(bool))); 964 connect(cw, SIGNAL(SetCutViewCells(bool)), this, SLOT(SetCutViewCells(bool))); 965 connect(cw, SIGNAL(SetCutScene(bool)), this, SLOT(SetCutScene(bool))); 966 967 cw->show(); 1231 mRenderErrors = true; 1232 mRenderFilter = true; 1233 mShowRenderCost = false; 1234 mShowPvsSizes = false; 1235 1236 mPvsSize = 0; 1237 mRenderError = 0.0f; 1238 mControlWidget = new RendererControlWidget(NULL); 1239 1240 connect(mControlWidget, SIGNAL(SetViewCellGranularity(int)), this, SLOT(SetViewCellGranularity(int))); 1241 connect(mControlWidget, SIGNAL(SetSceneCut(int)), this, SLOT(SetSceneCut(int))); 1242 connect(mControlWidget, SIGNAL(SetTopDistance(int)), this, SLOT(SetTopDistance(int))); 1243 1244 connect(mControlWidget, SIGNAL(SetVisibilityFilterSize(int)), this, SLOT(SetVisibilityFilterSize(int))); 1245 1246 connect(mControlWidget, SIGNAL(SetShowViewCells(bool)), this, SLOT(SetShowViewCells(bool))); 1247 connect(mControlWidget, SIGNAL(SetShowRenderCost(bool)), this, SLOT(SetShowRenderCost(bool))); 1248 connect(mControlWidget, SIGNAL(SetShowPvsSizes(bool)), this, SLOT(SetShowPvsSizes(bool))); 1249 connect(mControlWidget, SIGNAL(SetTopView(bool)), this, SLOT(SetTopView(bool))); 1250 connect(mControlWidget, SIGNAL(SetCutViewCells(bool)), this, SLOT(SetCutViewCells(bool))); 1251 connect(mControlWidget, SIGNAL(SetCutScene(bool)), this, SLOT(SetCutScene(bool))); 1252 connect(mControlWidget, SIGNAL(SetRenderErrors(bool)), this, SLOT(SetRenderErrors(bool))); 1253 connect(mControlWidget, SIGNAL(SetRenderFilter(bool)), this, SLOT(SetRenderFilter(bool))); 1254 1255 1256 mControlWidget->show(); 968 1257 } 969 1258 … … 972 1261 { 973 1262 if (mViewCellsManager) 974 mViewCellsManager->SetMaxFilterSize(number);975 //mViewCellsManager->CollectViewCells(number);1263 // mViewCellsManager->SetMaxFilterSize(number); 1264 mViewCellsManager->CollectViewCells(number); 976 1265 updateGL(); 977 1266 } … … 1029 1318 int i; 1030 1319 ViewCellContainer &viewcells = mViewCellsManager->GetViewCells(); 1320 int maxPvs = -1; 1321 for (i=0; i < viewcells.size(); i++) { 1322 ViewCell *vc = viewcells[i]; 1323 int p = vc->GetPvs().GetSize(); 1324 if (p > maxPvs) 1325 maxPvs = p; 1326 } 1327 1328 1031 1329 for (i=0; i < viewcells.size(); i++) { 1032 1330 ViewCell *vc = viewcells[i]; 1033 1331 // Mesh *m = vc->GetMesh(); 1034 RgbColor c = vc->GetColor(); 1332 1333 1334 RgbColor c; 1335 1336 if (!mShowPvsSizes) 1337 c = vc->GetColor(); 1338 else { 1339 float importance = (float)vc->GetPvs().GetSize() / (float)maxPvs; 1340 c = RgbColor(importance, 1.0f - importance, 0.0f); 1341 } 1035 1342 glColor3f(c.r, c.g, c.b); 1343 1036 1344 RenderViewCell(vc); 1037 1345 } -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r713 r746 68 68 int timerId; 69 69 bool mUseFalseColors; 70 bool mUseForcedColors; 70 71 71 72 HaltonSequence halton; … … 117 118 118 119 119 class GlRendererBuffer : public QGLPixelBuffer, public GlRenderer 120 { 120 class GlRendererBuffer : public QObject, public QGLPixelBuffer, public GlRenderer 121 { 122 Q_OBJECT 121 123 public: 122 124 GlRendererBuffer(const int w, … … 175 177 float mError; 176 178 int mPvsSize; 179 Vector3 mPosition; 180 Vector3 mDirection; 177 181 }; 178 182 … … 185 189 void SetupProjectionForViewPoint(const Vector3 &viewPoint, 186 190 const Beam &beam, 191 187 192 Intersectable *sourceObject); 193 194 public: 195 signals: 196 UpdatePvsErrorItem(int i, 197 GlRendererBuffer::PvsErrorEntry &); 188 198 }; 189 199 … … 193 203 Q_OBJECT 194 204 public: 205 206 QListWidget *mPvsErrorWidget; 207 195 208 RendererControlWidget(QWidget * parent = 0, Qt::WFlags f = 0); 209 210 public slots: 211 212 void FocusNextPvsErrorFrame(); 213 void UpdatePvsErrorItem(int i, 214 GlRendererBuffer::PvsErrorEntry &); 196 215 197 216 signals: … … 202 221 SetVisibilityFilterSize(int); 203 222 223 SetRenderFilter(bool); 224 SetRenderErrors(bool); 204 225 SetShowViewCells(bool); 226 SetShowRenderCost(bool); 227 SetShowPvsSizes(bool); 205 228 SetTopView(bool); 206 229 SetCutViewCells(bool); 207 230 SetCutScene(bool); 208 231 209 232 210 233 }; 211 234 … … 222 245 bool mCutViewCells; 223 246 bool mCutScene; 224 247 bool mRenderErrors; 248 bool mRenderFilter; 249 bool mShowRenderCost; 250 bool mShowPvsSizes; 251 225 252 Plane3 mSceneCutPlane; 226 253 float mTopDistance; 254 255 // some statistics 256 int mPvsSize; 257 float mRenderError; 258 259 RendererControlWidget *mControlWidget; 227 260 228 261 GlRendererWidget(SceneGraph *sceneGraph, … … 249 282 250 283 void keyPressEvent ( QKeyEvent * e ) ; 251 284 285 void 286 RenderPvs(); 287 252 288 float 253 289 RenderErrors(); … … 265 301 266 302 public slots: 267 void 268 SetViewCellGranularity(int number); 269 303 304 void SetRenderErrors(bool b) { 305 mRenderErrors = b; 306 updateGL(); 307 } 308 309 void SetRenderFilter(bool b) { 310 mRenderFilter = b; 311 updateGL(); 312 } 313 314 315 void 316 SetViewCellGranularity(int number); 317 270 318 void 271 319 SetVisibilityFilterSize(int number); 272 320 273 321 void 274 322 SetSceneCut(int cut); … … 281 329 updateGL(); 282 330 } 283 331 332 void SetShowRenderCost(bool b) { 333 mShowRenderCost = b; 334 updateGL(); 335 } 336 337 void SetShowPvsSizes(bool b) { 338 mShowPvsSizes = b; 339 updateGL(); 340 } 341 284 342 void SetTopView(bool b) { 285 343 mTopView = b; … … 295 353 updateGL(); 296 354 } 355 297 356 298 357 }; -
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r718 r746 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1. 0) on: ?t 23. III 21:40:0820063 # Generated by qmake (2.00a) (Qt 4.1.2) on: út 11. IV 11:35:23 2006 4 4 # Project: preprocessor.pro 5 5 # Template: app … … 63 63 $(MAKE) -f $(MAKEFILE).Debug uninstall 64 64 65 Makefile: preprocessor.pro D:/Qt/4.1.0/mkspecs/win32-msvc.net\qmake.conf D:/Qt/4.1.0/mkspecs/qconfig.pri \66 D:\Qt\4.1.0\mkspecs\features\qt_config.prf \67 D:\Qt\4.1.0\mkspecs\features\exclusive_builds.prf \68 D:\Qt\4.1.0\mkspecs\features\default_pre.prf \69 D:\Qt\4.1.0\mkspecs\features\win32\default_pre.prf \70 D:\Qt\4.1.0\mkspecs\features\release.prf \71 D:\Qt\4.1.0\mkspecs\features\debug_and_release.prf \72 D:\Qt\4.1.0\mkspecs\features\default_post.prf \73 D:\Qt\4.1.0\mkspecs\features\qt.prf \74 D:\Qt\4.1.0\mkspecs\features\win32\opengl.prf \75 D:\Qt\4.1.0\mkspecs\features\moc.prf \76 D:\Qt\4.1.0\mkspecs\features\win32\thread.prf \77 D:\Qt\4.1.0\mkspecs\features\warn_off.prf \78 D:\Qt\4.1.0\mkspecs\features\win32\console.prf \79 D:\Qt\4.1.0\mkspecs\features\win32\rtti.prf \80 D:\Qt\4.1.0\mkspecs\features\win32\exceptions.prf \81 D:\Qt\4.1.0\mkspecs\features\win32\stl.prf \82 D:\Qt\4.1.0\mkspecs\features\shared.prf \83 D:\Qt\4.1.0\mkspecs\features\resources.prf \84 D:\Qt\4.1.0\mkspecs\features\uic.prf65 Makefile: preprocessor.pro C:/Qt/4.1.2/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 66 C:\Qt\4.1.2\mkspecs\features\qt_config.prf \ 67 C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf \ 68 C:\Qt\4.1.2\mkspecs\features\default_pre.prf \ 69 C:\Qt\4.1.2\mkspecs\features\win32\default_pre.prf \ 70 C:\Qt\4.1.2\mkspecs\features\release.prf \ 71 C:\Qt\4.1.2\mkspecs\features\debug_and_release.prf \ 72 C:\Qt\4.1.2\mkspecs\features\default_post.prf \ 73 C:\Qt\4.1.2\mkspecs\features\qt.prf \ 74 C:\Qt\4.1.2\mkspecs\features\win32\opengl.prf \ 75 C:\Qt\4.1.2\mkspecs\features\moc.prf \ 76 C:\Qt\4.1.2\mkspecs\features\win32\thread.prf \ 77 C:\Qt\4.1.2\mkspecs\features\warn_off.prf \ 78 C:\Qt\4.1.2\mkspecs\features\win32\console.prf \ 79 C:\Qt\4.1.2\mkspecs\features\win32\rtti.prf \ 80 C:\Qt\4.1.2\mkspecs\features\win32\exceptions.prf \ 81 C:\Qt\4.1.2\mkspecs\features\win32\stl.prf \ 82 C:\Qt\4.1.2\mkspecs\features\shared.prf \ 83 C:\Qt\4.1.2\mkspecs\features\resources.prf \ 84 C:\Qt\4.1.2\mkspecs\features\uic.prf 85 85 $(QMAKE) -win32 -o Makefile preprocessor.pro 86 D:/Qt/4.1.0/mkspecs/qconfig.pri:87 D:\Qt\4.1.0\mkspecs\features\qt_config.prf:88 D:\Qt\4.1.0\mkspecs\features\exclusive_builds.prf:89 D:\Qt\4.1.0\mkspecs\features\default_pre.prf:90 D:\Qt\4.1.0\mkspecs\features\win32\default_pre.prf:91 D:\Qt\4.1.0\mkspecs\features\release.prf:92 D:\Qt\4.1.0\mkspecs\features\debug_and_release.prf:93 D:\Qt\4.1.0\mkspecs\features\default_post.prf:94 D:\Qt\4.1.0\mkspecs\features\qt.prf:95 D:\Qt\4.1.0\mkspecs\features\win32\opengl.prf:96 D:\Qt\4.1.0\mkspecs\features\moc.prf:97 D:\Qt\4.1.0\mkspecs\features\win32\thread.prf:98 D:\Qt\4.1.0\mkspecs\features\warn_off.prf:99 D:\Qt\4.1.0\mkspecs\features\win32\console.prf:100 D:\Qt\4.1.0\mkspecs\features\win32\rtti.prf:101 D:\Qt\4.1.0\mkspecs\features\win32\exceptions.prf:102 D:\Qt\4.1.0\mkspecs\features\win32\stl.prf:103 D:\Qt\4.1.0\mkspecs\features\shared.prf:104 D:\Qt\4.1.0\mkspecs\features\resources.prf:105 D:\Qt\4.1.0\mkspecs\features\uic.prf:86 C:/Qt/4.1.2/mkspecs/qconfig.pri: 87 C:\Qt\4.1.2\mkspecs\features\qt_config.prf: 88 C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf: 89 C:\Qt\4.1.2\mkspecs\features\default_pre.prf: 90 C:\Qt\4.1.2\mkspecs\features\win32\default_pre.prf: 91 C:\Qt\4.1.2\mkspecs\features\release.prf: 92 C:\Qt\4.1.2\mkspecs\features\debug_and_release.prf: 93 C:\Qt\4.1.2\mkspecs\features\default_post.prf: 94 C:\Qt\4.1.2\mkspecs\features\qt.prf: 95 C:\Qt\4.1.2\mkspecs\features\win32\opengl.prf: 96 C:\Qt\4.1.2\mkspecs\features\moc.prf: 97 C:\Qt\4.1.2\mkspecs\features\win32\thread.prf: 98 C:\Qt\4.1.2\mkspecs\features\warn_off.prf: 99 C:\Qt\4.1.2\mkspecs\features\win32\console.prf: 100 C:\Qt\4.1.2\mkspecs\features\win32\rtti.prf: 101 C:\Qt\4.1.2\mkspecs\features\win32\exceptions.prf: 102 C:\Qt\4.1.2\mkspecs\features\win32\stl.prf: 103 C:\Qt\4.1.2\mkspecs\features\shared.prf: 104 C:\Qt\4.1.2\mkspecs\features\resources.prf: 105 C:\Qt\4.1.2\mkspecs\features\uic.prf: 106 106 qmake: qmake_all FORCE 107 107 @$(QMAKE) -win32 -o Makefile preprocessor.pro -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r712 r746 242 242 renderer = new GlRendererBuffer(1024, 768, mSceneGraph, mViewCellsManager, mKdTree); 243 243 // renderer->makeCurrent(); 244 244 245 } 245 246 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r685 r746 161 161 bool mComputeVisibility; 162 162 163 GlRendererBuffer *GetRenderer() { return renderer;} 164 163 165 protected: 164 166 -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r718 r746 559 559 Debug<<"Valid viewcells before set validity: "<<mViewCellsManager->CountValidViewcells()<<endl; 560 560 // cull viewcells with PVS > median (0.5f) 561 //mViewCellsManager->SetValidityPercentage(0, 0.5f);561 mViewCellsManager->SetValidityPercentage(0, 0.5f); 562 562 Debug<<"Valid viewcells after set validity: "<<mViewCellsManager->CountValidViewcells()<<endl; 563 563 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r744 r746 1813 1813 if (!vc->IsLeaf()) { 1814 1814 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 1815 costFunction.push_back(interior->Get Cost());1815 costFunction.push_back(interior->GetMergeCost()); 1816 1816 1817 1817 ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r736 r746 327 327 /** Get costs resulting from each merge step. */ 328 328 void GetCostFunction(vector<float> &costFunction); 329 329 330 330 331 /** Returns optimal set of view cells for a given number of view cells. -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r744 r746 1044 1044 const float width) const 1045 1045 { 1046 Vector3 min = viewPoint - width * 0.5f; 1047 Vector3 max = viewPoint + width * 0.5; 1048 1049 return AxisAlignedBox3(min, max); 1046 float w = Magnitude(mViewSpaceBox.Size())*width; 1047 Vector3 min = viewPoint - w * 0.5f; 1048 Vector3 max = viewPoint + w * 0.5f; 1049 1050 return AxisAlignedBox3(min, max); 1050 1051 } 1051 1052 … … 1053 1054 void ViewCellsManager::GetPrVS(const Vector3 &viewPoint, PrVs &prvs) 1054 1055 { 1055 const AxisAlignedBox3 box = GetFilterBBox(viewPoint, mFilterWidth); 1056 1057 ViewCell *currentViewCell = GetViewCell(viewPoint); 1058 1056 const AxisAlignedBox3 box = GetFilterBBox(viewPoint, mFilterWidth); 1057 1058 ViewCell *currentViewCell = GetViewCell(viewPoint); 1059 1060 if (currentViewCell) { 1059 1061 ViewCellContainer viewCells; 1060 1062 ComputeBoxIntersections(box, viewCells); 1061 1063 1062 1064 ViewCell *root = ConstructLocalMergeTree2(currentViewCell, viewCells); 1063 1064 1065 prvs.mViewCell = root; 1065 //prvs.mPvs = root->GetPvs(); 1066 } else 1067 prvs.mViewCell = NULL; 1068 //prvs.mPvs = root->GetPvs(); 1066 1069 } 1067 1070 … … 4519 4522 Vector3 bsize = mViewSpaceBox.Size(); 4520 4523 const Vector3 viewPoint(mViewSpaceBox.Center()); 4521 const Vector3 width = Vector3(mFilterWidth); 4524 float w = Magnitude(mViewSpaceBox.Size())*mFilterWidth; 4525 const Vector3 width = Vector3(w); 4522 4526 4523 4527 PrVs testPrVs; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r735 r746 397 397 void SetMaxFilterSize(const int size); 398 398 399 /** Deletes interior nodes from the tree which have negative merge cost set (local merge) 400 */ 401 void DeleteLocalMergeTree(ViewCell *vc) const; 399 int GetMaxFilterSize() { 400 return mMaxFilterSize; 401 } 402 403 /** deletes interior nodes from the tree which have negative merge cost set (local merge) */ 404 void 405 DeleteLocalMergeTree(ViewCell *vc 406 ) const; 402 407 403 408 /** Evaluautes histogram for a given number of view cells. -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r718 r746 10 10 # filename ../data/vienna/vienna-simple.x3d 11 11 #filename ../data/vienna/vienna-buildings.x3d 12 #filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d 13 #;../data/vienna/vienna-plane.x3d 12 #filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-plane.x3d;../data/vienna/vienna-roads.x3d 14 13 # filename ../data/vienna/viewcells-25-sel.x3d 15 #filename ../data/atlanta/atlanta2.x3d14 filename ../data/atlanta/atlanta2.x3d 16 15 #filename ../data/soda/soda.dat 17 filename ../data/soda/soda5.dat16 #filename ../data/soda/soda5.dat 18 17 } 19 18 … … 25 24 # type vss 26 25 type rss 27 detectEmptyViewSpace true28 pvsRenderErrorSamples 5000 29 #pvsRenderErrorSamples 100026 detectEmptyViewSpace false 27 # pvsRenderErrorSamples 1 28 pvsRenderErrorSamples 1000 30 29 quitOnFinish true 31 30 computeVisibility true … … 36 35 samplesPerPass 100000 37 36 initialSamples 500000 38 vssSamples 200000037 vssSamples 1000000 39 38 vssSamplesPerPass 200000 40 39 useImportanceSampling true … … 78 77 samplesPerPass 500000 79 78 initialSamples 500000 80 vssSamples 2000000079 vssSamples 30000000 81 80 vssSamplesPerPass 1000000 82 useImportanceSampling true83 84 directionalSampling true81 useImportanceSampling false 82 83 directionalSampling false 85 84 objectBasedSampling false 86 85 … … 88 87 pvs false 89 88 rssTree false 90 rays true89 rays false 91 90 numRays 5000 92 91 } … … 104 103 105 104 maxDepth 40 106 minPvs 1 107 minRays 50 105 minPvs 3 106 # before vienna test it was: 107 # minRays 50 108 # splitType heuristic 109 110 minRays 100 108 111 minSize 0.001 109 112 maxCostRatio 1.0 … … 113 116 maxStaticMemory 100 114 117 115 #splitType regular118 splitType regular 116 119 # splitType heuristic 117 splitType hybrid120 # splitType hybrid 118 121 splitUseOnlyDrivingAxis false 119 122 importanceBasedCost false … … 178 181 179 182 Filter { 180 maxSize 20181 width 200.0183 maxSize 5 184 width 0.05 182 185 } 183 186 184 187 #number of active view cells 185 active 4000188 active 15000 186 189 maxStaticMemory 40 187 190 … … 255 258 # filename ../data/soda/soda5-viewcells.xml 256 259 # filename ../scripts/viewcells_atlanta.xml 257 filename ../data/soda/soda5-viewcells2.xml 260 # filename ../data/soda/soda5-viewcells2.xml 261 filename ../data/atlanta/viewcells_atlanta3.xml 262 # filename ../data/vienna/viewcells_vienna.xml 258 263 } 259 264 -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r693 r746 109 109 rendererWidget->resize(640, 480); 110 110 rendererWidget->show(); 111 112 if (p->GetRenderer()) { 113 114 cout<<"CONNECTING"<<endl; 115 QObject::connect(p->GetRenderer(), 116 SIGNAL(UpdatePvsErrorItem(int i, 117 GlRendererBuffer::PvsErrorEntry &)), 118 rendererWidget->mControlWidget, 119 SLOT(UpdatePvsErrorItem(int i, 120 GlRendererBuffer::PvsErrorEntry &))); 121 cout<<"CONNECTED"<<endl; 122 } 123 111 124 pt->start(QThread::LowPriority); 125 126 112 127 } else{ 113 128 // just call the mail method -> will be executed in the main thread
Note: See TracChangeset
for help on using the changeset viewer.