src/tools/benchmark_tool/benchmark_tool/rqt_graph/dotcode.py
def _filter_leaf_topics(
            self,
            nodes_in,
            edges_in,
            node_connections,
            hide_single_connection_topics,
            hide_dead_end_topics):
        """
        Remove certain ending topic nodes and their edges from list of nodes and edges.

        @param hide_single_connection_topics:
            if true removes topics that are only published/subscribed by one node
        @param hide_dead_end_topics: if true removes topics having only publishers
        """
        if not hide_dead_end_topics and not hide_single_connection_topics:
            return nodes_in, edges_in
        # do not manipulate incoming structures
        nodes = copy.copy(nodes_in)
        edges = copy.copy(edges_in)
        removal_nodes = []
        for n in nodes:
            if n in node_connections:
                node_edges = []
                has_out_edges = False
                node_edges.extend(node_connections[n].outgoing)
                if len(node_connections[n].outgoing) > 0:
                    has_out_edges = True
                node_edges.extend(node_connections[n].incoming)
                if (hide_single_connection_topics and len(node_edges) < 2) or \
                        (hide_dead_end_topics and not has_out_edges):
                    removal_nodes.append(n)
                    for e in node_edges:
                        if e in edges:
                            edges.remove(e)
        for n in removal_nodes:
            nodes.remove(n)
        return nodes, edges

        Remove certain ending topic nodes and their edges from list of nodes and edges.

        @param hide_single_connection_topics:
            if true removes topics that are only published/subscribed by one node
        @param hide_dead_end_topics: if true removes topics having only publishers
        
Remove certain ending topic nodes and their edges from list of nodes and edges.
Remove certain ending topic nodes and their edges from list of nodes and edges .
def _filter_leaf_topics(
            self,
            nodes_in,
            edges_in,
            node_connections,
            hide_single_connection_topics,
            hide_dead_end_topics):
        if not hide_dead_end_topics and not hide_single_connection_topics:
            return nodes_in, edges_in
        nodes = copy.copy(nodes_in)
        edges = copy.copy(edges_in)
        removal_nodes = []
        for n in nodes:
            if n in node_connections:
                node_edges = []
                has_out_edges = False
                node_edges.extend(node_connections[n].outgoing)
                if len(node_connections[n].outgoing) > 0:
                    has_out_edges = True
                node_edges.extend(node_connections[n].incoming)
                if (hide_single_connection_topics and len(node_edges) < 2) or \
                        (hide_dead_end_topics and not has_out_edges):
                    removal_nodes.append(n)
                    for e in node_edges:
                        if e in edges:
                            edges.remove(e)
        for n in removal_nodes:
            nodes.remove(n)
        return nodes, edges
def _filter_leaf_topics ( self , nodes_in , edges_in , node_connections , hide_single_connection_topics , hide_dead_end_topics ) : if not hide_dead_end_topics and not hide_single_connection_topics : return nodes_in , edges_in nodes = copy . copy ( nodes_in ) edges = copy . copy ( edges_in ) removal_nodes = [ ] for n in nodes : if n in node_connections : node_edges = [ ] has_out_edges = False node_edges . extend ( node_connections [ n ] . outgoing ) if len ( node_connections [ n ] . outgoing ) > 0 : has_out_edges = True node_edges . extend ( node_connections [ n ] . incoming ) if ( hide_single_connection_topics and len ( node_edges ) < 2 ) or ( hide_dead_end_topics and not has_out_edges ) : removal_nodes . append ( n ) for e in node_edges : if e in edges : edges . remove ( e ) for n in removal_nodes : nodes . remove ( n ) return nodes , edges
Remove certain ending topic nodes and their edges from list of nodes and edges.
Remove certain ending topic nodes and their edges from list of nodes and edges .
"""
        Remove certain ending topic nodes and their edges from list of nodes and edges.

        @param hide_single_connection_topics:
            if true removes topics that are only published/subscribed by one node
        @param hide_dead_end_topics: if true removes topics having only publishers
        """ # do not manipulate incoming structures
self
nodes_in
edges_in
node_connections
hide_single_connection_topics
if true removes topics that are only published/subscribed by one node
if true removes topics that are only published / subscribed by one node
hide_dead_end_topics
if true removes topics having only publishers
if true removes topics having only publishers