- Timestamp:
- 12/11/07 17:00:08 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2565 r2566 865 865 mShowPvsSizes = false; 866 866 mShowPiercingRays = false; 867 mShowWeightedRays = false; 868 867 869 mSpatialFilterSize = 0.01; 868 870 mPvsSize = 0; … … 902 904 connect(mControlWidget, SIGNAL(SetRenderBoxes(bool)), this, SLOT(SetRenderBoxes(bool))); 903 905 connect(mControlWidget, SIGNAL(SetRenderFilter(bool)), this, SLOT(SetRenderFilter(bool))); 904 connect(mControlWidget, SIGNAL(SetRenderVisibilityEstimates(bool)), 905 this, SLOT(SetRenderVisibilityEstimates(bool))); 906 connect(mControlWidget, SIGNAL(SetRenderVisibilityEstimates(bool)), this, SLOT(SetRenderVisibilityEstimates(bool))); 906 907 connect(mControlWidget, SIGNAL(SetUseFilter(bool)), this, SLOT(SetUseFilter(bool))); 907 connect(mControlWidget, SIGNAL(SetUseSpatialFilter(bool)), 908 this, SLOT(SetUseSpatialFilter(bool))); 908 connect(mControlWidget, SIGNAL(SetUseSpatialFilter(bool)), this, SLOT(SetUseSpatialFilter(bool))); 909 909 connect(mControlWidget, SIGNAL(SetShowPiercingRays(bool)), this, SLOT(SetShowPiercingRays(bool))); 910 connect(mControlWidget, SIGNAL(SetShowWeightedRays(bool)), this, SLOT(SetShowWeightedRays(bool))); 910 911 911 912 connect(mControlWidget, … … 1198 1199 ViewCellContainer &viewcells = mViewCellsManager->GetViewCells(); 1199 1200 int maxPvs = -1; 1200 int maxPiercingRays = 1; // for savety 1201 int maxPiercingRays = 1; // not zero for savety 1202 float maxRelativeRays = Limits::Small; // not zero for savety 1201 1203 1202 1204 for (i = 0; i < viewcells.size(); ++ i) … … 1213 1215 if (piercingRays > maxPiercingRays) 1214 1216 maxPiercingRays = piercingRays; 1215 } 1216 1217 if (!mShowPvsSizes && !mShowPiercingRays) 1217 1218 const float relativeArea = vc->GetBox().SurfaceArea() / mViewCellsManager->GetViewSpaceBox().SurfaceArea(); 1219 1220 if ((float)piercingRays / relativeArea > maxRelativeRays) 1221 maxRelativeRays = (float)piercingRays / relativeArea; 1222 } 1223 1224 if (!mShowPvsSizes && !mShowPiercingRays && !mShowWeightedRays) 1218 1225 { 1219 1226 for (i = 0; i < viewcells.size(); ++ i) … … 1260 1267 { 1261 1268 ViewCell *vc = viewcells[i]; 1262 const Vector3 dummyViewPoint(0.0, 0.0, 1.0); 1263 const float dist = SqrDistance( dummyViewPoint, vc->GetBox().Center());1269 1270 const float dist = SqrDistance(mDummyViewPoint, vc->GetBox().Center()); 1264 1271 1265 1272 vc->SetDistance(dist); … … 1269 1276 } 1270 1277 1271 RgbColor c; 1272 1273 for (i = 0; i < viewcells.size(); ++ i) 1278 for (i = 0; i < viewcells.size(); ++ i) 1274 1279 { 1280 RgbColor c; 1275 1281 ViewCell *vc = viewcells[i]; 1276 1282 … … 1283 1289 ((float)vc->GetNumPiercingRays() / (float)maxPiercingRays); 1284 1290 } 1285 else 1291 else if (mShowWeightedRays) // relative number of rays 1292 { 1293 // importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs); 1294 float relativeArea = vc->GetBox().SurfaceArea() / mViewCellsManager->GetViewSpaceBox().SurfaceArea(); 1295 1296 if (relativeArea < Limits::Small) 1297 relativeArea = Limits::Small; 1298 1299 importance = mTransferFunction * ((float)vc->GetNumPiercingRays() / relativeArea) / maxRelativeRays; 1300 } 1301 else // pvs size 1286 1302 { 1287 1303 //importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs); 1288 1304 importance = mTransferFunction * 1289 1305 ((float)vc->GetPvs().GetSize() / (float)maxPvs); 1290 // c = RgbColor(importance, 1.0f - importance, 0.0f);1291 c = RainbowColorMapping(5.0f * importance);1292 1306 } 1293 1307 … … 1452 1466 1453 1467 1454 QRadioButton *rb1, *rb2, *rb3 ;1468 QRadioButton *rb1, *rb2, *rb3, *rb4; 1455 1469 1456 1470 // Create a check box to be in the group box … … 1468 1482 rb3 = new QRadioButton("wireframe", hbox); 1469 1483 rb3->setText("wireframe"); 1484 1485 rb4 = new QRadioButton("weighted rays", hbox); 1486 rb4->setText("weighted rays"); 1487 connect(rb4, SIGNAL(toggled(bool)), SIGNAL(SetShowWeightedRays(bool))); 1488 1470 1489 //vl->addWidget(rb2); 1471 1490 //connect(rb2, SIGNAL(toggled(bool)), SIGNAL(SetShowPvsSizes(bool))); … … 1478 1497 vbox2->addWidget(rb1); 1479 1498 vbox2->addWidget(rb2); 1480 rb2->setChecked(true); 1499 vbox2->addWidget(rb4); 1500 rb3->setChecked(true); 1481 1501 1482 1502 vbox2->addStretch(1);
Note: See TracChangeset
for help on using the changeset viewer.