Changeset 1701 for GTP/trunk/Lib/Vis
- Timestamp:
- 10/30/06 19:05:41 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
r1694 r1701 234 234 ObjectContainer::const_iterator oit, oit_end = objects.end(); 235 235 236 if ( !exportSingleMesh)236 if (0&&!exportSingleMesh) 237 237 { 238 238 for (oit = objects.begin(); oit != oit_end; ++ oit) -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1697 r1701 457 457 { 458 458 // decide upon next split type 459 const float vspPriority = 460 const float ospPriority = 459 const float vspPriority = viewSpaceQueue.Top() ? viewSpaceQueue.Top()->GetPriority() : -1e20f; 460 const float ospPriority = objectSpaceQueue.Top() ? objectSpaceQueue.Top()->GetPriority() : -1e20f; 461 461 462 462 cout << "new decicion, vsp: " << vspPriority << ", osp: " << ospPriority << endl; … … 946 946 while (!splitQueue.Empty()) 947 947 { 948 const float priority = splitQueue.Top()->GetPriority(); 948 949 const float threshold = oldCandidate ? oldCandidate->GetPriority() : 1e20f; 950 951 // minimum slope reached 952 if ((steps >= maxSteps) || ((priority < threshold) && !(steps < minSteps))) 953 { 954 cout << "\n**************** breaking on " << priority << " smaller than " << threshold << endl; 955 break; 956 } 957 949 958 SubdivisionCandidate *sc = NextSubdivisionCandidate(splitQueue); 950 951 const float priority = sc->GetPriority(); 952 953 //float rc = (float)sc->GetRenderCostDecrease() / (mInitialRenderCost - mHierarchyStats.mTotalCost + 1.0f); 954 //float mc = (float)sc->GetPvsEntriesIncr() / (float)mHierarchyStats.mPvsEntries; 955 //cout << "dRc: " << sc->GetRenderCostDecrease() << " dMem: " << sc->GetPvsEntriesIncr() << " ratio1 " << rc << " ratio2 " << mc << " const: " << 1.0f - GetMemoryConst() << endl; 956 959 957 960 //////// 958 961 //-- subdivide leaf node of either type … … 968 971 969 972 DEL_PTR(sc); 970 971 // minimum slope reached972 if ((steps >= maxSteps) ||973 ((priority < threshold) && !(steps < minSteps)))974 {975 cout << "\n**************** breaking on " << priority << " smaller than " << threshold << endl;976 break;977 }978 979 973 } 980 974 -
GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h
r1697 r1701 77 77 Intersectable(): mMailbox(0), mReferences(0), mBvhLeaf(0), mVssRays(NULL) {} 78 78 79 virtual Intersectable::~Intersectable() {DEL_PTR(mVssRays);} ;79 virtual Intersectable::~Intersectable() {DEL_PTR(mVssRays);} 80 80 81 81 void SetId(const int id) { mId = id; } -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1697 r1701 88 88 89 89 Vector3 pt2 = sceneBox.Min() + scale2 * (sceneBox.Max() - sceneBox.Min()); 90 91 //Vector3 boxSize = sceneBox.Size() * Vector3(0.0025, 0.01, 0.0025);92 90 Vector3 boxSize = sceneBox.Size() * Vector3(0.005f, 0.02f, 0.005f); 93 91 … … 315 313 ObjectContainer::const_iterator oit, oit_end = objects.end(); 316 314 315 //AxisAlignedBox3 bbox = mSceneGraph->GetBox(); bbox.Enlarge(30.0); 317 316 for (oit = objects.begin(); oit != oit_end; ++ oit) 318 317 { … … 323 322 Triangle3 tri = dynamic_cast<TriangleIntersectable *>(obj)->GetItem(); 324 323 324 //if (bbox.IsInside(tri.mVertices[0]) && bbox.IsInside(tri.mVertices[1]) && bbox.IsInside(tri.mVertices[2])) 325 //{ 325 326 samplesOut << "v " << tri.mVertices[0].x << " " << tri.mVertices[0].y << " " << tri.mVertices[0].z << endl; 326 327 samplesOut << "v " << tri.mVertices[1].x << " " << tri.mVertices[1].y << " " << tri.mVertices[1].z << endl; 327 328 samplesOut << "v " << tri.mVertices[2].x << " " << tri.mVertices[2].y << " " << tri.mVertices[2].z << endl; 329 //} 328 330 } 329 331 else … … 482 484 } 483 485 486 //if (!strstr(filename.c_str(), "plane")) mSceneGraph->GetRoot()->UpdateBox(); 487 484 488 delete parser; 485 489 } … … 500 504 cout<<"#NUM_OBJECTS (Total numner of objects)\n"<<intersectables<<endl; 501 505 cout<<"#NUM_FACES (Total numner of faces)\n"<<faces<<endl; 506 502 507 mObjects.reserve(intersectables); 503 508 mSceneGraph->CollectObjects(&mObjects); 504 509 mSceneGraph->GetRoot()->UpdateBox(); 510 505 511 cout << "finished loading" << endl; 506 512 if (0) -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1696 r1701 286 286 long startTime = GetTime(); 287 287 288 mPreprocessor->GenerateRays(samplesPerPass, sampleType, simpleRays); 288 // create one third of each type 289 int stype; 290 291 stype = SamplingStrategy::OBJECT_BASED_DISTRIBUTION; 292 mPreprocessor->GenerateRays(samplesPerPass / 3, sampleType, simpleRays); 293 294 stype = SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION; 295 mPreprocessor->GenerateRays(samplesPerPass / 3, sampleType, simpleRays); 296 297 stype = SamplingStrategy::DIRECTION_BASED_DISTRIBUTION; 298 mPreprocessor->GenerateRays(samplesPerPass / 3, sampleType, simpleRays); 299 289 300 cout << "generated " << samplesPerPass << " samples in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 290 301 … … 1090 1101 case PER_TRIANGLE: 1091 1102 {//cout << "pertriangle" << endl; 1092 // HACK 1093 MeshInstance *mi = dynamic_cast<MeshInstance *>(obj); 1094 1095 // HACK: assume meshes are triangles 1096 if (mi->GetMesh()) 1097 { 1098 return (float)mi->GetMesh()->mFaces.size(); 1099 } 1103 return (float)obj->NumberOfFaces(); 1100 1104 } 1101 1105 default: … … 5754 5758 Debug << "view cell stats prefix: " << statsPrefix << endl; 5755 5759 5756 // should directional sampling be used?5757 bool dirSamples =5758 (mEvaluationSamplingType == SamplingStrategy::DIRECTION_BASED_DISTRIBUTION);5759 5760 5760 cout << "reseting pvs ... "; 5761 5761 -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1697 r1701 226 226 { 227 227 cerr << "already in obj format" << endl; 228 if (1) 229 preprocessor->ExportObj("test.obj", preprocessor->mObjects); 228 if (0) preprocessor->ExportObj("test.obj", preprocessor->mObjects); 230 229 } 231 230 else … … 233 232 const string objname = GetInternFilename(filename, ".obj"); 234 233 235 //cout << "exporting scene to " << objname << endl;234 cout << "exporting scene to " << objname << endl; 236 235 bool success = preprocessor->ExportObj(objname, preprocessor->mObjects); 237 236 … … 246 245 } 247 246 } 247 // Exporter *exporter= Exporter::GetExporter("test1.wrl"); 248 // AxisAlignedBox3 bbox = preprocessor->mKdTree->GetBox(); 249 // bbox.Scale(Vector3(1, 1, 0.5)); 250 //exporter->ExportGeometry(preprocessor->mObjects);cout<<"here2"<<endl; 248 251 249 252 // parse view cells related options
Note: See TracChangeset
for help on using the changeset viewer.