Changeset 1736 for GTP/trunk/Lib/Vis
- Timestamp:
- 11/09/06 19:05:09 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1733 r1736 320 320 Debug << "max memory: " << mMaxMemory << endl; 321 321 Debug << "use cost heuristics: " << mUseCostHeuristics << endl; 322 Debug << "use s ah (surface area heuristics: " << mUseSah << endl;322 Debug << "use surface area heuristics: " << mUseSah << endl; 323 323 Debug << "subdivision stats log: " << subdivisionStatsLog << endl; 324 324 Debug << "split borders: " << mSplitBorder << endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1733 r1736 151 151 Environment::GetSingleton()->GetIntValue( 152 152 "Hierarchy.Construction.maxRepairs", mMaxRepairs); 153 153 154 // compare to bytes 154 155 mTermMaxMemory *= (1024.0f * 1024.0f); … … 504 505 /// Repair split queue, i.e., affected view space candidates 505 506 cout << "repairing queue ... " << endl; 506 RepairQueue(dirtyVspList, viewSpaceQueue, true);507 const int repaired = RepairQueue(dirtyVspList, viewSpaceQueue, true); 507 508 508 cout << "\nrepaired " << (int)dirtyVspList.size() << "candidates" << endl;509 cout << "\nrepaired " << repaired << " candidates from " << (int)dirtyVspList.size() << " dirtied candidates" << endl; 509 510 } 510 511 else … … 534 535 /// Repair split queue 535 536 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; 539 540 } 540 541 } … … 1310 1311 1311 1312 1312 void HierarchyManager::RepairQueue(const SubdivisionCandidateContainer &dirtyList, 1313 1314 1313 int HierarchyManager::RepairQueue(const SubdivisionCandidateContainer &dirtyList, 1314 SplitQueue &splitQueue, 1315 const bool recomputeSplitPlaneOnRepair) 1315 1316 { 1316 1317 // for each update of the view space partition: … … 1330 1331 // split candidate 1331 1332 1333 int repaired = 0; 1334 1332 1335 // collect list of "dirty" candidates 1333 1336 const long startTime = GetTime(); … … 1356 1359 // reinsert 1357 1360 splitQueue.Push(sc); 1358 1361 1362 ++ repaired; 1359 1363 cout << "."; 1360 1364 … … 1371 1375 mHierarchyStats.mRepairTime += timeDiff; 1372 1376 1373 if (0) cout << "repaired in " << timeDiff * 1e-3f << " secs" << endl;1377 return repaired; 1374 1378 } 1375 1379 -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1732 r1736 363 363 /** Repairs the dirty entries of the subdivision candidate queue. The 364 364 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); 369 371 370 372 /** Collect subdivision candidates which were affected by the splits from the -
GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h
r1701 r1736 47 47 /// pointer to the containing bvh leaf 48 48 BvhLeaf *mBvhLeaf; 49 //BvhNode *mBvhLeaf;50 49 51 50 /// # of references to this instance 52 int mReferences;51 //int mReferences; 53 52 54 53 ////////////////// 55 54 // note matt: delete these, they are only taking memory 56 55 57 58 56 /// object based pvs 59 KdPvs mKdPvs;57 //KdPvs mKdPvs; 60 58 61 59 /// view cell based pvs per object 62 ViewCellPvs mViewCellPvs;60 //ViewCellPvs mViewCellPvs; 63 61 64 62 /////////////////////// … … 75 73 }; 76 74 77 Intersectable(): mMailbox(0), mReferences(0), mBvhLeaf(0), mVssRays(NULL) {} 75 Intersectable(): 76 mMailbox(0), 77 //mReferences(0), 78 mBvhLeaf(0), 79 mVssRays(NULL) {} 78 80 79 81 virtual Intersectable::~Intersectable() {DEL_PTR(mVssRays);} -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r1695 r1736 303 303 // determine the side of this ray with respect to the plane 304 304 AxisAlignedBox3 box = (*mi)->GetBox(); 305 305 306 // matt: no more ref 306 307 // for handling multiple objects: keep track of references 307 if (leaf->IsRoot())308 (*mi)->mReferences = 1; // initialise references at root308 //if (leaf->IsRoot()) 309 // (*mi)->mReferences = 1; // initialise references at root 309 310 310 -- (*mi)->mReferences; // remove parent ref 311 // matt: no more ref 312 //-- (*mi)->mReferences; // remove parent ref 311 313 312 314 … … 314 316 { 315 317 front->mObjects.push_back(*mi); 316 ++ (*mi)->mReferences;318 //++ (*mi)->mReferences; 317 319 } 318 320 … … 320 322 { 321 323 back->mObjects.push_back(*mi); 322 ++ (*mi)->mReferences; 324 // matt: no more ref 325 // ++ (*mi)->mReferences; 323 326 } 324 327 … … 346 349 Intersectable *object = *oit; 347 350 348 if (object->mReferences > 1) 351 // matt: no more ref 352 /*if (object->mReferences > 1) 349 353 { 350 354 leaf->mMultipleObjects.push_back(object); 351 } 355 }*/ 352 356 } 353 357 } … … 1044 1048 KdTree::CollectLeafPvs() 1045 1049 { 1046 int totalPvsSize = 0; 1050 1051 // matt: no more kd pvs 1052 int totalPvsSize = 0; 1053 /* 1047 1054 stack<KdNode *> nodeStack; 1048 1055 … … 1076 1083 } 1077 1084 } 1078 1085 */ 1079 1086 return totalPvsSize; 1080 1087 } -
GTP/trunk/Lib/Vis/Preprocessing/src/OspTree.cpp
r1715 r1736 39 39 bool checkOnlyMailed) 40 40 { 41 MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 41 // no view cell pvs!! 42 /* MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 42 43 43 44 if (vdata) … … 52 53 return true; 53 54 } 54 } 55 }*/ 55 56 56 57 return false; … … 250 251 if (parent->IsRoot()) 251 252 { 252 object->mReferences = 1; 253 // matt: no more parent ref 254 //object->mReferences = 1; 253 255 } 254 256 255 257 // remove parent ref 256 -- object->mReferences; 258 // matt: no more parent ref 259 //-- object->mReferences; 257 260 258 261 // determine the side of this ray with respect to the plane … … 262 265 { 263 266 front.push_back(object); 264 ++ object->mReferences; 267 // matt: no more ref 268 //++ object->mReferences; 265 269 } 266 270 … … 268 272 { 269 273 back.push_back(object); 270 ++ object->mReferences; 274 // matt: no more ref 275 //++ object->mReferences; 271 276 } 272 277 } … … 885 890 { 886 891 ViewCell *vc = *vit; 887 MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 892 // no view cel pvs!! 893 /*MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 888 894 889 895 if (!vdata) // should never happen … … 894 900 vdata->Mail(); 895 901 renderCost += vc->GetVolume(); 896 } 902 }*/ 897 903 } 898 904 } … … 1383 1389 { 1384 1390 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); 1388 1393 if (!vdata) 1389 1394 { … … 1406 1411 newRc += vc->GetVolume(); 1407 1412 } 1408 } 1413 }*/ 1409 1414 } 1410 1415 } … … 1464 1469 Intersectable *object = *oit; 1465 1470 1466 if (object->mReferences > 1) 1471 // matt: no more ref 1472 /*if (object->mReferences > 1) 1467 1473 { 1468 1474 leaf->mMultipleObjects.push_back(object); 1469 } 1475 }*/ 1470 1476 } 1471 1477 } … … 1529 1535 { 1530 1536 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(); 1533 1539 1534 1540 for (vit = obj->mViewCellPvs.mEntries.begin(); vit != vit_end; ++ vit) … … 1541 1547 viewCells.push_back(vc); 1542 1548 } 1543 } 1549 }*/ 1544 1550 } 1545 1551 } … … 1804 1810 for (it = touchedObjects.begin(); it != it_end; ++ it) 1805 1811 { 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; 1807 1814 ViewCellPvsMap::const_iterator mit, mit_end = (*it)->mViewCellPvs.mEntries.end(); 1808 1815 … … 1810 1817 { 1811 1818 Debug << "new sumpdf: " << (*mit).second.mSumPdf << endl; 1812 } 1819 }*/ 1813 1820 } 1814 1821 … … 1976 1983 { 1977 1984 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); 1980 1988 if (!vdata) 1981 1989 { … … 1986 1994 obj->mViewCellPvs.AddSample(vc, 1); 1987 1995 } 1996 1988 1997 vdata->Mail(); 1998 */ 1989 1999 1990 2000 return true; … … 2077 2087 ViewCell *vc = *vit; 2078 2088 2079 MailablePvsData *vdata = obj->mViewCellPvs.Find(vc);2089 /*MailablePvsData *vdata = obj->mViewCellPvs.Find(vc); 2080 2090 2081 2091 if (vdata && !vdata->Mailed()) … … 2083 2093 vdata->Mail(); 2084 2094 obj->mViewCellPvs.RemoveSample(vc, 1); 2085 } 2095 }*/ 2086 2096 } 2087 2097 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r1723 r1736 200 200 /// Map of PVS entries 201 201 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; 205 206 }; 206 207 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1732 r1736 3730 3730 exporter->SetWireframe(); 3731 3731 3732 // matt: no kd pvs 3733 /* 3732 3734 KdPvsMap::iterator kit = object->mKdPvs.mEntries.begin(); 3733 3735 Intersectable::NewMail(); … … 3755 3757 exporter->SetForcedMaterial(m); 3756 3758 exporter->ExportIntersectable(object); 3757 3759 */ 3758 3760 delete exporter; 3759 3761 }
Note: See TracChangeset
for help on using the changeset viewer.