Ignore:
Timestamp:
11/02/06 19:09:30 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r1707 r1709  
    3535        /// number of view cells 
    3636        int viewCells; 
    37         /// size of the PVS 
    38         int pvsSize; 
     37        /// cost of the PVS 
     38        float pvsCost; 
    3939        /// largest PVS of all view cells 
    40         int maxPvs; 
     40        float maxPvs; 
    4141        /// smallest PVS of all view cells 
    42         int minPvs; 
     42        float minPvs; 
    4343        /// view cells with empty PVS 
    4444        int emptyPvs; 
     
    5757 
    5858        double AvgLeaves() const {return (double)leaves / (double)viewCells;}; 
    59         double AvgPvs() const {return (double)pvsSize / (double)viewCells;}; 
     59        double AvgPvs() const {return (double)pvsCost / (double)viewCells;}; 
    6060 
    6161        void Reset() 
    6262        { 
    6363                viewCells = 0; 
    64                 pvsSize = 0; 
     64                pvsCost = 0; 
    6565                maxPvs = 0; 
    6666 
     
    7575 
    7676        friend ostream &operator<<(ostream &s, const ViewCellsStatistics &stat) 
     77        { 
     78                stat.Print(s); 
     79                return s; 
     80        } 
     81}; 
     82 
     83 
     84class ViewCellsTreeStats 
     85{ 
     86public: 
     87        int mPass; 
     88     
     89        int mNumViewCells; 
     90                 
     91        float mRenderCostDecrease; 
     92 
     93    float mTotalRenderCost; 
     94     
     95        float mCurrentPvsCost; 
     96                                                         
     97        float mExpectedCost; 
     98     
     99        float mAvgRenderCost; 
     100         
     101        float mDeviation; 
     102                         
     103        float mTotalPvsCost; 
     104         
     105        int mEntriesInPvs; 
     106     
     107        float mMemoryCost; 
     108         
     109        int mPvsSizeDecr; 
     110         
     111        float mVolume; 
     112 
     113 
     114        void Reset() 
     115        { 
     116                mPass = 0; 
     117                mNumViewCells = 0; 
     118                mRenderCostDecrease = 0; 
     119                mTotalRenderCost = 0; 
     120                mCurrentPvsCost = 0; 
     121                mExpectedCost = 0; 
     122                mAvgRenderCost = 0; 
     123                mDeviation = 0; 
     124                mTotalPvsCost = 0; 
     125                mEntriesInPvs = 0; 
     126                mMemoryCost = 0; 
     127                mPvsSizeDecr = 0; 
     128                mVolume = 0; 
     129        } 
     130 
     131 
     132        void Print(ostream &app) const; 
     133 
     134        friend ostream &operator<<(ostream &s, const ViewCellsTreeStats &stat) 
    77135        { 
    78136                stat.Print(s); 
     
    181239                // HACK: take scalar value because pvs may not have been stored properly 
    182240#if 1 
    183                 return a->mPvsSize < b->mPvsSize; 
     241                return a->mPvsCost < b->mPvsCost; 
    184242#else 
    185243                return a->GetPvs().EvalPvsCost() < b->GetPvs().EvalPvsCost(); 
     
    251309        RgbColor mColor; 
    252310        /// store pvs size, used for evaluation purpose when pvss are stored only in the leaves 
    253         int mPvsSize; 
     311        float mPvsCost; 
    254312        /** stores number of entries in pvs 
    255313            this variable has the same value as mPvsSize for object pvs,  
     
    421479        void GetPvs(ViewCell *vc, ObjectPvs &pvs) const; 
    422480 
    423         /** Returns pvs size (i.e. the number of stored objects) 
    424         */ 
    425         int GetPvsSize(ViewCell *vc) const; 
     481        /** Returns pvs size (i.e. the render cost of the stored objects) 
     482        */ 
     483        float GetPvsCost(ViewCell *vc) const; 
    426484 
    427485        /** Returns number of entries associated with this view cell.  
     
    538596                @returns difference in pvs size 
    539597        */ 
    540         ViewCellInterior *MergeViewCells(ViewCell *l, ViewCell *r, int &pvsDiff); //const; 
     598        ViewCellInterior *MergeViewCells(ViewCell *l, ViewCell *r, float &pvsDiff); //const; 
    541599 
    542600        /** Shuffles, i.e. takes border leaf from view cell 1 and adds it  
     
    601659                The pvs is assumed to be stored using lossless compression. 
    602660        */ 
    603         int GetPvsSizeForCompressedStorage(ViewCell *vc) const; 
     661        float GetPvsCostForCompressedStorage(ViewCell *vc) const; 
    604662         
    605663        /** Computes pvs size of this view cell. 
    606664                The pvs is assumed to be stored in the leaves. 
    607665        */ 
    608         int GetPvsSizeForLeafStorage(ViewCell *vc) const; 
     666        float GetPvsCostForLeafStorage(ViewCell *vc) const; 
    609667 
    610668        /** Counts the logical number of entries in the pvs this view cell. 
     
    616674        */ 
    617675        void UpdateStats(ofstream &stats, 
    618                                          const int pass, 
    619                                          const int viewCells, 
    620                                          const float renderCostDecrease, 
    621                                          const float totalRenderCost, 
    622                                          const int currentPvs, 
    623                                          const float expectedCost, 
    624                                          const float avgRenderCost, 
    625                                          const float deviation, 
    626                                          const int totalPvs, 
    627                                          const int entriesInPvs, 
    628                                          const float memoryCost, 
    629                                          const int pvsSizeDecr, 
    630                                          const float volume); 
     676                                         const ViewCellsTreeStats &vcStats); 
    631677 
    632678 
Note: See TracChangeset for help on using the changeset viewer.