Solar
Public Member Functions | List of all members
SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager Class Reference

A storage component to store a covisibility graph where each vertex is an id of a keyframe and each edge is weighted by the number of common cloud points between two keyframes. More...

#include <SolARCovisibilityGraphManager.h>

Inheritance diagram for SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager:
Inheritance graph
[legend]
Collaboration diagram for SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager:
Collaboration graph
[legend]

Public Member Functions

FrameworkReturnCode increaseEdge (uint32_t node1_id, uint32_t node2_id, float weight) override
 This method allow to increase edge between 2 nodes. More...
 
FrameworkReturnCode decreaseEdge (uint32_t node1_id, uint32_t node2_id, float weight) override
 This method allow to decrease edge between 2 nodes. More...
 
FrameworkReturnCode removeEdge (uint32_t node1_id, uint32_t node2_id) override
 This method allow to remove an edge between 2 nodes. More...
 
FrameworkReturnCode getEdge (uint32_t node1_id, uint32_t node2_id, float &weight) const override
 This method allow to get edge between 2 nodes. More...
 
bool isEdge (const uint32_t node1_id, const uint32_t node2_id) const override
 This method allow to verify that exist an edge between 2 nodes. More...
 
FrameworkReturnCode getAllNodes (std::set< uint32_t > &nodes_id) const override
 This method allow to get all nodes of the graph. More...
 
FrameworkReturnCode suppressNode (const uint32_t node_id) override
 This method allow to suppress a node of the graph. More...
 
FrameworkReturnCode getNeighbors (const uint32_t node_id, const float minWeight, std::vector< uint32_t > &neighbors, const uint32_t maxNbNeighbors=0) const override
 This method allow to get neighbors of a node in the graph. More...
 
FrameworkReturnCode minimalSpanningTree (std::vector< std::tuple< uint32_t, uint32_t, float > > &edges_weights, float &minTotalWeights) override
 This method allow to get minimal spanning tree of the graph. More...
 
FrameworkReturnCode maximalSpanningTree (std::vector< std::tuple< uint32_t, uint32_t, float > > &edges_weights, float &maxTotalWeights) override
 This method allow to get maximal spanning tree of the graph. More...
 
FrameworkReturnCode getShortestPath (const uint32_t node1_id, const uint32_t node2_id, std::vector< uint32_t > &path) override
 This method allow to get the shortest (by number of vertices) path between 2 nodes. More...
 
FrameworkReturnCode display () const override
 This method allow to display all vertices and weighted edges of the covisibility graph.
 
FrameworkReturnCode saveToFile (const std::string &file) const override
 This method allows to save the graph to the external file. More...
 
FrameworkReturnCode loadFromFile (const std::string &file) override
 This method allows to load the graph from the external file. More...
 
const SRef< SolAR::datastructure::CovisibilityGraph > & getConstCovisibilityGraph () const override
 This method returns the covisibility graph. More...
 
std::unique_lock< std::mutex > getCovisibilityGraph (SRef< SolAR::datastructure::CovisibilityGraph > &covisibilityGraph) override
 This method returns the covisibility graph. More...
 
void setCovisibilityGraph (const SRef< SolAR::datastructure::CovisibilityGraph > covisibilityGraph) override
 This method is to set the covisibility graph. More...
 
void unloadComponent () override final
 

Detailed Description

A storage component to store a covisibility graph where each vertex is an id of a keyframe and each edge is weighted by the number of common cloud points between two keyframes.

Member Function Documentation

◆ decreaseEdge()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::decreaseEdge ( uint32_t  node1_id,
uint32_t  node2_id,
float  weight 
)
override

This method allow to decrease edge between 2 nodes.

Parameters
[in]idof 1st node
[in]idof 2nd node
[in]weightto decrease
Returns
FrameworkReturnCode::SUCCESS if the addition succeed, else FrameworkReturnCode::_ERROR.

◆ getAllNodes()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::getAllNodes ( std::set< uint32_t > &  nodes_id) const
override

This method allow to get all nodes of the graph.

Parameters
[out]idsof all nodes
Returns
FrameworkReturnCode::SUCCESS if the addition succeed, else FrameworkReturnCode::_ERROR.

◆ getConstCovisibilityGraph()

const SRef< SolAR::datastructure::CovisibilityGraph > & SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::getConstCovisibilityGraph ( ) const
override

This method returns the covisibility graph.

Returns
the covisibility graph

◆ getCovisibilityGraph()

std::unique_lock< std::mutex > SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::getCovisibilityGraph ( SRef< SolAR::datastructure::CovisibilityGraph > &  covisibilityGraph)
override

This method returns the covisibility graph.

Parameters
[out]covisibilityGraphthe covisibility graph of map
Returns
the covisibility graph

◆ getEdge()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::getEdge ( uint32_t  node1_id,
uint32_t  node2_id,
float &  weight 
) const
override

This method allow to get edge between 2 nodes.

Parameters
[in]idof 1st node
[in]idof 2nd node
[out]weightof the edge
Returns
FrameworkReturnCode::SUCCESS if the addition succeed, else FrameworkReturnCode::_ERROR.

◆ getNeighbors()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::getNeighbors ( const uint32_t  node_id,
const float  minWeight,
std::vector< uint32_t > &  neighbors,
const uint32_t  maxNbNeighbors = 0 
) const
override

This method allow to get neighbors of a node in the graph.

Parameters
[in]node_idid of the node to get neighbors
[in]minWeightmin value between this node and a neighbor to accept
[out]neighborsa vector of neighbors sorted to greater weighted edge.
[in]maxNbNeighborsthe maximum number of neighbors. If it is zero, find all neighbors.
Returns
FrameworkReturnCode::SUCCESS if the addition succeed, else FrameworkReturnCode::_ERROR.

◆ getShortestPath()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::getShortestPath ( const uint32_t  node1_id,
const uint32_t  node2_id,
std::vector< uint32_t > &  path 
)
override

This method allow to get the shortest (by number of vertices) path between 2 nodes.

Parameters
[in]idof 1st node
[in]idof 2nd node
[out]theshortest path
Returns
FrameworkReturnCode::SUCCESS if the addition succeed, else FrameworkReturnCode::_ERROR.

◆ increaseEdge()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::increaseEdge ( uint32_t  node1_id,
uint32_t  node2_id,
float  weight 
)
override

This method allow to increase edge between 2 nodes.

Parameters
[in]idof 1st node
[in]idof 2nd node
[in]weightto increase
Returns
FrameworkReturnCode::SUCCESS if the addition succeed, else FrameworkReturnCode::_ERROR.

◆ isEdge()

bool SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::isEdge ( const uint32_t  node1_id,
const uint32_t  node2_id 
) const
override

This method allow to verify that exist an edge between 2 nodes.

Parameters
[in]idof 1st node
[in]idof 2nd node
Returns
true if exist, else false

◆ loadFromFile()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::loadFromFile ( const std::string &  file)
override

This method allows to load the graph from the external file.

Parameters
[in]filethe file name
Returns
FrameworkReturnCode::SUCCESS if the suppression succeed, else FrameworkReturnCode::_ERROR.

◆ maximalSpanningTree()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::maximalSpanningTree ( std::vector< std::tuple< uint32_t, uint32_t, float > > &  edges_weights,
float &  maxTotalWeights 
)
override

This method allow to get maximal spanning tree of the graph.

Parameters
[out]edges_weightsthe maximal spanning tree graph including edges with weights
[out]maxTotalWeightscost of the maximal spanning tree graph
Returns
FrameworkReturnCode::SUCCESS if the addition succeed, else FrameworkReturnCode::_ERROR.

◆ minimalSpanningTree()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::minimalSpanningTree ( std::vector< std::tuple< uint32_t, uint32_t, float > > &  edges_weights,
float &  minTotalWeights 
)
override

This method allow to get minimal spanning tree of the graph.

Parameters
[out]edges_weightsthe minimal spanning tree graph including edges with weights
[out]minTotalWeightscost of the minimal spanning tree graph
Returns
FrameworkReturnCode::SUCCESS if the addition succeed, else FrameworkReturnCode::_ERROR.

◆ removeEdge()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::removeEdge ( uint32_t  node1_id,
uint32_t  node2_id 
)
override

This method allow to remove an edge between 2 nodes.

Parameters
[in]idof 1st node
[in]idof 2nd node
Returns
FrameworkReturnCode::SUCCESS if the addition succeed, else FrameworkReturnCode::_ERROR.

◆ saveToFile()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::saveToFile ( const std::string &  file) const
override

This method allows to save the graph to the external file.

Parameters
[in]filethe file name
Returns
FrameworkReturnCode::SUCCESS if the suppression succeed, else FrameworkReturnCode::_ERROR.

◆ setCovisibilityGraph()

void SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::setCovisibilityGraph ( const SRef< SolAR::datastructure::CovisibilityGraph >  covisibilityGraph)
override

This method is to set the covisibility graph.

Parameters
[in]covisibilityGraphthe covisibility graph of map

◆ suppressNode()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARCovisibilityGraphManager::suppressNode ( const uint32_t  node_id)
override

This method allow to suppress a node of the graph.

Parameters
[in]idof the node to suppress
Returns
FrameworkReturnCode::SUCCESS if the addition succeed, else FrameworkReturnCode::_ERROR.

The documentation for this class was generated from the following file: