Changeset 2065 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 01/29/07 19:00:03 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2064 r2065 742 742 vector<int>::const_iterator iit, iit_end = strategies.end(); 743 743 744 cout << "===============================\n" << endl; 744 745 for (iit = strategies.begin(); iit != iit_end; ++ iit) 745 746 { … … 762 763 << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 763 764 765 cout << "===============================\n" << endl; 764 766 return (int)passSamples.size(); 765 767 } … … 1810 1812 { 1811 1813 1812 if ((vc->GetPvs().EvalPvsCost() > maxPvsSize) || 1813 (vc->GetPvs().EvalPvsCost() < minPvsSize)) 1814 { 1814 const float pvsCost = vc->GetPvs().EvalPvsCost(); 1815 1816 if ((pvsCost > maxPvsSize) || (pvsCost < minPvsSize)) 1817 { 1818 cout << "err: " << pvsCost << " " << minPvsSize << " " << maxPvsSize << endl; 1815 1819 return false; 1816 1820 } … … 2687 2691 const bool useHitObjects) 2688 2692 { 2689 if (!useHitObjects) { 2690 VssRayContainer::const_iterator it, it_end = rays.end(); 2691 for (it = rays.begin(); it != it_end; ++ it) { 2692 VssRay *vssRay = *it; 2693 // set only the termination object 2694 vssRay->mTerminationObject = GetIntersectable( 2695 *vssRay, 2696 true); 2697 } 2698 } 2693 if (!useHitObjects) 2694 { 2695 VssRayContainer::const_iterator it, it_end = rays.end(); 2696 2697 for (it = rays.begin(); it != it_end; ++ it) 2698 { 2699 VssRay *vssRay = *it; 2700 // set only the termination object 2701 vssRay->mTerminationObject = GetIntersectable( 2702 *vssRay, 2703 true); 2704 } 2705 } 2699 2706 } 2700 2707 … … 2756 2763 2757 2764 if (!GetViewSpaceBox().GetRaySegment(hray, tmin, tmax) || (tmin > tmax)) { 2758 // 2765 // cerr<<"ray outside view space box\n"; 2759 2766 return 0; 2760 2767 } … … 2785 2792 if (storeViewCells) 2786 2793 { 2787 cerr<<"Store viewcells should not be used in the test!"<<endl;2794 // cerr << "Store viewcells should not be used in the test!" << endl; 2788 2795 // copy viewcells memory efficiently 2789 2796 #if VSS_STORE_VIEWCELLS … … 5320 5327 { 5321 5328 cout << "exporting view cells after post process ... "; 5329 5322 5330 if (0) 5323 5331 { // export view space box … … 6306 6314 if (!node->IsLeaf()) 6307 6315 { 6308 cout << "error, can only doleaves" << endl;6316 cout << "error, can only process leaves" << endl; 6309 6317 return 0; 6310 6318 } … … 6372 6380 const int savedColorCode = mColorCode; 6373 6381 6374 const float maxRenderCost = UpdateObjectCosts();6382 const float maxRenderCost = -1;//UpdateObjectCosts(); 6375 6383 cout << "maxRenderCost: " << maxRenderCost << endl; 6376 6384 mColorCode = 0; // 0 = random, 1 = export pvs 6377 6378 if (0)6379 mHierarchyManager->ExportObjectSpaceHierarchy(exporter, objects,6380 CLAMP_TO_BOX ? &bbox : NULL, maxRenderCost, false);6381 6382 6383 //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane());6384 ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane());6385 6386 delete exporter;6387 6388 cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl;6389 mColorCode = savedColorCode;6390 }6391 6392 exporter = Exporter::GetExporter("final_object_partition.wrl");6393 6394 if (exporter)6395 {6396 if (CLAMP_TO_BOX)6397 {6398 exporter->mClampToBox = true;6399 }6400 6401 EvaluateViewCellsStats();6402 6403 const long starttime = GetTime();6404 cout << "exporting final objects (after initial construction + post process) ... ";6405 6406 // matt: hack for clamping scene6407 AxisAlignedBox3 bbox = mViewSpaceBox;6408 bbox.Scale(scale);6409 6410 // hack color code (show pvs size)6411 const int savedColorCode = mColorCode;6412 6413 mColorCode = 1; // 0 = random, 1 = export pvs6414 // don't visualize render cost6415 const float maxRenderCost = -1;6416 6385 6417 6386 if (1) … … 6420 6389 6421 6390 6422 //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 6423 if (0) 6391 if (1) 6392 { 6393 //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 6424 6394 ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 6395 } 6396 6397 delete exporter; 6398 6399 cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl; 6400 mColorCode = savedColorCode; 6401 } 6402 6403 exporter = Exporter::GetExporter("final_object_partition.wrl"); 6404 6405 if (exporter) 6406 { 6407 if (CLAMP_TO_BOX) 6408 { 6409 exporter->mClampToBox = true; 6410 } 6411 6412 EvaluateViewCellsStats(); 6413 6414 const long starttime = GetTime(); 6415 cout << "exporting final objects (after initial construction + post process) ... "; 6416 6417 // matt: hack for clamping scene 6418 AxisAlignedBox3 bbox = mViewSpaceBox; 6419 bbox.Scale(scale); 6420 6421 // hack color code (show pvs size) 6422 const int savedColorCode = mColorCode; 6423 6424 mColorCode = 1; // 0 = random, 1 = export pvs 6425 // don't visualize render cost 6426 const float maxRenderCost = -1; 6427 6428 if (1) 6429 mHierarchyManager->ExportObjectSpaceHierarchy(exporter, objects, 6430 CLAMP_TO_BOX ? &bbox : NULL, maxRenderCost, false); 6431 6432 6433 if (1) 6434 { 6435 ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 6436 //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 6437 } 6425 6438 6426 6439 delete exporter;
Note: See TracChangeset
for help on using the changeset viewer.