Changeset 2563
- Timestamp:
- 12/11/07 09:01:13 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2562 r2563 739 739 target.x, target.y, target.z, 740 740 up.x, up.y, up.z); 741 } else { 742 float dist = Magnitude(mSceneGraph->GetBox().Diagonal())*mTopDistance; 741 } 742 else 743 { 744 float dist = Magnitude(mSceneGraph->GetBox().Diagonal()) * mTopDistance; 743 745 Vector3 pos = mViewPoint + dist*Vector3(0, 744 746 1, … … 880 882 connect(mControlWidget, SIGNAL(SetSceneCut(int)), this, SLOT(SetSceneCut(int))); 881 883 connect(mControlWidget, SIGNAL(SetTopDistance(int)), this, SLOT(SetTopDistance(int))); 884 connect(mControlWidget, SIGNAL(SetTransparency(int)), this, SLOT(SetTransparency(int))); 882 885 883 886 connect(mControlWidget, SIGNAL(SetVisibilityFilterSize(int)), this, SLOT(SetVisibilityFilterSize(int))); … … 1146 1149 { 1147 1150 mHidingCost = (float)number / 1000.0f; 1148 cout << "hiding cost " << mHidingCost << endl;1151 //cout << "hiding cost " << mHidingCost << endl; 1149 1152 } 1150 1153 … … 1154 1157 { 1155 1158 mTopDistance = number/1000.0f; 1159 updateGL(); 1160 } 1161 1162 void 1163 QtGlRendererWidget::SetTransparency(int number) 1164 { 1165 mTransparency = number/1000.0f; 1156 1166 updateGL(); 1157 1167 } … … 1200 1210 maxPiercingRays = piercingRays; 1201 1211 } 1202 1203 cout << "here22 " << mHideByCost << " " << mHidingCost << endl;1204 1212 1205 1213 if (!mShowPvsSizes && !mShowPiercingRays) … … 1341 1349 slider->setValue(200); 1342 1350 1343 1344 1351 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetViewCellGranularity(int))); 1352 1353 /////////////////////////// 1345 1354 1346 1355 label = new QLabel("Transfer function"); … … 1357 1366 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetTransferFunction(int))); 1358 1367 1359 { 1360 QPushButton *button = new QPushButton("Update all PVSs", vbox); 1361 vbox->layout()->addWidget(button); 1362 connect(button, SIGNAL(clicked()), SLOT(UpdateAllPvs())); 1363 } 1364 1368 ////////////////////////////////////////7 1369 1370 1371 QPushButton *button = new QPushButton("Update all PVSs", vbox); 1372 vbox->layout()->addWidget(button); 1373 connect(button, SIGNAL(clicked()), SLOT(UpdateAllPvs())); 1374 1375 1376 ////////////////////////////////////////77777 1365 1377 1366 1378 label = new QLabel("Filter size"); … … 1377 1389 1378 1390 1391 ////////////////////////////////////////// 1392 1379 1393 label = new QLabel("Spatial Filter size"); 1380 1394 vbox->layout()->addWidget(label); … … 1390 1404 1391 1405 1406 /////////////////////////////////// 1407 1392 1408 1393 1409 QWidget *hbox = new QWidget(vbox); … … 1416 1432 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowRays(bool))); 1417 1433 1418 1419 1434 cb = new QCheckBox("Show piercing rays", hbox); 1420 1435 hlayout->addWidget(cb); 1421 1436 cb->setChecked(false); 1422 1437 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowPiercingRays(bool))); 1438 1439 1440 QButtonGroup *qbuttongroup = new QButtonGroup(hbox);//, "RenderingGroupBox"); 1441 //qbuttongroup->setTitle(i18n("Rendering options")); 1442 /*qbuttongroup->setColumnLayout(0, Qt::Vertical); 1443 qbuttongroup->layout()->setSpacing(0); 1444 qbuttongroup->layout()->setMargin(0); 1445 */ 1446 // Create a layout to organize the widgets. 1447 /* QVBoxLayout *qvboxlayout = new QVBoxLayout(qbuttongroup->layout()); 1448 qvboxlayout->setAlignment(Qt::AlignTop) 1449 qvboxlayout->setSpacing(6); 1450 qvboxlayout->setMargin(11); 1451 */ 1452 QRadioButton *rb; 1453 1454 // Create a check box to be in the group box 1455 rb = new QRadioButton("piercing rays", hbox); 1456 rb->setText("here71"); 1457 //qvboxlayout->addWidget(rb); 1458 1459 // Create another check box to the group box 1460 /* m_qradiobuttonStartFile = new QRadioButton("startFile", hbox); 1461 m_qradiobuttonStartFile->setText(i18n( "Start with last file used" ) ); 1462 qvboxlayout->addWidget(mRadiobuttonStartFile); 1463 */ 1464 1465 ////////////////////////////////// 1466 1467 1468 /*cb = new QRadiobox("Top View", vbox); 1469 vbox->layout()->addWidget(cb); 1470 cb->setChecked(false); 1471 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetTopView(bool))); 1472 */ 1423 1473 1424 1474 vbox->resize(800,150); … … 1448 1498 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetSceneCut(int))); 1449 1499 1500 1501 cb = new QCheckBox("Hide view cells by render cost ", vbox); 1502 vbox->layout()->addWidget(cb); 1503 cb->setChecked(false); 1504 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetHideByCost(bool))); 1505 1506 //////////////////////////// 1507 1508 const int range = 1000; 1509 1510 label = new QLabel("Hide by cost"); 1511 vbox->layout()->addWidget(label); 1512 1513 // the render cost visualization 1514 slider = new QSlider(Qt::Horizontal, vbox); 1515 vbox->layout()->addWidget(slider); 1516 slider->show(); 1517 slider->setRange(0, range); 1518 slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 1519 slider->setValue(0); 1520 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetHidingCost(int))); 1521 1522 /////////////////////////////////////////// 1523 1524 cb = new QCheckBox("Top View", vbox); 1525 vbox->layout()->addWidget(cb); 1526 cb->setChecked(false); 1527 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetTopView(bool))); 1528 1529 1530 label = new QLabel("Top distance"); 1531 vbox->layout()->addWidget(label); 1532 1533 slider = new QSlider(Qt::Horizontal, vbox); 1534 vbox->layout()->addWidget(slider); 1535 slider->show(); 1536 slider->setRange(1, 1000); 1537 slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 1538 slider->setValue(500); 1539 1540 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetTopDistance(int))); 1541 1542 1543 /////////////////////////////////////////// 1544 1545 cb = new QCheckBox("Transparency", vbox); 1546 vbox->layout()->addWidget(cb); 1547 cb->setChecked(false); 1548 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetTransparency(bool))); 1549 1550 label = new QLabel("Use transparency"); 1551 vbox->layout()->addWidget(label); 1552 1553 // the render cost visualization 1554 slider = new QSlider(Qt::Horizontal, vbox); 1555 vbox->layout()->addWidget(slider); 1556 slider->show(); 1557 slider->setRange(0, range); 1558 slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 1559 slider->setValue(0); 1560 1561 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetTransparency(int))); 1562 1563 ////////////////////////////// 1564 1450 1565 1451 1566 cb = new QCheckBox("Cut scene", vbox); … … 1493 1608 1494 1609 1495 1496 1497 slider = new QSlider(Qt::Horizontal, vbox);1498 vbox->layout()->addWidget(slider);1499 slider->show();1500 slider->setRange(1, 1000);1501 slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);1502 slider->setValue(500);1503 1504 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetTopDistance(int)));1505 1506 cb = new QCheckBox("Top View", vbox);1507 vbox->layout()->addWidget(cb);1508 cb->setChecked(false);1509 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetTopView(bool)));1510 1511 1512 1513 1610 vbox = new QGroupBox("PVS Errors", this); 1514 1611 layout()->addWidget(vbox); … … 1517 1614 vbox->setLayout(vl); 1518 1615 1519 QPushButton *button = new QPushButton("Compute Visibility", vbox);1616 button = new QPushButton("Compute Visibility", vbox); 1520 1617 vbox->layout()->addWidget(button); 1521 1618 connect(button, SIGNAL(clicked()), SLOT(ComputeVisibility())); … … 1545 1642 SLOT(PvsErrorClicked(const QModelIndex &))); 1546 1643 1547 QPushButton *button = new QPushButton("Next Error Frame", vbox);1644 button = new QPushButton("Next Error Frame", vbox); 1548 1645 vbox->layout()->addWidget(button); 1549 1646 connect(button, SIGNAL(clicked(void)), SLOT(FocusNextPvsErrorFrame(void))); 1550 1647 } 1551 1648 1552 // the render cost visualization1553 slider = new QSlider(Qt::Horizontal, vbox);1554 vbox->layout()->addWidget(slider);1555 slider->show();1556 slider->setRange(0, 1000);1557 slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);1558 slider->setValue(100);1559 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetHidingCost(int)));1560 1649 1561 cb = new QCheckBox("Hide view cells by render cost ", vbox); 1562 vbox->layout()->addWidget(cb); 1563 cb->setChecked(false); 1564 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetHideByCost(bool))); 1650 //mHidingCost = 0.1f; 1565 1651 1566 1652 setWindowTitle("Preprocessor Control Widget"); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2562 r2563 102 102 void SetVisibilityFilterSize(int); 103 103 void SetSpatialFilterSize(int); 104 void SetTransparency(int); 104 105 105 106 void SetShowRays(bool); … … 119 120 120 121 void SetHideByCost(bool); 122 void SetTransparency(bool); 121 123 }; 122 124 … … 152 154 float mTopDistance; 153 155 156 float mTransparency; 157 154 158 // some statistics 155 159 int mPvsSize; … … 284 288 285 289 void 290 SetTransparency(int dist); 291 292 void 286 293 SetHidingCost(int dist); 287 294 … … 317 324 318 325 void SetCutViewCells(bool b) { 319 std::cout << "here64" << std::endl;320 321 326 mCutViewCells = b; 322 327 updateGL(); … … 328 333 329 334 void SetHideByCost(bool b) { 330 std::cout << "here45" << std::endl;331 335 mHideByCost = b; 332 336 updateGL();
Note: See TracChangeset
for help on using the changeset viewer.