Ignore:
Timestamp:
10/02/06 19:07:38 (18 years ago)
Author:
mattausch
Message:

updated view cells loading. probably no optimal for performance

File:
1 edited

Legend:

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

    r1545 r1551  
    875875                } 
    876876                 
    877         viewCell->mLeaf = leaf; 
     877                viewCell->mLeaves.push_back(leaf); 
    878878 
    879879                if (mUseAreaForPvs) 
     
    973973 
    974974 
     975        ////////////////// 
    975976        //-- terminate traversal and create new view cell 
    976977        if (newNode->IsLeaf()) 
     
    993994                mBspStats.sampleContributions +=(int) sampCon; 
    994995 
     996                viewCell->mLeaves.push_back(leaf); 
     997 
     998                /////////// 
    995999                //-- store additional info 
    9961000                if (mStoreRays) 
     
    10031007                        } 
    10041008                } 
    1005  
    1006                  
    1007                 viewCell->mLeaf = leaf; 
    1008  
     1009         
    10091010                if (mUseAreaForPvs) 
    10101011                        viewCell->SetArea(tData.mProbability); 
     
    29912992                                                                   BspNodeGeometry &vcGeom) const 
    29922993{ 
     2994        // if false, cannot construct geometry for interior leaf 
     2995        if (!mViewCellsTree) 
     2996                return; 
     2997 
    29932998        ViewCellContainer leaves; 
    2994          
    29952999        mViewCellsTree->CollectLeaves(vc, leaves); 
    29963000 
     
    29993003        for (it = leaves.begin(); it != it_end; ++ it) 
    30003004        { 
    3001                 BspLeaf *l = dynamic_cast<BspViewCell *>(*it)->mLeaf; 
    3002                  
    3003                 ConstructGeometry(l, vcGeom); 
     3005                BspViewCell *bspVc = dynamic_cast<BspViewCell *>(*it); 
     3006                vector<BspLeaf *>::const_iterator bit, bit_end = bspVc->mLeaves.end(); 
     3007 
     3008                for (bit = bspVc->mLeaves.begin(); bit != bit_end; ++ bit) 
     3009                { 
     3010                        BspLeaf *l = *bit; 
     3011                        ConstructGeometry(l, vcGeom); 
     3012                } 
    30043013        } 
    30053014} 
     
    38063815                if (ray->mViewCells.size() < 2) 
    38073816                        continue; 
    3808 //TODO viewcellhierarchy 
     3817 
    38093818                iit = ray->mViewCells.begin(); 
    38103819                BspViewCell *bspVc = dynamic_cast<BspViewCell *>(*(iit ++)); 
    3811                 BspLeaf *leaf = bspVc->mLeaf; 
     3820                BspLeaf *leaf = bspVc->mLeaves[0]; 
    38123821                 
    38133822                // traverse intersections  
     
    38183827                        BspLeaf *prevLeaf = leaf; 
    38193828                        bspVc = dynamic_cast<BspViewCell *>(*iit); 
    3820             leaf = bspVc->mLeaf; 
     3829            leaf = bspVc->mLeaves[0]; // exactly one leaf 
    38213830 
    38223831                        // view space not valid or same view cell 
     
    39843993{ 
    39853994        ExportNode(mRoot, stream); 
    3986  
    39873995        return true; 
    39883996} 
Note: See TracChangeset for help on using the changeset viewer.