'Clear (reset) the scene.'

def clear_scene(self):

    if (self.scheme is not None):
        self.scheme.node_added.disconnect(self.add_node)
        self.scheme.node_removed.disconnect(self.remove_node)
        self.scheme.link_added.disconnect(self.add_link)
        self.scheme.link_removed.disconnect(self.remove_link)
        self.scheme.annotation_added.disconnect(self.add_annotation)
        self.scheme.annotation_removed.disconnect(self.remove_annotation)
        self.scheme.node_state_changed.disconnect(self.on_widget_state_change)
        self.scheme.channel_state_changed.disconnect(self.on_link_state_change)
        for annot in self.scheme.annotations:
            if (annot in self.__item_for_annotation):
                self.remove_annotation(annot)
        for link in self.scheme.links:
            if (link in self.__item_for_link):
                self.remove_link(link)
        for node in self.scheme.nodes:
            if (node in self.__item_for_node):
                self.remove_node(node)
    self.scheme = None
    self.__node_items = []
    self.__item_for_node = {}
    self.__link_items = []
    self.__item_for_link = {}
    self.__annotation_items = []
    self.__item_for_annotation = {}
    self.__anchor_layout.deleteLater()
    self.user_interaction_handler = None
    self.clear()
    log.info(("'%s'    cleared." % self))
