Ignore:
Timestamp:
02/27/06 07:58:27 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r660 r663  
    2828struct BspRay; 
    2929 
    30 #define OCTREE_HACK 0 
     30//#define OCTREE_HACK 0 
    3131/** 
    3232        This is a view space partitioning specialised BSPtree.   
     
    4444        /** Additional data which is passed down the BSP tree during traversal. 
    4545        */ 
    46         struct VspBspTraversalData 
     46        class VspBspTraversalData 
    4747        {   
     48        public: 
    4849                /// the current node 
    4950                BspNode *mNode; 
     
    6465                /// if this node is a kd-node (i.e., boundaries are axis aligned 
    6566                bool mIsKdNode; 
    66  
    67  
    68 #if OCTREE_HACK // OCTREE HACK 
     67                // hack for octree 
    6968                int mAxis; 
    70 #endif 
    71                 /// bounding box of current view space. 
    72                 ///AxisAlignedBox3 mBbox; 
    73                  
     69                float mPriority; 
     70 
     71                static bool sBreathFirstSplits; 
     72 
    7473                /** Returns average ray contribution. 
    7574                */ 
     
    129128                float GetCost() const 
    130129                { 
    131 #if 1 
    132                         return mPvs * mProbability; 
    133 #endif 
    134 #if 0 
    135                         return (float) (-mDepth); // for regular grid 
    136 #endif 
    137 #if 0 
    138                         return (float)(mPvs * (int)mRays->size()); 
    139 #endif 
    140 #if 0 
    141                         return (float)mPvs; 
    142 #endif 
    143 #if 0 
    144                         return mProbabiliy * (float)mRays->size(); 
    145 #endif 
     130                        if (sBreathFirstSplits) 
     131                                return mPvs * mProbability; 
     132                        else 
     133                                return (float) (-mDepth); // for kd tree 
    146134                } 
    147135 
     
    160148    }; 
    161149         
     150 
    162151        typedef std::priority_queue<VspBspTraversalData> VspBspTraversalQueue; 
    163152         
     
    788777 
    789778        //int mSplits; 
    790  
     779        /// subdivision stats output file 
    791780        ofstream mSubdivsionStats; 
    792  
     781        /// if random split axis should be used 
    793782        bool mUseRandomAxis; 
    794  
     783        /// use polygon split whenever there are polys left 
    795784        bool mUsePolygonSplitIfAvailable; 
    796  
     785        /// current time stamp (used for keeping split history) 
    797786        int mTimeStamp; 
    798  
     787        /// number of currenly generated view cells 
    799788        int mCreatedViewCells; 
     789        /// if vsp bsp tree should simulate octree 
     790        bool mSimulateOctree; 
     791 
     792        int mBreathFirstSplits; 
    800793 
    801794private: 
Note: See TracChangeset for help on using the changeset viewer.