Ignore:
Timestamp:
11/01/06 23:20:53 (18 years ago)
Author:
mattausch
Message:

worked on full render cost evaluation
warning: some change sin render cost evaluation for pvs which could have bugs

File:
1 edited

Legend:

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

    r1706 r1707  
    503503                                tstack.push(*it); 
    504504                        } 
    505                          
    506505                } 
    507506        } 
     
    930929                const int upper = mViewCellsManager->GetMaxPvsSize(); 
    931930 
    932                 const float penalty = EvalPvsPenalty((*vit)->GetPvs().CountObjectsInPvs(), lower, upper); 
     931                const float penalty = EvalPvsPenalty((*vit)->GetPvs().EvalPvsCost(), lower, upper); 
    933932                 
    934933                mDeviation += fabs(mAvgRenderCost - penalty); 
     
    10231022        vc->Mail(); 
    10241023 
    1025         const int pvs1 = left->GetPvs().CountObjectsInPvs(); 
    1026         const int pvs2 = right->GetPvs().CountObjectsInPvs(); 
     1024        const float pvs1 = left->GetPvs().EvalPvsCost(); 
     1025        const float pvs2 = right->GetPvs().EvalPvsCost(); 
    10271026 
    10281027 
     
    10301029        mMergedViewCells.push_back(vc); 
    10311030 
    1032         pvsDiff = vc->GetPvs().CountObjectsInPvs() - pvs1 - pvs2; 
     1031        pvsDiff = vc->GetPvs().EvalPvsCost() - pvs1 - pvs2; 
    10331032 
    10341033 
     
    10381037                // set scalars 
    10391038                mViewCellsManager->UpdateScalarPvsSize(left,  
    1040                                 left->GetPvs().CountObjectsInPvs(),  
     1039                                left->GetPvs().EvalPvsCost(),  
    10411040                                left->GetPvs().GetSize()); 
    10421041                         
     
    10491048                // set scalars 
    10501049                mViewCellsManager->UpdateScalarPvsSize(right,  
    1051                         right->GetPvs().CountObjectsInPvs(),  
     1050                        right->GetPvs().EvalPvsCost(),  
    10521051                        right->GetPvs().GetSize()); 
    10531052 
     
    13361335        if (1) 
    13371336        { 
    1338                 const float penalty = EvalPvsPenalty(vc->GetPvs().CountObjectsInPvs(), lower, upper); 
     1337                const float penalty = EvalPvsPenalty(vc->GetPvs().EvalPvsCost(), lower, upper); 
    13391338                return fabs(mAvgRenderCost - penalty) / (float)mNumActiveViewCells; 
    13401339        } 
     
    13491348        if (mUseAreaForPvs) 
    13501349        { 
    1351                 return vc->GetPvs().CountObjectsInPvs() * vc->GetArea(); 
    1352         } 
    1353  
    1354         return vc->GetPvs().CountObjectsInPvs() * vc->GetVolume(); 
     1350                return vc->GetPvs().EvalPvsCost() * vc->GetArea(); 
     1351        } 
     1352 
     1353        return vc->GetPvs().EvalPvsCost() * vc->GetVolume(); 
    13551354} 
    13561355 
     
    17951794        if (vc->IsLeaf()) 
    17961795        { 
    1797                 return vc->GetPvs().CountObjectsInPvs(); 
    1798         } 
    1799          
    1800         // interior nodes: pvs is either stored as a scalar or 
    1801         // has to be reconstructed from the leaves 
     1796                return vc->GetPvs().EvalPvsCost(); 
     1797        } 
     1798         
     1799        // interior nodes: pvs is either stored as a  
     1800        // scalar or has to be reconstructed from the leaves 
    18021801        // the stored pvs size is the valid pvs size => just return scalar 
    18031802        if (vc->mPvsSizeValid) 
     
    18331832        } 
    18341833 
    1835         return newPvs.CountObjectsInPvs(); 
     1834        return newPvs.EvalPvsCost(); 
    18361835} 
    18371836 
     
    20022001        switch (mViewCellsStorage) 
    20032002        { 
    2004         case PVS_IN_LEAVES: //-- store pvs only in leaves 
     2003        case PVS_IN_LEAVES:  
     2004                // pvs is stored only in leaves 
    20052005                pvsSize = GetPvsSizeForLeafStorage(vc);                  
    20062006                break; 
     
    20122012                // pvs is stored consistently in the tree up to the root 
    20132013                // just return pvs size  
    2014                 pvsSize = vc->GetPvs().CountObjectsInPvs();      
     2014                pvsSize = vc->GetPvs().EvalPvsCost();    
    20152015                break; 
    20162016        } 
Note: See TracChangeset for help on using the changeset viewer.