Changeset 1123 for GTP/trunk/Lib/Vis


Ignore:
Timestamp:
07/12/06 08:23:09 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
2 edited

Legend:

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

    r1122 r1123  
    2222 
    2323#define USE_FIXEDPOINT_T 0 
    24 #define COUNT_OBJECTS 0 
     24 
    2525 
    2626//-- static members 
     
    26492649mTimeStamp(1) 
    26502650{ 
    2651  
    26522651        bool randomize = false; 
    26532652        Environment::GetSingleton()->GetBoolValue("VspTree.Construction.randomize", randomize); 
     
    26662665        Environment::GetSingleton()->GetFloatValue("OspTree.Termination.maxCostRatio", mTermMaxCostRatio); 
    26672666 
    2668         Environment::GetSingleton()->GetFloatValue("OspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio); 
    2669         Environment::GetSingleton()->GetIntValue("OspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance); 
     2667        Environment::GetSingleton()->GetFloatValue("OspTree.Termination.minGlobalCostRatio", 
     2668                mTermMinGlobalCostRatio); 
     2669        Environment::GetSingleton()->GetIntValue("OspTree.Termination.mTermGlobalCostMissTolerance); 
    26702670 
    26712671 
     
    26782678        // if only the driving axis is used for axis aligned split 
    26792679        Environment::GetSingleton()->GetBoolValue("OspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 
    2680          
    26812680        Environment::GetSingleton()->GetFloatValue("OspTree.maxStaticMemory", mMaxMemory); 
    2682  
    26832681        Environment::GetSingleton()->GetBoolValue("OspTree.useCostHeuristics", mUseCostHeuristics); 
    26842682 
     
    31173115int OspTree::PrepareHeuristics(Intersectable *object) 
    31183116{ 
    3119 #if COUNT_OBJECTS 
    3120         return 1; 
    3121 #else 
    3122         // the priotity of the object is the number of view cell pvs entries of the object 
    3123         return object->mViewCellPvs.GetSize(); 
    3124 #endif 
     3117        if (mUseSah) 
     3118                return 1; 
     3119        else 
     3120                // the priotity of the object is the number of view cell pvs entries of the object 
     3121                return object->mViewCellPvs.GetSize(); 
    31253122} 
    31263123 
     
    31873184void OspTree::RemoveContriFromPvs(Intersectable *object, int &pvs) const 
    31883185{ 
    3189 #if COUNT_OBJECTS 
    3190         -- pvs; 
    3191 #else 
    3192         // the cost of an object is the number of view cells it is part of 
    3193         pvs -= object->mViewCellPvs.GetSize(); 
    3194 #endif 
     3186        if (mUseSah) 
     3187                -- pvs; 
     3188        else 
     3189                // the cost of an object is the number of view cells it is part of 
     3190                pvs -= object->mViewCellPvs.GetSize(); 
    31953191} 
    31963192 
     
    31983194void OspTree::AddContriToPvs(Intersectable *object, int &pvs) const 
    31993195{ 
    3200 #if COUNT_OBJECTS 
    3201         ++ pvs; 
    3202 #else 
    3203         // the cost of an object is the number of view cells it is part of 
    3204         pvs += object->mViewCellPvs.GetSize(); 
    3205 #endif 
     3196        if (mUseSah) 
     3197                ++ pvs; 
     3198        else 
     3199                // the cost of an object is the number of view cells it is part of 
     3200                pvs += object->mViewCellPvs.GetSize(); 
    32063201} 
    32073202 
     
    32873282float OspTree::EvalViewCellPvsIncr(Intersectable *object) const 
    32883283{ 
    3289 #if COUNT_OBJECTS        
    3290         return 1; 
    3291 #else 
    3292         return (float)object->mViewCellPvs.GetSize(); 
    3293 #endif 
     3284        if (mUseSah) 
     3285                return 1; 
     3286        else 
     3287                return (float)object->mViewCellPvs.GetSize(); 
    32943288} 
    32953289 
     
    37873781{ 
    37883782        RayInfoContainer *rays = new RayInfoContainer(); 
     3783 
     3784        // makes no sense otherwise because only one kd cell available 
     3785        // during view space partition 
     3786        mVspTree.mPvsCountMethod = VspTree::PER_OBJECT; 
     3787 
    37893788        PrepareVsp(sampleRays, forcedViewSpace, *rays); 
    37903789 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h

    r1122 r1123  
    10231023 
    10241024 
    1025  
    10261025        //-- local termination 
    10271026 
     
    15961595 
    15971596 
    1598  
    15991597        //-- global criteria 
    16001598 
     
    16281626        float mEpsilon; 
    16291627 
     1628 
     1629        bool mUseSah; 
    16301630 
    16311631        /// subdivision stats output file 
Note: See TracChangeset for help on using the changeset viewer.