Opened 8 years ago

Closed 8 years ago

#1044 closed defect (not a bug)

Need "ribbon drawing finished" trigger

Reported by: Tristan Croll Owned by: Conrad Huang
Priority: moderate Milestone:
Component: Depiction Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

To provide live symmetry visualisation for ribbons it looks to me like the easiest approach is to make a copy of the ribbon drawing so I can re-color it and tile it as necessary. This works and is fast, but at the moment coping with ribbon display changes is problematic. I thought that simply triggering a redraw on the ribbon_display changed event should do it, but when that trigger is fired the ribbon drawing hasn't changed yet. Would it be possible to have a trigger that's guaranteed to fire *after* the ribbon's been redrawn?

Change History (3)

comment:1 by Conrad Huang, 8 years ago

I'm not sure I understand the question. Are you trying to force a ribbon update or get notified when the ribbon is updated?

The former question is easier to answer. Currently, ribbons are updated as part of the redraw caused by the firing of a "graphics update" trigger. As part of that redraw, ribbons of structures that are not marked as "something with ribbons may have changed" are not recomputed. To mark a structure for ribbon rebuild, in Python it's

s._graphics_changed |= s._RIBBON_CHANGE

and in C++ it's

s._set_gc_ribbon()

where s is an AtomicStructure/Structure instance.

If you want the latter (notification when ribbon is updated), there is currently no facility for doing so.

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

I’m afraid I want the latter. 

This is to do with #822 - my improved implementation of crystallographic (and eventually non-crystallographic) symmetry visualisation. Basically, given a centre, radius and a set of symmetry matrices, it provides a drawing of all symmetry atoms/bonds inside the sphere (fast enough to navigate live with negligible slowdown for spheres up to about 50 Angstroms radius). It’s helpful to also provide the symmetry copies of the ribbon (just tiling the whole ribbon for each copy with any atoms in the sphere). In order to differentiate the symmetry copies from the main model I darken them, which is easiest achieved by copying the ribbon drawing geometry into fresh Drawing objects then applying the modified vertex colours. But at present I have no neat way of catching when the ribbon drawing changes.



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





comment:3 by Tristan Croll, 8 years ago

Resolution: not a bug
Status: assignedclosed

Ah - never mind. Turns out the 'frame drawn' trigger was what I was searching for.

Note: See TracTickets for help on using tickets.