MCPcopy Create free account
hub / github.com/UZ-SLAMLab/ORB_SLAM3 / addGraph

Method addGraph

Thirdparty/g2o/g2o/core/optimizable_graph.cpp:681–703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679}
680
681void OptimizableGraph::addGraph(OptimizableGraph* g){
682 for (HyperGraph::VertexIDMap::iterator it=g->vertices().begin(); it!=g->vertices().end(); ++it){
683 OptimizableGraph::Vertex* v= (OptimizableGraph::Vertex*)(it->second);
684 if (vertex(v->id()))
685 continue;
686 OptimizableGraph::Vertex* v2=v->clone();
687 v2->edges().clear();
688 v2->setHessianIndex(-1);
689 addVertex(v2);
690 }
691 for (HyperGraph::EdgeSet::iterator it=g->edges().begin(); it!=g->edges().end(); ++it){
692 OptimizableGraph::Edge* e = (OptimizableGraph::Edge*)(*it);
693 OptimizableGraph::Edge* en = e->clone();
694 en->resize(e->vertices().size());
695 int cnt = 0;
696 for (vector<HyperGraph::Vertex*>::const_iterator it = e->vertices().begin(); it != e->vertices().end(); ++it) {
697 OptimizableGraph::Vertex* v = (OptimizableGraph::Vertex*) vertex((*it)->id());
698 assert(v);
699 en->setVertex(cnt++, v);
700 }
701 addEdge(en);
702 }
703}
704
705int OptimizableGraph::maxDimension() const{
706 int maxDim=0;

Callers

nothing calls this directly

Calls 7

setHessianIndexMethod · 0.80
setVertexMethod · 0.80
idMethod · 0.45
cloneMethod · 0.45
clearMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected