- Timestamp:
- 02/21/08 18:10:24 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2638 r2643 307 307 GlRenderer::InitGL(); 308 308 309 //glEnable(GL_FOG); 310 //glFogi(GL_FOG_MODE, GL_EXP); 311 glFogi(GL_FOG_MODE, GL_LINEAR); 312 313 // glFogf(GL_FOG_DENSITY, .2f); 314 glFogf(GL_FOG_START, 50.f); 315 glFogf(GL_FOG_END, 500.f); 316 309 317 GLfloat light_ambient[] = {0.3, 0.3, 0.3, 1.0}; 310 318 GLfloat light_diffuse[] = {0.6, 0.6, 0.6, 1.0}; … … 440 448 int indexBufferSize = 0; 441 449 442 KdNode::NewMail ();450 KdNode::NewMail2(); 443 451 //Intersectable::NewMail(); 444 452 … … 506 514 if (viewcell) 507 515 { 508 #if 1516 #if 0 509 517 // copy the pvs so that it can be filtered ... 510 518 if (PvsChanged(viewcell)) … … 518 526 //mMutex.lock(); 519 527 // mSpatialFilter size is in range 0.001 - 0.1 520 mViewCellsManager->ApplyFilter2(viewcell, 521 mUseFilter, 522 100.0f * mSpatialFilterSize, 523 //pvs, 524 mPvsCache.mPvs, 525 &mPvsCache.filteredBoxes); 528 mViewCellsManager->ApplyFilter2(viewcell, 529 mUseFilter, 530 100.0f * mSpatialFilterSize, 531 mPvsCache.mPvs, 532 &mPvsCache.filteredBoxes); 526 533 //mPvsCache.mPvs = pvs; 527 534 //mMutex.unlock(); … … 535 542 // update the indices for rendering 536 543 PreparePvs2(mPvsCache.mPvs); 537 538 544 emit PvsUpdated(); 545 mCurrentPvsCost = mPvsCache.mPvs.EvalPvsCost(); 539 546 } 540 547 #else 548 541 549 PreparePvs2(viewcell->GetPvs()); 542 550 emit PvsUpdated(); 551 543 552 #endif 544 553 … … 577 586 mWireFrame = false; 578 587 } 588 mCurrentPvsCost = viewcell->GetPvs().EvalPvsCost(); 579 589 } 580 590 else … … 585 595 RenderScene(); 586 596 } 597 598 //cout << "vp: " << mViewPoint << " vd: " << mViewDirection << endl; 587 599 } 588 600 … … 794 806 } 795 807 796 if ( 1 &&mShowRays)808 if (mShowRays) 797 809 { 798 810 RenderRays(mViewCellsManager->mVizBuffer.GetRays(), mRayVisualizationMethod, mShowDistribution, 1); … … 937 949 //mRenderVisibilityEstimates = true; 938 950 951 mComputeGVS = false; 939 952 mUseRandomColorPerPvsObject = false; 940 953 … … 980 993 mShowRays = false; 981 994 982 SetSceneCut( 0);995 SetSceneCut(1000); 983 996 mControlWidget = new QtRendererControlWidget(NULL); 984 997 … … 991 1004 connect(mControlWidget, SIGNAL(SetRandomViewPoint()), this, SLOT(SetRandomViewPoint())); 992 1005 connect(mControlWidget, SIGNAL(StoreStatistics(void)), this, SLOT(StoreStatistics(void))); 1006 connect(mControlWidget, SIGNAL(ComputeGVS(void)), this, SLOT(ComputeGVS(void))); 993 1007 connect(mControlWidget, SIGNAL(LoadObject(void)), this, SLOT(LoadObject(void))); 994 1008 … … 1270 1284 #if 0 1271 1285 QFont font40; font40.setPointSize(30); 1272 s.sprintf("PVS: %04d", mPvsSize);1273 renderText(20, 40, s, font40);1286 //s.sprintf("PVS: %04d", mPvsSize); 1287 //renderText(20, 40, s, font40); 1274 1288 #endif 1275 1289 1276 /* QFont font40; font40.setPointSize(30); 1277 s.sprintf("New triangles: %04d", 100); 1278 renderText(200, 40, s, font40);*/ 1290 //s.sprintf("RAW TRI: %07d", mViewCellsManager->GetPreprocessor()->mGenericStats); 1291 //renderText(290, 40, s, font40); 1292 //s.sprintf("PVS TRI: %07d", mViewCellsManager->GetPreprocessor()->mGenericStats2); 1293 //renderText(290, 70, s, font40); 1294 1295 s.sprintf("PVS TRI: %07d", (int)mCurrentPvsCost); 1296 renderText(290, 70, s, font40); 1297 //renderText(290, 70, s, font40); 1298 1279 1299 } 1280 1300 … … 1283 1303 QtGlRendererWidget::SetViewCellGranularity(int number) 1284 1304 { 1285 if (mViewCellsManager) { 1286 // mViewCellsManager->SetMaxFilterSize(number); 1305 if (mViewCellsManager) 1306 { 1307 // mViewCellsManager->SetMaxFilterSize(number); 1287 1308 1288 1309 // $$ tmp off … … 1301 1322 if (mViewCellsManager) 1302 1323 mViewCellsManager->SetMaxFilterSize(number); 1324 1303 1325 mPvsCache.Reset(); 1304 1326 updateGL(); … … 1324 1346 AxisAlignedBox3 box = mViewCellsManager->GetViewSpaceBox(); 1325 1347 Vector3 p = (1.0f - f) * box.Min() + f * box.Max(); 1326 mSceneCutPlane.mNormal = Vector3(0, -1,0);1348 mSceneCutPlane.mNormal = Vector3(0, -1, 0); 1327 1349 mSceneCutPlane.mD = -DotProd(mSceneCutPlane.mNormal, p); 1328 1350 … … 1996 2018 QGroupBox *groupBox = CreateVisualizationPanel(hbox); 1997 2019 vh->addWidget(groupBox, 0, 0); 2020 1998 2021 #if REMOVE_TEMPORARY 1999 2022 QGroupBox *groupBox2 = CreateRenderCostPanel(hbox); 2000 2023 vh->addWidget(groupBox2, 0, 0); 2001 #endif 2024 2002 2025 QGroupBox *groupBox3 = CreateRayVisualizationPanel(hbox); 2003 2026 vh->addWidget(groupBox3, 0, 0); … … 2005 2028 QGroupBox *groupBox4 = CreateTrafoPanel(hbox); 2006 2029 vh->addWidget(groupBox4, 0, 0); 2030 #endif 2007 2031 2008 2032 ////////////////////////////////// 2009 2033 2010 2011 /*cb = new QRadiobox("Top View", vbox);2012 vl->addWidget(cb);2013 cb->setChecked(false);2014 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetTopView(bool)));2015 */2016 2034 2017 2035 //vbox->resize(800,150); … … 2168 2186 #endif 2169 2187 2188 button = new QPushButton("Compute GVS", vbox); 2189 vbox->layout()->addWidget(button); 2190 connect(button, SIGNAL(clicked()), SIGNAL(ComputeGVS())); 2191 2170 2192 #if DYNAMIC_OBJECTS_HACK 2171 2193 … … 2202 2224 2203 2225 //connect(button, SIGNAL(clicked(void)), SLOT(StoreStatistics(void))); 2204 //mHidingCost = 0.1f;2205 //////////////////////////////////////////2226 2227 ////////////////////////////////////////// 2206 2228 2207 2229 label = new QLabel("Spatial Filter size");
Note: See TracChangeset
for help on using the changeset viewer.