Ignore:
Timestamp:
06/07/06 18:38:29 (18 years ago)
Author:
mattausch
Message:

environment as a singleton

File:
1 edited

Legend:

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

    r1002 r1004  
    5555 
    5656 
    57 VspBspTree::VspBspTree(Environment *env): 
     57VspBspTree::VspBspTree(): 
    5858mRoot(NULL), 
    5959mUseAreaForPvs(false), 
     
    6767{ 
    6868        bool randomize = false; 
    69         env->GetBoolValue("VspBspTree.Construction.randomize", randomize); 
     69        Environment::GetSingleton()->GetBoolValue("VspBspTree.Construction.randomize", randomize); 
    7070        if (randomize) 
    7171                Randomize(); // initialise random generator for heuristics 
    7272 
    7373        //-- termination criteria for autopartition 
    74         env->GetIntValue("VspBspTree.Termination.maxDepth", mTermMaxDepth); 
    75         env->GetIntValue("VspBspTree.Termination.minPvs", mTermMinPvs); 
    76         env->GetIntValue("VspBspTree.Termination.minRays", mTermMinRays); 
    77         env->GetFloatValue("VspBspTree.Termination.minProbability", mTermMinProbability); 
    78         env->GetFloatValue("VspBspTree.Termination.maxRayContribution", mTermMaxRayContribution); 
    79         env->GetFloatValue("VspBspTree.Termination.minAccRayLenght", mTermMinAccRayLength); 
    80         env->GetFloatValue("VspBspTree.Termination.maxCostRatio", mTermMaxCostRatio); 
    81         env->GetIntValue("VspBspTree.Termination.missTolerance", mTermMissTolerance); 
    82         env->GetIntValue("VspBspTree.Termination.maxViewCells", mMaxViewCells); 
     74        Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.maxDepth", mTermMaxDepth); 
     75        Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.minPvs", mTermMinPvs); 
     76        Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.minRays", mTermMinRays); 
     77        Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.minProbability", mTermMinProbability); 
     78        Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.maxRayContribution", mTermMaxRayContribution); 
     79        Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.minAccRayLenght", mTermMinAccRayLength); 
     80        Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.maxCostRatio", mTermMaxCostRatio); 
     81        Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.missTolerance", mTermMissTolerance); 
     82        Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.maxViewCells", mMaxViewCells); 
    8383 
    8484        //-- max cost ratio for early tree termination 
    85         env->GetFloatValue("VspBspTree.Termination.maxCostRatio", mTermMaxCostRatio); 
    86  
    87         env->GetFloatValue("VspBspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio); 
    88         env->GetIntValue("VspBspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance); 
     85        Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.maxCostRatio", mTermMaxCostRatio); 
     86 
     87        Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio); 
     88        Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance); 
    8989 
    9090        // HACK//mTermMinPolygons = 25; 
    9191 
    9292        //-- factors for bsp tree split plane heuristics 
    93         env->GetFloatValue("VspBspTree.Factor.pvs", mPvsFactor); 
    94         env->GetFloatValue("VspBspTree.Termination.ct_div_ci", mCtDivCi); 
     93        Environment::GetSingleton()->GetFloatValue("VspBspTree.Factor.pvs", mPvsFactor); 
     94        Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.ct_div_ci", mCtDivCi); 
    9595 
    9696 
    9797        //-- partition criteria 
    98         env->GetIntValue("VspBspTree.maxPolyCandidates", mMaxPolyCandidates); 
    99         env->GetIntValue("VspBspTree.maxRayCandidates", mMaxRayCandidates); 
    100         env->GetIntValue("VspBspTree.splitPlaneStrategy", mSplitPlaneStrategy); 
    101  
    102         env->GetFloatValue("VspBspTree.Construction.epsilon", mEpsilon); 
    103         env->GetIntValue("VspBspTree.maxTests", mMaxTests); 
     98        Environment::GetSingleton()->GetIntValue("VspBspTree.maxPolyCandidates", mMaxPolyCandidates); 
     99        Environment::GetSingleton()->GetIntValue("VspBspTree.maxRayCandidates", mMaxRayCandidates); 
     100        Environment::GetSingleton()->GetIntValue("VspBspTree.splitPlaneStrategy", mSplitPlaneStrategy); 
     101 
     102        Environment::GetSingleton()->GetFloatValue("VspBspTree.Construction.epsilon", mEpsilon); 
     103        Environment::GetSingleton()->GetIntValue("VspBspTree.maxTests", mMaxTests); 
    104104 
    105105        // if only the driving axis is used for axis aligned split 
    106         env->GetBoolValue("VspBspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 
     106        Environment::GetSingleton()->GetBoolValue("VspBspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 
    107107         
    108108        //-- termination criteria for axis aligned split 
    109         env->GetFloatValue("VspBspTree.Termination.AxisAligned.maxRayContribution",  
     109        Environment::GetSingleton()->GetFloatValue("VspBspTree.Termination.AxisAligned.maxRayContribution",  
    110110                                                                mTermMaxRayContriForAxisAligned); 
    111         env->GetIntValue("VspBspTree.Termination.AxisAligned.minRays", 
     111        Environment::GetSingleton()->GetIntValue("VspBspTree.Termination.AxisAligned.minRays", 
    112112                                                         mTermMinRaysForAxisAligned); 
    113113 
    114         //env->GetFloatValue("VspBspTree.maxTotalMemory", mMaxTotalMemory); 
    115         env->GetFloatValue("VspBspTree.maxStaticMemory", mMaxMemory); 
    116  
    117         env->GetFloatValue("VspBspTree.Construction.renderCostWeight", mRenderCostWeight); 
    118         env->GetBoolValue("VspBspTree.usePolygonSplitIfAvailable", mUsePolygonSplitIfAvailable); 
    119  
    120         env->GetBoolValue("VspBspTree.useCostHeuristics", mUseCostHeuristics); 
    121         env->GetBoolValue("VspBspTree.useSplitCostQueue", mUseSplitCostQueue); 
    122         env->GetBoolValue("VspBspTree.simulateOctree", mCirculatingAxis); 
    123         env->GetBoolValue("VspBspTree.useRandomAxis", mUseRandomAxis); 
    124         env->GetIntValue("VspBspTree.nodePriorityQueueType", mNodePriorityQueueType); 
    125  
    126         env->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMerge", mEmptyViewCellsMergeAllowed); 
     114        //Environment::GetSingleton()->GetFloatValue("VspBspTree.maxTotalMemory", mMaxTotalMemory); 
     115        Environment::GetSingleton()->GetFloatValue("VspBspTree.maxStaticMemory", mMaxMemory); 
     116 
     117        Environment::GetSingleton()->GetFloatValue("VspBspTree.Construction.renderCostWeight", mRenderCostWeight); 
     118        Environment::GetSingleton()->GetBoolValue("VspBspTree.usePolygonSplitIfAvailable", mUsePolygonSplitIfAvailable); 
     119 
     120        Environment::GetSingleton()->GetBoolValue("VspBspTree.useCostHeuristics", mUseCostHeuristics); 
     121        Environment::GetSingleton()->GetBoolValue("VspBspTree.useSplitCostQueue", mUseSplitCostQueue); 
     122        Environment::GetSingleton()->GetBoolValue("VspBspTree.simulateOctree", mCirculatingAxis); 
     123        Environment::GetSingleton()->GetBoolValue("VspBspTree.useRandomAxis", mUseRandomAxis); 
     124        Environment::GetSingleton()->GetIntValue("VspBspTree.nodePriorityQueueType", mNodePriorityQueueType); 
     125 
     126        Environment::GetSingleton()->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMerge", mEmptyViewCellsMergeAllowed); 
    127127         
    128128        char subdivisionStatsLog[100]; 
    129         env->GetStringValue("VspBspTree.subdivisionStats", subdivisionStatsLog); 
     129        Environment::GetSingleton()->GetStringValue("VspBspTree.subdivisionStats", subdivisionStatsLog); 
    130130        mSubdivisionStats.open(subdivisionStatsLog); 
    131131 
    132         env->GetFloatValue("VspBspTree.Construction.minBand", mMinBand); 
    133         env->GetFloatValue("VspBspTree.Construction.maxBand", mMaxBand); 
    134         env->GetBoolValue("VspBspTree.Construction.useDrivingAxisForMaxCost", mUseDrivingAxisForMaxCost); 
     132        Environment::GetSingleton()->GetFloatValue("VspBspTree.Construction.minBand", mMinBand); 
     133        Environment::GetSingleton()->GetFloatValue("VspBspTree.Construction.maxBand", mMaxBand); 
     134        Environment::GetSingleton()->GetBoolValue("VspBspTree.Construction.useDrivingAxisForMaxCost", mUseDrivingAxisForMaxCost); 
    135135 
    136136        //-- debug output 
     
    198198        Debug << endl; 
    199199} 
    200  
     200/* 
    201201VspBspTree::VspBspTree(): 
    202202mRoot(NULL), 
     
    211211mEpsilon(1e-6f) 
    212212{ 
    213 } 
     213}*/ 
    214214 
    215215BspViewCell *VspBspTree::GetOutOfBoundsCell() 
Note: See TracChangeset for help on using the changeset viewer.