Changeset 1022 for GTP/trunk/Lib/Vis/Preprocessing/src
- Timestamp:
- 06/19/06 17:07:49 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1021 r1022 13 13 #include "PlyParser.h" 14 14 #include "SamplingStrategy.h" 15 #include "VspOspTree.h" 15 16 16 17 … … 433 434 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree); 434 435 } 435 #if 0436 436 else if (strcmp(name, "vspOspTree") == 0) 437 437 { 438 mVspOspTree = new VspOspTree(); 439 mViewCellsManager = new VspOspViewCellsManager(mVspOspTree); 440 } 441 #endif 438 mVspTree = new VspTree(); 439 mOspTree = new OspTree(); 440 441 mViewCellsManager = new VspOspViewCellsManager(mVspTree, mOspTree); 442 } 442 443 else if (strcmp(name, "sceneDependent") == 0) 443 444 { -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r1020 r1022 22 22 struct VssRayContainer; 23 23 class SamplingStrategy; 24 25 24 class GlRendererBuffer; 25 class VspTree; 26 class OspTree; 26 27 27 28 /** Namespace for the external visibility preprocessor … … 134 135 VssRayContainer &vssRays) {}; 135 136 137 /** Returns a view cells manager with respect to the given name. 138 */ 136 139 ViewCellsManager *CreateViewCellsManager(const char *name); 137 140 … … 144 147 /// kD-tree organizing the scene graph (occluders + occludees) + viewcells 145 148 KdTree *mKdTree; 146 147 149 /// View space partition bsp tree 148 150 VspBspTree *mVspBspTree; 151 // view space partition tree 152 VspTree *mVspTree; 153 /// object space partition tree 154 OspTree *mOspTree; 155 /// BSP tree representing the viewcells 156 BspTree *mBspTree; 157 158 149 159 /// list of all loaded occluders 150 160 ObjectContainer mOccluders; … … 152 162 ObjectContainer mOccludees; 153 163 154 /// BSP tree representing the viewcells 155 BspTree *mBspTree; 156 164 157 165 ViewCellsManager *mViewCellsManager; 158 166 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1021 r1022 113 113 mSamplingType = Preprocessor::DIRECTION_BASED_DISTRIBUTION; 114 114 } 115 else if (strcmp(buf, "interior") == 0) 115 else if (strcmp(buf, "object_directional") == 0) 116 { 117 mSamplingType = Preprocessor::OBJECT_DIRECTION_BASED_DISTRIBUTION; 118 } 119 /*else if (strcmp(buf, "interior") == 0) 116 120 { 117 121 mSamplingType = Preprocessor::OBJECTS_INTERIOR_DISTRIBUTION; 118 } 119 else if (strcmp(buf, "object_directional") == 0) 120 { 121 mSamplingType = Preprocessor::OBJECT_DIRECTION_BASED_DISTRIBUTION; 122 } 122 }*/ 123 123 else 124 124 { … … 142 142 mEvaluationSamplingType = Preprocessor::OBJECT_DIRECTION_BASED_DISTRIBUTION; 143 143 } 144 else if (strcmp(buf, "interior") == 0)144 /*else if (strcmp(buf, "interior") == 0) 145 145 { 146 146 mEvaluationSamplingType = Preprocessor::OBJECTS_INTERIOR_DISTRIBUTION; 147 } 147 }*/ 148 148 else 149 149 { … … 2358 2358 2359 2359 2360 2361 2362 2360 void ViewCellsManager::ExportColor(Exporter *exporter, ViewCell *vc) const 2363 2361 { … … 2423 2421 2424 2422 2423 void ViewCellsManager::CollectMergeCandidates(const VssRayContainer &rays, 2424 vector<MergeCandidate> &candidates) 2425 { 2426 // implemented in subclasses 2427 } 2428 2425 2429 /**********************************************************************/ 2426 2430 /* BspViewCellsManager implementation */ -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r1021 r1022 368 368 369 369 virtual void CollectMergeCandidates(const VssRayContainer &rays, 370 vector<MergeCandidate> &candidates) = 0;370 vector<MergeCandidate> &candidates); 371 371 372 372 void CollectViewCells(const int n); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r1006 r1022 30 30 #include "ViewCellsManager.h" 31 31 #include "GzFileInputSource.h" 32 #include "VspOspTree.h" 33 32 34 33 35 namespace GtpVisibilityPreprocessor { … … 621 623 mViewCellsManager = new BspViewCellsManager(mBspTree); 622 624 } 623 else // vspBspTree625 else if (strcmp(name, "vspBspTree") == 0) // 624 626 { 625 627 Debug << "view cell type: VspBsp" << endl; … … 631 633 mVspBspTree->mBox = mViewSpaceBox; 632 634 } 635 else if (strcmp(name, "vspOspTree") == 0) 636 { 637 Debug << "view cell type: VspOsp" << endl; 638 639 mVspTree = new VspTree(); 640 mOspTree = new OspTree(); 641 642 //mCurrentBspNode = mVspBspTree->GetRoot(); 643 mViewCellsManager = new VspOspViewCellsManager(mVspTree, mOspTree); 644 645 mVspTree->mBoundingBox = mViewSpaceBox; 646 } 647 633 648 634 649 mViewCellsTree = mViewCellsManager->GetViewCellsTree(); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
r1006 r1022 21 21 class ViewCellsManager; 22 22 class ViewCellsTree; 23 class VspTree; 24 class OspTree; 25 26 23 27 24 28 class ViewCellsParseHandlers: public HandlerBase … … 69 73 70 74 VspBspTree *mVspBspTree; 75 VspTree *mVspTree; 76 OspTree *mOspTree; 77 71 78 BspTree *mBspTree; 72 79 ViewCellsTree *mViewCellsTree; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
r1021 r1022 2310 2310 /*****************************************************************/ 2311 2311 2312 OspTree::OspTree(): 2313 mRoot(NULL) 2314 #if TODO 2315 mOutOfBoundsCell(NULL), 2316 mStoreRays(false), 2317 mUseRandomAxis(false), 2318 mTimeStamp(1) 2319 #endif 2320 { 2321 #if TODO 2322 bool randomize = false; 2323 Environment::GetSingleton()->GetBoolValue("VspTree.Construction.randomize", randomize); 2324 if (randomize) 2325 Randomize(); // initialise random generator for heuristics 2326 2327 //-- termination criteria for autopartition 2328 Environment::GetSingleton()->GetIntValue("VspTree.Termination.maxDepth", mTermMaxDepth); 2329 Environment::GetSingleton()->GetIntValue("VspTree.Termination.minPvs", mTermMinPvs); 2330 Environment::GetSingleton()->GetIntValue("VspTree.Termination.minRays", mTermMinRays); 2331 Environment::GetSingleton()->GetFloatValue("VspTree.Termination.minProbability", mTermMinProbability); 2332 Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxRayContribution", mTermMaxRayContribution); 2333 Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxCostRatio", mTermMaxCostRatio); 2334 Environment::GetSingleton()->GetIntValue("VspTree.Termination.missTolerance", mTermMissTolerance); 2335 Environment::GetSingleton()->GetIntValue("VspTree.Termination.maxViewCells", mMaxViewCells); 2336 2337 //-- max cost ratio for early tree termination 2338 Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxCostRatio", mTermMaxCostRatio); 2339 2340 Environment::GetSingleton()->GetFloatValue("VspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio); 2341 Environment::GetSingleton()->GetIntValue("VspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance); 2342 2343 // HACK//mTermMinPolygons = 25; 2344 2345 //-- factors for bsp tree split plane heuristics 2346 Environment::GetSingleton()->GetFloatValue("VspTree.Termination.ct_div_ci", mCtDivCi); 2347 2348 //-- partition criteria 2349 Environment::GetSingleton()->GetFloatValue("VspTree.Construction.epsilon", mEpsilon); 2350 2351 // if only the driving axis is used for axis aligned split 2352 Environment::GetSingleton()->GetBoolValue("VspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 2353 2354 //Environment::GetSingleton()->GetFloatValue("VspTree.maxTotalMemory", mMaxTotalMemory); 2355 Environment::GetSingleton()->GetFloatValue("VspTree.maxStaticMemory", mMaxMemory); 2356 2357 Environment::GetSingleton()->GetBoolValue("VspTree.useCostHeuristics", mUseCostHeuristics); 2358 Environment::GetSingleton()->GetBoolValue("VspTree.simulateOctree", mCirculatingAxis); 2359 Environment::GetSingleton()->GetBoolValue("VspTree.useRandomAxis", mUseRandomAxis); 2360 Environment::GetSingleton()->GetIntValue("VspTree.nodePriorityQueueType", mNodePriorityQueueType); 2361 2362 char subdivisionStatsLog[100]; 2363 Environment::GetSingleton()->GetStringValue("VspTree.subdivisionStats", subdivisionStatsLog); 2364 mSubdivisionStats.open(subdivisionStatsLog); 2365 2366 Environment::GetSingleton()->GetFloatValue("VspTree.Construction.minBand", mMinBand); 2367 Environment::GetSingleton()->GetFloatValue("VspTree.Construction.maxBand", mMaxBand); 2368 2369 2370 //-- debug output 2371 2372 Debug << "******* VSP BSP options ******** " << endl; 2373 Debug << "max depth: " << mTermMaxDepth << endl; 2374 Debug << "min PVS: " << mTermMinPvs << endl; 2375 Debug << "min probabiliy: " << mTermMinProbability << endl; 2376 Debug << "min rays: " << mTermMinRays << endl; 2377 Debug << "max ray contri: " << mTermMaxRayContribution << endl; 2378 Debug << "max cost ratio: " << mTermMaxCostRatio << endl; 2379 Debug << "miss tolerance: " << mTermMissTolerance << endl; 2380 Debug << "max view cells: " << mMaxViewCells << endl; 2381 Debug << "randomize: " << randomize << endl; 2382 2383 Debug << "min global cost ratio: " << mTermMinGlobalCostRatio << endl; 2384 Debug << "global cost miss tolerance: " << mTermGlobalCostMissTolerance << endl; 2385 Debug << "only driving axis: " << mOnlyDrivingAxis << endl; 2386 Debug << "max memory: " << mMaxMemory << endl; 2387 Debug << "use cost heuristics: " << mUseCostHeuristics << endl; 2388 Debug << "subdivision stats log: " << subdivisionStatsLog << endl; 2389 Debug << "use random axis: " << mUseRandomAxis << endl; 2390 Debug << "priority queue type: " << mNodePriorityQueueType << endl; 2391 Debug << "circulating axis: " << mCirculatingAxis << endl; 2392 Debug << "minband: " << mMinBand << endl; 2393 Debug << "maxband: " << mMaxBand << endl; 2394 2395 2396 mSplitCandidates = new vector<SortableEntry>; 2397 2398 Debug << endl; 2399 #endif 2400 } 2401 2402 2312 2403 2313 2404 void OspTree::SplitObjects(const AxisAlignedPlane & splitPlane,
Note: See TracChangeset
for help on using the changeset viewer.