I think it was I who moved it from StarsRenderer to BallsRenderer because it is a simple property of an atom, like spacefill, and the symmetry was obvious, especially after I introduced visiblity flags. Like Balls, it has just an atom-visibility connection; unlike Stars it has no underlying class. It had no place in StarsRenderer.

I'll be very glad when those visibility flags go back in. They will be very important. My code was sraightforward:

int ballVisibilityFlag = viewer.getShapeVisibilityFlag(JmolConstants.SHAPE_BALLS); int haloVisibilityFlag = viewer.getShapeVisibilityFlag(JmolConstants.SHAPE_HALO);
    Atom[] atoms = frame.atoms;
    for (int i = frame.atomCount; --i >= 0; ) {
      Atom atom = atoms[i];
      if ((atom.shapeVisibilityFlags & JmolConstants.ATOM_IN_MODEL) == 0)
        continue;
      atom.transform(viewer);
      if ((atom.shapeVisibilityFlags & ballVisibilityFlag) != 0)
        renderBall(atom);
      if ((atom.shapeVisibilityFlags & haloVisibilityFlag) != 0)
        renderHalo(atom);
    }
  }

  void renderBall(Atom atom) {
    g3d.fillSphereCentered(atom.colixAtom, atom.screenDiameter,
                           atom.screenX, atom.screenY, atom.screenZ);
  }

  void renderHalo(Atom atom) {
    int diameter = atom.screenDiameter;
    int halowidth = diameter / 4;
    if (halowidth < 4) halowidth = 4;
    if (halowidth > 10) halowidth = 10;
    int haloDiameter = diameter + 2 * halowidth;
    g3d.fillScreenedCircleCentered(colixSelection, haloDiameter,
                                   atom.screenX, atom.screenY, atom.screenZ);
  }

        

The following construct is what has to go everywhere it appears in a renderer:

        if (atom.modelIndex != displayModelIndex) {
          atom.formalChargeAndFlags &= ~Atom.VISIBLE_FLAG;
          continue;
        }

That is far too limiting. (It assumes there is only one possibility -- "frame range" requires dissecting out atom visibility from formal charge; getting a "state" of the display (something I'm not sure I saw on your list, Miguel) demands it.

This also reminds me that the "VISIBLE" concept needs to be pulled out as "CLICKABLE", and that clickability needs to be a method of all shapes, reserving "visible" for the actually being what it says. These are clearly defined at the end of ModelManager.

This will be a challenge for sure for us to re-introduce.



-Bob



Miguel wrote:

Bob wrote:


While I'm at it...

halo was moved.


I don't understand.


Miguel



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

--
--

Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED]
http://www.stolaf.edu/people/hansonr

"Imagination is more important than knowledge." - Albert Einstein



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to