Ignore:
Timestamp:
12/20/06 00:26:02 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r1845 r1912  
    372372 
    373373                VspTraversalData(): 
    374                 mNode(NULL), 
    375                 mDepth(0), 
    376                 mRays(NULL), 
    377                 mPvs(0), 
    378                 mProbability(0.0), 
    379                 mMaxCostMisses(0),  
    380                 mPriority(0) 
     374                        mNode(NULL), 
     375                        mDepth(0), 
     376                        mRays(NULL), 
     377                        mPvs(0), 
     378                        mProbability(0.0), 
     379                        mMaxCostMisses(0),  
     380                        mPriority(0), 
     381                        mCorrectedPvs(0) 
    381382                {} 
    382383                 
     
    387388                                                 const float p, 
    388389                                                 const AxisAlignedBox3 &box): 
    389                 mNode(node),  
    390                 mDepth(depth),  
    391                 mRays(rays), 
    392                 mPvs(pvs), 
    393                 mProbability(p), 
    394                 mBoundingBox(box), 
    395                 mMaxCostMisses(0), 
    396                 mPriority(0) 
     390                        mNode(node),  
     391                        mDepth(depth),  
     392                        mRays(rays), 
     393                        mProbability(p), 
     394                        mBoundingBox(box), 
     395                        mMaxCostMisses(0), 
     396                        mPriority(0), 
     397                        mCorrectedPvs(0), 
     398                        mPvs(pvs), 
     399                        mRenderCost(0), 
     400                        mCorrectedRenderCost(0) 
    397401                {} 
    398402 
     
    400404                                                 RayInfoContainer *rays, 
    401405                                                 const AxisAlignedBox3 &box):  
    402                 mNode(NULL),  
    403                 mDepth(depth),  
    404                 mRays(rays), 
    405                 mPvs(0), 
    406                 mProbability(0), 
    407                 mMaxCostMisses(0), 
    408                 mBoundingBox(box) 
     406                        mNode(NULL),  
     407                        mDepth(depth),  
     408                        mRays(rays), 
     409                        mProbability(0), 
     410                        mMaxCostMisses(0), 
     411                        mBoundingBox(box), 
     412                        mCorrectedPvs(0), 
     413                        mPvs(0) , 
     414                        mRenderCost(0), 
     415                        mCorrectedRenderCost(0)  
    409416                {} 
    410417 
     
    425432                                // delete old view cell 
    426433                                delete mNode->GetViewCell(); 
     434 
    427435                                delete mNode; 
    428436                                mNode = NULL; 
     
    440448                /// the bounding box of the node 
    441449                AxisAlignedBox3 mBoundingBox; 
    442                 /// pvs size 
    443                 float mPvs; 
    444450                /// how often this branch has missed the max-cost ratio 
    445451                int mMaxCostMisses; 
    446452                // current priority 
    447453                float mPriority; 
    448  
    449                  
     454                /// pvs size 
     455                float mPvs; 
     456                /// the correction factor for this pvs 
     457                float mCorrectedPvs; 
     458                /// pvs size 
     459                float mRenderCost; 
     460                /// the correction factor for this pvs 
     461                float mCorrectedRenderCost; 
     462 
    450463                friend bool operator<(const VspTraversalData &a, const VspTraversalData &b) 
    451464                { 
     
    460473        public: 
    461474 
    462                 static VspTree* sVspTree; 
    463  
    464                 /// the current split plane 
    465                 AxisAlignedPlane mSplitPlane; 
    466                 /// parent node traversal data 
    467                 VspTraversalData mParentData; 
    468                  
    469475                VspSubdivisionCandidate(const VspTraversalData &tData): mParentData(tData) 
    470476                {}; 
     
    502508                } 
    503509 
    504         VspSubdivisionCandidate(const AxisAlignedPlane &plane, const VspTraversalData &tData):  
    505                 mSplitPlane(plane), mParentData(tData) 
     510                VspSubdivisionCandidate(const AxisAlignedPlane &plane, const VspTraversalData &tData):  
     511                        mSplitPlane(plane), mParentData(tData) 
    506512                {} 
    507513 
     
    510516                        return mPriority; 
    511517                } 
     518 
     519                //////////////////// 
     520 
     521                static VspTree* sVspTree; 
     522 
     523                /// the current split plane 
     524                AxisAlignedPlane mSplitPlane; 
     525                /// parent node traversal data 
     526                VspTraversalData mParentData; 
     527         
     528                float mCorrectedFrontPvs; 
     529                float mCorrectedBackPvs; 
     530 
     531                float mCorrectedFrontRenderCost; 
     532                float mCorrectedBackRenderCost; 
    512533        }; 
    513534 
     
    729750        /** Evaluates render cost decrease of next split. 
    730751        */ 
    731         float EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane, 
    732                                                                  const VspTraversalData &data, 
     752        float EvalRenderCostDecrease(VspSubdivisionCandidate &splitData,  
    733753                                                                 float &normalizedOldRenderCost) const; 
    734754 
     
    790810                @returns the root of the subdivision 
    791811        */ 
    792         VspInterior *SubdivideNode(const AxisAlignedPlane &splitPlane, 
    793                                                            VspTraversalData &tData, 
     812        VspInterior *SubdivideNode(const VspSubdivisionCandidate &sc, 
    794813                                                           VspTraversalData &frontData, 
    795814                               VspTraversalData &backData); 
     
    813832        */ 
    814833        void SortSubdivisionCandidates(const RayInfoContainer &rays,  
    815                                                         const int axis,  
    816                                                         float minBand,  
    817                                                         float maxBand); 
     834                                                                  const int axis,  
     835                                                                  float minBand,  
     836                                                                  float maxBand); 
    818837 
    819838        /** Evaluate render cost of this pvs. 
Note: See TracChangeset for help on using the changeset viewer.