Changeset 2162 for GTP/trunk/Lib/Vis
- Timestamp:
- 02/23/07 18:37:15 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 62 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility_internal.sh
r2130 r2162 14 14 15 15 #NUM_SAMPLE_RAYS=1000000000 16 NUM_SAMPLE_RAYS= 1000000016 NUM_SAMPLE_RAYS=20000000 17 17 18 18 $PREPROCESSOR -total_samples=$NUM_SAMPLE_RAYS \ -
GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h
r2161 r2162 8 8 #include "PvsBase.h" 9 9 #include "google/dense_hash_set" 10 #include "google/dense_hash_map" 10 11 11 12 … … 24 25 }; 25 26 26 size_t operator()(T a) const27 /*int operator()(T a) const 27 28 { 29 if (!a) 30 return -2; 28 31 return (size_t)(a->GetId()); 32 }*/ 33 34 int operator()(int a) const 35 { 36 return a; 29 37 } 38 30 39 31 40 bool operator()(T a, T b) const … … 36 45 37 46 38 #define HASH_SET google::dense_hash_set<T, my_hash_compare<T> > 47 //#define HASH_SET google::dense_hash_set<T, my_hash_compare<T> > 48 #define HASH_SET google::dense_hash_map<int, T>//, hash_compare<int> > 39 49 //#define HASH_SET stdext::hash_set<T, my_hash_compare<T> > 40 50 #define HASH_ITERATOR HASH_SET::iterator … … 63 73 T Next(S &pdf) 64 74 { 65 T sample = *mItCurrent;75 T sample = (*mItCurrent).second; 66 76 ++ mItCurrent; 67 77 … … 71 81 T Next() 72 82 { 73 T sample = *mItCurrent;83 T sample = (*mItCurrent).second; 74 84 ++ mItCurrent; 75 85 … … 94 104 95 105 //HashPvs(): mEntries((Intersectable *)100) {}; 96 HashPvs() {}; 106 HashPvs() 107 { 108 mEntries.set_deleted_key(-1); 109 mEntries.set_empty_key(-2); 110 //mEntries.Reset(); 111 }; 97 112 //virtual ~HashPvs() {}; 98 113 … … 207 222 bool HashPvs<T, S>::Find(T sample, typename HASH_ITERATOR &it) 208 223 { 209 it = mEntries.find(sample );224 it = mEntries.find(sample->GetId()); 210 225 211 226 // already in map 212 227 return (it != mEntries.end()); 213 return false;214 228 } 215 229 … … 237 251 return 0.0f; 238 252 239 mEntries.insert( sample);253 mEntries.insert(pair<int, T>(sample->GetId(), sample)); 240 254 return 1.0f; 241 242 /*pair<HASH_SET::iterator, bool> p = mEntries.insert(sample);243 244 if (p.second)245 return 0.0f;246 else247 return 1.0f;*/248 255 } 249 256 … … 257 264 if (!Find(sample, it)) 258 265 { 259 mEntries.insert(sample); 260 } 261 262 //pair<HASH_SET::iterator, bool> p = mEntries.insert(sample); 266 mEntries.insert(pair<int, T>(sample->GetId(), sample)); 267 } 263 268 } 264 269 … … 268 273 const float pdf) 269 274 { 270 /*pair<HASH_ITERATOR, bool> p = mEntries.insert(sample); 275 static CONST_HASH_ITERATOR it; 276 277 it = mEntries.find(sample->GetId());//, sample); 271 278 272 279 // already in map 273 return p.second; 274 */ 275 static HASH_ITERATOR it; 280 const bool found = (it != mEntries.end()); 276 281 277 282 // already in map 278 if (Find(sample, it)) 283 if (found) 284 //if (Find(pair<int, T>(sample->GetId(), sample), it)) 279 285 return false; 280 281 mEntries.insert(sample); 286 287 mEntries.insert(pair<int, T>(sample->GetId(), sample)); 288 282 289 return true; 283 290 } … … 375 382 for (ait = a.mEntries.begin(); ait != ait_end; ++ ait) 376 383 { 377 mergedPvs.AddSample( *ait, 1.0f);384 mergedPvs.AddSample((*ait).second, 1.0f); 378 385 } 379 386 … … 382 389 for (bit = b.mEntries.begin(); bit != bit_end; ++ bit) 383 390 { 384 mergedPvs.AddSample(*bit, 1.0f); 385 } 386 391 mergedPvs.AddSample((*bit).second, 1.0f); 392 } 387 393 } 388 394 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
r2161 r2162 72 72 OptimizeForWindowsApplication="TRUE" 73 73 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;Timer" 74 PreprocessorDefinitions="WIN32;NDEBUG;_LIB; "74 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;USE_VERBOSE_PVS" 75 75 ExceptionHandling="TRUE" 76 76 RuntimeLibrary="2" … … 1151 1151 </File> 1152 1152 <File 1153 RelativePath=".\sparsehash\src\google\dense_hash_map"> 1154 </File> 1155 <File 1156 RelativePath=".\sparsehash\src\google\dense_hash_set"> 1157 </File> 1158 <File 1153 1159 RelativePath=".\sparsehash\src\google\sparsehash\densehashtable.h"> 1154 1160 </File> 1155 1161 <File 1162 RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h"> 1163 </File> 1164 <File 1156 1165 RelativePath=".\sparsehash\src\windows\hash_fun.h"> 1157 1166 </File> 1158 1167 <File 1159 RelativePath=".\sparsehash\src\google\sparsehash\hash_fun.h">1160 </File>1161 <File1162 1168 RelativePath=".\sparsehash\src\windows\hash_map.h"> 1163 1169 </File> 1164 1170 <File 1171 RelativePath=".\sparsehash\src\google\sparse_hash_map"> 1172 </File> 1173 <File 1174 RelativePath=".\sparsehash\src\google\sparse_hash_set"> 1175 </File> 1176 <File 1165 1177 RelativePath=".\sparsehash\src\google\sparsehash\sparsehashtable.h"> 1178 </File> 1179 <File 1180 RelativePath=".\sparsehash\src\google\sparsetable"> 1166 1181 </File> 1167 1182 <File -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
r2161 r2162 89 89 void Reserve(const int number) { 90 90 cout<<"here3"<<endl; 91 //DEL_PTR(mRays);91 DEL_PTR(mRays); 92 92 cout<<"here44"<<endl; 93 93 mRays = new VssRay[number]; -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r2161 r2162 81 81 OptimizeForWindowsApplication="TRUE" 82 82 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\MultiLevelRayTracing;Timer" 83 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NO_QT "83 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NO_QT;USE_VERBOSE_PVS" 84 84 RuntimeLibrary="2" 85 85 EnableEnhancedInstructionSet="2"
Note: See TracChangeset
for help on using the changeset viewer.