Changeset 2587 for GTP/trunk/Lib/Vis
- Timestamp:
- 01/10/08 02:43:33 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_soda
r2564 r2587 14 14 15 15 $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 16 -rss_distributions= direction\16 -rss_distributions=mutation+object_direction+spatial \ 17 17 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ \ 18 18 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \ -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2586 r2587 13 13 #include "BvHierarchy.h" 14 14 #include "KdTree.h" 15 #include "SamplingStrategy.h" 16 15 17 16 18 #ifdef USE_CG … … 200 202 201 203 202 void GlRenderer::RenderRays(const VssRayContainer &rays )204 void GlRenderer::RenderRays(const VssRayContainer &rays, int colorType) 203 205 { 204 206 VssRayContainer::const_iterator it = rays.begin(), it_end = rays.end(); … … 206 208 glBegin(GL_LINES); 207 209 210 float importance; 211 208 212 for (; it != it_end; ++it) 209 213 { 210 214 VssRay *ray = *it; 211 const float importance = log10(1e3*ray->mWeightedPvsContribution)/3.0f; 212 213 //glColor3f(1.0f, 0.0f, 0.0f); 214 glColor3f(importance, importance, importance); 215 216 switch (colorType) 217 { 218 case 0: 219 glColor3f(1.0f, 0.0f, 0.0f); 220 break; 221 222 case 1: 223 importance = 1.0f * ray->Length() / Magnitude(mViewCellsManager->GetViewSpaceBox().Diagonal()); 224 glColor3f(importance, importance, importance); 225 break; 226 227 case 2: 228 importance = log10(1e3 * ray->mPvsContribution) / 3.0f; 229 glColor3f(importance, importance, importance); 230 break; 231 232 case 3: 233 { 234 // nested switches ok? 235 switch (ray->mDistribution) 236 { 237 case SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION: 238 glColor3f(1, 0, 0); 239 break; 240 case SamplingStrategy::MUTATION_BASED_DISTRIBUTION: 241 glColor3f(0, 1, 0); 242 break; 243 case SamplingStrategy::DIRECTION_BASED_DISTRIBUTION: 244 glColor3f(0, 1, 1); 245 break; 246 case SamplingStrategy::OBJECT_DIRECTION_BASED_DISTRIBUTION: 247 glColor3f(1, 1, 0); 248 break; 249 } 250 } 251 } 252 215 253 glVertex3fv(&ray->mOrigin.x); 216 254 glVertex3fv(&ray->mTermination.x); -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r2543 r2587 129 129 130 130 void 131 RenderRays(const VssRayContainer &rays );131 RenderRays(const VssRayContainer &rays, int colorType = 0); 132 132 133 133 void -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
r2584 r2587 411 411 <File 412 412 RelativePath=".\HashPvs.h"> 413 </File> 414 <File 415 RelativePath=".\HavranRayCaster.cpp"> 416 </File> 417 <File 418 RelativePath=".\HavranRayCaster.h"> 413 419 </File> 414 420 <File … … 1053 1059 </File> 1054 1060 <File 1061 RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h"> 1062 </File> 1063 <File 1055 1064 RelativePath=".\sparsehash\src\windows\hash_fun.h"> 1056 1065 </File> 1057 1066 <File 1058 RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h">1059 </File>1060 <File1061 1067 RelativePath=".\sparsehash\src\windows\hash_map.h"> 1062 1068 </File> … … 1075 1081 <File 1076 1082 RelativePath=".\sparsehash\src\windows\stl_hash_fun.h"> 1083 </File> 1084 </Filter> 1085 <Filter 1086 Name="havran" 1087 Filter=""> 1088 <File 1089 RelativePath=".\havran\allocgo2.cpp"> 1090 </File> 1091 <File 1092 RelativePath=".\havran\allocgo2.h"> 1093 </File> 1094 <File 1095 RelativePath=".\havran\configh.h"> 1096 </File> 1097 <File 1098 RelativePath=".\havran\ktb.cpp"> 1099 </File> 1100 <File 1101 RelativePath=".\havran\ktb.h"> 1102 </File> 1103 <File 1104 RelativePath=".\havran\ktb8b.cpp"> 1105 </File> 1106 <File 1107 RelativePath=".\havran\ktb8b.h"> 1108 </File> 1109 <File 1110 RelativePath=".\havran\ktbai.cpp"> 1111 </File> 1112 <File 1113 RelativePath=".\havran\ktbai.h"> 1114 </File> 1115 <File 1116 RelativePath=".\havran\ktball.cpp"> 1117 </File> 1118 <File 1119 RelativePath=".\havran\ktball.h"> 1120 </File> 1121 <File 1122 RelativePath=".\havran\ktbconf.h"> 1123 </File> 1124 <File 1125 RelativePath=".\havran\ktbftrav.cpp"> 1126 </File> 1127 <File 1128 RelativePath=".\havran\ktbtrav.cpp"> 1129 </File> 1130 <File 1131 RelativePath=".\havran\ktbtrav.h"> 1132 </File> 1133 <File 1134 RelativePath=".\havran\raypack.h"> 1135 </File> 1136 <File 1137 RelativePath=".\havran\sbbox.cpp"> 1138 </File> 1139 <File 1140 RelativePath=".\havran\sbbox.h"> 1141 </File> 1142 <File 1143 RelativePath=".\havran\subdivm.h"> 1144 </File> 1145 <File 1146 RelativePath=".\havran\timer.cpp"> 1147 </File> 1148 <File 1149 RelativePath=".\havran\timer.h"> 1077 1150 </File> 1078 1151 </Filter> -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2584 r2587 717 717 if (1 && mShowRays) 718 718 { 719 RenderRays(mViewCellsManager->mVizBuffer.GetRays() );719 RenderRays(mViewCellsManager->mVizBuffer.GetRays(), mRayVisualizationMethod); 720 720 } 721 721 } … … 880 880 mSpatialFilterSize = 0.01; 881 881 mPvsSize = 0; 882 mRayVisualizationMethod = 0; 882 883 mRenderError = 0.0f; 883 884 mShowRays = false; … … 925 926 connect(mControlWidget, SIGNAL(SetShowWeightedTriangles(bool)), this, SLOT(SetShowWeightedTriangles(bool))); 926 927 928 connect(mControlWidget, SIGNAL(UseConstColorForRayViz(bool)), this, SLOT(UseConstColorForRayViz(bool))); 929 connect(mControlWidget, SIGNAL(UseRayLengthForRayViz(bool)), this, SLOT(UseRayLengthForRayViz(bool))); 930 connect(mControlWidget, SIGNAL(SetShowContribution(bool)), this, SLOT(SetShowContribution(bool))); 931 connect(mControlWidget, SIGNAL(SetShowDistribution(bool)), this, SLOT(SetShowDistribution(bool))); 932 933 927 934 connect(mControlWidget, 928 935 SIGNAL(SetShowRays(bool)), … … 1543 1550 QRadioButton *rb1, *rb2, *rb3, *rb4, *rb5; 1544 1551 1552 rb1 = new QRadioButton("wireframe", parent); 1553 rb1->setText("wireframe"); 1554 connect(rb1, SIGNAL(toggled(bool)), SIGNAL(SetShowWireFrame(bool))); 1555 1545 1556 // Create a check box to be in the group box 1546 rb 1= new QRadioButton("piercing rays", parent);1547 rb 1->setText("piercing rays");1557 rb2 = new QRadioButton("piercing rays", parent); 1558 rb2->setText("piercing rays"); 1548 1559 //vl->addWidget(rb1); 1549 connect(rb1, SIGNAL(toggled(bool)), SIGNAL(SetShowPiercingRays(bool))); 1550 1551 rb2 = new QRadioButton("pvs size", parent); 1552 rb2->setText("pvs size"); 1553 connect(rb2, SIGNAL(toggled(bool)), SIGNAL(SetShowPvsSizes(bool))); 1554 1555 rb3 = new QRadioButton("wireframe", parent); 1556 rb3->setText("wireframe"); 1560 connect(rb2, SIGNAL(toggled(bool)), SIGNAL(SetShowPiercingRays(bool))); 1561 1562 rb3 = new QRadioButton("pvs size", parent); 1563 rb3->setText("pvs size"); 1564 connect(rb3, SIGNAL(toggled(bool)), SIGNAL(SetShowPvsSizes(bool))); 1557 1565 1558 1566 rb4 = new QRadioButton("weighted rays", parent); … … 1565 1573 1566 1574 QGroupBox *groupBox = new QGroupBox("Visualization options"); 1567 1568 QVBoxLayout *vbox2 = new QVBoxLayout;1569 1570 vbox2->addWidget(rb3);1571 vbox2->addWidget(rb1);1572 vbox2->addWidget(rb2);1573 vbox2->addWidget(rb4);1574 vbox2->addWidget(rb5);1575 1576 rb3->setChecked(true);1577 1578 vbox2->addStretch(1);1579 groupBox->setLayout(vbox2);1580 1581 return groupBox;1582 }1583 1584 1585 1586 QGroupBox *QtRendererControlWidget::CreateRenderCostPanel(QWidget *parent)1587 {1588 QRadioButton *rb1, *rb2, *rb3;1589 1590 // Create a check box to be in the group box1591 rb1 = new QRadioButton("triangles", parent);1592 rb1->setText("triangles");1593 //vl->addWidget(rb1);1594 connect(rb1, SIGNAL(toggled(bool)), SIGNAL(SetShowWeightedTriangles(bool)));1595 1596 rb2 = new QRadioButton("distance weighted pvs", parent);1597 rb2->setText("distance weighted");1598 connect(rb2, SIGNAL(toggled(bool)), SIGNAL(SetShowDistanceWeightedPvs(bool)));1599 1600 rb3 = new QRadioButton("distance weighted triangles", parent);1601 rb3->setText("distance weighted triangles");1602 connect(rb3, SIGNAL(toggled(bool)), SIGNAL(SetShowDistanceWeightedTriangles(bool)));1603 1604 QGroupBox *groupBox = new QGroupBox("Render cost options");1605 1575 1606 1576 QVBoxLayout *vbox2 = new QVBoxLayout; … … 1609 1579 vbox2->addWidget(rb2); 1610 1580 vbox2->addWidget(rb3); 1611 1612 rb2->setChecked(true); 1581 vbox2->addWidget(rb4); 1582 vbox2->addWidget(rb5); 1583 1584 rb1->setChecked(true); 1585 1586 vbox2->addStretch(1); 1587 groupBox->setLayout(vbox2); 1588 1589 return groupBox; 1590 } 1591 1592 1593 1594 QGroupBox *QtRendererControlWidget::CreateRenderCostPanel(QWidget *parent) 1595 { 1596 QRadioButton *rb1, *rb2, *rb3; 1597 1598 // Create a check box to be in the group box 1599 rb1 = new QRadioButton("triangles", parent); 1600 rb1->setText("triangles"); 1601 connect(rb1, SIGNAL(toggled(bool)), SIGNAL(SetShowWeightedTriangles(bool))); 1602 1603 rb2 = new QRadioButton("distance weighted pvs", parent); 1604 rb2->setText("distance weighted"); 1605 connect(rb2, SIGNAL(toggled(bool)), SIGNAL(SetShowDistanceWeightedPvs(bool))); 1606 1607 rb3 = new QRadioButton("distance weighted triangles", parent); 1608 rb3->setText("distance weighted triangles"); 1609 connect(rb3, SIGNAL(toggled(bool)), SIGNAL(SetShowDistanceWeightedTriangles(bool))); 1610 1611 QGroupBox *groupBox = new QGroupBox("Render cost options"); 1612 1613 QVBoxLayout *vbox2 = new QVBoxLayout; 1614 1615 vbox2->addWidget(rb1); 1616 vbox2->addWidget(rb2); 1617 vbox2->addWidget(rb3); 1618 1619 rb1->setChecked(true); 1620 1621 vbox2->addStretch(1); 1622 groupBox->setLayout(vbox2); 1623 1624 return groupBox; 1625 } 1626 1627 1628 QGroupBox *QtRendererControlWidget::CreateRayVisualizationPanel(QWidget *parent) 1629 { 1630 QRadioButton *rb1, *rb2, *rb3, *rb4; 1631 1632 // Create a check box to be in the group box 1633 rb1 = new QRadioButton("const color", parent); 1634 rb1->setText("const color"); 1635 //vl->addWidget(rb1); 1636 connect(rb1, SIGNAL(toggled(bool)), SIGNAL(UseConstColorForRayViz(bool))); 1637 1638 rb2 = new QRadioButton("ray length", parent); 1639 rb2->setText("ray length"); 1640 connect(rb2, SIGNAL(toggled(bool)), SIGNAL(UseRayLengthForRayViz(bool))); 1641 1642 rb3 = new QRadioButton("contribution", parent); 1643 rb3->setText("contribution"); 1644 connect(rb3, SIGNAL(toggled(bool)), SIGNAL(SetShowContribution(bool))); 1645 1646 rb4 = new QRadioButton("distribution", parent); 1647 rb4->setText("distribution"); 1648 connect(rb4, SIGNAL(toggled(bool)), SIGNAL(SetShowDistribution(bool))); 1649 1650 QGroupBox *groupBox = new QGroupBox("Ray visualization options"); 1651 QVBoxLayout *vbox2 = new QVBoxLayout; 1652 1653 vbox2->addWidget(rb1); 1654 vbox2->addWidget(rb2); 1655 vbox2->addWidget(rb3); 1656 vbox2->addWidget(rb4); 1657 1658 rb1->setChecked(true); 1613 1659 1614 1660 vbox2->addStretch(1); … … 1740 1786 QGroupBox *groupBox2 = CreateRenderCostPanel(hbox); 1741 1787 vh->addWidget(groupBox2, 0, 0); 1788 1789 1790 QGroupBox *groupBox3 = CreateRayVisualizationPanel(hbox); 1791 vh->addWidget(groupBox3, 0, 0); 1742 1792 1743 1793 ////////////////////////////////// -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2584 r2587 98 98 99 99 QGroupBox *CreateRenderCostPanel(QWidget *parent); 100 QGroupBox *CreateRayVisualizationPanel(QWidget *parent); 100 101 101 102 … … 141 142 void SetShowWeightedTriangles(bool); 142 143 void SetShowDistanceWeightedPvs(bool); 144 145 void UseConstColorForRayViz(bool); 146 void UseRayLengthForRayViz(bool); 147 void SetShowContribution(bool); 148 void SetShowDistribution(bool); 143 149 }; 144 150 … … 195 201 Vector3 mDummyViewPoint; 196 202 203 int mRayVisualizationMethod; 204 197 205 QtRendererControlWidget *mControlWidget; 198 206 … … 430 438 mShowWeightedTriangles = b; 431 439 updateGL(); 440 } 441 442 void UseConstColorForRayViz(bool b) 443 { 444 mRayVisualizationMethod = 0; 445 } 446 447 void UseRayLengthForRayViz(bool b) 448 { 449 mRayVisualizationMethod = 1; 450 } 451 452 void SetShowContribution(bool b) 453 { 454 mRayVisualizationMethod = 2; 455 } 456 457 void SetShowDistribution(bool b) 458 { 459 mRayVisualizationMethod = 3; 432 460 } 433 461
Note: See TracChangeset
for help on using the changeset viewer.