Ignore:
Timestamp:
05/24/08 11:59:35 (16 years ago)
Author:
mattausch
Message:

enabled view cell visualization

File:
1 edited

Legend:

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

    r2696 r2705  
    2222#define NOT_ACCOUNTED_OBJECT 0 
    2323#define ACCOUNTED_OBJECT 2 
    24 #define SHOW_QT_VISUALIZATION 0 
     24 
    2525 
    2626static const float MIN_DIST = 0.001f; 
     
    174174 
    175175 
    176 void GvsPreprocessor::CountObject(Intersectable *triObj) 
    177 { 
     176int GvsPreprocessor::CountObject(Intersectable *triObj) 
     177{ 
     178        int numObjects = 0; 
     179 
    178180        if ((triObj->mCounter != (NOT_ACCOUNTED_OBJECT + 1)) &&  
    179181                (triObj->mCounter != (ACCOUNTED_OBJECT + 1))) 
    180182        { 
    181183                ++ triObj->mCounter; 
    182                 ++ mGenericStats[1]; 
    183         } 
     184                ++ numObjects; 
     185        } 
     186 
     187        mGenericStats[1] += numObjects; 
     188 
     189        return numObjects; 
    184190} 
    185191 
     
    187193void GvsPreprocessor::UpdateStatsForVisualization(KdIntersectable *kdInt) 
    188194{ 
    189         //mViewCellsManager->UpdateStatsForViewCell(mCurrentViewCell, kdInt); 
    190  
    191195        // count new objects in pvs due to kd node conversion    
    192196        myobjects.clear(); 
    193         mKdTree->CollectObjects(kdInt->GetItem(), myobjects); 
     197        // also gather duplicates to avoid mailing 
     198        mKdTree->CollectObjectsWithDublicates(kdInt->GetItem(), myobjects); 
     199 
     200        int numObj; 
    194201 
    195202        ObjectContainer::const_iterator oit, oit_end = myobjects.end(); 
    196203 
    197204        for (oit = myobjects.begin(); oit != oit_end; ++ oit) 
    198                 CountObject(*oit); 
     205                numObj = CountObject(*oit); 
     206 
     207        mViewCellsManager->UpdateStatsForViewCell(mCurrentViewCell, kdInt, numObj); 
    199208}        
    200209 
     
    240249                                mCurrentViewCell->GetPvs().AddSampleDirty(kdInt, 1.0f); 
    241250 
    242                                 if (SHOW_QT_VISUALIZATION) UpdateStatsForVisualization(kdInt);   
     251                                if (QT_VISUALIZATION_SHOWN) UpdateStatsForVisualization(kdInt);  
    243252                        } 
    244253                } 
     
    871880 
    872881 
    873 void GvsPreprocessor::IntersectWithViewCell() 
     882void GvsPreprocessor::ComputeViewCellGeometryIntersection() 
    874883{ 
    875884        AxisAlignedBox3 box = mCurrentViewCell->GetBox(); 
     
    915924                        mCurrentViewCell->GetPvs().AddSampleDirty(kdInt, 1.0f); 
    916925                        //mCurrentViewCell->GetPvs().AddSampleDirtyCheck(kdInt, 1.0f); 
    917                         if (SHOW_QT_VISUALIZATION) UpdateStatsForVisualization(kdInt); 
     926                        if (QT_VISUALIZATION_SHOWN) UpdateStatsForVisualization(kdInt); 
    918927                } 
    919928        } 
     
    12961305         
    12971306        // at last compute objects that directly intersect view cell 
    1298         IntersectWithViewCell(); 
     1307        ComputeViewCellGeometryIntersection(); 
    12991308 
    13001309                 
Note: See TracChangeset for help on using the changeset viewer.