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

A storage component to store with persistence the visibility between keypoints and 3D points, and respectively, based on a bimap from boost. More...

#include <SolARBoostCovisibilityGraph.h>

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

Public Member Functions

FrameworkReturnCode increaseEdge (const uint32_t node1_id, const uint32_t node2_id, const float weight) override
 This method allow to increase edge between 2 nodes. More...
 
FrameworkReturnCode decreaseEdge (const uint32_t node1_id, const uint32_t node2_id, const float weight) override
 This method allow to decrease edge between 2 nodes. More...
 
FrameworkReturnCode removeEdge (const uint32_t node1_id, const uint32_t node2_id) override
 This method allow to remove an edge between 2 nodes. More...
 
FrameworkReturnCode getEdge (const uint32_t node1_id, const 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 (uint32_t node1_id, 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< datastructure::CovisibilityGraph > & getConstCovisibilityGraph () const override
 This method returns the covisibility graph. More...
 
std::unique_lock< std::mutex > getCovisibilityGraph (SRef< datastructure::CovisibilityGraph > &covisibilityGraph) override
 This method returns the covisibility graph. More...
 
void setCovisibilityGraph (const SRef< datastructure::CovisibilityGraph > covisibilityGraph) override
 This method is to set the covisibility graph. More...
 
FrameworkReturnCode clear ()
 This method clears the covisibility graph (deletes all nodes and edges).
 
bool isNode (const uint32_t node_id) const
 This method tests if node_id exists in the covisibility graph. More...
 
FrameworkReturnCode addNode (const uint32_t node_id)
 This method allows to suppress a node of the graph. More...
 
FrameworkReturnCode addEdge (const uint32_t node_id_1, const uint32_t node_id_2, const float weight)
 This method adds an edge to the covisibility graph. More...
 
void unloadComponent () override final
 

Detailed Description

A storage component to store with persistence the visibility between keypoints and 3D points, and respectively, based on a bimap from boost.

Member Function Documentation

◆ addEdge()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::addEdge ( const uint32_t  node_id_1,
const uint32_t  node_id_2,
const float  weight 
)

This method adds an edge to the covisibility graph.

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

◆ addNode()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::addNode ( const uint32_t  node_id)

This method allows to suppress a node of the graph.

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

◆ decreaseEdge()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::decreaseEdge ( const uint32_t  node1_id,
const uint32_t  node2_id,
const 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 execution succeed, else FrameworkReturnCode::_ERROR.

◆ getAllNodes()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::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 execution succeed, else FrameworkReturnCode::_ERROR.

◆ getConstCovisibilityGraph()

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

This method returns the covisibility graph.

Returns
the covisibility graph

◆ getCovisibilityGraph()

std::unique_lock< std::mutex > SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::getCovisibilityGraph ( SRef< 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::SolARBoostCovisibilityGraph::getEdge ( const uint32_t  node1_id,
const 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 execution succeed, else FrameworkReturnCode::_ERROR.

◆ getNeighbors()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::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::SolARBoostCovisibilityGraph::getShortestPath ( uint32_t  node1_id,
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 execution succeed, else FrameworkReturnCode::_ERROR.

◆ increaseEdge()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::increaseEdge ( const uint32_t  node1_id,
const uint32_t  node2_id,
const 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 execution succeed, else FrameworkReturnCode::_ERROR.

◆ isEdge()

bool SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::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

◆ isNode()

bool SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::isNode ( const uint32_t  node_id) const

This method tests if node_id exists in the covisibility graph.

Parameters
[in]idof the node to test
Returns
true if the node is present in the graph.

◆ loadFromFile()

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

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

Parameters
[in]thefile name
Returns
FrameworkReturnCode::SUCCESS if the execution succeed, else FrameworkReturnCode::_ERROR.

◆ maximalSpanningTree()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::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 execution succeed, else FrameworkReturnCode::_ERROR.

◆ minimalSpanningTree()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::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 execution succeed, else FrameworkReturnCode::_ERROR.

◆ removeEdge()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::removeEdge ( const uint32_t  node1_id,
const 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 execution succeed, else FrameworkReturnCode::_ERROR.

◆ saveToFile()

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

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

Parameters
[in]thefile name
Returns
FrameworkReturnCode::SUCCESS if the execution succeed, else FrameworkReturnCode::_ERROR.

◆ setCovisibilityGraph()

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

This method is to set the covisibility graph.

Parameters
[in]covisibilityGraphthe covisibility graph of map

◆ suppressNode()

FrameworkReturnCode SolAR::MODULES::TOOLS::SolARBoostCovisibilityGraph::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 execution succeed, else FrameworkReturnCode::_ERROR.

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