Ignore:
Timestamp:
12/05/05 20:33:53 (19 years ago)
Author:
mattausch
Message:

started to add view cell merging to vsp kd tree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.h

    r440 r452  
    3333#include "RayInfo.h" 
    3434#include "Containers.h" 
     35 
     36class VspKdTreeLeaf; 
     37 
     38/** 
     39        Candidate for leaf merging based on priority. 
     40*/ 
     41class MergeCandidate 
     42 
     43public: 
     44        VspKdTreeLeaf *mLeaf1; 
     45        VspKdTreeLeaf *mLeaf2; 
     46 
     47        MergeCandidate(VspKdTreeLeaf *l1, VspKdTreeLeaf *l2); 
     48 
     49        /** Computes PVS difference between the leaves. 
     50        */ 
     51        int ComputePvsDifference() const; 
     52 
     53        /** Evaluates the merge costs of this leaf. 
     54        */ 
     55        float EvaluateMergeCost() const; 
     56 
     57        friend bool operator<(const MergeCandidate &leafa, const MergeCandidate &leafb)  
     58        { 
     59                return leafa.ComputePvsDifference() < leafb.ComputePvsDifference(); 
     60        } 
     61}; 
     62 
     63 
    3564 
    3665/** 
     
    294323        static int mailID; 
    295324 
    296  
    297325protected: 
    298326 
     
    306334        RayInfoContainer mRays; 
    307335        bool mValidPvs; 
    308          
     336 
     337        ViewCell *mViewCell; 
    309338private: 
    310339        int mPvsSize; 
     
    453482        void CollectLeaves(vector<VspKdTreeLeaf *> &leaves) const; 
    454483 
     484        /** Merges leaves of this tree according to some criteria. 
     485        */ 
     486        void MergeLeaves(); 
     487 
     488        /** Finds neighbours of this node. 
     489                @param n the input node 
     490                @param neighbours the neighbors of the input node 
     491                @param onlyUnmailed if only unmailed neighbors are collected 
     492        */ 
     493        int FindNeighbors(VspKdTreeLeaf *n,  
     494                                          vector<VspKdTreeLeaf *> &neighbors,  
     495                                          bool onlyUnmailed); 
     496 
    455497protected: 
    456498 
     
    547589 
    548590protected: 
     591         
     592 
    549593        ///////////////////////////// 
    550594        // The core pointer 
     
    610654        float mTermMaxRayContribution; 
    611655 
    612  
    613656        bool mOnlyDrivingAxis; 
     657 
     658        typedef std::pair<VspKdTreeLeaf *, VspKdTreeLeaf *> LeafPair; 
     659 
    614660        ///////////////////////////// 
    615661        VspKdStatistics mStat;   
Note: See TracChangeset for help on using the changeset viewer.