Changeset 938 for GTP/trunk/Lib/Vis/Preprocessing/src
- Timestamp:
- 05/10/06 08:05:24 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r904 r938 49 49 50 50 if (optionalParams != NULL) 51 delete optionalParams;51 DEL_PTR(optionalParams); 52 52 } 53 53 … … 312 312 313 313 int 314 Environment::FindOption(const char *name, 315 const bool isFatal) const 314 Environment::FindOption(const char *name, const bool isFatal) const 316 315 { 317 316 int i; … … 2183 2182 } 2184 2183 2185 void 2184 bool 2186 2185 Environment::Parse(const int argc, char **argv, bool useExePath) 2187 2186 { 2188 2187 bool result = true; 2189 2188 // Read the names of the scene, environment and output files 2190 2189 ReadCmdlineParams(argc, argv, ""); … … 2217 2216 // error - bad input file name specified ? 2218 2217 cerr<<"Error parsing environment file "<<envFilename<<endl; 2218 result = false; 2219 2219 } 2220 2220 delete envFilename; … … 2231 2231 exit(0); 2232 2232 } 2233 2234 } 2235 2236 } 2233 2234 return true; 2235 } 2236 2237 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.h
r860 r938 336 336 //@} 337 337 338 voidParse(const int argc, char **argv, bool useExePath);338 bool Parse(const int argc, char **argv, bool useExePath); 339 339 340 340 void -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r931 r938 356 356 { 357 357 environment->GetStringValue("ViewCells.filename", buf); 358 mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects );358 mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, environment); 359 359 } 360 360 else … … 395 395 if (strcmp(name, "kdTree") == 0) 396 396 { 397 mViewCellsManager = new KdViewCellsManager(mKdTree );397 mViewCellsManager = new KdViewCellsManager(mKdTree, environment); 398 398 } 399 399 else if (strcmp(name, "bspTree") == 0) … … 402 402 403 403 mBspTree = new BspTree(); 404 mViewCellsManager = new BspViewCellsManager(mBspTree );404 mViewCellsManager = new BspViewCellsManager(mBspTree, environment); 405 405 } 406 406 else if (strcmp(name, "vspBspTree") == 0) … … 409 409 410 410 mVspBspTree = new VspBspTree(environment); 411 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree );411 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, environment); 412 412 } 413 413 else if (strcmp(name, "vspKdTree") == 0) … … 415 415 mVspKdTree = new VspKdTree(); 416 416 417 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree );417 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree, environment); 418 418 } 419 419 else if (strcmp(name, "sceneDependent") == 0) … … 424 424 Debug << "view cell type: Bsp" << endl; 425 425 426 mViewCellsManager = new BspViewCellsManager(mBspTree );426 mViewCellsManager = new BspViewCellsManager(mBspTree, environment); 427 427 } 428 428 else -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r883 r938 371 371 372 372 373 ViewCellsTree::ViewCellsTree(ViewCellsManager *vcm ):373 ViewCellsTree::ViewCellsTree(ViewCellsManager *vcm, Environment *env): 374 374 mRoot(NULL), 375 375 mUseAreaForPvs(false), … … 381 381 #endif 382 382 { 383 env ironment->GetBoolValue("ViewCells.Visualization.exportMergedViewCells", mExportMergedViewCells);384 env ironment->GetFloatValue("ViewCells.maxStaticMemory", mMaxMemory);383 env->GetBoolValue("ViewCells.Visualization.exportMergedViewCells", mExportMergedViewCells); 384 env->GetFloatValue("ViewCells.maxStaticMemory", mMaxMemory); 385 385 386 386 //-- merge options 387 environment->GetFloatValue("ViewCells.PostProcess.renderCostWeight", mRenderCostWeight); 388 environment->GetIntValue("ViewCells.PostProcess.minViewCells", mMergeMinViewCells); 389 environment->GetFloatValue("ViewCells.PostProcess.maxCostRatio", mMergeMaxCostRatio); 390 environment->GetBoolValue("ViewCells.PostProcess.refine", mRefineViewCells); 391 392 393 Debug << "========= view cell tree options ================\n"; 387 env->GetFloatValue("ViewCells.PostProcess.renderCostWeight", mRenderCostWeight); 388 env->GetIntValue("ViewCells.PostProcess.minViewCells", mMergeMinViewCells); 389 env->GetFloatValue("ViewCells.PostProcess.maxCostRatio", mMergeMaxCostRatio); 390 env->GetBoolValue("ViewCells.PostProcess.refine", mRefineViewCells); 391 392 env->GetIntValue("ViewCells.PostProcess.maxMergesPerPass", mMaxMergesPerPass); 393 env->GetFloatValue("ViewCells.PostProcess.avgCostMaxDeviation", mAvgCostMaxDeviation); 394 395 Debug << "============= view cell tree options ================\n"; 394 396 Debug << "minimum view cells: " << mMergeMinViewCells << endl; 395 397 Debug << "max cost ratio: " << mMergeMaxCostRatio << endl; 396 398 Debug << "max memory: " << mMaxMemory << endl; 397 399 Debug << "refining view cells: " << mRefineViewCells << endl; 398 Debug << " ********* view cell tree options ***************\n";400 Debug << "============= view cell tree options ================\n"; 399 401 400 402 MergeCandidate::sRenderCostWeight = mRenderCostWeight; … … 555 557 // maximal ratio of old expected render cost to expected render 556 558 // when the the render queue has to be reset. 557 float avgCostMaxDeviation;558 int maxMergesPerPass;559 559 int numMergedViewCells = 0; 560 561 environment->GetIntValue("ViewCells.PostProcess.maxMergesPerPass", maxMergesPerPass); 562 environment->GetFloatValue("ViewCells.PostProcess.avgCostMaxDeviation", avgCostMaxDeviation); 560 563 561 564 562 cout << "actual merge starts now ... " << endl; … … 570 568 //-- reset merge queue if the ratio of current expected cost / real expected cost 571 569 // too small or after a given number of merges 572 if ((mergedPerPass > m axMergesPerPass) ||573 ( avgCostMaxDeviation > mAvgRenderCost / realAvgRenderCost))570 if ((mergedPerPass > mMaxMergesPerPass) || 571 (mAvgCostMaxDeviation > mAvgRenderCost / realAvgRenderCost)) 574 572 { 575 573 Debug << "************ reset queue *****************\n" 576 << "ratios: " << avgCostMaxDeviation574 << "ratios: " << mAvgCostMaxDeviation 577 575 << " real avg render cost " << realAvgRenderCost << " average render cost " << mAvgRenderCost 578 << " merged per pass : " << mergedPerPass << " of maximal " << m axMergesPerPass << endl;576 << " merged per pass : " << mergedPerPass << " of maximal " << mMaxMergesPerPass << endl; 579 577 580 578 Debug << "Values before reset: " -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r881 r938 23 23 class ViewCellsManager; 24 24 class ViewCellLeaf; 25 class Environment; 25 26 26 27 /** Statistics for a view cell partition. … … 346 347 347 348 public: 348 ViewCellsTree(ViewCellsManager *vcm );349 ViewCellsTree(ViewCellsManager *vcm, Environment *env); 349 350 ~ViewCellsTree(); 350 351 … … 588 589 float mMaxMemory; 589 590 591 int mMaxMergesPerPass; 592 float mAvgCostMaxDeviation; 590 593 }; 591 594 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r931 r938 41 41 42 42 43 ViewCellsManager::ViewCellsManager( ):43 ViewCellsManager::ViewCellsManager(Environment *env): 44 44 mRenderer(NULL), 45 45 mInitialSamples(0), … … 54 54 mMaxPvsRatio(1.0), 55 55 mViewCellPvsIsUpdated(false) 56 ,mEnvironment(env) 56 57 { 57 58 mViewSpaceBox.Initialize(); 58 59 ParseEnvironment(); 59 60 60 mViewCellsTree = new ViewCellsTree(this );61 mViewCellsTree = new ViewCellsTree(this, env); 61 62 } 62 63 … … 65 66 { 66 67 // visualization stuff 67 environment->GetBoolValue("ViewCells.Visualization.exportRays", mExportRays);68 environment->GetBoolValue("ViewCells.Visualization.exportGeometry", mExportGeometry);69 environment->GetFloatValue("ViewCells.maxPvsRatio", mMaxPvsRatio);70 71 environment->GetBoolValue("ViewCells.pruneEmptyViewCells", mPruneEmptyViewCells);68 mEnvironment->GetBoolValue("ViewCells.Visualization.exportRays", mExportRays); 69 mEnvironment->GetBoolValue("ViewCells.Visualization.exportGeometry", mExportGeometry); 70 mEnvironment->GetFloatValue("ViewCells.maxPvsRatio", mMaxPvsRatio); 71 72 mEnvironment->GetBoolValue("ViewCells.pruneEmptyViewCells", mPruneEmptyViewCells); 72 73 73 74 // HACK … … 77 78 mMinPvsSize = 0; 78 79 79 environment->GetBoolValue("ViewCells.processOnlyValidViewCells", mOnlyValidViewCells);80 81 environment->GetIntValue("ViewCells.Construction.samples", mConstructionSamples);82 environment->GetIntValue("ViewCells.PostProcess.samples", mPostProcessSamples);83 environment->GetBoolValue("ViewCells.PostProcess.useRaysForMerge", mUseRaysForMerge);84 85 environment->GetIntValue("ViewCells.Visualization.samples", mVisualizationSamples);86 87 environment->GetIntValue("ViewCells.Construction.samplesPerPass", mSamplesPerPass);88 environment->GetBoolValue("ViewCells.exportToFile", mExportViewCells);89 90 environment->GetIntValue("ViewCells.active", mNumActiveViewCells);91 environment->GetBoolValue("ViewCells.PostProcess.compress", mCompressViewCells);92 environment->GetBoolValue("ViewCells.Visualization.useClipPlane", mUseClipPlaneForViz);93 environment->GetBoolValue("ViewCells.PostProcess.merge", mMergeViewCells);94 environment->GetBoolValue("ViewCells.evaluateViewCells", mEvaluateViewCells);95 environment->GetBoolValue("ViewCells.showVisualization", mShowVisualization);96 environment->GetIntValue("ViewCells.Filter.maxSize", mMaxFilterSize);97 environment->GetFloatValue("ViewCells.Filter.width", mFilterWidth);98 environment->GetIntValue("ViewCells.renderCostEvaluationType", mRenderCostEvaluationType);99 100 environment->GetBoolValue("ViewCells.exportBboxesForPvs", mExportBboxesForPvs);101 environment->GetBoolValue("ViewCells.exportPvs", mExportPvs);80 mEnvironment->GetBoolValue("ViewCells.processOnlyValidViewCells", mOnlyValidViewCells); 81 82 mEnvironment->GetIntValue("ViewCells.Construction.samples", mConstructionSamples); 83 mEnvironment->GetIntValue("ViewCells.PostProcess.samples", mPostProcessSamples); 84 mEnvironment->GetBoolValue("ViewCells.PostProcess.useRaysForMerge", mUseRaysForMerge); 85 86 mEnvironment->GetIntValue("ViewCells.Visualization.samples", mVisualizationSamples); 87 88 mEnvironment->GetIntValue("ViewCells.Construction.samplesPerPass", mSamplesPerPass); 89 mEnvironment->GetBoolValue("ViewCells.exportToFile", mExportViewCells); 90 91 mEnvironment->GetIntValue("ViewCells.active", mNumActiveViewCells); 92 mEnvironment->GetBoolValue("ViewCells.PostProcess.compress", mCompressViewCells); 93 mEnvironment->GetBoolValue("ViewCells.Visualization.useClipPlane", mUseClipPlaneForViz); 94 mEnvironment->GetBoolValue("ViewCells.PostProcess.merge", mMergeViewCells); 95 mEnvironment->GetBoolValue("ViewCells.evaluateViewCells", mEvaluateViewCells); 96 mEnvironment->GetBoolValue("ViewCells.showVisualization", mShowVisualization); 97 mEnvironment->GetIntValue("ViewCells.Filter.maxSize", mMaxFilterSize); 98 mEnvironment->GetFloatValue("ViewCells.Filter.width", mFilterWidth); 99 mEnvironment->GetIntValue("ViewCells.renderCostEvaluationType", mRenderCostEvaluationType); 100 101 mEnvironment->GetBoolValue("ViewCells.exportBboxesForPvs", mExportBboxesForPvs); 102 mEnvironment->GetBoolValue("ViewCells.exportPvs", mExportPvs); 102 103 103 104 char buf[100]; 104 environment->GetStringValue("ViewCells.samplingType", buf);105 mEnvironment->GetStringValue("ViewCells.samplingType", buf); 105 106 106 107 … … 119 120 } 120 121 121 environment->GetStringValue("ViewCells.Evaluation.samplingType", buf);122 mEnvironment->GetStringValue("ViewCells.Evaluation.samplingType", buf); 122 123 123 124 if (strcmp(buf, "box") == 0) … … 135 136 } 136 137 137 environment->GetStringValue("ViewCells.renderCostEvaluationType", buf);138 mEnvironment->GetStringValue("ViewCells.renderCostEvaluationType", buf); 138 139 139 140 if (strcmp(buf, "perobject") == 0) … … 151 152 } 152 153 153 environment->GetStringValue("ViewCells.Visualization.colorCode", buf);154 mEnvironment->GetStringValue("ViewCells.Visualization.colorCode", buf); 154 155 155 156 if (strcmp(buf, "PVS") == 0) … … 719 720 char s[64]; 720 721 721 environment->GetIntValue("ViewCells.Evaluation.samplesPerPass", samplesPerPass);722 environment->GetIntValue("ViewCells.Evaluation.samples", numSamples);722 mEnvironment->GetIntValue("ViewCells.Evaluation.samplesPerPass", samplesPerPass); 723 mEnvironment->GetIntValue("ViewCells.Evaluation.samples", numSamples); 723 724 724 725 char statsPrefix[100]; 725 environment->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix);726 mEnvironment->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix); 726 727 727 728 Debug << "view cell evaluation samples per pass: " << samplesPerPass << endl; … … 813 814 int histoPasses; 814 815 815 environment->GetBoolValue("ViewCells.Evaluation.histogram", useHisto);816 environment->GetIntValue("ViewCells.Evaluation.histoPasses", histoPasses);816 mEnvironment->GetBoolValue("ViewCells.Evaluation.histogram", useHisto); 817 mEnvironment->GetIntValue("ViewCells.Evaluation.histoPasses", histoPasses); 817 818 818 819 const int numLeaves = mViewCellsTree->GetNumInitialViewCells(mViewCellsTree->GetRoot()); … … 1162 1163 X3dParser parser; 1163 1164 1164 environment->GetFloatValue("ViewCells.height", parser.mViewCellHeight);1165 mEnvironment->GetFloatValue("ViewCells.height", parser.mViewCellHeight); 1165 1166 1166 1167 bool success = parser.ParseFile(filename, *this); … … 1588 1589 float pos; 1589 1590 1590 environment->GetFloatValue("ViewCells.Visualization.clipPlanePos", pos);1591 mEnvironment->GetFloatValue("ViewCells.Visualization.clipPlanePos", pos); 1591 1592 1592 1593 Vector3 point = mViewSpaceBox.Min() + mViewSpaceBox.Size() * pos; 1593 1594 1594 1595 if (mUseClipPlaneForViz) 1595 environment->GetIntValue("ViewCells.Visualization.clipPlaneAxis", axis);1596 mEnvironment->GetIntValue("ViewCells.Visualization.clipPlaneAxis", axis); 1596 1597 1597 1598 Vector3 normal(0,0,0); … … 2063 2064 2064 2065 2065 BspViewCellsManager::BspViewCellsManager(BspTree *bspTree ):2066 ViewCellsManager( ), mBspTree(bspTree)2067 { 2068 environment->GetIntValue("BspTree.Construction.samples", mInitialSamples);2066 BspViewCellsManager::BspViewCellsManager(BspTree *bspTree, Environment *env): 2067 ViewCellsManager(env), mBspTree(bspTree) 2068 { 2069 mEnvironment->GetIntValue("BspTree.Construction.samples", mInitialSamples); 2069 2070 mBspTree->SetViewCellsManager(this); 2070 2071 mBspTree->mViewCellsTree = mViewCellsTree; … … 2234 2235 { 2235 2236 char mstats[100]; 2236 environment->GetStringValue("ViewCells.mergeStats", mstats);2237 mEnvironment->GetStringValue("ViewCells.mergeStats", mstats); 2237 2238 mViewCellsTree->ExportStats(mstats); 2238 2239 } … … 2318 2319 { 2319 2320 char filename[100]; 2320 environment->GetStringValue("ViewCells.filename", filename);2321 mEnvironment->GetStringValue("ViewCells.filename", filename); 2321 2322 ExportViewCells(filename, mExportPvs, objects); 2322 2323 } … … 2326 2327 { 2327 2328 char filename[100]; 2328 environment->GetStringValue("ViewCells.boxesFilename", filename);2329 mEnvironment->GetStringValue("ViewCells.boxesFilename", filename); 2329 2330 ExportBoundingBoxes(filename, objects); 2330 2331 } … … 2386 2387 //-- visualization of the BSP splits 2387 2388 bool exportSplits = false; 2388 environment->GetBoolValue("BspTree.Visualization.exportSplits", exportSplits);2389 mEnvironment->GetBoolValue("BspTree.Visualization.exportSplits", exportSplits); 2389 2390 2390 2391 if (exportSplits) … … 2933 2934 2934 2935 2935 KdViewCellsManager::KdViewCellsManager(KdTree *kdTree ):2936 ViewCellsManager( ), mKdTree(kdTree), mKdPvsDepth(100)2936 KdViewCellsManager::KdViewCellsManager(KdTree *kdTree, Environment *env): 2937 ViewCellsManager(env), mKdTree(kdTree), mKdPvsDepth(100) 2937 2938 { 2938 2939 } … … 3237 3238 3238 3239 3239 VspKdViewCellsManager::VspKdViewCellsManager(VspKdTree *vspKdTree ):3240 ViewCellsManager( ), mVspKdTree(vspKdTree)3241 { 3242 environment->GetIntValue("VspKdTree.Construction.samples", mInitialSamples);3240 VspKdViewCellsManager::VspKdViewCellsManager(VspKdTree *vspKdTree, Environment *env): 3241 ViewCellsManager(env), mVspKdTree(vspKdTree) 3242 { 3243 mEnvironment->GetIntValue("VspKdTree.Construction.samples", mInitialSamples); 3243 3244 mVspKdTree->SetViewCellsManager(this); 3244 3245 } … … 3598 3599 3599 3600 3600 VspBspViewCellsManager::VspBspViewCellsManager(VspBspTree *vspBspTree ):3601 ViewCellsManager( ), mVspBspTree(vspBspTree)3602 { 3603 environment->GetIntValue("VspBspTree.Construction.samples", mInitialSamples);3601 VspBspViewCellsManager::VspBspViewCellsManager(VspBspTree *vspBspTree, Environment *env): 3602 ViewCellsManager(env), mVspBspTree(vspBspTree) 3603 { 3604 mEnvironment->GetIntValue("VspBspTree.Construction.samples", mInitialSamples); 3604 3605 mVspBspTree->SetViewCellsManager(this); 3605 3606 mVspBspTree->mViewCellsTree = mViewCellsTree; … … 3756 3757 ObjectPvs pvs; 3757 3758 3758 environment->GetStringValue("ViewCells.mergeStats", mstats);3759 mEnvironment->GetStringValue("ViewCells.mergeStats", mstats); 3759 3760 mViewCellsTree->ExportStats(mstats); 3760 3761 } … … 4010 4011 { 4011 4012 char filename[100]; 4012 environment->GetStringValue("ViewCells.filename", filename);4013 mEnvironment->GetStringValue("ViewCells.filename", filename); 4013 4014 ExportViewCells(filename, mExportPvs, objects); 4014 4015 } … … 4019 4020 { 4020 4021 char filename[100]; 4021 environment->GetStringValue("ViewCells.boxesFilename", filename);4022 mEnvironment->GetStringValue("ViewCells.boxesFilename", filename); 4022 4023 4023 4024 ExportBoundingBoxes(filename, objects); … … 4320 4321 //-- visualization of the BSP splits 4321 4322 bool exportSplits = false; 4322 environment->GetBoolValue("VspBspTree.Visualization.exportSplits", exportSplits);4323 mEnvironment->GetBoolValue("VspBspTree.Visualization.exportSplits", exportSplits); 4323 4324 4324 4325 if (exportSplits) … … 4723 4724 4724 4725 4725 ViewCellsManager *ViewCellsManager::LoadViewCells(const string filename,4726 ViewCellsManager *ViewCellsManager::LoadViewCells(const string &filename, 4726 4727 ObjectContainer *objects, 4728 Environment *env, 4727 4729 BoundingBoxConverter *bconverter) 4728 4730 { … … 4731 4733 ViewCellsManager *vm = NULL; 4732 4734 4733 Debug << "vc filename: " << filename << endl; 4734 4735 Debug << "here23 filename: " << filename << endl; 4735 4736 //BoundingBoxConverter bconverter; 4736 4737 4737 if (parser.ParseFile(filename, &vm, objects, bconverter ))4738 { 4738 if (parser.ParseFile(filename, &vm, objects, bconverter, env)) 4739 {Debug << "here25 filename: " << filename << endl; 4739 4740 //vm->PrepareLoadedViewCells(); 4740 4741 vm->ResetViewCells(); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r931 r938 33 33 class MergeCandidate; 34 34 class BoundingBoxConverter; 35 35 class Environment; 36 36 37 37 struct BspRay; … … 72 72 enum {PER_OBJECT, PER_TRIANGLE}; 73 73 74 /** Constructor taking the initial and construction samples. 75 @param initialSamples the maximal number of samples used for creating the hierarchy 76 of view cells 77 @param constructionSamples the maximal number of samples used for construction 78 */ 79 ViewCellsManager(const int initialSamples, const int constructionSamples); 80 81 ViewCellsManager(); 74 /** default constructor taking an environment file. 75 */ 76 ViewCellsManager(Environment *env); 82 77 83 78 virtual ~ViewCellsManager(); … … 434 429 @returns the view cells manager if loading was successful, false otherwise 435 430 */ 436 static ViewCellsManager *LoadViewCells(const string filename,431 static ViewCellsManager *LoadViewCells(const string &filename, 437 432 ObjectContainer *objects, 433 Environment *env, 438 434 BoundingBoxConverter *bconverter = NULL); 439 435 … … 559 555 bool mExportBboxesForPvs; 560 556 561 557 Environment *environment; 562 558 Plane3 mClipPlane; 563 559 … … 638 634 /// if pvs should be exported with view cells 639 635 bool mExportPvs; 636 637 Environment *mEnvironment; 640 638 }; 641 639 … … 652 650 used to construct the bsp tree. 653 651 */ 654 BspViewCellsManager(BspTree *tree );652 BspViewCellsManager(BspTree *tree, Environment *env); 655 653 656 654 ~BspViewCellsManager(); … … 739 737 public: 740 738 741 KdViewCellsManager(KdTree *tree );739 KdViewCellsManager(KdTree *tree, Environment *env); 742 740 743 741 int ConstructSubdivision(const ObjectContainer &objects, … … 795 793 /// depth of the KD tree nodes with represent the view cells 796 794 int mKdPvsDepth; 795 796 797 797 }; 798 798 … … 806 806 public: 807 807 808 VspKdViewCellsManager(VspKdTree *vspKdTree );808 VspKdViewCellsManager(VspKdTree *vspKdTree, Environment *env); 809 809 810 810 int ConstructSubdivision(const ObjectContainer &objects, … … 870 870 public: 871 871 872 VspBspViewCellsManager(VspBspTree *tree );872 VspBspViewCellsManager(VspBspTree *tree, Environment *env); 873 873 ~VspBspViewCellsManager(); 874 874 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r931 r938 65 65 // StdInParseHandlers: Constructors and Destructor 66 66 // --------------------------------------------------------------------------- 67 ViewCellsParseHandlers::ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter): 67 ViewCellsParseHandlers::ViewCellsParseHandlers(ObjectContainer *objects, 68 BoundingBoxConverter *bconverter, 69 Environment *env): 68 70 mElementCount(0) 69 71 , mAttrCount(0) … … 79 81 , mObjects(objects) 80 82 , mBoundingBoxConverter(bconverter) 83 , mEnvironment(env) 81 84 { 82 85 // mObjects = objects; … … 102 105 EndViewCells(); 103 106 107 if (element == "BoundingBoxes") 108 EndBoundingBoxes(); 109 110 // inside the view cell description 104 111 if (mParseViewCells) 105 112 { … … 150 157 void ViewCellsParseHandlers::EndBoundingBoxes() 151 158 { 152 // bounding boxes gathered: associate object ids with bounding boxes 159 // all bounding boxes gathered in this step => 160 // associate object ids with bounding boxes 153 161 if (mBoundingBoxConverter) 154 162 mBoundingBoxConverter->IdentifyObjects(mIBoundingBoxes, *mObjects); … … 605 613 //mCurrentBspNode = mBspTree->GetRoot(); 606 614 607 mViewCellsManager = new BspViewCellsManager(mBspTree );615 mViewCellsManager = new BspViewCellsManager(mBspTree, mEnvironment); 608 616 } 609 617 else if (strcmp(name, "vspBspTree") == 0) … … 613 621 mVspBspTree = new VspBspTree(); 614 622 //mCurrentBspNode = mVspBspTree->GetRoot(); 615 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree );623 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, mEnvironment); 616 624 617 625 mVspBspTree->mBox = mViewSpaceBox; … … 622 630 // TODO 623 631 mVspKdTree = new VspKdTree(); 624 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree );632 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree, mEnvironment); 625 633 } 626 634 else … … 692 700 ViewCellsManager **viewCells, 693 701 ObjectContainer *objects, 694 BoundingBoxConverter *bconverter) 702 BoundingBoxConverter *bconverter, 703 Environment *env) 695 704 { 696 705 // Initialize the XML4C system … … 724 733 // to do. 725 734 // 726 ViewCellsParseHandlers handler(objects, bconverter );735 ViewCellsParseHandlers handler(objects, bconverter, env); 727 736 parser->setDocumentHandler(&handler); 728 737 parser->setErrorHandler(&handler); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.h
r931 r938 10 10 class VspBspTree; 11 11 class BoundingBoxConverter; 12 class Environment; 12 13 13 14 class ViewCellsParser : public Parser … … 20 21 ViewCellsManager **viewCells, 21 22 ObjectContainer *objectsm, 22 BoundingBoxConverter *bconverter); 23 BoundingBoxConverter *bconverter, 24 Environment *env); 23 25 }; 24 26 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
r931 r938 28 28 // Constructors and Destructor 29 29 // ----------------------------------------------------------------------- 30 ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter );30 ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter, Environment *env); 31 31 ~ViewCellsParseHandlers(); 32 32 … … 84 84 85 85 IndexedBoundingBoxContainer mIBoundingBoxes; 86 Environment *mEnvironment; 86 87 87 88 bool mParseViewCells;
Note: See TracChangeset
for help on using the changeset viewer.