Opened 4 years ago

Closed 4 years ago

#5663 closed defect (fixed)

surface vs. view

Reported by: pett Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Graphics Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

I'm not sure you'll regard this as a bug, but if you have one residue selected in a structure (e.g. 1gcn) and an undisplayed surface (model display turned off), then "view sel" basically does nothing -- it does not zoom in on the selected residue, which I would imagine would be pretty confusing to most users.

Change History (6)

comment:1 by Tom Goddard, 4 years ago

It doesn't matter whether the surface is displayed or not. The view command appears to consider the entire surface to be selected. I can see how it would do that since it is using some fancy pants stuff to show just certain triangles of the surface selected. No other surface does that -- other surfaces are either all selected or not selected. It certainly would confuse any users so seems like a bug to me.

comment:2 by Tom Goddard, 4 years ago

The problem is that the Objects argument to the view command python code has no ability to handle partially selected surfaces. So the "sel" selector adds to the Objects that the entire surface model is selected. The underlying graphics Drawing object allows only a subset of triangles to be outlined as selected. It would be a major change to add to the Objects class the ability to specify a subset of triangles of the surface. If we did that you'd expect all commands to respect it, for instance "color sel blue" should just color the actual triangles that are selected. Every command that acts on surfaces would need to consider the case of having only a subset of triangles specified. This is just too difficult for too little gain.

The reason we mostly don't get into trouble with the molecular surfaces is because commands like "color sel blue" ignore the selected molecular surface and just look at its atoms. There is really ugly code to handle this in the color command, and probably other commands.

A possible fix is to have the MolecularSurface.selected property always return False. I tried this and "view sel" and "color sel blue" work but it is hard to say if the MolecularSurface lying about part of it being selected will cause other obscure bugs. I suspect it would not cause problems because the selection of the surface always should mirror the selection of the atoms and commands should be acting on the specified atoms. It does cause some bad behavior with commands that act on surfaces and don't know about atoms since those commands won't see the surface as selected. So for example commands "measure area sel", "surface dust sel", "surface splitByColor sel", "surface zone sel", ... no longer work with the molecular surface selected because it does not see any selected surface.

comment:3 by Tom Goddard, 4 years ago

Because the ChimeraX "sel" selector does not handle partially selected surfaces and treats the full surface as selected if any part of it is selected, commands can only act on full surfaces. The commands that act on atoms (like "color") can modify part of a surface by considering only the specified atoms.

So this looks like a basic limitation of our surface selection capability. A variety of commands that act on surfaces would not work if "sel" is used to specify the surfaces if we simply made MolecularSurfaces claim they are never selected. It seems relatively few bad behaviors result from treating a partially selected molecular surface as if it is all selected. This "view sel" example is one of those bad cases. This behavior has been in ChimeraX for years (forever), and has not been reported before.

I'm afraid the best we may be able to do for this bug is call it a "limitation".

comment:4 by pett, 4 years ago

It seems to me that the "practical" solution is to have the view command ignore models whose model-level display bit is off. It certainly does not solve all cases, but remedies a very common single case.

in reply to:  5 ; comment:5 by goddard@…, 4 years ago

I think a better solution is that "view <spec>" should ignore MolecularSurfaces if some atoms are also specified.  This is what other commands like "color" does.  It is ugly but not hard.

comment:6 by Tom Goddard, 4 years ago

Resolution: fixed
Status: assignedclosed

Fixed in 1.4, not 1.3.

Made "view <spec>" command exclude molecular surfaces if atoms of surface are also part of <spec>.

The "view <spec>" command has always only used the displayed specified objects. It did not zoom when the molecular surface was hidden because of a different bug where it incorrectly included the bounds of the undisplayed surface. That is also fixed.

Note: See TracTickets for help on using tickets.