Changeset 1790 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 11/25/06 04:07:13 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1789 r1790 1956 1956 } 1957 1957 1958 /*1959 void1960 ViewCellsManager::AddSampleContributions(const VssRayContainer &rays)1961 {1962 if (!ViewCellsConstructed())1963 return;1964 1965 VssRayContainer::const_iterator it, it_end = rays.end();1966 cout <<"here60"<<endl;1967 for (it = rays.begin(); it != it_end; ++ it) {1968 AddSampleContributions(*(*it));1969 }1970 }1971 */1972 1958 1973 1959 int ViewCellsManager::GetMinPvsSize() const … … 1983 1969 } 1984 1970 1985 /*1986 void1987 ViewCellsManager::AddSampleContributions(VssRay &ray)1988 {cout << "here12" << endl;1989 // assumes viewcells have been stored...1990 ViewCellContainer *viewcells = &ray.mViewCells;1991 ViewCellContainer::const_iterator it;1992 1993 if (!ray.mTerminationObject)1994 return;1995 1996 Intersectable *obj = GetIntersectable(ray, true);1997 1998 for (it = viewcells->begin(); it != viewcells->end(); ++it)1999 {2000 ViewCell *viewcell = *it;2001 if (viewcell->GetValid())2002 {2003 Intersectable *entry = GetIntersectable(ray, true);2004 if (entry)2005 // if ray not outside of view space2006 viewcell->GetPvs().AddSample(entry, ray.mPdf);2007 }2008 }2009 }2010 */2011 1971 2012 1972 float ViewCellsManager::ComputeSampleContribution(VssRay &ray, 2013 1973 const bool addRays, 2014 1974 const bool storeViewCells) 2015 { cout << "$$$$$$$$$$$$$4here10" << endl;1975 { 2016 1976 ViewCellContainer viewcells; 2017 1977 … … 6041 6001 6042 6002 6003 #define PVS_ADD_DIRTY 1 6043 6004 float VspOspViewCellsManager::ComputeSampleContribution(VssRay &ray, 6044 6005 const bool addRays, … … 6094 6055 { 6095 6056 // todo: maybe not correct for kd node pvs 6096 /*if (viewcell->GetPvs().GetSampleContribution(6097 terminationObj, ray.mPdf, contribution))6057 if (viewcell->GetPvs().GetSampleContribution( 6058 terminationObj, ray.mPdf, contribution)) 6098 6059 { 6099 6060 ++ ray.mPvsContribution; 6100 6061 } 6101 ray.mRelativePvsContribution += contribution;*/ 6062 6063 ray.mRelativePvsContribution += contribution; 6102 6064 } 6103 6065 … … 6109 6071 #if SAMPLE_ORIGIN_OBJECTS 6110 6072 6111 /*if (originObj &&6073 if (originObj && 6112 6074 viewcell->GetPvs().GetSampleContribution(originObj, 6113 6075 ray.mPdf, … … 6116 6078 ++ ray.mPvsContribution; 6117 6079 ray.mRelativePvsContribution += contribution; 6118 } */6080 } 6119 6081 #endif 6120 6082 } … … 6135 6097 6136 6098 //$$JB hack 6137 float contrib; 6138 //viewCell->GetPvs().AddSampleDirtyCheck(terminationObj, ray.mPdf, contrib); 6139 viewCell->GetPvs().AddSample(terminationObj, ray.mPdf);//, contrib); 6140 6141 if (viewCell->GetPvs().GetSize() == 50) 6142 //if (viewCell->GetPvs().RequiresResort()) 6143 {Intersectable::NewMail(); 6144 cout << "\nbefore sort: " << viewCell->GetPvs().GetLastSorted() << " \n"; 6145 ObjectPvsIterator pit = viewCell->GetPvs().GetIterator(); int i = 0; 6146 while (pit.HasMoreEntries()) 6147 { 6148 ObjectPvsEntry entry = pit.Next(); 6149 Intersectable *object = entry.mObject; 6150 6151 if ((i ++) == viewCell->GetPvs().GetLastSorted()) 6152 cout << "| "; 6153 6154 //if (object->Mailed()) cout << "error!!"<<endl; 6155 object->Mail(); 6156 cout << (int)object << " "; 6157 } 6158 6159 //viewCell->GetPvs().Sort(); 6160 6161 /*cout << "\nafter sort\n"; 6162 pit = viewCell->GetPvs().GetIterator(); i = 0; 6163 while (pit.HasMoreEntries()) 6164 { 6165 ObjectPvsEntry entry = pit.Next(); 6166 Intersectable *object = entry.mObject; 6167 6168 if ((i ++) == viewCell->GetPvs().GetLastSorted()) 6169 cout << "| "; 6170 cout << (int)object << " "; 6171 }*/ 6172 } 6173 //else cout << "b"; 6099 6100 #if PVS_ADD_DIRTY 6101 viewCell->GetPvs().AddSampleDirtyCheck(terminationObj, ray.mPdf); 6102 #else 6103 viewCell->GetPvs().AddSample(terminationObj, ray.mPdf); 6104 #endif 6105 6174 6106 #if SAMPLE_ORIGIN_OBJECTS 6175 //viewCell->GetPvs().AddSample(originObj, ray.mPdf); 6107 #if PVS_ADD_DIRTY 6108 viewCell->GetPvs().AddSampleDirtyCheck(originObj, ray.mPdf); 6109 #else 6110 viewCell->GetPvs().AddSample(originObj, ray.mPdf); 6176 6111 #endif 6112 #endif 6113 if (viewCell->GetPvs().RequiresResort()) 6114 { 6115 viewCell->GetPvs().Sort(); 6116 } 6177 6117 } 6178 6118 … … 6310 6250 ////////////// 6311 6251 // filtered stats 6252 6312 6253 sprintf(suffix, "-%09d-eval-filter.log", castSamples); 6313 6254 const string filename2 = string(statsPrefix) + string(suffix);
Note: See TracChangeset
for help on using the changeset viewer.