EXPERIMENTAL
| 524 | |
| 525 | // EXPERIMENTAL |
| 526 | void ViewerGui::openMapCollection() { |
| 527 | |
| 528 | OCTOMAP_DEBUG("Opening hierarchy from %s...\n", m_filename.c_str()); |
| 529 | |
| 530 | std::ifstream infile(m_filename.c_str(), std::ios_base::in |std::ios_base::binary); |
| 531 | if (!infile.is_open()) { |
| 532 | QMessageBox::warning(this, "File error", "Cannot open OcTree file", QMessageBox::Ok); |
| 533 | return; |
| 534 | } |
| 535 | infile.close(); |
| 536 | |
| 537 | MapCollection<MapNode<OcTree> > collection(m_filename); |
| 538 | int i=0; |
| 539 | for (MapCollection<MapNode<OcTree> >::iterator it = collection.begin(); |
| 540 | it != collection.end(); ++it) { |
| 541 | OCTOMAP_DEBUG("Adding hierarchy node %s\n", (*it)->getId().c_str()); |
| 542 | OcTree* tree = (*it)->getMap(); |
| 543 | if (!tree) |
| 544 | OCTOMAP_ERROR("Error while reading node %s\n", (*it)->getId().c_str()); |
| 545 | else { |
| 546 | OCTOMAP_DEBUG("Read tree with %zu tree nodes\n", tree->size()); |
| 547 | } |
| 548 | pose6d origin = (*it)->getOrigin(); |
| 549 | this->addOctree(tree, i, origin); |
| 550 | ++i; |
| 551 | } |
| 552 | setOcTreeUISwitches(); |
| 553 | showOcTree(); |
| 554 | m_glwidget->resetView(); |
| 555 | OCTOMAP_DEBUG("done\n"); |
| 556 | } |
| 557 | |
| 558 | void ViewerGui::loadGraph(bool completeGraph) { |
| 559 |