Changeset 1626 for GTP/trunk/Lib/Vis
- Timestamp:
- 10/16/06 17:17:42 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1625 r1626 273 273 274 274 275 void HierarchyManager::ConstructInterleaved 2(const VssRayContainer &sampleRays,276 277 275 void HierarchyManager::ConstructInterleavedWithGradient(const VssRayContainer &sampleRays, 276 const ObjectContainer &objects, 277 AxisAlignedBox3 *forcedViewSpace) 278 278 { 279 279 mHierarchyStats.Reset(); -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1625 r1626 216 216 /** Exports object space hierarchy for visualization. 217 217 */ 218 void ExportObjectSpaceHierarchy( 219 Exporter *exporter, 220 const ObjectContainer &objects, 221 const AxisAlignedBox3 *bbox, 222 const bool exportBounds = true) const; 218 void ExportObjectSpaceHierarchy(Exporter *exporter, 219 const ObjectContainer &objects, 220 const AxisAlignedBox3 *bbox, 221 const bool exportBounds = true) const; 223 222 224 223 /** Returns intersectable pierced by this ray. 225 224 */ 226 Intersectable *GetIntersectable( 227 const VssRay &ray, 228 const bool isTermination) const; 225 Intersectable *GetIntersectable(const VssRay &ray, const bool isTermination) const; 226 227 /** Export object space partition bounding boxes. 228 */ 229 void ExportBoundingBoxes(OUT_STREAM &stream, const ObjectContainer &objects); 229 230 230 231 friend ostream &operator<<(ostream &s, const HierarchyManager &hm) … … 233 234 return s; 234 235 } 235 236 void ExportBoundingBoxes(OUT_STREAM &stream, const ObjectContainer &objects);237 238 236 239 237 protected: … … 386 384 for the next split. 387 385 */ 388 void ConstructInterleaved( 389 const VssRayContainer &sampleRays, 390 const ObjectContainer &objects, 391 AxisAlignedBox3 *forcedViewSpace); 386 void ConstructInterleaved(const VssRayContainer &sampleRays, 387 const ObjectContainer &objects, 388 AxisAlignedBox3 *forcedViewSpace); 392 389 393 390 /** Construct object space partition interleaved with view space partition. … … 399 396 next number of split. 400 397 */ 401 void ConstructInterleaved2( 402 const VssRayContainer &sampleRays, 403 const ObjectContainer &objects, 404 AxisAlignedBox3 *forcedViewSpace); 398 void ConstructInterleavedWithGradient(const VssRayContainer &sampleRays, 399 const ObjectContainer &objects, 400 AxisAlignedBox3 *forcedViewSpace); 405 401 406 402 /** Use iteration to construct the object space hierarchy. 407 403 */ 408 void ConstructMultiLevel( 409 const VssRayContainer &sampleRays, 410 const ObjectContainer &objects, 411 AxisAlignedBox3 *forcedViewSpace); 404 void ConstructMultiLevel(const VssRayContainer &sampleRays, 405 const ObjectContainer &objects, 406 AxisAlignedBox3 *forcedViewSpace); 412 407 413 408 /** Reset the object space subdivision. -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1613 r1626 817 817 bool Preprocessor::InitRayCast(const string externKdTree, const string internkdtree) 818 818 { 819 bool loadKdTree; 820 Environment::GetSingleton()->GetBoolValue("Preprocessor.loadKdTree", loadKdTree); 819 bool loadKdTree = true; 820 //Environment::GetSingleton()->GetBoolValue("Preprocessor.loadKdTree", loadKdTree); 821 821 822 822 823 if (!loadKdTree) 823 { 824 { ///////// 824 825 //-- build new kd tree from scene geometry 826 825 827 BuildKdTree(); 826 828 KdTreeStatistics(cout); -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1613 r1626 61 61 62 62 63 64 65 string ReplaceSuffix(string filename, 66 string a, 67 string b) 68 { 69 string result = filename; 70 71 int pos = (int)filename.rfind(a, (int)filename.size() - 1); 72 if (pos == filename.size() - a.size()) { 73 result.replace(pos, a.size(), b); 74 } 75 return result; 76 } 63 static string ReplaceSuffix(string filename, string a, string b) 64 { 65 string result = filename; 66 67 int pos = (int)filename.rfind(a, (int)filename.size() - 1); 68 if (pos == filename.size() - a.size()) { 69 result.replace(pos, a.size(), b); 70 } 71 return result; 72 } 73 74 75 static string GetInternKdTreeName(string &filename) 76 { 77 //Environment::GetSingleton()->GetStringValue("Preprocessor.kdTreeFilename", internKdTree); 78 79 // hack! should take any extension 80 if (strstr(filename.c_str(), ".x3d")) 81 { 82 return ReplaceSuffix(filename, ".x3d", ".kd"); 83 } 84 else if (strstr(filename.c_str(), ".dat")) 85 { 86 return ReplaceSuffix(filename, ".dat", ".kd"); 87 } 88 else if (strstr(filename.c_str(), ".obj")) 89 { 90 return ReplaceSuffix(filename, ".dat", ".kd"); 91 } 92 93 cerr << "Error: Currently unsupported format for kd, filename " << filename << endl; 94 95 // return empty string 96 return string(); 97 } 98 77 99 78 100 int … … 126 148 } 127 149 128 string externKdTree = ReplaceSuffix(filename, ".obj", ".kdf"); 129 char internKdTree[100]; 130 Environment::GetSingleton()->GetStringValue("Preprocessor.kdTreeFilename", internKdTree); 131 //const string internKdTree = ReplaceSuffic(filename, ".x3d", ".kd"); 150 const string externKdTree = ReplaceSuffix(filename, ".obj", ".kdf"); 151 const string internKdTree = GetInternKdTreeName(filename); 132 152 133 153 //-- initialize external ray casters
Note: See TracChangeset
for help on using the changeset viewer.