Changeset 1736 for GTP/trunk/Lib


Ignore:
Timestamp:
11/09/06 19:05:09 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
8 edited

Legend:

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

    r1733 r1736  
    320320        Debug << "max memory: " << mMaxMemory << endl; 
    321321        Debug << "use cost heuristics: " << mUseCostHeuristics << endl; 
    322         Debug << "use sah (surface area heuristics: " << mUseSah << endl; 
     322        Debug << "use surface area heuristics: " << mUseSah << endl; 
    323323        Debug << "subdivision stats log: " << subdivisionStatsLog << endl; 
    324324        Debug << "split borders: " << mSplitBorder << endl; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r1733 r1736  
    151151        Environment::GetSingleton()->GetIntValue( 
    152152                "Hierarchy.Construction.maxRepairs", mMaxRepairs); 
     153 
    153154        // compare to bytes 
    154155        mTermMaxMemory *= (1024.0f * 1024.0f); 
     
    504505                        /// Repair split queue, i.e., affected view space candidates 
    505506                        cout << "repairing queue ... " << endl; 
    506                         RepairQueue(dirtyVspList, viewSpaceQueue, true); 
     507                        const int repaired = RepairQueue(dirtyVspList, viewSpaceQueue, true); 
    507508             
    508                         cout << "\nrepaired " << (int)dirtyVspList.size() << " candidates" << endl; 
     509                        cout << "\nrepaired " << repaired << " candidates from " << (int)dirtyVspList.size() << " dirtied candidates" << endl; 
    509510                } 
    510511                else 
     
    534535                        /// Repair split queue 
    535536                        cout << "repairing queue ... " << endl; 
    536                         RepairQueue(dirtyOspList, objectSpaceQueue, true); 
    537  
    538                         cout << "repaired " << (int)dirtyOspList.size() << " candidates" << endl; 
     537                        const int repaired = RepairQueue(dirtyOspList, objectSpaceQueue, true); 
     538 
     539                        cout << "\nrepaired " << repaired << " candidates from " << (int)dirtyOspList.size() << " dirtied candidates" << endl; 
    539540                } 
    540541        } 
     
    13101311 
    13111312 
    1312 void HierarchyManager::RepairQueue(const SubdivisionCandidateContainer &dirtyList,  
    1313                                                                    SplitQueue &splitQueue, 
    1314                                                                    const bool recomputeSplitPlaneOnRepair) 
     1313int HierarchyManager::RepairQueue(const SubdivisionCandidateContainer &dirtyList, 
     1314                                                                  SplitQueue &splitQueue, 
     1315                                                                  const bool recomputeSplitPlaneOnRepair) 
    13151316{ 
    13161317        // for each update of the view space partition: 
     
    13301331        // split candidate 
    13311332 
     1333        int repaired = 0; 
     1334 
    13321335        // collect list of "dirty" candidates 
    13331336        const long startTime = GetTime(); 
     
    13561359                 // reinsert 
    13571360                splitQueue.Push(sc); 
    1358  
     1361                 
     1362                ++ repaired; 
    13591363                cout << "."; 
    13601364 
     
    13711375        mHierarchyStats.mRepairTime += timeDiff; 
    13721376 
    1373         if (0) cout << "repaired in " << timeDiff * 1e-3f << " secs" << endl; 
     1377        return repaired; 
    13741378} 
    13751379 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h

    r1732 r1736  
    363363        /** Repairs the dirty entries of the subdivision candidate queue. The 
    364364                list of entries is given in the dirty list. 
    365         */ 
    366         void RepairQueue(const SubdivisionCandidateContainer &dirtyList,  
    367                                          SplitQueue &splitQueue, 
    368                                          const bool recomputeSplitPlaneOnRepair); 
     365 
     366                @returns number of repaired candidates 
     367        */ 
     368        int RepairQueue(const SubdivisionCandidateContainer &dirtyList,  
     369                                        SplitQueue &splitQueue, 
     370                                        const bool recomputeSplitPlaneOnRepair); 
    369371 
    370372        /** Collect subdivision candidates which were affected by the splits from the 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h

    r1701 r1736  
    4747  /// pointer to the containing bvh leaf 
    4848  BvhLeaf *mBvhLeaf; 
    49 //BvhNode *mBvhLeaf; 
    5049   
    5150  /// # of references to this instance 
    52   int mReferences; 
     51  //int mReferences; 
    5352 
    5453  ////////////////// 
    5554  // note matt: delete these, they are only taking memory 
    5655 
    57  
    5856  /// object based pvs 
    59   KdPvs mKdPvs; 
     57  //KdPvs mKdPvs; 
    6058 
    6159  /// view cell based pvs per object 
    62   ViewCellPvs mViewCellPvs; 
     60  //ViewCellPvs mViewCellPvs; 
    6361         
    6462  /////////////////////// 
     
    7573                }; 
    7674   
    77   Intersectable(): mMailbox(0), mReferences(0), mBvhLeaf(0), mVssRays(NULL) {} 
     75  Intersectable():  
     76  mMailbox(0),  
     77  //mReferences(0),  
     78  mBvhLeaf(0),  
     79  mVssRays(NULL) {} 
    7880 
    7981  virtual Intersectable::~Intersectable() {DEL_PTR(mVssRays);} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp

    r1695 r1736  
    303303    // determine the side of this ray with respect to the plane 
    304304    AxisAlignedBox3 box = (*mi)->GetBox(); 
    305                  
     305         
     306        // matt: no more ref 
    306307        // for handling multiple objects: keep track of references 
    307         if (leaf->IsRoot())  
    308                 (*mi)->mReferences = 1; // initialise references at root 
     308        //if (leaf->IsRoot())  
     309        //      (*mi)->mReferences = 1; // initialise references at root 
    309310         
    310         -- (*mi)->mReferences; // remove parent ref 
     311        // matt: no more ref 
     312        //-- (*mi)->mReferences; // remove parent ref 
    311313 
    312314 
     
    314316        { 
    315317      front->mObjects.push_back(*mi); 
    316           ++ (*mi)->mReferences; 
     318          //++ (*mi)->mReferences; 
    317319        } 
    318320         
     
    320322        { 
    321323      back->mObjects.push_back(*mi); 
    322           ++ (*mi)->mReferences; 
     324        // matt: no more ref 
     325        //  ++ (*mi)->mReferences; 
    323326        } 
    324327 
     
    346349                Intersectable *object = *oit; 
    347350                 
    348                 if (object->mReferences > 1) 
     351                // matt: no more ref 
     352                /*if (object->mReferences > 1) 
    349353                { 
    350354                        leaf->mMultipleObjects.push_back(object); 
    351                 } 
     355                }*/ 
    352356        } 
    353357} 
     
    10441048KdTree::CollectLeafPvs() 
    10451049{ 
    1046   int totalPvsSize = 0; 
     1050 
     1051        // matt: no more kd pvs 
     1052    int totalPvsSize = 0; 
     1053        /* 
    10471054  stack<KdNode *> nodeStack; 
    10481055   
     
    10761083    } 
    10771084  } 
    1078  
     1085*/ 
    10791086  return totalPvsSize; 
    10801087} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/OspTree.cpp

    r1715 r1736  
    3939                                                                                  bool checkOnlyMailed) 
    4040{ 
    41         MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 
     41        // no view cell pvs!! 
     42/*      MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 
    4243 
    4344        if (vdata) 
     
    5253                                return true; 
    5354                } 
    54         } 
     55        }*/ 
    5556 
    5657        return false; 
     
    250251                if (parent->IsRoot()) 
    251252                { 
    252                         object->mReferences = 1; 
     253                        // matt: no more parent ref 
     254                        //object->mReferences = 1; 
    253255                } 
    254256 
    255257                // remove parent ref 
    256                 -- object->mReferences; 
     258                // matt: no more parent ref 
     259                //-- object->mReferences; 
    257260 
    258261                // determine the side of this ray with respect to the plane 
     
    262265                { 
    263266            front.push_back(object); 
    264                         ++ object->mReferences; 
     267                        // matt: no more ref 
     268                        //++ object->mReferences; 
    265269                } 
    266270 
     
    268272                { 
    269273                        back.push_back(object); 
    270                         ++ object->mReferences; 
     274                        // matt: no more ref 
     275                        //++ object->mReferences; 
    271276                } 
    272277        } 
     
    885890                { 
    886891                        ViewCell *vc = *vit; 
    887                         MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 
     892                        // no view cel pvs!! 
     893                        /*MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 
    888894 
    889895                        if (!vdata) // should never happen 
     
    894900                                vdata->Mail(); 
    895901                                renderCost += vc->GetVolume(); 
    896                         } 
     902                        }*/ 
    897903                } 
    898904        } 
     
    13831389                { 
    13841390                        ViewCell *vc = *vit; 
    1385                          
    1386                         MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 
    1387  
     1391                        // no more view cell pvs!! 
     1392                        /*MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 
    13881393                        if (!vdata) 
    13891394                        { 
     
    14061411                                        newRc += vc->GetVolume(); 
    14071412                                } 
    1408                         } 
     1413                        }*/ 
    14091414                } 
    14101415        } 
     
    14641469                Intersectable *object = *oit; 
    14651470                 
    1466                 if (object->mReferences > 1) 
     1471                // matt: no more ref 
     1472                /*if (object->mReferences > 1) 
    14671473                { 
    14681474                        leaf->mMultipleObjects.push_back(object); 
    1469                 } 
     1475                }*/ 
    14701476        } 
    14711477} 
     
    15291535        { 
    15301536                Intersectable *obj = *oit; 
    1531  
    1532                 ViewCellPvsMap::const_iterator vit, vit_end = obj->mViewCellPvs.mEntries.end(); 
     1537                // no more view cell pvs!! 
     1538                /*ViewCellPvsMap::const_iterator vit, vit_end = obj->mViewCellPvs.mEntries.end(); 
    15331539 
    15341540                for (vit = obj->mViewCellPvs.mEntries.begin(); vit != vit_end; ++ vit) 
     
    15411547                                viewCells.push_back(vc); 
    15421548                        } 
    1543                 } 
     1549                }*/ 
    15441550        } 
    15451551} 
     
    18041810        for (it = touchedObjects.begin(); it != it_end; ++ it) 
    18051811        { 
    1806                 Debug << "\nobj: " << (*it) << " vc pvs size: " << (*it)->mViewCellPvs.GetSize() << endl << endl; 
     1812                // no more view cell pvs!! 
     1813                /*Debug << "\nobj: " << (*it) << " vc pvs size: " << (*it)->mViewCellPvs.GetSize() << endl << endl; 
    18071814                ViewCellPvsMap::const_iterator mit, mit_end = (*it)->mViewCellPvs.mEntries.end(); 
    18081815 
     
    18101817                { 
    18111818                        Debug << "new sumpdf: " << (*mit).second.mSumPdf << endl; 
    1812                 } 
     1819                }*/ 
    18131820        } 
    18141821 
     
    19761983{        
    19771984        contribution = 0; // todo 
    1978         MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 
    1979  
     1985         
     1986        // no more view cell pvs!! 
     1987        /*MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 
    19801988        if (!vdata) 
    19811989        { 
     
    19861994                obj->mViewCellPvs.AddSample(vc, 1); 
    19871995        } 
     1996 
    19881997        vdata->Mail(); 
     1998        */ 
    19891999 
    19902000        return true; 
     
    20772087                        ViewCell *vc = *vit; 
    20782088                         
    2079                         MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 
     2089                        /*MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 
    20802090 
    20812091                        if (vdata && !vdata->Mailed()) 
     
    20832093                                vdata->Mail(); 
    20842094                                obj->mViewCellPvs.RemoveSample(vc, 1); 
    2085                         } 
     2095                        }*/ 
    20862096                } 
    20872097        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h

    r1723 r1736  
    200200        /// Map of PVS entries 
    201201        std::map<T, S, LtSample<T> > mEntries; 
    202  
    203   /// Number of samples used to create the PVS 
    204   int mSamples; 
     202        //vector<pair<T, S> > mEntries;  
     203         
     204        /// Number of samples used to create the PVS 
     205        int mSamples; 
    205206}; 
    206207 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1732 r1736  
    37303730                        exporter->SetWireframe(); 
    37313731 
     3732                        // matt: no kd pvs 
     3733                        /* 
    37323734                        KdPvsMap::iterator kit = object->mKdPvs.mEntries.begin(); 
    37333735                        Intersectable::NewMail(); 
     
    37553757                        exporter->SetForcedMaterial(m); 
    37563758                        exporter->ExportIntersectable(object); 
    3757  
     3759*/ 
    37583760                        delete exporter; 
    37593761                } 
Note: See TracChangeset for help on using the changeset viewer.