From: <ha...@us...> - 2006-03-02 15:32:34
|
Revision: 4539 Author: hansonr Date: 2006-03-02 07:32:13 -0800 (Thu, 02 Mar 2006) ViewCVS: http://svn.sourceforge.net/jmol/?rev=4539&view=rev Log Message: ----------- Included here: (1) continued streamlining of rendering methods. (2) new Atom.shapeVisibilityFlags (3) new constants in JmolConstants (6) Viewer.isTainted is after any script or frame change (9) all mpsRenderers modified. (10) VISIBLE_DOTS added for atoms included in "Token.visible" (11) new int shapeVisibilityFlags for monomers (12) new getProperty("shapeInfo") (13) getProperty("atomInfo") and ("polymerInfo") include shapeVisibility (14) Frame, ModelManager modified as necessary. I'd still like to get all the displayModelIndex references out of ALL the renderers, including all ShapeRenderers, but I'll not do that now because Sasurface is one of those, and I'm afraid Miguel might be working on it. Bob Hanson Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Atom.java trunk/Jmol/src/org/jmol/viewer/Backbone.java trunk/Jmol/src/org/jmol/viewer/BackboneRenderer.java trunk/Jmol/src/org/jmol/viewer/Balls.java trunk/Jmol/src/org/jmol/viewer/CartoonRenderer.java trunk/Jmol/src/org/jmol/viewer/Dots.java trunk/Jmol/src/org/jmol/viewer/DotsRenderer.java trunk/Jmol/src/org/jmol/viewer/Frame.java trunk/Jmol/src/org/jmol/viewer/Group.java trunk/Jmol/src/org/jmol/viewer/JmolConstants.java trunk/Jmol/src/org/jmol/viewer/MeshRibbonRenderer.java trunk/Jmol/src/org/jmol/viewer/ModelManager.java trunk/Jmol/src/org/jmol/viewer/Monomer.java trunk/Jmol/src/org/jmol/viewer/Mps.java trunk/Jmol/src/org/jmol/viewer/MpsRenderer.java trunk/Jmol/src/org/jmol/viewer/PropertyManager.java trunk/Jmol/src/org/jmol/viewer/RepaintManager.java trunk/Jmol/src/org/jmol/viewer/RibbonsRenderer.java trunk/Jmol/src/org/jmol/viewer/RocketsRenderer.java trunk/Jmol/src/org/jmol/viewer/Shape.java trunk/Jmol/src/org/jmol/viewer/Stars.java trunk/Jmol/src/org/jmol/viewer/StrandsRenderer.java trunk/Jmol/src/org/jmol/viewer/TraceRenderer.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/viewer/Atom.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Atom.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Atom.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -49,6 +49,7 @@ byte formalChargeAndFlags; byte alternateLocationID; int visibilityFlags; + int shapeVisibilityFlags; short madAtom; short colixAtom; Bond[] bonds; @@ -135,6 +136,14 @@ } } + final void setShapeVisibility(int shapeVisibilityFlag, boolean isVisible) { + if(isVisible) { + shapeVisibilityFlags |= shapeVisibilityFlag; + } else { + shapeVisibilityFlags &=~shapeVisibilityFlag; + } + } + void setGroup(Group group) { this.group = group; } @@ -416,9 +425,13 @@ } boolean isVisible() { - return (visibilityFlags > JmolConstants.VISIBLE_MODEL); + return ((visibilityFlags & JmolConstants.VISIBLE_ATOM) != 0); } + boolean isShapeVisible(int shapeID) { + return ((shapeVisibilityFlags & (1 << shapeID)) != 0); + } + float getPartialCharge() { float[] partialCharges = group.chain.frame.partialCharges; return partialCharges == null ? 0 : partialCharges[atomIndex]; Modified: trunk/Jmol/src/org/jmol/viewer/Backbone.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Backbone.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Backbone.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -45,14 +45,17 @@ // note that i is initialized to monomerCount - 1 // in order to skip the last atom // but it is picked up within the loop by looking at i+1 + boolean isVisible = (mad != 0); for (int i = monomerCount - 1; --i >= 0; ) { if ((bsSelected.get(atomIndices[i]) && bsSelected.get(atomIndices[i + 1])) || (bondSelectionModeOr && (bsSelected.get(atomIndices[i]) || - bsSelected.get(atomIndices[i + 1])))) + bsSelected.get(atomIndices[i + 1])))) { + monomers[i].setShapeVisibility(myVisibilityFlag, isVisible); mads[i] = mad; + } } } Modified: trunk/Jmol/src/org/jmol/viewer/BackboneRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/BackboneRenderer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/BackboneRenderer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -29,20 +29,23 @@ class BackboneRenderer extends MpsRenderer { - void renderMpspolymer(Mps.Mpspolymer mpspolymer) { + int myVisibilityFlag; + + void renderMpspolymer(Mps.Mpspolymer mpspolymer, int myVisibilityFlag) { + this.myVisibilityFlag = myVisibilityFlag; renderBackboneChain((Backbone.Bbpolymer)mpspolymer); } void renderBackboneChain(Backbone.Bbpolymer bbpolymer) { - render1Chain(bbpolymer.monomerCount, + render1Chain(bbpolymer.monomerCount, bbpolymer.monomers, bbpolymer.polymer.getLeadAtomIndices(), bbpolymer.mads, bbpolymer.colixes); } - void render1Chain(int monomerCount, int[] atomIndices, - short[] mads, short[] colixes) { + void render1Chain(int monomerCount, Monomer[] monomers, + int[] atomIndices, short[] mads, short[] colixes) { for (int i = monomerCount - 1; --i >= 0; ) { - if (mads[i] == 0) + if ((monomers[i].shapeVisibilityFlags & myVisibilityFlag) == 0) continue; Atom atomA = frame.getAtomAt(atomIndices[i]); Modified: trunk/Jmol/src/org/jmol/viewer/Balls.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Balls.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Balls.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -33,9 +33,15 @@ void setSize(int size, BitSet bsSelected) { short mad = (short)size; Atom[] atoms = frame.atoms; - for (int i = frame.atomCount; --i >= 0; ) - if (bsSelected.get(i)) - atoms[i].setMadAtom(mad); + boolean isVisible = (mad != 0); + int bsLength = bsSelected.length(); + for (int i = bsLength; --i >= 0; ) { + if (bsSelected.get(i)) { + Atom atom = atoms[i]; + atom.setShapeVisibility(myVisibilityFlag,isVisible); + atom.setMadAtom(mad); + } + } } void setProperty(String propertyName, Object value, BitSet bs) { Modified: trunk/Jmol/src/org/jmol/viewer/CartoonRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/CartoonRenderer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/CartoonRenderer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -86,8 +86,11 @@ Point3i[] ribbonTopScreens; Point3i[] ribbonBottomScreens; - void renderMpspolymer( Mps.Mpspolymer mpspolymer) { + int myVisibilityFlag; + + void renderMpspolymer( Mps.Mpspolymer mpspolymer, int myVisibilityFlag) { Cartoon.Cchain strandsChain = (Cartoon.Cchain)mpspolymer; + this.myVisibilityFlag = myVisibilityFlag; if (strandsChain.wingVectors != null) { monomerCount = strandsChain.monomerCount; monomers = strandsChain.monomers; @@ -111,9 +114,9 @@ ribbonBottomScreens = calcScreens(leadMidpoints, wingVectors, mads, isNucleicPolymer ? 0f : -0.5f / 1000); boolean lastWasSpecial = false; - for (int i = monomerCount; --i >= 0; ) - if (mads[i] > 0) { - Monomer group = monomers[i]; + for (int i = monomerCount; --i >= 0; ) { + Monomer group = monomers[i]; + if ((group.shapeVisibilityFlags & myVisibilityFlag) != 0) { short colix = Graphics3D.inheritColix(colixes[i], group.getLeadAtom().colixAtom); boolean isSpecial = isSpecials[i]; @@ -139,6 +142,7 @@ // for the next segment lastWasSpecial = false; } + } viewer.freeTempScreens(ribbonTopScreens); viewer.freeTempScreens(ribbonBottomScreens); viewer.freeTempScreens(leadMidpointScreens); Modified: trunk/Jmol/src/org/jmol/viewer/Dots.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Dots.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Dots.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -146,9 +146,11 @@ diameterP = 2 * radiusP; } int atomCount = frame.atomCount; + boolean isVisible = (mad != 0); + int bsLength = bsSelected.length(); // always delete old surfaces for selected atoms if (dotsConvexMaps != null) { - for (int i = atomCount; --i >= 0; ) + for (int i = bsLength; --i >= 0; ) if (bsSelected.get(i)) dotsConvexMaps[i] = null; deleteUnnecessaryTori(); @@ -161,14 +163,15 @@ dotsConvexMaps = new int[atomCount][]; colixesConvex = new short[atomCount]; } - for (int i = atomCount; --i >= 0; ) + for (int i = bsLength; --i >= 0; ) { if (bsSelected.get(i)) { - setAtomI(i); + setAtomI(i, isVisible); getNeighbors(bsSelected); calcConvexMap(); calcTori(); calcCavities(); } + } } if (dotsConvexMaps == null) dotsConvexMax = 0; @@ -250,9 +253,10 @@ : atom.getBondingRadiusFloat()); } - void setAtomI(int indexI) { + void setAtomI(int indexI, boolean isVisible) { this.indexI = indexI; atomI = frame.atoms[indexI]; + atomI.setShapeVisibility(myVisibilityFlag,isVisible); centerI = atomI.point3f; radiusI = getAppropriateRadius(atomI); radiiIP2 = radiusI + radiusP; @@ -810,4 +814,18 @@ for (int i = bitmap.length; --i >= 0; ) bitmap[i] = 0; } + void setModelVisibility() { + if (dotsConvexMaps == null) + return; + Atom[] atoms = frame.atoms; + int displayModelIndex = viewer.getDisplayModelIndex(); + for (int i = dotsConvexMax; --i >= 0; ) { + int[] map = dotsConvexMaps[i]; + if (map != null && map != mapNull) { + Atom atom = atoms[i]; + if (displayModelIndex < 0 || displayModelIndex == atom.modelIndex) + atom.visibilityFlags |= JmolConstants.VISIBLE_DOTS; + } + } + } } Modified: trunk/Jmol/src/org/jmol/viewer/DotsRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/DotsRenderer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/DotsRenderer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -61,20 +61,17 @@ Atom[] atoms = frame.atoms; int[][] dotsConvexMaps = dots.dotsConvexMaps; short[] colixesConvex = dots.colixesConvex; - int displayModelIndex = this.displayModelIndex; for (int i = dots.dotsConvexMax; --i >= 0; ) { - int[] map = dotsConvexMaps[i]; - if (map != null && map != mapNull) { - Atom atom = atoms[i]; - if (displayModelIndex < 0 || displayModelIndex == atom.modelIndex) - renderConvex(dots, atom, colixesConvex[i], map); + Atom atom = atoms[i]; + if ((atom.visibilityFlags & JmolConstants.VISIBLE_DOTS) != 0) { + renderConvex(dots, atom, colixesConvex[i], dotsConvexMaps[i]); } } Dots.Torus[] tori = dots.tori; for (int i = dots.torusCount; --i >= 0; ) { Dots.Torus torus = tori[i]; - if (displayModelIndex < 0 || - displayModelIndex == atoms[torus.ixI].modelIndex) + Atom atom = atoms[torus.ixI]; + if ((atom.visibilityFlags & JmolConstants.VISIBLE_DOTS) != 0) renderTorus(torus, atoms, colixesConvex, dotsConvexMaps); } Dots.Cavity[] cavities = dots.cavities; @@ -84,8 +81,8 @@ } for (int i = dots.cavityCount; --i >= 0; ) { Dots.Cavity cavity = cavities[i]; - if (displayModelIndex < 0 || - displayModelIndex == atoms[cavity.ixI].modelIndex) + Atom atom = atoms[cavity.ixI]; + if ((atom.visibilityFlags & JmolConstants.VISIBLE_DOTS) != 0) renderCavity(cavities[i], atoms, colixesConvex, dotsConvexMaps); } } Modified: trunk/Jmol/src/org/jmol/viewer/Frame.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Frame.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Frame.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -746,6 +746,7 @@ try { Class shapeClass = Class.forName(className); Shape shape = (Shape)shapeClass.newInstance(); + shape.setVisibilityInfo(shapeID); shape.setViewerG3dFrame(viewer, g3d, this); return shape; } catch (Exception e) { Modified: trunk/Jmol/src/org/jmol/viewer/Group.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Group.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Group.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -33,6 +33,7 @@ short groupID; int firstAtomIndex = -1; int lastAtomIndex; + int shapeVisibilityFlags = 0; Group(Chain chain, String group3, int seqcode, int firstAtomIndex, int lastAtomIndex) { @@ -45,6 +46,14 @@ this.lastAtomIndex = lastAtomIndex; } + final void setShapeVisibility(int visFlag, boolean isVisible) { + if(isVisible) { + shapeVisibilityFlags |= visFlag; + } else { + shapeVisibilityFlags &=~visFlag; + } +} + final boolean isGroup3(String group3) { return group3Names[groupID].equalsIgnoreCase(group3); } Modified: trunk/Jmol/src/org/jmol/viewer/JmolConstants.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/JmolConstants.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/JmolConstants.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -30,13 +30,22 @@ public final static int VISIBLE_MODEL = 1; - public final static int VISIBLE_BALL = 2; - public final static int VISIBLE_STICK = 4; - public final static int VISIBLE_BACKBONE = 8; - public final static int VISIBLE_CARTOON = 16; - public final static int VISIBLE_STAR = 32; - public final static int VISIBLE_HALO = 64; - + public final static int VISIBLE_BALL = 1 << 1; + public final static int VISIBLE_STICK = 1 << 2; + public final static int VISIBLE_BACKBONE = 1 << 3; + public final static int VISIBLE_CARTOON = 1 << 4; + public final static int VISIBLE_STAR = 1 << 5; + public final static int VISIBLE_HALO = 1 << 6; + public final static int VISIBLE_DOTS = 1 << 7; + // VISIBLE_ATOM might be modified to include other shapes, + public final static int VISIBLE_ATOM = + VISIBLE_BALL + | VISIBLE_STICK + | VISIBLE_BACKBONE + | VISIBLE_CARTOON + | VISIBLE_STAR + | VISIBLE_HALO + | VISIBLE_DOTS; // for now, just update this by hand // perhaps use ant filter later ... but mth doesn't like it :-( Modified: trunk/Jmol/src/org/jmol/viewer/MeshRibbonRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/MeshRibbonRenderer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/MeshRibbonRenderer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -59,8 +59,10 @@ float baseOffset; boolean isNucleicPolymer; - - void renderMpspolymer( Mps.Mpspolymer mpspolymer) { + int myVisibilityFlag; + + void renderMpspolymer( Mps.Mpspolymer mpspolymer, int myVisibilityFlag) { + this.myVisibilityFlag = myVisibilityFlag; MeshRibbon.Schain strandsChain = (MeshRibbon.Schain)mpspolymer; strandCount = viewer.getStrandsCount(); @@ -117,12 +119,11 @@ void render1Strand(int monomerCount, Monomer[] monomers, short[] mads, short[] colixes, Point3i[] screens) { for (int i = monomerCount; --i >= 0; ) - if (mads[i] > 0) + if ((monomers[i].shapeVisibilityFlags & myVisibilityFlag) != 0) render1StrandSegment(monomerCount, monomers[i], colixes[i], mads, screens, i); } - void render1StrandSegment(int monomerCount, Monomer monomer, short colix, short[] mads, Point3i[] screens, int i) { int iLast = monomerCount; Modified: trunk/Jmol/src/org/jmol/viewer/ModelManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/ModelManager.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/ModelManager.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -629,7 +629,6 @@ Hashtable getModelInfo() { Hashtable info = new Hashtable(); - boolean isPDB = frame.isPDB; int modelCount = viewer.getModelCount(); info.put("modelSetName",getModelSetName()); info.put("modelCount",new Integer(modelCount)); @@ -692,6 +691,8 @@ info.put("radius", new Float((atom.getRasMolRadius()/120.0))); info.put("info", getAtomInfo(i)); info.put("visible", new Boolean(getAtomVisibility(i))); + info.put("visibilityFlags", new Integer(atom.visibilityFlags)); + info.put("shapeVisibilityFlags", new Integer(atom.shapeVisibilityFlags)); info.put("spacefill", new Integer(atom.madAtom >> 3)); info.put("color", viewer.getHexColorFromIndex(atom.colixAtom)); info.put("colix", new Integer(atom.colixAtom)); @@ -785,6 +786,7 @@ infoGroup.put("_apt2", new Integer(group.lastAtomIndex)); infoGroup.put("atomInfo1", getAtomInfo(group.firstAtomIndex)); infoGroup.put("atomInfo2", getAtomInfo(group.lastAtomIndex)); + infoGroup.put("shapeVisibility", new Integer(frame.atoms[group.firstAtomIndex].shapeVisibilityFlags)); infoChain.add(infoGroup); } arrayName.put("residues",infoChain); @@ -830,7 +832,6 @@ info.put("edge", getBoundBoxCornerVector()); return info; } - void setModelVisibility() { if (frame == null) @@ -842,5 +843,23 @@ shape.setModelVisibility(); } } + } + + + Hashtable getShapeInfo() { + Hashtable info = new Hashtable(); + if (frame == null) + return info; + for (int i = 0; i < JmolConstants.SHAPE_MAX; ++i) { + Shape shape = frame.shapes[i]; + if (shape != null) { + Hashtable shapeinfo = new Hashtable(); + shapeinfo.put("index",new Integer(i)); + shapeinfo.put("myVisibilityFlag",new Integer(shape.myVisibilityFlag)); + info.put(JmolConstants.shapeClassBases[i],shapeinfo); + } + } + return info; } + } Modified: trunk/Jmol/src/org/jmol/viewer/Monomer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Monomer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Monomer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -214,7 +214,8 @@ Hashtable info = new Hashtable(); info.put("seqcode",getSeqcodeString()); info.put("firstAtom", chain.frame.atoms[firstAtomIndex].getInfo()); - info.put("lasttAtom", chain.frame.atoms[lastAtomIndex].getInfo()); + info.put("lastAtom", chain.frame.atoms[lastAtomIndex].getInfo()); + info.put("shapeVisibilityFlags", new Integer(shapeVisibilityFlags)); ProteinStructure structure = getProteinStructure(); if(structure != null)info.put("structure", getStructureTypeName(structure.type)); return info; Modified: trunk/Jmol/src/org/jmol/viewer/Mps.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Mps.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Mps.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -170,6 +170,7 @@ Point3f[] leadMidpoints; Vector3f[] wingVectors; + Mpspolymer(Polymer polymer, int madOn, int madHelixSheet, int madTurnRandom, int madDnaRna) { this.polymer = polymer; @@ -262,10 +263,15 @@ } void setMad(short mad, BitSet bsSelected) { - int[] atomIndices = polymer.getLeadAtomIndices(); + int[] leadAtomIndices = polymer.getLeadAtomIndices(); + boolean isVisible = (mad != 0); for (int i = monomerCount; --i >= 0; ) { - if (bsSelected.get(atomIndices[i])) + int leadAtomIndex = leadAtomIndices[i]; + if (bsSelected.get(leadAtomIndex)) { mads[i] = mad >= 0 ? mad : getMadSpecial(mad, i); + monomers[i].setShapeVisibility(myVisibilityFlag, isVisible); + frame.atoms[leadAtomIndex].setShapeVisibility(myVisibilityFlag,isVisible); + } } if (monomerCount > 1) mads[monomerCount] = mads[monomerCount - 1]; Modified: trunk/Jmol/src/org/jmol/viewer/MpsRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/MpsRenderer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/MpsRenderer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -40,12 +40,12 @@ for (int c = mcpsmodel.getMpspolymerCount(); --c >= 0; ) { Mps.Mpspolymer mpspolymer = mcpsmodel.getMpspolymer(c); if (mpspolymer.monomerCount >= 2) - renderMpspolymer(mpspolymer); + renderMpspolymer(mpspolymer, shape.myVisibilityFlag); } } } - abstract void renderMpspolymer(Mps.Mpspolymer mpspolymer); + abstract void renderMpspolymer(Mps.Mpspolymer mpspolymer, int myVisibilityFlag); //////////////////////////////////////////////////////////////// // some utilities Modified: trunk/Jmol/src/org/jmol/viewer/PropertyManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/PropertyManager.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/PropertyManager.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -126,7 +126,12 @@ if(infoType.equalsIgnoreCase("extractModel")) return viewer.getModelExtract(myParam); + + // misc + if(infoType.equalsIgnoreCase("shapeInfo")) + return viewer.getShapeInfo(); + // public objects if(infoType.equalsIgnoreCase("jmolViewer")) @@ -135,7 +140,7 @@ if(infoType.equalsIgnoreCase("messageQueue")) return viewer.getMessageQueue(); - return "getProperty ERROR\n\nOptions include\n" + return "getProperty ERROR\n"+ infoType +"?\nOptions include\n" + "\n getProperty(\"appletInfo\")" + "\n getProperty(\"fileName\")" @@ -147,6 +152,7 @@ + "\n\n getProperty(\"modelInfo\")" + "\n\n getProperty(\"polymerInfo\")" + "\n getProperty(\"chainInfo\")" + + "\n getProperty(\"shapeInfo\")" + "\n\n getProperty(\"boundboxInfo\")" + "\n getProperty(\"centerInfo\")" Modified: trunk/Jmol/src/org/jmol/viewer/RepaintManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/RepaintManager.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/RepaintManager.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -48,7 +48,7 @@ displayModelIndex = -1; else displayModelIndex = modelIndex; - + viewer.setTainted(true); viewer.setStatusFrameChanged(modelIndex); return true; } Modified: trunk/Jmol/src/org/jmol/viewer/RibbonsRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/RibbonsRenderer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/RibbonsRenderer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -64,8 +64,10 @@ boolean isNucleic; boolean ribbonBorder = false; - - void renderMpspolymer( Mps.Mpspolymer mpspolymer) { + int myVisibilityFlag; + + void renderMpspolymer( Mps.Mpspolymer mpspolymer, int myVisibilityFlag) { + this.myVisibilityFlag = myVisibilityFlag; Ribbons.Schain strandsChain = (Ribbons.Schain)mpspolymer; if (strandsChain.wingVectors != null) { // note that we are not treating a PhosphorusPolymer @@ -106,7 +108,7 @@ Point3i[] ribbonTopScreens, Point3i[] ribbonBottomScreens) { for (int i = monomerCount; --i >= 0; ) - if (mads[i] > 0) + if ((monomers[i].shapeVisibilityFlags & myVisibilityFlag) != 0) render2StrandSegment(monomerCount, monomers[i], colixes[i], mads, ribbonTopScreens, ribbonBottomScreens, i); Modified: trunk/Jmol/src/org/jmol/viewer/RocketsRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/RocketsRenderer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/RocketsRenderer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -38,8 +38,10 @@ int diameterBeg, diameterMid, diameterEnd; Rockets cartoon; - - void renderMpspolymer(Mps.Mpspolymer mpspolymer) { + int myVisibilityFlag; + + void renderMpspolymer(Mps.Mpspolymer mpspolymer, int myVisibilityFlag) { + this.myVisibilityFlag = myVisibilityFlag; Rockets.Cchain cchain = (Rockets.Cchain)mpspolymer; render1Chain(cchain.polymer, cchain.mads, cchain.colixes); } @@ -50,7 +52,7 @@ initializeChain((AminoPolymer)polymer); clearPending(); for (int i = 0; i < monomerCount; ++i) { - if (mads[i] == 0) + if ((monomers[i].shapeVisibilityFlags & myVisibilityFlag) == 0) continue; Monomer monomer = monomers[i]; short colix = Graphics3D.inheritColix(colixes[i], Modified: trunk/Jmol/src/org/jmol/viewer/Shape.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Shape.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Shape.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -34,7 +34,16 @@ Viewer viewer; Frame frame; Graphics3D g3d; - + int shapeID; + int myVisibilityFlag; + int shapeVisibilityFlags; //future expansion + + final void setVisibilityInfo(int shapeID) { + this.shapeID = shapeID; + this.myVisibilityFlag = (1 << shapeID); + this.shapeVisibilityFlags = 0; + } + final void setViewerG3dFrame(Viewer viewer, Graphics3D g3d, Frame frame) { this.viewer = viewer; this.g3d = g3d; Modified: trunk/Jmol/src/org/jmol/viewer/Stars.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Stars.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Stars.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -35,13 +35,20 @@ short[] colixes; void setSize(int size, BitSet bsSelected) { + + Atom[] atoms = frame.atoms; - for (int i = frame.atomCount; --i >= 0; ) + boolean isVisible = (size != 0); + int bsLength = bsSelected.length(); + if (mads == null && bsLength > 0) + mads = new short[frame.atomCount]; + for (int i = bsLength; --i >= 0; ) { if (bsSelected.get(i)) { - if (mads == null) - mads = new short[frame.atomCount]; - mads[i] = atoms[i].convertEncodedMad(size); + Atom atom = atoms[i]; + atom.setShapeVisibility(myVisibilityFlag,isVisible); + mads[i] = atom.convertEncodedMad(size); } + } } void setProperty(String propertyName, Object value, BitSet bs) { Modified: trunk/Jmol/src/org/jmol/viewer/StrandsRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/StrandsRenderer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/StrandsRenderer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -57,10 +57,12 @@ float baseOffset; boolean isNucleicPolymer; - - void renderMpspolymer(Mps.Mpspolymer mpspolymer) { + int myVisibilityFlag; + + void renderMpspolymer(Mps.Mpspolymer mpspolymer, int myVisibilityFlag) { Strands.Schain schain = (Strands.Schain)mpspolymer; + this.myVisibilityFlag = myVisibilityFlag; strandCount = viewer.getStrandsCount(); strandSeparation = (strandCount <= 1 ) ? 0 : 1f / (strandCount - 1); baseOffset = @@ -103,9 +105,10 @@ void render1Strand(int monomerCount, Monomer[] monomers, short[] mads, short[] colixes, Point3i[] screens) { for (int i = monomerCount; --i >= 0; ) - if (mads[i] > 0) + if ((monomers[i].shapeVisibilityFlags & myVisibilityFlag) != 0) { render1StrandSegment(monomerCount, monomers[i], colixes[i], mads, screens, i); + } } Modified: trunk/Jmol/src/org/jmol/viewer/TraceRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/TraceRenderer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/TraceRenderer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -31,8 +31,10 @@ class TraceRenderer extends MpsRenderer { boolean isNucleicPolymer; - - void renderMpspolymer(Mps.Mpspolymer mpspolymer) { + int myVisibilityFlag; + + void renderMpspolymer(Mps.Mpspolymer mpspolymer, int myVisibilityFlag) { + this.myVisibilityFlag = myVisibilityFlag; Trace.Tchain tchain = (Trace.Tchain)mpspolymer; isNucleicPolymer = tchain.polymer instanceof NucleicPolymer; monomerCount = tchain.monomerCount; @@ -54,7 +56,7 @@ void render1Chain(short[] mads, short[] colixes) { for (int i = monomerCount; --i >= 0; ) { - if (mads[i] == 0) + if ((monomers[i].shapeVisibilityFlags & myVisibilityFlag) == 0) continue; short colix = Graphics3D.inheritColix(colixes[i], Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2006-02-28 18:49:19 UTC (rev 4538) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2006-03-02 15:32:13 UTC (rev 4539) @@ -1526,6 +1526,10 @@ return modelManager.getChainInfo(); } + public Hashtable getShapeInfo() { + return modelManager.getShapeInfo(); + } + Vector getAllAtomInfo(String atomExpression) { BitSet bs = getAtomBitSet(atomExpression); return modelManager.getAllAtomInfo(bs); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |