Ignore:
Timestamp:
08/22/07 14:27:41 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2546 r2547  
    387387mOutOfBoundsCell(NULL), 
    388388mStoreRays(false), 
    389 //mStoreRays(true), 
    390389mTimeStamp(1), 
    391390mHierarchyManager(NULL) 
    392391{ 
    393392        mLocalSubdivisionCandidates = new vector<SortableEntry>; 
    394  
    395         bool randomize = false; 
    396         Environment::GetSingleton()->GetBoolValue("VspTree.Construction.randomize", randomize); 
    397         if (randomize) 
    398                 Randomize(); // initialise random generator for heuristics 
     393        ParseEnvironment(); 
     394} 
     395 
     396 
     397VspTree::VspTree(const AxisAlignedBox3 &bbox): 
     398mRoot(NULL), 
     399mOutOfBoundsCell(NULL), 
     400mStoreRays(false), 
     401mTimeStamp(1), 
     402mHierarchyManager(NULL), 
     403mBoundingBox(bbox) 
     404{ 
     405        mLocalSubdivisionCandidates = new vector<SortableEntry>; 
     406        ParseEnvironment(); 
     407} 
     408 
     409 
     410 
     411void VspTree::ParseEnvironment() 
     412{ 
     413        // initialise random generator for heuristics 
     414        bool randomize; 
     415    Environment::GetSingleton()->GetBoolValue("VspTree.Construction.randomize", randomize); 
     416        if (randomize) Randomize();  
    399417 
    400418        char subdivisionStatsLog[100]; 
    401419        Environment::GetSingleton()->GetStringValue("VspTree.subdivisionStats", subdivisionStatsLog); 
    402420        mSubdivisionStats.open(subdivisionStatsLog); 
     421 
    403422 
    404423        ///////////// 
     
    410429        Environment::GetSingleton()->GetFloatValue("VspTree.Termination.minProbability", mTermMinProbability); 
    411430        Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxRayContribution", mTermMaxRayContribution); 
    412          
     431 
    413432        Environment::GetSingleton()->GetIntValue("VspTree.Termination.missTolerance", mTermMissTolerance); 
    414433        Environment::GetSingleton()->GetIntValue("VspTree.Termination.maxViewCells", mMaxViewCells); 
     
    432451 
    433452        Environment::GetSingleton()->GetFloatValue("VspTree.Construction.renderCostDecreaseWeight", mRenderCostDecreaseWeight); 
    434          
     453 
    435454        // if only the driving axis is used for axis aligned split 
    436455        Environment::GetSingleton()->GetBoolValue("VspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 
     
    439458 
    440459        //mMemoryConst = (float)(sizeof(VspLeaf) + sizeof(VspViewCell)); 
    441         //mMemoryConst = 50;//(float)(sizeof(VspViewCell)); 
    442460        //mMemoryConst = (float)(sizeof(VspLeaf) + sizeof(ObjectPvs)); 
    443  
    444         mMemoryConst = 16;//(float)sizeof(ObjectPvs); 
    445          
     461        //mMemoryConst = (float)sizeof(ObjectPvs); 
     462 
     463        // hack 
     464        mMemoryConst = 16; 
     465 
    446466 
    447467        ////////////// 
     
    450470        Debug << "******* VSP options ********" << endl; 
    451471 
    452     Debug << "max depth: " << mTermMaxDepth << endl; 
     472        Debug << "max depth: " << mTermMaxDepth << endl; 
    453473        Debug << "min PVS: " << mTermMinPvs << endl; 
    454474        Debug << "min probabiliy: " << mTermMinProbability << endl; 
     
    458478        Debug << "miss tolerance: " << mTermMissTolerance << endl; 
    459479        Debug << "max view cells: " << mMaxViewCells << endl; 
     480 
    460481        Debug << "randomize: " << randomize << endl; 
    461  
    462482        Debug << "min global cost ratio: " << mTermMinGlobalCostRatio << endl; 
    463483        Debug << "global cost miss tolerance: " << mTermGlobalCostMissTolerance << endl; 
Note: See TracChangeset for help on using the changeset viewer.