Changeset 2053 for GTP/trunk/Lib
- Timestamp:
- 01/24/07 16:35:17 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2050 r2053 89 89 mUseForcedColors = false; 90 90 mRenderBoxes = false; 91 mUseGlLists = true;92 //mUseGlLists = false;91 // mUseGlLists = true; 92 mUseGlLists = false; 93 93 94 94 if (mViewCellsManager->GetViewCellPoints()->size()) … … 447 447 448 448 if (id != 0xFFFFFF) 449 { 449 450 ++ mObjects[id]->mCounter; 451 } 450 452 } 451 453 } … … 511 513 512 514 pixelCount = mOcclusionQueries[j]->GetQueryResult(); 515 513 516 mObjects[j]->mCounter += pixelCount; 514 517 } … … 554 557 // cout <<"o="<<j+q<<" q="<<mOcclusionQueries[q]->GetQueryId()<<" pc="<<pixelCount<<" "; 555 558 mObjects[j + t]->mCounter += pixelCount; 559 556 560 } 557 561 … … 735 739 { 736 740 (*it)->mCounter = 0; 741 737 742 } 738 743 -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2048 r2053 16 16 { 17 17 18 #define GVS_DEBUG 018 #define GVS_DEBUG 1 19 19 20 20 struct VizStruct … … 140 140 141 141 // set flag for visualization 142 newRay->mFlags |= VssRay::ReverseSample;142 //newRay->mFlags |= VssRay::ReverseSample; 143 143 144 144 // if ray is not further processed => delete ray … … 154 154 } 155 155 156 // #id: 1270 156 157 157 bool GvsPreprocessor::HasContribution(VssRay &ray) 158 158 { … … 314 314 if (!newRay) return castRays; 315 315 316 newRay->mFlags |= VssRay::BorderSample;316 //newRay->mFlags |= VssRay::BorderSample; 317 317 318 318 // add new ray to queue … … 391 391 GenerateRays(numRandomRays, vcStrat, simpleRays); 392 392 393 393 394 ///////////////////// 394 395 395 396 396 // keep origin for per view cell sampling … … 398 398 399 399 const int numBorderSamples = (int)vssRays.size() - numRandomRays; 400 401 400 // set flags 402 VssRayContainer::const_iterator rit, rit_end = vssRays.end(); 403 int i = 0; 404 401 /*VssRayContainer::const_iterator rit, rit_end = vssRays.end(); 405 402 for (rit = vssRays.begin(); rit != rit_end; ++ rit, ++ i) 406 { 407 if (i < numBorderSamples) 408 (*rit)->mFlags |= VssRay::BorderSample; 409 } 410 403 (*rit)->mFlags |= VssRay::BorderSample; 404 */ 411 405 int castRays = (int)simpleRays.size(); 412 406 … … 429 423 mGvsStats.mBorderSamples += castRays; 430 424 431 CLEAR_CONTAINER(invalidSamples);425 //CLEAR_CONTAINER(invalidSamples); 432 426 433 427 //cout << "cast rays: " << castRays << endl; … … 585 579 EnqueueRays(samples, invalidSamples); 586 580 587 CLEAR_CONTAINER(invalidSamples);581 //CLEAR_CONTAINER(invalidSamples); 588 582 //Debug << "generated " << numSamples << " samples in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 589 583 return (int)simpleRays.size(); … … 599 593 VssRay *ray = *vit; 600 594 601 if (!HandleRay(ray)) 602 invalidSamples.push_back(ray); 595 HandleRay(ray); 596 597 //if (!HandleRay(ray)); 598 // invalidSamples.push_back(ray); 603 599 } 604 600 } … … 729 725 //exporter->SetFilled(); 730 726 731 DEL_PTR(exporter);727 delete exporter; 732 728 } 733 729 … … 820 816 vector<ViewCellPoints *> *vcPoints = mViewCellsManager->GetViewCellPoints(); 821 817 818 819 int i = 0; 822 820 if (!vcPoints->empty()) 823 821 { 822 cout << "loading view cell list" << endl; 823 824 824 vector<ViewCellPoints *>::const_iterator vit, vit_end = vcPoints->end(); 825 825 826 826 for (vit = vcPoints->begin(); vit != vit_end; ++ vit) 827 { 827 {//cout << i ++ << " " << (*vit)->first->GetId() << endl; 828 828 mViewCells.push_back((*vit)->first); 829 829 } … … 913 913 (*oit)->mCounter = 0; 914 914 } 915 //int dummy = 0;915 int dummy = 0; 916 916 while (NextViewCell())// && (dummy < 3)) 917 {//++ dummy; 917 { 918 //++ dummy; 919 //if (mProcessedViewCells < 53) continue; 920 918 921 long startTime = GetTime(); 919 922 cout << "\n***********************\n" … … 969 972 // is this really necessary? 970 973 //ClearRayQueue(); 971 974 cout << "finished" << endl; 972 975 if (mEvaluatePixelError || mExportVisibility) 973 976 { … … 988 991 } 989 992 990 993 /* 991 994 void GvsPreprocessor::ComputeRenderError() 992 995 { … … 1012 1015 } 1013 1016 } 1014 1017 */ 1015 1018 1016 1019 void GvsPreprocessor::UpdatePvs(ViewCell *currentViewCell) … … 1047 1050 void GvsPreprocessor::GetObjectPvs(ObjectContainer &objectPvs) const 1048 1051 { 1052 objectPvs.reserve((int)mTrianglePvs.size()); 1053 1049 1054 BvhLeaf::NewMail(); 1050 1055 … … 1056 1061 1057 1062 BvhLeaf *bv = intersect->mBvhLeaf; 1063 1064 // hack: reset counter 1065 (*oit)->mCounter = 0; 1058 1066 1059 1067 if (!bv || bv->Mailed()) … … 1063 1071 1064 1072 objectPvs.push_back(bv); 1065 // hack: reset counter1066 (*oit)->mCounter = 0;1067 1073 } 1068 1074 } -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
r2048 r2053 217 217 void DeterminePvsObjects(VssRayContainer &rays); 218 218 219 virtual void ComputeRenderError();219 //virtual void ComputeRenderError(); 220 220 221 221 void StorePvs(const ObjectContainer &objectPvs); -
GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp
r1571 r2053 65 65 mVertices.push_back(tri.mVertices[1]); 66 66 mVertices.push_back(tri.mVertices[2]); 67 68 VertexContainer::iterator it, it_end = mVertices.end();69 70 //for (it = mVertices.begin(); it != it_end; ++ it){cout << (*it) << " ";}cout<<endl<<endl;71 //cout << "poly n: " << GetNormal() << " t normal: " << tri.GetNormal() << endl;72 67 } 73 68 … … 105 100 Vector3 lastSplit; 106 101 102 ///////////// 107 103 //-- find line - plane intersections 108 104 … … 139 135 if (sideA > 0) 140 136 { 137 //////////// 141 138 //-- plane - line intersection 139 142 140 Vector3 splitPt = partition.FindIntersection(ptA, ptB); 143 // test if split point not too close to other split point144 141 142 // test if split point not too close to previous split point 145 143 if (!foundSplit || (!EpsilonEqualV3(splitPt, lastSplit, epsilon))) 146 144 { … … 153 151 } 154 152 } 153 155 154 back.mVertices.push_back(ptB); 156 155 } … … 249 248 sum += mVertices[i]; 250 249 251 return sum /(float)i;250 return sum / (float)i; 252 251 } 253 252 … … 258 257 int i; 259 258 Vector3 center = Center(); 260 for (i=0; i < mVertices.size(); i++) { 261 mVertices[i] = center + scale*(mVertices[i] - center); 259 260 for (i=0; i < mVertices.size(); i++) 261 { 262 mVertices[i] = center + scale * (mVertices[i] - center); 262 263 } 263 264 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2050 r2053 658 658 659 659 // export the preprocessed information to a file 660 if ( mExportVisibility)660 if (1 && mExportVisibility) 661 661 { 662 662 ExportPreprocessedData(mVisibilityFileName); -
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
r1942 r2053 997 997 if (!object->Mailed()) { 998 998 object->Mail(); 999 999 1000 object->mCounter = 1; 1000 1001 } else 1002 { 1003 1001 1004 object->mCounter++; 1002 1005 } 1003 1006 #if EVAL_VIEWCELLS 1004 1007 // and do the same for all viewcells … … 1010 1013 currInfo.viewCells++; 1011 1014 viewcell->Mail(); 1015 1012 1016 viewcell->mCounter = 1; 1013 1017 } else 1018 { 1019 1014 1020 viewcell->mCounter++; 1021 } 1015 1022 } 1016 1023 #endif … … 1059 1066 } 1060 1067 if (--object->mCounter == 0) 1068 { 1061 1069 currInfo.pvsFront--; 1070 } 1062 1071 } 1063 1072 … … 1071 1080 } 1072 1081 if (--viewcell->mCounter == 0) 1082 { 1073 1083 currInfo.viewCellsFront--; 1084 } 1074 1085 } 1075 1086 #endif … … 2386 2397 if (!object->Mailed()) { 2387 2398 object->Mail(); 2399 2388 2400 object->mCounter = 1; 2389 2401 pvs.push_back(object); … … 2843 2855 object->mCounter = 1; 2844 2856 } else 2857 { 2858 2845 2859 object->mCounter++; 2860 } 2846 2861 samples++; 2847 2862 } -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r2048 r2053 197 197 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;"$(QTDIR)\include\QtOpenGl";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtCore";"$(QTDIR)\include";QtInterface" 198 198 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG" 199 ExceptionHandling="TRUE" 199 200 RuntimeLibrary="2" 200 201 EnableEnhancedInstructionSet="2" … … 209 210 Name="VCLinkerTool" 210 211 AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib QtCore4.lib qtmain.lib cg.lib cgGL.lib QtOpenGL4.lib Qt3Support4.lib QtTest4.lib QtGui4.lib QtInterface.lib" 211 OutputFile="../bin/release/Preprocessor 2.exe"212 OutputFile="../bin/release/Preprocessor.exe" 212 213 LinkIncremental="1" 213 214 AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;"$(QTDIR)\lib";.\QtInterface\Release;"$(CG_LIB_PATH)"" … … 217 218 OptimizeReferences="2" 218 219 EnableCOMDATFolding="2" 220 OptimizeForWindows98="1" 219 221 TargetMachine="1" 220 222 FixedBaseAddress="1"/> -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2051 r2053 536 536 537 537 if (GenerateViewPoint(viewCell, pt)) 538 { cout<<"here4"<<endl;538 { 539 539 ++ generatedPts; 540 540 cout << "generated view point " << generatedPts << endl; … … 1102 1102 vm->mMaxPvsSize = (int)objects->size(); 1103 1103 1104 1104 1105 if (finalizeViewCells) 1105 1106 { 1106 1107 // create the meshes and compute volumes 1107 vm->FinalizeViewCells( true);1108 vm->FinalizeViewCells(false); 1108 1109 // vm->mViewCellsTree->AssignRandomColors(); 1109 1110 } … … 1113 1114 cout << "=============== " << vm->GetViewCellById(5318)->GetPvs().GetSize() << "========" << endl; 1114 1115 } 1116 1117 cout << (int)vm->mViewCells.size() << " view cells loaded in " 1118 << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 1115 1119 1116 1120 Debug << (int)vm->mViewCells.size() << " view cells loaded in " -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r2049 r2053 396 396 { 397 397 //cout << "exchanging pvs" << endl; 398 399 sort(mBvhLeaves.begin(), mBvhLeaves.end(), ilt);400 398 ObjectPvs newPvs; 401 399 … … 449 447 { 450 448 ViewCellContainer::const_iterator vit, vit_end = mViewCells.end(); 451 449 450 sort(mBvhLeaves.begin(), mBvhLeaves.end(), ilt); 451 452 //cout << "viewcells : " << mViewCells.size() << endl; 452 453 for (vit = mViewCells.begin(); vit != vit_end; ++ vit) 453 { //cout << "j";454 { 454 455 ExchangePvs(*vit); 455 456 } … … 773 774 //ViewCellsMap::iterator vit = mViewCells.find(viewCellId); 774 775 // BspViewCell *viewCell = static_cast<BspViewCell *>((*vit).second); 776 775 777 BspViewCell *viewCell = static_cast<BspViewCell *>(*vit); 776 778 if (viewCell->GetId() == viewCellId) … … 1508 1510 #endif 1509 1511 1510 if ( 0&& PVS_HACK)1512 if (1 && PVS_HACK) 1511 1513 handler.ExchangeElements(); 1512 1514 -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r2049 r2053 366 366 new QtGlRendererBuffer(1024, 1024, 367 367 preprocessor->mSceneGraph, 368 368 preprocessor->mViewCellsManager, 369 369 preprocessor->mKdTree); 370 370 }
Note: See TracChangeset
for help on using the changeset viewer.