BALL-Project / ball

The Biochemical Algorithms Library
GNU Lesser General Public License v2.1
72 stars 32 forks source link

Colorize only chosen residues #561

Open Laura-K opened 9 years ago

Laura-K commented 9 years ago

Hi all !

With BALL and VIEW, I'm trying to colorize some residues really often. I saw that the update() function of the ColorProcessor examples (and my implementation too by the way) rewrite the color of all the GeometricObjects, and this takes times. Instead, I would prefer to update the changed residue only.

Is there a way to change the color of just one residue ? I don't find it with the documentation and reading the VIEW code.

I don't find a way with BALL & VIEW to get the GeometricObject list corresponding to a Residue. So I tried to make my own class regrouping for each amino acid the corresponding Residue and GeometricObjects. I though that I could call the ColorProcessor::operator() and hoped it will update the representation with less costs. But just before building my list of amino acids, I observe that Representation->getGeometricObjects() gave me a list with less geometric objects than the Residues number in my peptide. That puzzeled me. In my mind, it should give me (manyGeometric objects) * (number of Residues in the peptide).

I'm not even sure my approach will gave me results if I manage to give directly the good GeometricObject list to the ColorProcessor::operator(). Would you advise me to continue this idea or did I miss an easier way to update a single element color ?

I thank you for your help.

Best, Laura

Laura-K commented 9 years ago

Hi

I tried to color directly the geometric objects with colorProcessor.operator() and it does not work. Also I tried to update a residue by calling directly the GLRenderer after coloring them with setColor(), but it was a failure too.

This feature would be very interesting. For example for highlight automaticlly elements under the mouse cursor, or for make elements blinking with smooth transitions. It's really missing.

Is there a way I am missing ? As I did not find how to change the color of selected geometric objects into a representation, I am searching for an alternative. For example create another group of colored meshs around the selected residue, with the same number of vertices, just a little bigger to mask the residue and makes highlight it. Is it possible to create representation with geometric objects from another representation ? I tried a little, but nothing was visible in the renderer.

This second idea seems very complicated for such a little thing.

Best, Laura