Changeset 1329 for GTP/trunk/Lib


Ignore:
Timestamp:
09/11/06 00:45:27 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r1323 r1329  
    221221 
    222222        // start with view space subdivison: prepare vsp tree for traversal 
    223         PrepareViewSpaceSubdivision(sampleRays, objects, forcedViewSpace); 
    224  
     223        if (StartViewSpaceSubdivision()) 
     224        { 
     225                mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 
     226                PrepareViewSpaceSubdivision(sampleRays, objects, forcedViewSpace); 
     227        } 
     228         
    225229        // start object space subdivision immediately? 
    226230        if (StartObjectSpaceSubdivision()) 
     
    345349        return !ObjectSpaceSubdivisionConstructed() &&  
    346350                   (mTQueue.Empty() || ((mConstructionType == INTERLEAVED) && ospDepthReached)); 
     351} 
     352 
     353 
     354bool HierarchyManager::StartViewSpaceSubdivision() const 
     355{ 
     356        const bool vspDepthReached =  
     357                (mMinDepthForObjectSpaceSubdivion <= mVspTree->mVspStats.maxDepth); 
     358     
     359        return !ViewSpaceSubdivisionConstructed() &&  
     360                   (mTQueue.Empty() || ((mConstructionType == INTERLEAVED) && vspDepthReached)); 
    347361} 
    348362 
     
    390404                        mObjectSpaceSubdivisionType = mSavedObjectSpaceSubdivisionType; 
    391405 
    392                         cout << "starting object space subdivision at maximal view space subdivison depth " << mVspTree->mVspStats.maxDepth << " (" << mMinDepthForObjectSpaceSubdivion << ") " << endl; 
     406                        cout << "starting object space subdivision at depth "  
     407                                 << mVspTree->mVspStats.maxDepth << " ("  
     408                                 << mMinDepthForObjectSpaceSubdivion << ") " << endl; 
     409 
    393410                        PrepareObjectSpaceSubdivision(sampleRays, objects); 
     411 
     412                        cout << "reseting queue ... "; 
     413                        ResetQueue(); 
     414                        cout << "finished" << endl; 
     415                } 
     416 
     417                if (StartViewSpaceSubdivision()) 
     418                { 
     419                        mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 
     420 
     421                        cout << "starting view space subdivision at depth "  
     422                                 << mVspTree->mVspStats.maxDepth << " ("  
     423                                 << mMinDepthForObjectSpaceSubdivion << ") " << endl; 
     424 
     425                        PrepareViewSpaceSubdivision(sampleRays, objects, forcedViewSpace); 
    394426 
    395427                        cout << "reseting queue ... "; 
     
    422454        return false; 
    423455        } 
     456} 
     457 
     458 
     459bool HierarchyManager::ViewSpaceSubdivisionConstructed() const 
     460{ 
     461        return mVspTree && mVspTree->GetRoot(); 
    424462} 
    425463 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h

    r1323 r1329  
    252252 
    253253        bool StartObjectSpaceSubdivision() const; 
     254        bool StartViewSpaceSubdivision() const; 
    254255 
    255256        void PrepareViewSpaceSubdivision( 
    256257                const VssRayContainer &sampleRays, 
    257258                const ObjectContainer &objects, 
    258                 AxisAlignedBox3 *forcedViewSpace); 
     259                AxisAlignedBox3 *forcedViewSpace = NULL); 
    259260 
    260261        bool ObjectSpaceSubdivisionConstructed() const; 
     262        bool ViewSpaceSubdivisionConstructed() const; 
    261263 
    262264    void ResetQueue(); 
     
    266268 
    267269        enum {SEQUENTIAL, INTERLEAVED}; 
     270         
    268271        int mObjectSpaceSubdivisionType; 
     272    int mViewSpaceSubdivisionType; 
     273 
    269274        /// the original osp type 
    270275        int mSavedObjectSpaceSubdivisionType; 
     276        int mSavedViewSpaceSubdivisionType; 
    271277 
    272278        int mConstructionType; 
Note: See TracChangeset for help on using the changeset viewer.