Class CEdgeCounter
Defined in File CEdgeCounter.h
Class Documentation
-
class CEdgeCounter
Generic class for tracking the total number of edges for different tpes of edges and for storing visualization-related information for each type.
Public Types
-
using iterator = std::map<std::string, int>::iterator
-
using const_iterator = std::map<std::string, int>::const_iterator
Public Functions
-
CEdgeCounter()
-
~CEdgeCounter() = default
-
void setWindowManagerPtr(mrpt::graphslam::CWindowManager *win_manager)
Provide the instance with a CWindowManager.
-
void 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 setLoopClosureEdgesManually(int num_loop_closures)
Method for manually setting the number of loop closures registered so far.
-
int getLoopClosureEdges() const
Returns the edges that form loop closures in the current graph.
-
int getTotalNumOfEdges() const
Return the total amount of registered edges.
See also
-
void getTotalNumOfEdges(int *total_num_edges) const
Return the total amount of registered edges.
See also
-
int getNumForEdgeType(const std::string &name) const
Return the number of edges for the specified type.
See also
- Throws:
std::exception – If edge is not found
-
void getNumForEdgeType(const std::string &name, int *total_num)
Return the number of edges for the specified type.
See also
- Throws:
std::exception – If edge is not found
-
void 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.
See also
-
void addEdge(const std::string &name, bool is_loop_closure = false, bool is_new = false)
Increment the number of edges for the specified type.
See also
- Throws:
std::exception – If edge exists and is_new is True
-
void addEdgeType(const std::string &name)
Explicitly register a new edge type.
-
void clearAllEdges()
Reset the state of the CEdgeCounter instance.
-
void dumpToConsole() const
Dump a report of the registered, so far, edges to the console.
See also
-
void getAsString(std::string *str_out) const
Fill the provided string with a detailed report of the registered, so far, edges.
-
std::string getAsString() const
Return a detailed report of the registered, so far, edges in a string representation.
-
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.
- Throws:
std::exception – If a name in the provided std::map doesn’t already exist
-
void setTextMessageParams(const std::map<std::string, double> &name_to_offset_y, const std::map<std::string, int> &name_to_text_index, double offset_y_total_edges, int text_index_total_edges, double offset_y_loop_closures, 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.
-
inline const_iterator cbegin() const
-
inline const_iterator cend() const
-
using iterator = std::map<std::string, int>::iterator