Changeset 1741 for GTP/trunk/Lib/Vis
- Timestamp:
- 11/12/06 23:04:47 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1740 r1741 1943 1943 //subStats.mEntriesInPvs += entriesIncr; 1944 1944 1945 // if (rcDecr <= 0)1946 1945 if (nextCandidate->Type() == SubdivisionCandidate::VIEW_SPACE) 1947 1946 { 1948 1947 ++ subStats.mViewSpaceSplits; 1949 cout << "v";//cout << "vsp t: " << timeStamp << " rc: " << rcDecr << " pvs: " << entriesIncr << endl; 1948 cout << "v"; 1949 //cout << "vsp t: " << timeStamp << " rc: " << rcDecr << " pvs: " << entriesIncr << endl; 1950 1950 } 1951 1951 else 1952 1952 { 1953 1953 ++ subStats.mObjectSpaceSplits; 1954 cout << "o";//"osp t: " << timeStamp << " rc: " << rcDecr << " pvs: " << entriesIncr << endl; 1954 cout << "o"; 1955 //"osp t: " << timeStamp << " rc: " << rcDecr << " pvs: " << entriesIncr << endl; 1955 1956 } 1956 1957 … … 1974 1975 1975 1976 1976 void HierarchyManager::EvaluateSubdivision(const VssRayContainer &sampleRays, 1977 void HierarchyManager::EvaluateSubdivision(const VssRayContainer &sampleRays, 1977 1978 const ObjectContainer &objects, 1978 1979 const string &filename) -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r1740 r1741 22 22 { 23 23 public: 24 25 PvsEntry() {} 24 26 25 27 PvsEntry(T sample, const S &data): mObject(sample), mData(data) {} … … 371 373 std::vector<PvsEntry<T, S> >::const_iterator ait = a.mEntries.begin(), ait_end = a.mEntries.end(); 372 374 std::vector<PvsEntry<T, S> >::const_iterator bit = b.mEntries.begin(), bit_end = b.mEntries.end(); 373 374 while (1) 375 { 376 for (; (ait != ait_end) && ((*ait).mObject < (*bit).mObject); ++ ait) 375 Intersectable::NewMail(); 376 cout << "a: " << a.mEntries.size() << " b " << b.mEntries.size() << endl; 377 378 for (; (ait != ait_end); ++ ait) 379 { 380 Intersectable *aObj = (*ait).mObject; 381 Intersectable *bObj = NULL; 382 PvsEntry<T, S> aEntry = (*ait); 383 384 for (; (bit != bit_end) && ((*bit).mObject <= (*ait).mObject); ++ bit) 377 385 { 378 if ((*ait).mObject != (*bit).mObject) 379 mergedPvs.mEntries.push_back(*ait); 380 } 381 382 for (; (bit != bit_end) && ((ait == ait_end) || ((*bit).mObject <= (*bit).mObject)); ++ bit) 383 { 384 if ((*ait).mObject == (*bit).mObject) 386 bObj = (*bit).mObject; 387 388 // object found => add up probabilities 389 if (bObj != aEntry.mObject) 385 390 { 386 PvsData newData( (*ait).mData.mSumPdf + (*bit).mData.mSumPdf);387 PvsEntry<T, S> entry( (*ait).mObject, newData);391 PvsData newData(aEntry.mData.mSumPdf + (*bit).mData.mSumPdf); 392 PvsEntry<T, S> entry(bObj, newData); 388 393 mergedPvs.mEntries.push_back(entry); 394 if (bObj->Mailed()) 395 cout << "Error2 " << bObj << endl; 396 bObj->Mail(); 397 cout << "e: " << (int)bObj; 389 398 } 390 399 else 391 400 { 401 if (bObj->Mailed()) 402 cout << "Error3 " << bObj << endl; 403 bObj->Mail(); 392 404 mergedPvs.mEntries.push_back(*bit); 405 cout << "e: " << (int)bObj; 393 406 } 394 407 } 395 } 408 409 // only push back if objects different 410 // (equal case is handled by second loop) 411 if (aObj != bObj) 412 { 413 mergedPvs.mEntries.push_back(*ait); 414 if (aObj->Mailed()) 415 cout << "Error1 " << aObj << endl; 416 aObj->Mail(); 417 cout << "e: " << (int)aObj; 418 } 419 } 420 421 // add the rest 422 for (; (bit != bit_end); ++ bit) 423 { 424 Intersectable *bObj = (*bit).mObject; 425 426 mergedPvs.mEntries.push_back(*bit); 427 if (bObj->Mailed()) 428 cout << "Error4 " << bObj << endl; 429 bObj->Mail(); 430 cout << "e: " << (int)bObj; 431 } 432 433 /* 434 while ((ait != ait_end) || (bit != bit_end)) 435 {cout << "x"; 436 437 // first iterate through first vector until we find the objects 438 for (; (ait != ait_end) && ((bit == bit_end) || ((*ait).mObject <= (*bit).mObject)); ++ ait) 439 { 440 Intersectable *obj = (*ait).mObject; 441 aEntry = (*ait); 442 //bObject = (bit != bit_end) ? (*bit).mObject : NULL; 443 444 // only push back if objects different 445 // (equal case is handled by second loop) 446 if (obj != bEntry.mObject) 447 { 448 mergedPvs.mEntries.push_back(*ait); 449 if (obj->Mailed()) 450 cout << "Error1 " << obj << endl; 451 obj->Mail(); 452 cout << "e: " << obj; 453 } 454 } 455 456 // iterate through second pvs 457 for (; (bit != bit_end) && ((ait == ait_end) || ((*bit).mObject <= (*ait).mObject)); ++ bit) 458 { 459 Intersectable *obj = (*bit).mObject; 460 bEntry = (*bit); 461 //aObject = (ait != ait_end) ? (*ait).mObject : NULL; 462 463 // object found => add up probabilities 464 if (obj != aEntry.mObject) 465 { 466 PvsData newData(aEntry.mData.mSumPdf + bEntry.mData.mSumPdf); 467 PvsEntry<T, S> entry(obj, newData); 468 mergedPvs.mEntries.push_back(entry); 469 if (obj->Mailed()) 470 cout << "Error2 " << obj << endl; 471 obj->Mail(); 472 cout << "e: " << obj; 473 } 474 else 475 { 476 if (obj->Mailed()) 477 cout << "Error3 " << obj << endl; 478 obj->Mail(); 479 mergedPvs.mEntries.push_back(*bit); 480 cout << "e: " << obj; 481 } 482 } 483 }*/ 396 484 } 397 485 … … 457 545 S &data = (*it).mData; 458 546 data.mSumPdf += pdf; 459 547 cout << "w"; 460 548 return data.mSumPdf; 461 549 } … … 463 551 { 464 552 PvsEntry<T, S> entry(sample, pdf); 465 553 cout << "i"; 466 554 mEntries.insert(it, entry); 467 555 return pdf; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r1740 r1741 1723 1723 { 1724 1724 root = root->GetParent(); 1725 cout << "h"; 1725 1726 pvs.MergeInPlace(root->GetPvs()); 1726 1727 }
Note: See TracChangeset
for help on using the changeset viewer.