Changeset 2720 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 05/27/08 21:24:34 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/ObjectPlacer.cpp
r2710 r2720 63 63 AxisAlignedBox3 box = leaf->GetBox(); 64 64 65 Vector3 p = box.Center() - pt; ;65 Vector3 p = box.Center() - pt; 66 66 67 67 // set pivot to ground of object -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2719 r2720 589 589 590 590 //cout << "dynamic objects in pvs " << mDynamicPvsObjects.size() << endl;; 591 591 #if 0 592 592 for (dit = mDynamicPvsObjects.begin(); dit != dit_end; ++ dit) 593 593 { 594 594 _RenderDynamicObject(*dit); 595 595 } 596 597 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);596 #endif 597 //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 598 598 599 599 // show placed dynamic objects as wireframe … … 789 789 790 790 int pixelCount = query->GetQueryResult(); 791 pErrorPixels = ( (float)pixelCount)/ (GetWidth() * GetHeight());791 pErrorPixels = (float)pixelCount / (GetWidth() * GetHeight()); 792 792 793 793 if (0) cout << "error pixels=" << pixelCount << endl; … … 1347 1347 void QtGlRendererWidget::LoadObjects() 1348 1348 { 1349 AxisAlignedBox3 sceneBox = mViewCellsManager->GetViewSpaceBox(); 1350 1351 float x = 1.0f; 1352 float y = 20.0f; 1353 float z = 80.0f; 1354 1355 AxisAlignedBox3 box(Vector3(0.5f * x, 0, -0.5f * z), Vector3(-0.5f * x, y, 0.5f * z)); 1356 1357 // box.Scale(Vector3(0.02f, 0.1f, 0.1f)); 1358 1359 box.Translate(-box.Min()); 1360 1361 SceneGraphLeaf *leaf = GetPreprocessor()->GenerateBoxGeometry(box); 1362 mPlacer->AddObject(leaf); 1363 1349 1364 LoadObject("../data/teapot.bn"); 1350 1365 LoadObject("../data/bunny.bn"); … … 1625 1640 } 1626 1641 1627 #if 01628 float QtGlRendererWidget::ComputeRenderCost(ViewCell *vc)1629 {1630 ObjectPvs basePvs;1631 1632 basePvs = vc->CopyPvs();1633 ObjectPvsIterator pit = basePvs.GetIterator();1634 1635 float renderCost = 0;1636 1637 //cout << "cost vis: " << mShowDistanceWeightedPvs << " " << " " << mShowDistanceWeightedTriangles << " " << mShowWeightedTriangles << endl;1638 1639 // first mark all objects from this pvs1640 while (pit.HasMoreEntries())1641 {1642 KdIntersectable *kdObj = static_cast<KdIntersectable *>(pit.Next());1643 1644 if (mShowDistanceWeightedPvs)1645 {1646 const AxisAlignedBox3 box = kdObj->GetBox();1647 1648 const float dist = SqrDistance(vc->GetBox().Center(), box.Center());1649 renderCost += 1.0f / dist;1650 }1651 else if (mShowDistanceWeightedTriangles)1652 {1653 const AxisAlignedBox3 box = kdObj->GetBox();1654 1655 const float dist = SqrDistance(vc->GetBox().Center(), box.Center());1656 renderCost += kdObj->ComputeNumTriangles() / dist;1657 }1658 else //if (mShowWeightedTriangles)1659 {1660 renderCost += kdObj->ComputeNumTriangles();1661 }1662 //if (pit.Next()->Mail();1663 }1664 1665 return renderCost;1666 }1667 #else1668 1642 1669 1643 float QtGlRendererWidget::ComputeRenderCost(ViewCell *vc) … … 1688 1662 #endif 1689 1663 } 1690 #endif1691 1692 1664 1693 1665 … … 1946 1918 if (0 && (i < 20)) 1947 1919 { 1948 cout << "pvs1: " << vc->GetPvs().GetSize() << " pvs2: " << compareInfo[i].mPvsSize << " importance: " << importance << endl; 1920 cout << "pvs1: " << vc->GetPvs().GetSize() << " pvs2: " 1921 << compareInfo[i].mPvsSize << " importance: " << importance << endl; 1949 1922 } 1950 1923
Note: See TracChangeset
for help on using the changeset viewer.