Ignore:
Timestamp:
01/20/07 00:14:25 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r1867 r1999  
    108108         
    109109        int mPvsSizeDecr; 
    110  
    111110   
    112111        float mVolume; 
     
    153152 
    154153public: 
     154 
    155155        ViewCell(); 
    156156 
     
    243243        } 
    244244 
    245   static bool GreaterOrEqualPvs(const ViewCell *a, const ViewCell *b) { 
    246         return !SmallerPvs(a, b); 
    247   } 
     245        static bool GreaterOrEqualPvs(const ViewCell *a, const ViewCell *b)  
     246        { 
     247                return !SmallerPvs(a, b); 
     248        } 
    248249 
    249250        static bool SmallerRenderCost(const ViewCell *a, const ViewCell *b)  
     
    260261                @hack The function is available for leaves also to have a common interface, 
    261262                but it should be less than zero for leaves. 
    262                 */ 
     263        */ 
    263264        void SetMergeCost(const float mergeCost); 
    264265 
     
    269270        float GetMergeCost() const; 
    270271 
    271   void UpdatePvsCost() { 
    272         mPvsCost = GetPvs().EvalPvsCost(); 
    273   } 
    274  
    275   void SetPvsCost(const float c) { 
    276         mPvsCost = c; 
    277   } 
    278  
    279   float GetPvsCost() const { 
    280         return mPvsCost; 
    281   } 
     272        void UpdatePvsCost() { 
     273                mPvsCost = GetPvs().EvalPvsCost(); 
     274        } 
     275 
     276        void SetPvsCost(const float c) { 
     277                mPvsCost = c; 
     278        } 
     279 
     280        float GetPvsCost() const { 
     281                return mPvsCost; 
     282        } 
    282283 
    283284        ////////// 
    284285        //-- mailing stuff 
    285286 
    286   //    static void NewMail(const int reserve = 1)  
    287   //    { 
    288   //            sMailId += sReservedMailboxes; 
    289   //            sReservedMailboxes = reserve; 
    290   //    } 
    291  
    292   //    void Mail() { mMailbox = sMailId; } 
    293   //    bool Mailed() const { return mMailbox == sMailId; } 
    294  
    295   //    void Mail(const int mailbox) { mMailbox = sMailId + mailbox; } 
    296   //    bool Mailed(const int mailbox) const { return mMailbox == sMailId + mailbox; } 
    297  
    298   //    int IncMail() { return ++ mMailbox - sMailId; } 
     287        //      static void NewMail(const int reserve = 1)  
     288        //      { 
     289        //              sMailId += sReservedMailboxes; 
     290        //              sReservedMailboxes = reserve; 
     291        //      } 
     292 
     293        //      void Mail() { mMailbox = sMailId; } 
     294        //      bool Mailed() const { return mMailbox == sMailId; } 
     295 
     296        //      void Mail(const int mailbox) { mMailbox = sMailId + mailbox; } 
     297        //      bool Mailed(const int mailbox) const { return mMailbox == sMailId + mailbox; } 
     298 
     299        //      int IncMail() { return ++ mMailbox - sMailId; } 
    299300 
    300301 
     
    302303        // both mailId and mailbox should be unique for each thread!!! 
    303304 
    304   //static int sMailId; 
    305   //static int sReservedMailboxes; 
    306          
    307   int GetFilteredPvsSize() const { 
    308         return mFilteredPvsSize; 
    309   } 
    310  
    311   void SetFilteredPvsSize(const int s) { 
    312         mFilteredPvsSize = s; 
     305        //static int sMailId; 
     306        //static int sReservedMailboxes; 
     307 
     308        int GetFilteredPvsSize() const  
     309        { 
     310                return mFilteredPvsSize; 
     311        } 
     312 
     313        void SetFilteredPvsSize(const int s) { 
     314                mFilteredPvsSize = s; 
    313315  } 
    314316 
     
    341343        bool mPvsSizeValid; 
    342344 
    343   /// Filter cost of the pvs 
    344   int mFilteredPvsSize; 
     345 
     346        /// Filter cost of the pvs 
     347        int mFilteredPvsSize; 
    345348 
    346349}; 
     
    356359 
    357360        ViewCellInterior(Mesh *mesh); 
    358          
     361 
    359362        /** Sets pointer from parent to child and vice versa. 
    360363        */ 
     
    368371                mCost = c; 
    369372        } 
    370          
     373 
    371374        float GetCost() const { 
    372375                return mCost; 
    373376        } 
    374    
    375   ViewCellContainer mChildren; 
     377 
     378        ViewCellContainer mChildren; 
    376379 
    377380protected: 
    378   /** overall cost resulting from the merge */ 
    379   float mCost; 
     381 
     382        /// Pverall cost resulting from the merge. 
     383        float mCost; 
    380384}; 
    381385 
     
    449453 
    450454public: 
     455 
    451456        ViewCellsTree(); 
     457 
    452458        /** View cells tree constructor taking a view cell mnanager as parameter 
    453459        */ 
     
    509515        float GetPvsCost(ViewCell *vc) const; 
    510516   
    511  
    512517        /** Returns number of entries associated with this view cell.  
    513518 
     
    587592        void ReadEnvironment(); 
    588593 
    589         ///////////////////////////////////////////////////////////////// 
    590         //                    merge related stuff                      // 
    591         ///////////////////////////////////////////////////////////////// 
     594 
     595        ////////////////////////////////////////////////////////////// 
     596        //                    merge related stuff                   // 
     597        ////////////////////////////////////////////////////////////// 
     598 
    592599 
    593600        /** Computes render cost of the merged pvs. 
     
    623630                @returns difference in pvs size 
    624631        */ 
    625         ViewCellInterior *MergeViewCells(ViewCell *l, ViewCell *r, float &pvsDiff); //const; 
     632        ViewCellInterior *MergeViewCells(ViewCell *l, ViewCell *r, float &pvsDiff); 
    626633 
    627634        /** Shuffles, i.e. takes border leaf from view cell 1 and adds it  
Note: See TracChangeset for help on using the changeset viewer.