MCPcopy Create free account
hub / github.com/OctoMap/octomap / openMapCollection

Method openMapCollection

octovis/src/ViewerGui.cpp:526–556  ·  view source on GitHub ↗

EXPERIMENTAL

Source from the content-addressed store, hash-verified

524
525// EXPERIMENTAL
526void 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
558void ViewerGui::loadGraph(bool completeGraph) {
559

Callers

nothing calls this directly

Calls 8

addOctreeMethod · 0.95
getIdMethod · 0.80
getMapMethod · 0.80
getOriginMethod · 0.80
resetViewMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected