'Commit the selected tree to output.'

def commit(self):

    if self.__prevent_commit:
        return
    if (not self.scene.selectedItems()):
        self.send('Tree', None)
        if (self.model is None):
            self.selected_tree_index = (-1)
        return
    selected_item = self.scene.selectedItems()[0]
    self.selected_tree_index = self.grid_items.index(selected_item)
    tree = self.model.trees[self.selected_tree_index]
    tree.instances = self.instances
    tree.meta_target_class_index = self.target_class_index
    tree.meta_size_calc_idx = self.size_calc_idx
    tree.meta_depth_limit = self.depth_limit
    self.send('Tree', tree)
