﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
1551	Model.get_selected() doesn't consider child Drawings	Tristan Croll	Tom Goddard	"The symptoms mainly show up in the Model Panel ""Selected"" column. If a `Model` object is an empty drawing and has no child `Model` instances (e.g. when it's acting as a container for some `Drawing` instances, then `get_selected(include_children=True, fully=True)` will always return True. ISOLDE and Clipper between them create quite a number of classes that fit the above description. The below modification to `Model.set_selected()` seems to behave correctly:

{{{
    def get_selected(self, include_children=False, fully=False):
        '''Is this model selected?  If fully is true then are all parts of this model selected?'''
        if fully:
            if not self.highlighted and not self.empty_drawing():
                return False
            if include_children:
                for d in self.child_drawings():
                    if isinstance(d, Model):
                        if not d.get_selected(include_children=True, fully=True):
                            return False
                    else:
                        if not d.highlighted and not d.empty_drawing():
                            return False

            return True

        if self.highlighted:
            return True

        if include_children:
            for d in self.child_drawings():
                if isinstance(d, Model):
                    if d.get_selected(include_children=True):
                        return True
                    else:
                        if d.highlighted:
                            return True

        return False
}}}"	defect	closed	major		Core		fixed						all	ChimeraX
