Exemple #1
0
	def _distTableSelCB(self, selDists):
		if self.distSelectsAtomsVar.get():
			select = []
			select.extend(selDists)
			for sd in selDists:
				select.extend(sd.atoms)
			selection.setCurrent(select)
		else:
			selection.removeCurrent(self.distances)
			selection.addCurrent(selDists)
Exemple #2
0
	def _itemsSelectAtoms(self, items, add=False):
			atoms = set()
			for item in items:
				atoms.update(item.atoms)
			if self.geomSelAtomsVar.get():
				if add:
					selection.addCurrent(atoms)
				else:
					selection.setCurrent(atoms)
			elif set(atoms) == set(selection.currentAtoms()):
				selection.removeCurrent(atoms)
def split_surfaces(plist):

    pplist = []
    for p in plist:
        pieces = split_surface_piece(p)
        pplist.extend(pieces)
        if pieces:
            # Select pieces if original surface selected.
            from chimera.selection import containedInCurrent
            if containedInCurrent(p):
                from chimera.selection import addCurrent, removeCurrent
                removeCurrent(p)  # Get error missing C++ object without this.
                p.model.removePiece(p)
                addCurrent(pieces)
    return pplist
Exemple #4
0
	def _tableCB(self, sels, modeChange=False):
		if self.geomSelAtomsVar.get() or modeChange:
			self._itemsSelectAtoms(sels)
		if self.geomSelObjVar.get():
			items = set(geomManager.items)
			# avoid affecting the selection if models are
			# being destroyed...
			removable = [a.model
						for a in items.difference(sels)
						if not a.model.__destroyed__]
			if removable:
				selection.removeCurrent(removable)
			addable = [a.model for a in sels if not a.model.__destroyed__]
			if addable:
				selection.addCurrent(addable)
		if modeChange:
			return
		butState = 'normal'
		if not sels:
			butState = 'disabled'
		for but in self.buttons:
			but.configure(state=butState)

		self.feedback(sels)
Exemple #5
0
    def deselect(self):

        from chimera.selection import removeCurrent
        removeCurrent(self.bond)
Exemple #6
0
  def deselect(self):

    selection.removeCurrent(self.bond)
Exemple #7
0
  def deselect(self):

    selection.removeCurrent(self.atom)