Changeset 2636
- Timestamp:
- 01/23/08 06:32:46 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r2634 r2636 152 152 tStack.push(tdata); 153 153 AxisAlignedBox3 backBox, frontBox; 154 154 155 155 while (!tStack.empty()) { 156 156 // cout<<mStat.Nodes()<<" "<<mTermMaxNodes<<endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2634 r2636 1235 1235 pruneInvalidRays); 1236 1236 1237 #if DYNAMIC_OBJECTS_HACK 1237 //#if DYNAMIC_OBJECTS_HACK 1238 // disabled not neccessary 1239 UpdateDynamicObjects(); 1240 #if 0 1238 1241 static Ray hRay; 1239 1242 VssRayContainer::iterator vit, vit_end = vssRays.end(); … … 1722 1725 1723 1726 mDynamicObjects.push_back(tmi); 1727 1724 1728 return true; 1725 1729 } … … 1733 1737 leaf->RebuildKtbTree(); 1734 1738 mSceneGraph->GetRoot()->mChildren.push_back(leaf); 1739 1740 if (mRayCaster) 1741 mRayCaster->AddDynamicObjecs(leaf->mGeometry, leaf->GetTransformation()); 1742 1743 1735 1744 return true; 1736 1745 } … … 1741 1750 } 1742 1751 1743 } 1752 1753 void 1754 Preprocessor::ObjectMoved(SceneGraphLeaf *object) 1755 { 1756 // first invalidate all PVS from which this object is visible 1757 ViewCellContainer::const_iterator vit, vit_end = mViewCellsManager->GetViewCells().end(); 1758 1759 AxisAlignedBox3 box = object->GetBox(); 1760 1761 KdNode::NewMail(); 1762 1763 ObjectContainer objects; 1764 // first mail all kDObjects which are intersected by the object 1765 preprocessor->mKdTree->CollectKdObjects(box, 1766 objects); 1767 1768 // now search for pvss which contained any mailed node 1769 for (vit = mViewCellsManager->GetViewCells().begin(); vit != vit_end; ++ vit) { 1770 ObjectPvs &pvs = (*vit)->GetPvs(); 1771 for (int i=0; i < objects.size(); i++) { 1772 vector<PvsEntry<Intersectable *,PvsData> >::iterator v; 1773 // ObjectPvsIterator it; 1774 if (pvs.Find(objects[i], v)) { 1775 // clear the pvs 1776 pvs.Clear(); 1777 break; 1778 } 1779 } 1780 } 1781 1782 } 1783 1784 void 1785 Preprocessor::UpdateDynamicObjects() 1786 { 1787 if (mUpdateDynamicObjects) { 1788 preprocessor->mRayCaster->DeleteDynamicObjects(); 1789 1790 for (int i=0; i < mDynamicObjects.size(); i++) { 1791 SceneGraphLeaf *l = mDynamicObjects[i]; 1792 mRayCaster->AddDynamicObjecs(l->mGeometry, l->GetTransformation()); 1793 preprocessor->ObjectMoved(l); 1794 } 1795 mUpdateDynamicObjects = false; 1796 } 1797 } 1798 1799 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r2633 r2636 273 273 274 274 275 int mGenericStats; 275 int mGenericStats; 276 277 void ScheduleUpdateDynamicObjects() { 278 mUpdateDynamicObjects = true; 279 } 280 281 void UpdateDynamicObjects(); 276 282 277 283 protected: … … 291 297 virtual void EvalViewCellHistogram(); 292 298 293 299 virtual void ObjectMoved(SceneGraphLeaf *object); 294 300 ///////////////////////// 295 301 … … 309 315 310 316 PreprocessorThread *mThread; 317 318 bool mUpdateDynamicObjects; 311 319 }; 312 320 -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r2582 r2636 446 446 bool VerbosePvs<T, S>::RemoveSample(T sample, const float pdf) 447 447 { 448 -- mSamples;449 448 450 449 typename vector<PvsEntry<T, S> >::iterator it; … … 453 452 if (!entryFound) 454 453 return false; 454 455 // $$JB decrement only if the sample found 456 -- mSamples; 455 457 456 458 S &data = (*it).mData; -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2635 r2636 17 17 #include "IntersectableWrapper.h" 18 18 #include "LogWriter.h" 19 19 #include "RayCaster.h" 20 20 21 21 … … 664 664 } 665 665 666 void QtGlRendererWidget::mouseReleaseEvent(QMouseEvent *e) 667 { 668 669 if (e->modifiers() & Qt::AltModifier) 670 if (mCurrentDynamicObjectIdx >= 0) { 671 // preprocessor->ScheduleUpdateDynamicObjects(); 672 } 673 } 674 666 675 void 667 676 QtGlRendererWidget::mouseMoveEvent(QMouseEvent *e) … … 722 731 tmi->ApplyWorldTransform(tm); 723 732 #else 724 SceneGraphLeaf *l = mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx]; 733 SceneGraphLeaf *l = 734 mViewCellsManager->GetPreprocessor()->mDynamicObjects[mCurrentDynamicObjectIdx]; 725 735 l->ApplyTransform(tm); 736 726 737 #endif 727 738 updateGL(); … … 744 755 } 745 756 746 void747 QtGlRendererWidget::mouseReleaseEvent(QMouseEvent *)748 {749 }750 757 751 758 void … … 1021 1028 connect(mControlWidget, SIGNAL(SetRotation(bool)), this, SLOT(SetRotation(bool))); 1022 1029 connect(mControlWidget, SIGNAL(SetScale(bool)), this, SLOT(SetScale(bool))); 1023 1030 1031 connect(mControlWidget, SIGNAL(UpdateDynamicObjects()), this, SLOT(UpdateDynamicObjects())); 1032 1024 1033 setWindowTitle("PVS Visualization"); 1025 1034 … … 1091 1100 ++ mCurrentDynamicObjectIdx; 1092 1101 1093 if (mViewCellsManager->GetPreprocessor()->LoadDynamicGeometry(filename)) 1094 cout << "Loading finished" << endl; 1095 else 1096 cerr << "Loading failed" << endl; 1097 1102 if (mViewCellsManager->GetPreprocessor()->LoadDynamicGeometry(filename)) { 1103 1104 cout << "Loading finished" << endl; 1105 } else 1106 cerr << "Loading failed" << endl; 1107 1098 1108 updateGL(); 1099 1109 } … … 1742 1752 1743 1753 vbox2->addStretch(1); 1754 1755 1756 QPushButton *button = new QPushButton("Update", groupBox); 1757 vbox2->addWidget(button); 1758 connect(button, SIGNAL(clicked()), SIGNAL(UpdateDynamicObjects())); 1759 1760 1744 1761 groupBox->setLayout(vbox2); 1745 1762 1746 1763 return groupBox; 1747 1764 } 1748 1749 1765 1750 1766 … … 2373 2389 } 2374 2390 2375 } 2391 void 2392 QtGlRendererWidget::UpdateDynamicObjects() 2393 { 2394 preprocessor->ScheduleUpdateDynamicObjects(); 2395 2396 } 2397 2398 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2633 r2636 108 108 109 109 signals: 110 110 void UpdateDynamicObjects(); 111 111 void ComputeVisibility(); 112 112 void StopComputation(); … … 310 310 311 311 public slots: 312 312 void UpdateDynamicObjects(); 313 313 void UpdateAllPvs(); 314 314 void ComputeVisibility(); -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h
r2621 r2636 78 78 /// used as actual pvs entry 79 79 ObjectContainer mGeometry; 80 80 const Matrix4x4 &GetTransformation() const { return mTrafo; } 81 81 protected: 82 82 -
GTP/trunk/Lib/Vis/Preprocessing/src/run_test2
r2635 r2636 4 4 5 5 #COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 6 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass= 1000000 -total_samples=20000000 -mutation_use_pass_importance- -mutation_silhouette_search_steps=3 -preprocessor_ray_cast_method=1-preprocessor_detect_empty_viewspace+"6 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000 -total_samples=20000000 -mutation_use_pass_importance- -mutation_silhouette_search_steps=3 -preprocessor_ray_cast_method=3 -preprocessor_detect_empty_viewspace+" 7 7 8 8 #SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d"
Note: See TracChangeset
for help on using the changeset viewer.