- Timestamp:
- 02/28/07 15:33:04 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp
r2124 r2172 765 765 #ifdef GTP_INTERNAL 766 766 int rayCaster; 767 Environment::GetSingleton()->GetIntValue(" Mutation.radiusTermination",767 Environment::GetSingleton()->GetIntValue("Preprocessor.rayCastMethod", 768 768 rayCaster); 769 769 useEnhancedFeatures = (rayCaster == -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2164 r2172 22 22 #include "InternalRayCaster.h" 23 23 #include "GlobalLinesRenderer.h" 24 #include "ObjectsParser.h"25 24 26 25 … … 266 265 267 266 268 bool Preprocessor::LoadBinaryObj(const string &filename,267 bool Preprocessor::LoadBinaryObj(const string filename, 269 268 SceneGraphNode *root, 270 269 vector<FaceParentInfo> *parents) … … 278 277 cout << "binary obj dump available, loading " << filename.c_str() << endl; 279 278 279 // table for vertices 280 VertexContainer vertices; 281 282 if (parents) 283 cout << "using face parents" << endl; 284 else 285 cout << "not using face parents" << endl; 286 280 287 // read in triangle size 281 288 int numTriangles; … … 302 309 root->mGeometry.push_back(obj); 303 310 304 if ((i ++) % 500000 == 499999) 311 i ++; 312 313 if (i % 500000 == 499999) 305 314 cout<<"\r"<<i<<"/"<<numTriangles<<"\r"; 306 315 } … … 479 488 const int files = SplitFilenames(filename, filenames); 480 489 cout << "number of input files: " << files << endl; 481 482 490 bool result = false; 483 491 bool isObj = false; … … 534 542 535 543 result = parser->ParseFile(filename, 536 537 538 539 544 mSceneGraph->GetRoot(), 545 mLoadMeshes, 546 fi); 547 540 548 cout << "loaded " << (int)mSceneGraph->GetRoot()->mGeometry.size() << " entities" << endl; 541 542 549 // only works for triangles 543 550 if (result && !mLoadMeshes) 544 551 { 545 552 cout << "exporting binary obj to " << bnFile << "... " << endl; 546 547 553 ExportBinaryObj(bnFile, mSceneGraph->GetRoot()); 548 549 554 cout << "finished" << endl; 550 555 } 551 556 552 557 delete parser; 558 } 559 else if (0) 560 { 561 ExportBinaryObj("../data/test.bn", mSceneGraph->GetRoot()); 553 562 } 554 563 } … … 729 738 char buf[100]; 730 739 731 740 if (mLoadViewCells) 732 741 { 733 734 #ifdef USE_BIT_PVS 735 // HACK: for kd pvs, set pvs size to maximal number of kd nodes 736 vector<KdLeaf *> leaves; 737 preprocessor->mKdTree->CollectLeaves(leaves); 738 739 ObjectPvs::SetPvsSize((int)leaves.size()); 740 #endif 741 742 Environment::GetSingleton()->GetStringValue("ViewCells.filename", buf); 743 cout << "loading objects from " << buf << endl; 744 745 // load objects which will be used as pvs entries 746 ObjectContainer pvsObjects; 747 if (0) LoadObjects(buf, pvsObjects, mObjects); 748 749 const bool finalizeViewCells = true; 750 cout << "loading view cells from " << buf << endl; 751 752 mViewCellsManager = ViewCellsManager::LoadViewCells(buf, 753 pvsObjects, 754 mObjects, 755 finalizeViewCells, 756 NULL); 742 Environment::GetSingleton()->GetStringValue("ViewCells.filename", buf); 743 cout << "loading view cells from " << buf << endl<<flush; 744 745 mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, true, NULL); 757 746 758 747 cout << "view cells loaded." << endl<<flush; … … 1273 1262 const long t1 = GetTime(); 1274 1263 1275 if ( (int)rays.size() > 10000) {1264 if (0 && (int)rays.size() > 10000) { 1276 1265 1277 1266 mRayCaster->SortRays(rays); … … 1367 1356 1368 1357 if ((int)rays.size() > 100000 && i % 100000 == 0) 1358 //cout << "here2 " << vssRays.size()<<endl; 1369 1359 cout<<"\r"<<i<<"/"<<(int)rays.size()<<"\r"; 1370 1360 } … … 1642 1632 1643 1633 1644 bool Preprocessor::LoadObjects(const string &filename, 1645 ObjectContainer &pvsObjects, 1646 const ObjectContainer &preprocessorObjects) 1647 { 1648 ObjectsParser parser; 1649 1650 const bool success = parser.ParseObjects(filename, 1651 pvsObjects, 1652 preprocessorObjects); 1653 1654 if (!success) 1655 { 1656 Debug << "Error: loading objects failed!" << endl; 1657 } 1658 1659 // hack: no bvh object could be found => take preprocessor objects 1660 if (pvsObjects.empty()) 1661 { 1662 Debug << "no objects" << endl; 1663 pvsObjects = preprocessorObjects; 1664 } 1665 1666 return success; 1667 } 1668 1669 1670 } 1634 } -
GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.cpp
r2116 r2172 1 1 #include "VssRay.h" 2 2 #include "AxisAlignedBox3.h" 3 #include "Ray.h" 4 3 #include "SamplingStrategy.h" 5 4 6 5 namespace GtpVisibilityPreprocessor { … … 340 339 VssRayContainer::SelectRays(const int number, 341 340 VssRayContainer &selected, 342 const bool copy) const 341 const bool copy 342 ) const 343 343 { 344 344 float p = number/(float)size(); … … 346 346 347 347 for (; it != end(); it++) 348 if (Random(1.0f) < p) { 348 // temporarily only take mutation rays! 349 if ((*it)->mDistribution == SamplingStrategy::MUTATION_BASED_DISTRIBUTION && Random(1.0f) < p) { 349 350 if (!copy) 350 351 selected.push_back(*it);
Note: See TracChangeset
for help on using the changeset viewer.