Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#821 closed enhancement (not a bug)

Have pseudobonds respect user hide flags

Reported by: Tristan Croll Owned by: Eric Pettersen
Priority: minor Milestone:
Component: Depiction Version:
Keywords: Cc: chimera-programmers
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

I understand why it makes sense to have pseudobonds remain visible when their atoms HIDE_RIBBON or HIDE_NUCLEOTIDE flags are set, but I think it would make more sense for other flags to hide them. I'd like to suggest amending lines 71-73 of Pseudobond.h to the following:

    { return (visible() &&
	      (atoms()[0]->display() || (atoms()[0]->hide()&(Atom::HIDE_RIBBON|Atom::HIDE_NUCLEOTIDE))) &&
	      (atoms()[1]->display() || (atoms()[1]->hide()&(Atom::HIDE_RIBBON|Atom::HIDE_NUCLEOTIDE)))); }

Change History (4)

comment:1 by Tristan Croll, 8 years ago

Oops - misread the logic there. This works:

    bool shown() const
    { bool cartoon_hides = (Atom::HIDE_RIBBON|Atom::HIDE_NUCLEOTIDE);
      return (visible() && 
	      (atoms()[0]->display() && !(atoms()[0]->hide()&~cartoon_hides)) &&
	      (atoms()[1]->display() && !(atoms()[1]->hide()&~cartoon_hides))); }

comment:2 by Eric Pettersen, 8 years ago

Cc: chimera-programmers added
Component: CoreDepiction

We need to decide in what situations we want pseudobonds displayed (and what ones we don't).

comment:3 by Eric Pettersen, 8 years ago

Resolution: not a bug
Status: assignedclosed

Okay, the design intent of atom 'hide' flags are that when a hide bit is set, there is some other depiction of the atom being presented, and so the "regular" atom depiction should be hidden. By that logic, pseudbonds should be drawn to atoms whose hide masks are non-zero. So I am not going to change the code in the fashion requested.

However, some kinds of pseudobonds *should* hide when an alternative atom depiction is shown -- namely chain-trace pseudobonds. Consequently, I have added a "shown_when_atoms_hidden" boolean attribute to Pseudobond (default true) which is used to suppress chain-trace pseudobonds in the presence of alternative depictions. Now, you don't actually say what kind of pseudobonds are proving problematic for you, but it's possible that this new attribute could be helpful, depending on your use case.

--Eric

in reply to:  4 ; comment:4 by tic20@…, 8 years ago

That will do just fine, thanks. For the record, my use case is representations of position and distance restraints on atoms.

 
 
Tristan Croll
Research Fellow
Cambridge Institute for Medical Research
University of Cambridge CB2 0XY
 

 

Note: See TracTickets for help on using tickets.