Generic class for tracking the total number of edges for different tpes of edges and for storing visualization-related information for each type.
Definition at line 32 of file CEdgeCounter.h.
#include <mrpt/graphslam/misc/CEdgeCounter.h>
Public Types | |
typedef std::map< std::string, int >::iterator | iterator |
typedef std::map< std::string, int >::const_iterator | const_iterator |
Public Member Functions | |
CEdgeCounter () | |
Constructor class. More... | |
~CEdgeCounter () | |
Destructor class. More... | |
void | setWindowManagerPtr (mrpt::graphslam::CWindowManager *win_manager) |
Provide the instance with a CWindowManager. More... | |
void | setRemovedEdges (int removed_edges) |
State how many of the existing edges have been removed. More... | |
void | setLoopClosureEdgesManually (int num_loop_closures) |
Method for manually setting the number of loop closures registered so far. More... | |
int | getLoopClosureEdges () const |
Returns the edges that form loop closures in the current graph. More... | |
int | getTotalNumOfEdges () const |
Return the total amount of registered edges. More... | |
void | getTotalNumOfEdges (int *total_num_edges) const |
Return the total amount of registered edges. More... | |
int | getNumForEdgeType (const std::string &name) const |
Return the number of edges for the specified type. More... | |
void | getNumForEdgeType (const std::string &name, int *total_num) |
Return the number of edges for the specified type. More... | |
void | setEdgesManually (const std::string &name, int num_of_edges) |
Set number of a specific edge type manually. More... | |
void | addEdge (const std::string &name, bool is_loop_closure=false, bool is_new=false) |
Increment the number of edges for the specified type. More... | |
void | addEdgeType (const std::string &name) |
Explicitly register a new edge type. More... | |
void | clearAllEdges () |
Reset the state of the CEdgeCounter instance. More... | |
void | dumpToConsole () const |
Dump a report of the registered, so far, edges to the console. More... | |
void | getAsString (std::string *str_out) const |
Fill the provided string with a detailed report of the registered, so far, edges. More... | |
std::string | getAsString () const |
Return a detailed report of the registered, so far, edges in a string representation. More... | |
void | setTextMessageParams (const std::map< std::string, double > &name_to_offset_y, const std::map< std::string, int > &name_to_text_index) |
Add the textMessage parameters to the object All the names in the given std::maps have to be already specified and added in the object via addEdge with is_new=true or addEdgeType. More... | |
void | setTextMessageParams (const std::map< std::string, double > &name_to_offset_y, const std::map< std::string, int > &name_to_text_index, const double &offset_y_total_edges, const int &text_index_total_edges, const double &offset_y_loop_closures, const int &text_index_loop_closures) |
Handle the extra visualization parameters for the total number of edges and for loop closures and then passes execution to the other setTextMessageParams function. More... | |
iterator | begin () |
Instance Iterators. More... | |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
Private Member Functions | |
void | initCEdgeCounter () |
Initialization method to be called from the various Constructors. More... | |
void | updateTextMessages () const |
Update the given CDisplayWindow3D with the edges registered so far. More... | |
Private Attributes | |
mrpt::gui::CDisplayWindow3D * | m_win |
mrpt::graphslam::CWindowManager * | m_win_manager |
std::map< std::string, int > | m_name_to_edges_num |
Map edge name <=> num of edges. More... | |
int | m_num_loop_closures |
int | m_unique_edges |
std::map< std::string, double > | m_name_to_offset_y |
std::map< std::string, int > | m_name_to_text_index |
bool | m_has_read_textmessage_params |
bool | m_display_total_edges |
bool | m_display_loop_closures |
int | m_offset_y_total_edges |
int | m_offset_y_loop_closures |
int | m_text_index_total_edges |
int | m_text_index_loop_closures |
typedef std::map<std::string, int>::const_iterator mrpt::graphslam::detail::CEdgeCounter::const_iterator |
Definition at line 35 of file CEdgeCounter.h.
typedef std::map<std::string, int>::iterator mrpt::graphslam::detail::CEdgeCounter::iterator |
Definition at line 34 of file CEdgeCounter.h.
mrpt::graphslam::detail::CEdgeCounter::CEdgeCounter | ( | ) |
Constructor class.
mrpt::graphslam::detail::CEdgeCounter::~CEdgeCounter | ( | ) |
Destructor class.
void mrpt::graphslam::detail::CEdgeCounter::addEdge | ( | const std::string & | name, |
bool | is_loop_closure = false , |
||
bool | is_new = false |
||
) |
Increment the number of edges for the specified type.
std::exception | If edge exists and is_new is True |
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::_execGraphSlamStep().
void mrpt::graphslam::detail::CEdgeCounter::addEdgeType | ( | const std::string & | name | ) |
Explicitly register a new edge type.
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::initClass().
|
inline |
Instance Iterators.
Definition at line 143 of file CEdgeCounter.h.
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::getGraphSlamStats().
|
inline |
Definition at line 146 of file CEdgeCounter.h.
void mrpt::graphslam::detail::CEdgeCounter::clearAllEdges | ( | ) |
Reset the state of the CEdgeCounter instance.
void mrpt::graphslam::detail::CEdgeCounter::dumpToConsole | ( | ) | const |
Dump a report of the registered, so far, edges to the console.
|
inline |
Definition at line 149 of file CEdgeCounter.h.
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::getGraphSlamStats().
|
inline |
Definition at line 152 of file CEdgeCounter.h.
void mrpt::graphslam::detail::CEdgeCounter::getAsString | ( | std::string * | str_out | ) | const |
Fill the provided string with a detailed report of the registered, so far, edges.
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::getDescriptiveReport().
std::string mrpt::graphslam::detail::CEdgeCounter::getAsString | ( | ) | const |
Return a detailed report of the registered, so far, edges in a string representation.
int mrpt::graphslam::detail::CEdgeCounter::getLoopClosureEdges | ( | ) | const |
Returns the edges that form loop closures in the current graph.
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::getGraphSlamStats().
int mrpt::graphslam::detail::CEdgeCounter::getNumForEdgeType | ( | const std::string & | name | ) | const |
Return the number of edges for the specified type.
std::exception | If edge is not found |
void mrpt::graphslam::detail::CEdgeCounter::getNumForEdgeType | ( | const std::string & | name, |
int * | total_num | ||
) |
Return the number of edges for the specified type.
std::exception | If edge is not found |
int mrpt::graphslam::detail::CEdgeCounter::getTotalNumOfEdges | ( | ) | const |
Return the total amount of registered edges.
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::getGraphSlamStats().
void mrpt::graphslam::detail::CEdgeCounter::getTotalNumOfEdges | ( | int * | total_num_edges | ) | const |
Return the total amount of registered edges.
|
private |
Initialization method to be called from the various Constructors.
void mrpt::graphslam::detail::CEdgeCounter::setEdgesManually | ( | const std::string & | name, |
int | num_of_edges | ||
) |
Set number of a specific edge type manually.
Handy for not having to call addEdge multiple times in a row.
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::_execGraphSlamStep().
void mrpt::graphslam::detail::CEdgeCounter::setLoopClosureEdgesManually | ( | int | num_loop_closures | ) |
Method for manually setting the number of loop closures registered so far.
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::_execGraphSlamStep().
void mrpt::graphslam::detail::CEdgeCounter::setRemovedEdges | ( | int | removed_edges | ) |
State how many of the existing edges have been removed.
Method is to be called after CNetworkOfPoses::collapseDuplicatedEdges method has been executed.
void mrpt::graphslam::detail::CEdgeCounter::setTextMessageParams | ( | const std::map< std::string, double > & | name_to_offset_y, |
const std::map< std::string, int > & | name_to_text_index | ||
) |
Add the textMessage parameters to the object All the names in the given std::maps have to be already specified and added in the object via addEdge with is_new=true or addEdgeType.
std::exception | If a name in the provided std::map doesn't already exist |
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::initClass().
void mrpt::graphslam::detail::CEdgeCounter::setTextMessageParams | ( | const std::map< std::string, double > & | name_to_offset_y, |
const std::map< std::string, int > & | name_to_text_index, | ||
const double & | offset_y_total_edges, | ||
const int & | text_index_total_edges, | ||
const double & | offset_y_loop_closures, | ||
const int & | text_index_loop_closures | ||
) |
Handle the extra visualization parameters for the total number of edges and for loop closures and then passes execution to the other setTextMessageParams function.
void mrpt::graphslam::detail::CEdgeCounter::setWindowManagerPtr | ( | mrpt::graphslam::CWindowManager * | win_manager | ) |
Provide the instance with a CWindowManager.
Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::initClass().
|
private |
Update the given CDisplayWindow3D with the edges registered so far.
|
private |
Definition at line 184 of file CEdgeCounter.h.
|
private |
Definition at line 184 of file CEdgeCounter.h.
|
private |
Definition at line 181 of file CEdgeCounter.h.
|
private |
Map edge name <=> num of edges.
Tracking number of edges
Definition at line 173 of file CEdgeCounter.h.
|
private |
Definition at line 178 of file CEdgeCounter.h.
|
private |
Definition at line 179 of file CEdgeCounter.h.
|
private |
Definition at line 173 of file CEdgeCounter.h.
|
private |
Definition at line 185 of file CEdgeCounter.h.
|
private |
Definition at line 185 of file CEdgeCounter.h.
|
private |
Definition at line 186 of file CEdgeCounter.h.
|
private |
Definition at line 186 of file CEdgeCounter.h.
|
private |
Definition at line 175 of file CEdgeCounter.h.
|
private |
Definition at line 166 of file CEdgeCounter.h.
|
private |
Definition at line 167 of file CEdgeCounter.h.
Page generated by Doxygen 1.8.13 for MRPT 1.5.3 at Mon Oct 30 10:27:08 UTC 2017 |