- Timestamp:
- 05/05/06 11:09:03 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r878 r904 1687 1687 "preprocessor_apply_filter", 1688 1688 "true"); 1689 1690 RegisterOption("Preprocessor.applyVisibilitySpatialFilter", 1691 optBool, 1692 "preprocessor_apply_spatial_filter", 1693 "true"); 1689 1694 1690 1695 RegisterOption("Preprocessor.visibilityFilterWidth", -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r884 r904 725 725 PrVs prvs; 726 726 // mViewCellsManager->SetMaxFilterSize(1); 727 mViewCellsManager->GetPrVS(mViewPoint, prvs );727 mViewCellsManager->GetPrVS(mViewPoint, prvs, mViewCellsManager->GetFilterWidth()); 728 728 viewcell = prvs.mViewCell; 729 729 … … 851 851 } else { 852 852 // mViewCellsManager->SetMaxFilterSize(1); 853 mViewCellsManager->GetPrVS(mViewPoint, prvs );853 mViewCellsManager->GetPrVS(mViewPoint, prvs, mViewCellsManager->GetFilterWidth()); 854 854 viewcell = prvs.mViewCell; 855 855 } … … 863 863 mSpatialFilterSize* 864 864 Magnitude(mViewCellsManager->GetViewSpaceBox().Size()), 865 // mViewCellsManager->GetFilterWidth()/2,866 865 pvs); 867 866 } -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r882 r904 746 746 for (int j=0; j < leaf->mObjects.size(); j++) { 747 747 Intersectable *object = leaf->mObjects[j]; 748 if (!object->Mailed() ) {748 if (!object->Mailed() && Overlap(box, object->GetBox())) { 749 749 object->Mail(); 750 750 objects.push_back(object); -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r878 r904 133 133 mVisibilityFileName = buffer; 134 134 environment->GetBoolValue("Preprocessor.applyVisibilityFilter", mApplyVisibilityFilter ); 135 environment->GetBoolValue("Preprocessor.applyVisibilitySpatialFilter", 136 mApplyVisibilitySpatialFilter ); 135 137 environment->GetFloatValue("Preprocessor.visibilityFilterWidth", mVisibilityFilterWidth); 136 138 … … 273 275 { 274 276 275 if (mApplyVisibilityFilter ) {277 if (mApplyVisibilityFilter || mApplyVisibilitySpatialFilter) { 276 278 cout<<"Applying visibility filter..."; 277 279 cout<<"filyter width = "<<mVisibilityFilterWidth<<endl; 278 280 279 281 mViewCellsManager->ApplyFilter(mKdTree, 280 m VisibilityFilterWidth,281 m VisibilityFilterWidth);282 mApplyVisibilityFilter ? mVisibilityFilterWidth : -1.0f, 283 mApplyVisibilitySpatialFilter ? mVisibilityFilterWidth : -1.0f); 282 284 cout<<"done."; 283 285 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r878 r904 171 171 172 172 bool mApplyVisibilityFilter; 173 bool mApplyVisibilitySpatialFilter; 173 174 174 175 float mVisibilityFilterWidth; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r884 r904 1082 1082 1083 1083 1084 void ViewCellsManager::GetPrVS(const Vector3 &viewPoint, PrVs &prvs) 1085 { 1086 const AxisAlignedBox3 box = GetFilterBBox(viewPoint, mFilterWidth); 1084 void ViewCellsManager::GetPrVS(const Vector3 &viewPoint, 1085 PrVs &prvs, 1086 const float filterWidth) 1087 { 1088 const AxisAlignedBox3 box = GetFilterBBox(viewPoint, filterWidth); 1087 1089 1088 1090 ViewCell *currentViewCell = GetViewCell(viewPoint); … … 4917 4919 // AxisAlignedBox3 box(center - Vector3(viewSpaceFilterSize/2), 4918 4920 // center + Vector3(viewSpaceFilterSize/2)); 4921 4922 if (viewSpaceFilterSize >=0.0f) { 4923 4924 bool usePrVS = false; 4925 4919 4926 4920 AxisAlignedBox3 box = GetViewCellBox(viewCell); 4921 box.Enlarge(Vector3(viewSpaceFilterSize/2)); 4927 if (!usePrVS) { 4928 AxisAlignedBox3 box = GetViewCellBox(viewCell); 4929 box.Enlarge(Vector3(viewSpaceFilterSize/2)); 4930 4931 ViewCellContainer viewCells; 4932 ComputeBoxIntersections(box, viewCells); 4933 4934 // cout<<"box="<<box<<endl; 4935 ViewCellContainer::const_iterator it=viewCells.begin(), it_end = viewCells.end(); 4936 4937 int i; 4938 for (i=0; it != it_end; ++it, i++) { 4939 // cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl; 4940 pvs.Merge((*it)->GetPvs()); 4941 } 4942 } else { 4943 PrVs prvs; 4944 AxisAlignedBox3 box = GetViewCellBox(viewCell); 4945 4946 // mViewCellsManager->SetMaxFilterSize(1); 4947 GetPrVS(box.Center(), prvs, viewSpaceFilterSize); 4948 pvs = prvs.mViewCell->GetPvs(); 4949 DeleteLocalMergeTree(prvs.mViewCell); 4950 } 4951 } else 4952 pvs = viewCell->GetPvs(); 4922 4953 4923 ViewCellContainer viewCells; 4924 ComputeBoxIntersections(box, viewCells); 4925 4926 // cout<<"box="<<box<<endl; 4927 ViewCellContainer::const_iterator it=viewCells.begin(), it_end = viewCells.end(); 4928 4929 int i; 4930 for (i=0; it != it_end; ++it, i++) { 4931 // cout<<"v"<<i<<" pvs="<<(*it)->GetPvs().mEntries.size()<<endl; 4932 pvs.Merge((*it)->GetPvs()); 4933 } 4934 4935 ApplySpatialFilter(kdTree, spatialFilterSize, pvs); 4954 if (spatialFilterSize >=0.0f) 4955 ApplySpatialFilter(kdTree, spatialFilterSize, pvs); 4956 4936 4957 } 4937 4958 … … 4968 4989 pvs.Clear(); 4969 4990 pvs = newPvs[i]; 4991 newPvs[i].Clear(); 4970 4992 } 4971 4993 4994 delete newPvs; 4972 4995 } 4973 4996 … … 4989 5012 const AxisAlignedBox3 tbox = GetFilterBBox(viewPoint, mFilterWidth); 4990 5013 4991 GetPrVS(viewPoint, testPrVs );5014 GetPrVS(viewPoint, testPrVs, GetFilterWidth()); 4992 5015 4993 5016 exporter->SetWireframe(); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r884 r904 233 233 virtual void GetPvsStatistics(PvsStatistics &stat); 234 234 235 virtual void GetPrVS(const Vector3 &viewPoint, PrVs &prvs );235 virtual void GetPrVS(const Vector3 &viewPoint, PrVs &prvs, const float filterWidth); 236 236 237 237 /** Get a viewcell containing the specified point … … 455 455 456 456 float GetFilterWidth() { 457 return mFilterWidth; 458 } 459 460 float GetAbsFilterWidth() { 457 461 return Magnitude(mViewSpaceBox.Size())*mFilterWidth; 458 462 } 459 463 460 464 protected: 461 465 void -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r884 r904 9 9 # filename vienna.x3d 10 10 # filename ../data/vienna/vienna-simple.x3d 11 filename ../data/vienna/vienna-buildings.x3d11 #filename ../data/vienna/vienna-buildings.x3d 12 12 #filename ../data/vienna/city1500_flat_1.x3d 13 13 #filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-plane.x3d;../data/vienna/vienna-roads.x3d … … 15 15 #filename ../data/atlanta/atlanta2.x3d 16 16 #filename ../data/soda/soda.dat 17 #filename ../data/soda/soda5.dat17 filename ../data/soda/soda5.dat 18 18 #filename ../data/PowerPlant/ppsection1/part_a/g0.ply 19 19 #filename ../data/PowerPlant/ppsection1/part_b/g0.ply … … 40 40 quitOnFinish false 41 41 computeVisibility true 42 applyVisibilityFilter true 42 applyVisibilityFilter false 43 applyVisibilitySpatialFilter true 43 44 visibilityFilterWidth 0.01 44 45 visibilityFile visibility.xml … … 279 280 # filename ../data/soda/soda5-viewcells.xml 280 281 # filename ../scripts/viewcells_atlanta.xml 281 #filename ../data/soda/soda5-viewcells2.xml282 filename ../data/soda/soda5-viewcells2.xml 282 283 # filename ../data/atlanta/viewcells_atlanta3.xml 283 filename ../data/vienna/viewcells_vienna.xml284 # filename ../data/vienna/viewcells_vienna.xml 284 285 # filename ../data/vienna/viewcells_vienna2.xml 285 286 # filename ../data/vienna/vienna_simple-21-04-avs2-viewCells.xml
Note: See TracChangeset
for help on using the changeset viewer.