Ignore:
Timestamp:
01/18/06 23:35:50 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp

    r547 r551  
    252252 
    253253 
     254void ViewCellsManager::FinalizeViewCells(const bool createMesh) 
     255{ 
     256        ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 
     257        for (it = mViewCells.begin(); it != it_end; ++ it) 
     258        { 
     259                Finalize(*it, createMesh); 
     260        } 
     261} 
     262 
     263 
     264void ViewCellsManager::Finalize(ViewCell *viewCell, const bool createMesh) 
     265{ 
     266        // implemented in subclasses 
     267} 
     268 
     269 
    254270ViewCell *ViewCellsManager::MergeViewCells(ViewCell &front, ViewCell &back) const 
    255271{ 
     
    11451161void BspViewCellsManager::CreateMesh(ViewCell *vc) 
    11461162{ 
    1147 } 
    1148  
    1149 ViewCell * 
    1150 BspViewCellsManager::GetViewCell(const Vector3 &point) 
     1163        // TODO 
     1164} 
     1165 
     1166 
     1167ViewCell *BspViewCellsManager::GetViewCell(const Vector3 &point) 
    11511168{ 
    11521169  if (!mBspTree) 
     
    14451462void KdViewCellsManager::CreateMesh(ViewCell *vc) 
    14461463{ 
     1464        // TODO 
    14471465} 
    14481466 
     
    17931811void VspKdViewCellsManager::CreateMesh(ViewCell *vc) 
    17941812{ 
     1813        //TODO 
    17951814} 
    17961815 
     
    18161835float VspBspViewCellsManager::GetProbability(ViewCell *viewCell) 
    18171836{ 
    1818         if (mVspBspTree->mUseAreaForPvs) 
     1837        if (0 && mVspBspTree->mUseAreaForPvs) 
    18191838                return GetArea(viewCell) / GetAccVcArea(); 
    18201839        else 
     
    18651884        VssRayContainer savedRays; 
    18661885 
     1886        Debug << "construction samples: " << mConstructionSamples << " rays: " << rays.size() << endl; 
    18671887        GetRaySets(rays, mConstructionSamples, constructionRays, &savedRays); 
    18681888 
     
    19731993                if (exporter) 
    19741994                { 
    1975                         //exporter->SetWireframe(); 
    1976                         exporter->SetFilled(); 
     1995                        if (1) 
     1996                                exporter->SetWireframe(); 
     1997                        else 
     1998                                exporter->SetFilled(); 
    19771999                        ExportViewCellsForViz(exporter); 
    19782000 
     
    20312053        if (mViewCellsFinished) 
    20322054        { 
     2055                FinalizeViewCells(true); 
    20332056                EvaluateViewCellsStats(); 
    20342057                return 0; 
     
    20492072 
    20502073 
    2051         //-- merge the individual view cells: Should be done here because it makes 
     2074        if (1) 
     2075        { 
     2076                FinalizeViewCells(false); 
     2077        } 
     2078 
     2079        //-- merge the individual view cells 
    20522080        MergeViewCells(postProcessRays, objects); 
    20532081        //-- refines the merged view cells 
     
    20592087 
    20602088        // real meshes are only contructed only at this stage 
    2061         CreateViewCellMeshes(); 
     2089        //CreateViewCellMeshes(); 
     2090        FinalizeViewCells(true); 
    20622091 
    20632092        // write view cells to disc 
     
    24972526        return mVspBspTree->CastBeam(beam); 
    24982527} 
     2528 
     2529 
     2530void VspBspViewCellsManager::Finalize(ViewCell *viewCell) 
     2531{ 
     2532        BspViewCell *vc = dynamic_cast<BspViewCell *>(viewCell); 
     2533        CreateMesh(vc); 
     2534 
     2535        vector<BspLeaf *>::const_iterator it, it_end = vc->mLeaves.end(); 
     2536 
     2537        float area = 0; 
     2538        float volume = 0; 
     2539 
     2540        for (it = vc->mLeaves.begin(); it != it_end; ++ it) 
     2541        { 
     2542                BspNodeGeometry geom; 
     2543                BspLeaf *leaf = *it; 
     2544                mVspBspTree->ConstructGeometry(leaf, geom); 
     2545 
     2546                area += geom.GetArea(); 
     2547                volume += geom.GetVolume(); 
     2548        } 
     2549 
     2550        viewCell->SetVolume(volume); 
     2551        viewCell->SetArea(area); 
     2552} 
Note: See TracChangeset for help on using the changeset viewer.