Ignore:
Timestamp:
05/10/06 08:05:24 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r904 r938  
    4949   
    5050  if (optionalParams != NULL) 
    51     delete optionalParams; 
     51    DEL_PTR(optionalParams); 
    5252} 
    5353 
     
    312312 
    313313int 
    314 Environment::FindOption(const char *name, 
    315                         const bool isFatal) const 
     314Environment::FindOption(const char *name, const bool isFatal) const 
    316315{ 
    317316  int i; 
     
    21832182} 
    21842183 
    2185 void 
     2184bool 
    21862185Environment::Parse(const int argc, char **argv, bool useExePath) 
    21872186{ 
    2188    
     2187  bool result = true; 
    21892188  // Read the names of the scene, environment and output files 
    21902189  ReadCmdlineParams(argc, argv, ""); 
     
    22172216    // error - bad input file name specified ? 
    22182217    cerr<<"Error parsing environment file "<<envFilename<<endl; 
     2218        result = false; 
    22192219  } 
    22202220  delete envFilename; 
     
    22312231    exit(0); 
    22322232  } 
    2233  
    2234 } 
    2235  
    2236 } 
     2233   
     2234  return true; 
     2235} 
     2236 
     2237} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.h

    r860 r938  
    336336  //@} 
    337337 
    338   void Parse(const int argc, char **argv, bool useExePath); 
     338  bool Parse(const int argc, char **argv, bool useExePath); 
    339339 
    340340  void 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r931 r938  
    356356        { 
    357357                environment->GetStringValue("ViewCells.filename", buf); 
    358                 mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects); 
     358                mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, environment); 
    359359        } 
    360360        else 
     
    395395        if (strcmp(name, "kdTree") == 0) 
    396396        { 
    397                 mViewCellsManager = new KdViewCellsManager(mKdTree); 
     397                mViewCellsManager = new KdViewCellsManager(mKdTree, environment); 
    398398        } 
    399399        else if (strcmp(name, "bspTree") == 0) 
     
    402402 
    403403                mBspTree = new BspTree(); 
    404                 mViewCellsManager = new BspViewCellsManager(mBspTree); 
     404                mViewCellsManager = new BspViewCellsManager(mBspTree, environment); 
    405405        } 
    406406        else if (strcmp(name, "vspBspTree") == 0) 
     
    409409 
    410410                mVspBspTree = new VspBspTree(environment); 
    411                 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree); 
     411                mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, environment); 
    412412        } 
    413413        else if (strcmp(name, "vspKdTree") == 0) 
     
    415415                mVspKdTree = new VspKdTree();            
    416416         
    417                 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree); 
     417                mViewCellsManager = new VspKdViewCellsManager(mVspKdTree, environment); 
    418418        } 
    419419        else if (strcmp(name, "sceneDependent") == 0) 
     
    424424                Debug << "view cell type: Bsp" << endl; 
    425425                 
    426                 mViewCellsManager = new BspViewCellsManager(mBspTree); 
     426                mViewCellsManager = new BspViewCellsManager(mBspTree, environment); 
    427427        } 
    428428        else 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp

    r883 r938  
    371371 
    372372 
    373 ViewCellsTree::ViewCellsTree(ViewCellsManager *vcm): 
     373ViewCellsTree::ViewCellsTree(ViewCellsManager *vcm, Environment *env): 
    374374mRoot(NULL), 
    375375mUseAreaForPvs(false), 
     
    381381#endif 
    382382{ 
    383         environment->GetBoolValue("ViewCells.Visualization.exportMergedViewCells", mExportMergedViewCells); 
    384         environment->GetFloatValue("ViewCells.maxStaticMemory", mMaxMemory); 
     383        env->GetBoolValue("ViewCells.Visualization.exportMergedViewCells", mExportMergedViewCells); 
     384        env->GetFloatValue("ViewCells.maxStaticMemory", mMaxMemory); 
    385385 
    386386        //-- 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"; 
    394396        Debug << "minimum view cells: " << mMergeMinViewCells << endl; 
    395397        Debug << "max cost ratio: " << mMergeMaxCostRatio << endl; 
    396398        Debug << "max memory: " << mMaxMemory << endl; 
    397399        Debug << "refining view cells: " << mRefineViewCells << endl; 
    398         Debug << "********* view cell tree options ***************\n"; 
     400        Debug << "============= view cell tree options ================\n"; 
    399401 
    400402        MergeCandidate::sRenderCostWeight = mRenderCostWeight; 
     
    555557        // maximal ratio of old expected render cost to expected render 
    556558        // when the the render queue has to be reset. 
    557         float avgCostMaxDeviation; 
    558         int maxMergesPerPass; 
    559559        int numMergedViewCells = 0; 
    560          
    561         environment->GetIntValue("ViewCells.PostProcess.maxMergesPerPass", maxMergesPerPass); 
    562         environment->GetFloatValue("ViewCells.PostProcess.avgCostMaxDeviation", avgCostMaxDeviation); 
     560                 
    563561 
    564562        cout << "actual merge starts now ... " << endl; 
     
    570568                //-- reset merge queue if the ratio of current expected cost / real expected cost 
    571569                //   too small or after a given number of merges 
    572                 if ((mergedPerPass > maxMergesPerPass) || 
    573                         (avgCostMaxDeviation > mAvgRenderCost / realAvgRenderCost)) 
     570                if ((mergedPerPass > mMaxMergesPerPass) || 
     571                        (mAvgCostMaxDeviation > mAvgRenderCost / realAvgRenderCost)) 
    574572                { 
    575573                        Debug << "************ reset queue *****************\n" 
    576                                   << "ratios: " << avgCostMaxDeviation  
     574                                  << "ratios: " << mAvgCostMaxDeviation  
    577575                                  << " real avg render cost " << realAvgRenderCost << " average render cost " << mAvgRenderCost 
    578                                   << " merged per pass : " << mergedPerPass << " of maximal " << maxMergesPerPass << endl; 
     576                                  << " merged per pass : " << mergedPerPass << " of maximal " << mMaxMergesPerPass << endl; 
    579577 
    580578                        Debug << "Values before reset: "   
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h

    r881 r938  
    2323class ViewCellsManager; 
    2424class ViewCellLeaf; 
     25class Environment; 
    2526 
    2627/** Statistics for a view cell partition. 
     
    346347 
    347348public: 
    348         ViewCellsTree(ViewCellsManager *vcm); 
     349        ViewCellsTree(ViewCellsManager *vcm, Environment *env); 
    349350        ~ViewCellsTree(); 
    350351 
     
    588589        float mMaxMemory; 
    589590 
     591        int mMaxMergesPerPass; 
     592        float mAvgCostMaxDeviation; 
    590593}; 
    591594 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r931 r938  
    4141 
    4242 
    43 ViewCellsManager::ViewCellsManager(): 
     43ViewCellsManager::ViewCellsManager(Environment *env): 
    4444mRenderer(NULL), 
    4545mInitialSamples(0), 
     
    5454mMaxPvsRatio(1.0), 
    5555mViewCellPvsIsUpdated(false) 
     56,mEnvironment(env) 
    5657{ 
    5758        mViewSpaceBox.Initialize(); 
    5859        ParseEnvironment(); 
    5960 
    60         mViewCellsTree = new ViewCellsTree(this); 
     61        mViewCellsTree = new ViewCellsTree(this, env); 
    6162} 
    6263 
     
    6566{ 
    6667        // 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); 
    7273 
    7374        // HACK 
     
    7778                mMinPvsSize = 0; 
    7879 
    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); 
    102103 
    103104        char buf[100]; 
    104         environment->GetStringValue("ViewCells.samplingType", buf); 
     105        mEnvironment->GetStringValue("ViewCells.samplingType", buf); 
    105106 
    106107         
     
    119120        } 
    120121 
    121         environment->GetStringValue("ViewCells.Evaluation.samplingType", buf); 
     122        mEnvironment->GetStringValue("ViewCells.Evaluation.samplingType", buf); 
    122123         
    123124        if (strcmp(buf, "box") == 0) 
     
    135136        } 
    136137 
    137         environment->GetStringValue("ViewCells.renderCostEvaluationType", buf); 
     138        mEnvironment->GetStringValue("ViewCells.renderCostEvaluationType", buf); 
    138139         
    139140        if (strcmp(buf, "perobject") == 0) 
     
    151152        } 
    152153 
    153     environment->GetStringValue("ViewCells.Visualization.colorCode", buf); 
     154    mEnvironment->GetStringValue("ViewCells.Visualization.colorCode", buf); 
    154155 
    155156        if (strcmp(buf, "PVS") == 0) 
     
    719720        char s[64];  
    720721 
    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); 
    723724 
    724725        char statsPrefix[100]; 
    725         environment->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix); 
     726        mEnvironment->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix); 
    726727 
    727728        Debug << "view cell evaluation samples per pass: " << samplesPerPass << endl; 
     
    813814        int histoPasses; 
    814815 
    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); 
    817818 
    818819        const int numLeaves = mViewCellsTree->GetNumInitialViewCells(mViewCellsTree->GetRoot()); 
     
    11621163        X3dParser parser; 
    11631164 
    1164         environment->GetFloatValue("ViewCells.height", parser.mViewCellHeight); 
     1165        mEnvironment->GetFloatValue("ViewCells.height", parser.mViewCellHeight); 
    11651166 
    11661167        bool success = parser.ParseFile(filename, *this); 
     
    15881589        float pos; 
    15891590 
    1590         environment->GetFloatValue("ViewCells.Visualization.clipPlanePos", pos); 
     1591        mEnvironment->GetFloatValue("ViewCells.Visualization.clipPlanePos", pos); 
    15911592 
    15921593        Vector3 point = mViewSpaceBox.Min() +  mViewSpaceBox.Size() * pos; 
    15931594 
    15941595        if (mUseClipPlaneForViz) 
    1595         environment->GetIntValue("ViewCells.Visualization.clipPlaneAxis", axis); 
     1596        mEnvironment->GetIntValue("ViewCells.Visualization.clipPlaneAxis", axis); 
    15961597 
    15971598        Vector3 normal(0,0,0); 
     
    20632064 
    20642065 
    2065 BspViewCellsManager::BspViewCellsManager(BspTree *bspTree): 
    2066 ViewCellsManager(), mBspTree(bspTree) 
    2067 { 
    2068         environment->GetIntValue("BspTree.Construction.samples", mInitialSamples); 
     2066BspViewCellsManager::BspViewCellsManager(BspTree *bspTree, Environment *env): 
     2067ViewCellsManager(env), mBspTree(bspTree) 
     2068{ 
     2069        mEnvironment->GetIntValue("BspTree.Construction.samples", mInitialSamples); 
    20692070        mBspTree->SetViewCellsManager(this); 
    20702071        mBspTree->mViewCellsTree = mViewCellsTree; 
     
    22342235        { 
    22352236                char mstats[100]; 
    2236                 environment->GetStringValue("ViewCells.mergeStats", mstats); 
     2237                mEnvironment->GetStringValue("ViewCells.mergeStats", mstats); 
    22372238                mViewCellsTree->ExportStats(mstats); 
    22382239        } 
     
    23182319        { 
    23192320                char filename[100]; 
    2320                 environment->GetStringValue("ViewCells.filename", filename); 
     2321                mEnvironment->GetStringValue("ViewCells.filename", filename); 
    23212322                ExportViewCells(filename, mExportPvs, objects); 
    23222323        } 
     
    23262327        { 
    23272328                char filename[100]; 
    2328                 environment->GetStringValue("ViewCells.boxesFilename", filename); 
     2329                mEnvironment->GetStringValue("ViewCells.boxesFilename", filename); 
    23292330                ExportBoundingBoxes(filename, objects); 
    23302331        } 
     
    23862387        //-- visualization of the BSP splits 
    23872388        bool exportSplits = false; 
    2388         environment->GetBoolValue("BspTree.Visualization.exportSplits", exportSplits); 
     2389        mEnvironment->GetBoolValue("BspTree.Visualization.exportSplits", exportSplits); 
    23892390 
    23902391        if (exportSplits) 
     
    29332934 
    29342935 
    2935 KdViewCellsManager::KdViewCellsManager(KdTree *kdTree): 
    2936 ViewCellsManager(), mKdTree(kdTree), mKdPvsDepth(100) 
     2936KdViewCellsManager::KdViewCellsManager(KdTree *kdTree, Environment *env): 
     2937ViewCellsManager(env), mKdTree(kdTree), mKdPvsDepth(100) 
    29372938{ 
    29382939} 
     
    32373238 
    32383239 
    3239 VspKdViewCellsManager::VspKdViewCellsManager(VspKdTree *vspKdTree): 
    3240 ViewCellsManager(), mVspKdTree(vspKdTree) 
    3241 { 
    3242         environment->GetIntValue("VspKdTree.Construction.samples", mInitialSamples); 
     3240VspKdViewCellsManager::VspKdViewCellsManager(VspKdTree *vspKdTree, Environment *env): 
     3241ViewCellsManager(env), mVspKdTree(vspKdTree) 
     3242{ 
     3243        mEnvironment->GetIntValue("VspKdTree.Construction.samples", mInitialSamples); 
    32433244        mVspKdTree->SetViewCellsManager(this); 
    32443245} 
     
    35983599 
    35993600 
    3600 VspBspViewCellsManager::VspBspViewCellsManager(VspBspTree *vspBspTree): 
    3601 ViewCellsManager(), mVspBspTree(vspBspTree) 
    3602 { 
    3603         environment->GetIntValue("VspBspTree.Construction.samples", mInitialSamples); 
     3601VspBspViewCellsManager::VspBspViewCellsManager(VspBspTree *vspBspTree, Environment *env): 
     3602ViewCellsManager(env), mVspBspTree(vspBspTree) 
     3603{ 
     3604        mEnvironment->GetIntValue("VspBspTree.Construction.samples", mInitialSamples); 
    36043605        mVspBspTree->SetViewCellsManager(this); 
    36053606        mVspBspTree->mViewCellsTree = mViewCellsTree; 
     
    37563757                ObjectPvs pvs; 
    37573758 
    3758                 environment->GetStringValue("ViewCells.mergeStats", mstats); 
     3759                mEnvironment->GetStringValue("ViewCells.mergeStats", mstats); 
    37593760                mViewCellsTree->ExportStats(mstats); 
    37603761        } 
     
    40104011        { 
    40114012                char filename[100]; 
    4012                 environment->GetStringValue("ViewCells.filename", filename); 
     4013                mEnvironment->GetStringValue("ViewCells.filename", filename); 
    40134014                ExportViewCells(filename, mExportPvs, objects); 
    40144015        } 
     
    40194020        { 
    40204021                char filename[100]; 
    4021                 environment->GetStringValue("ViewCells.boxesFilename", filename); 
     4022                mEnvironment->GetStringValue("ViewCells.boxesFilename", filename); 
    40224023         
    40234024                ExportBoundingBoxes(filename, objects); 
     
    43204321        //-- visualization of the BSP splits 
    43214322        bool exportSplits = false; 
    4322         environment->GetBoolValue("VspBspTree.Visualization.exportSplits", exportSplits); 
     4323        mEnvironment->GetBoolValue("VspBspTree.Visualization.exportSplits", exportSplits); 
    43234324 
    43244325        if (exportSplits) 
     
    47234724 
    47244725 
    4725 ViewCellsManager *ViewCellsManager::LoadViewCells(const string filename,  
     4726ViewCellsManager *ViewCellsManager::LoadViewCells(const string &filename,  
    47264727                                                                                                  ObjectContainer *objects, 
     4728                                                                                                  Environment *env, 
    47274729                                                                                                  BoundingBoxConverter *bconverter) 
    47284730{ 
     
    47314733        ViewCellsManager *vm = NULL; 
    47324734 
    4733         Debug << "vc filename: " << filename << endl; 
    4734  
     4735        Debug << "here23 filename: " << filename << endl; 
    47354736        //BoundingBoxConverter bconverter; 
    47364737 
    4737         if (parser.ParseFile(filename, &vm, objects, bconverter)) 
    4738         { 
     4738        if (parser.ParseFile(filename, &vm, objects, bconverter, env)) 
     4739        {Debug << "here25 filename: " << filename << endl; 
    47394740                //vm->PrepareLoadedViewCells(); 
    47404741                vm->ResetViewCells(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r931 r938  
    3333class MergeCandidate; 
    3434class BoundingBoxConverter; 
    35  
     35class Environment; 
    3636 
    3737struct BspRay; 
     
    7272        enum {PER_OBJECT, PER_TRIANGLE}; 
    7373 
    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); 
    8277 
    8378        virtual ~ViewCellsManager(); 
     
    434429                @returns the view cells manager if loading was successful, false otherwise 
    435430        */ 
    436         static ViewCellsManager *LoadViewCells(const string filename,  
     431        static ViewCellsManager *LoadViewCells(const string &filename,  
    437432                                                                                   ObjectContainer *objects,  
     433                                                                                   Environment *env, 
    438434                                                                                   BoundingBoxConverter *bconverter = NULL); 
    439435 
     
    559555        bool mExportBboxesForPvs; 
    560556                 
    561  
     557        Environment *environment; 
    562558        Plane3 mClipPlane; 
    563559 
     
    638634        /// if pvs should be exported with view cells 
    639635        bool mExportPvs; 
     636 
     637        Environment *mEnvironment; 
    640638}; 
    641639 
     
    652650                used to construct the bsp tree. 
    653651        */ 
    654         BspViewCellsManager(BspTree *tree); 
     652        BspViewCellsManager(BspTree *tree, Environment *env); 
    655653 
    656654        ~BspViewCellsManager(); 
     
    739737public: 
    740738 
    741         KdViewCellsManager(KdTree *tree); 
     739        KdViewCellsManager(KdTree *tree, Environment *env); 
    742740 
    743741        int ConstructSubdivision(const ObjectContainer &objects,  
     
    795793        /// depth of the KD tree nodes with represent the view cells 
    796794        int mKdPvsDepth; 
     795 
     796 
    797797}; 
    798798 
     
    806806public: 
    807807 
    808         VspKdViewCellsManager(VspKdTree *vspKdTree); 
     808        VspKdViewCellsManager(VspKdTree *vspKdTree, Environment *env); 
    809809 
    810810        int ConstructSubdivision(const ObjectContainer &objects,  
     
    870870public: 
    871871 
    872         VspBspViewCellsManager(VspBspTree *tree); 
     872        VspBspViewCellsManager(VspBspTree *tree, Environment *env); 
    873873        ~VspBspViewCellsManager(); 
    874874 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r931 r938  
    6565//  StdInParseHandlers: Constructors and Destructor 
    6666// --------------------------------------------------------------------------- 
    67 ViewCellsParseHandlers::ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter): 
     67ViewCellsParseHandlers::ViewCellsParseHandlers(ObjectContainer *objects,  
     68                                                                                           BoundingBoxConverter *bconverter, 
     69                                                                                           Environment *env): 
    6870  mElementCount(0) 
    6971  , mAttrCount(0) 
     
    7981  , mObjects(objects) 
    8082  , mBoundingBoxConverter(bconverter) 
     83  , mEnvironment(env) 
    8184{ 
    8285        // mObjects = objects; 
     
    102105          EndViewCells(); 
    103106 
     107  if (element == "BoundingBoxes") 
     108          EndBoundingBoxes(); 
     109 
     110  // inside the view cell description 
    104111  if (mParseViewCells) 
    105112  { 
     
    150157void ViewCellsParseHandlers::EndBoundingBoxes() 
    151158{ 
    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 
    153161        if (mBoundingBoxConverter) 
    154162                mBoundingBoxConverter->IdentifyObjects(mIBoundingBoxes, *mObjects); 
     
    605613                //mCurrentBspNode = mBspTree->GetRoot(); 
    606614 
    607                 mViewCellsManager = new BspViewCellsManager(mBspTree); 
     615                mViewCellsManager = new BspViewCellsManager(mBspTree, mEnvironment); 
    608616        } 
    609617        else if (strcmp(name, "vspBspTree") == 0) 
     
    613621                mVspBspTree = new VspBspTree(); 
    614622                //mCurrentBspNode = mVspBspTree->GetRoot(); 
    615                 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree); 
     623                mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, mEnvironment); 
    616624 
    617625                mVspBspTree->mBox = mViewSpaceBox; 
     
    622630                // TODO 
    623631                mVspKdTree = new VspKdTree();    
    624                 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree); 
     632                mViewCellsManager = new VspKdViewCellsManager(mVspKdTree, mEnvironment); 
    625633        } 
    626634        else 
     
    692700                                                                ViewCellsManager **viewCells, 
    693701                                                                ObjectContainer *objects, 
    694                                                                 BoundingBoxConverter *bconverter) 
     702                                                                BoundingBoxConverter *bconverter, 
     703                                                                Environment *env) 
    695704{ 
    696705  // Initialize the XML4C system 
     
    724733  //  to do. 
    725734  // 
    726   ViewCellsParseHandlers handler(objects, bconverter); 
     735  ViewCellsParseHandlers handler(objects, bconverter, env); 
    727736  parser->setDocumentHandler(&handler); 
    728737  parser->setErrorHandler(&handler); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.h

    r931 r938  
    1010class VspBspTree; 
    1111class BoundingBoxConverter; 
     12class Environment; 
    1213 
    1314class ViewCellsParser : public Parser 
     
    2021                                 ViewCellsManager **viewCells, 
    2122                                 ObjectContainer *objectsm, 
    22                                  BoundingBoxConverter *bconverter); 
     23                                 BoundingBoxConverter *bconverter, 
     24                                 Environment *env); 
    2325}; 
    2426 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h

    r931 r938  
    2828  //  Constructors and Destructor 
    2929  // ----------------------------------------------------------------------- 
    30   ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter); 
     30  ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter, Environment *env); 
    3131  ~ViewCellsParseHandlers(); 
    3232   
     
    8484 
    8585  IndexedBoundingBoxContainer mIBoundingBoxes; 
     86  Environment *mEnvironment; 
    8687 
    8788  bool mParseViewCells; 
Note: See TracChangeset for help on using the changeset viewer.