Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(35) |
May
(67) |
Jun
(2) |
Jul
|
Aug
(12) |
Sep
(54) |
Oct
(91) |
Nov
(168) |
Dec
(100) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(209) |
Feb
(158) |
Mar
(19) |
Apr
(24) |
May
(184) |
Jun
(134) |
Jul
(54) |
Aug
(399) |
Sep
(218) |
Oct
(271) |
Nov
(207) |
Dec
(126) |
2004 |
Jan
(138) |
Feb
(249) |
Mar
(420) |
Apr
(100) |
May
(335) |
Jun
(143) |
Jul
(91) |
Aug
(129) |
Sep
(98) |
Oct
(170) |
Nov
(352) |
Dec
(355) |
2005 |
Jan
(256) |
Feb
(158) |
Mar
(163) |
Apr
(38) |
May
(217) |
Jun
(98) |
Jul
(213) |
Aug
(169) |
Sep
(260) |
Oct
(94) |
Nov
(87) |
Dec
(153) |
2006 |
Jan
(35) |
Feb
(176) |
Mar
(308) |
Apr
(168) |
May
(152) |
Jun
(67) |
Jul
(99) |
Aug
(90) |
Sep
(313) |
Oct
(266) |
Nov
(282) |
Dec
(189) |
2007 |
Jan
(118) |
Feb
(309) |
Mar
(289) |
Apr
(209) |
May
(268) |
Jun
(103) |
Jul
(91) |
Aug
(143) |
Sep
(146) |
Oct
(205) |
Nov
(157) |
Dec
(172) |
2008 |
Jan
(53) |
Feb
(87) |
Mar
(188) |
Apr
(99) |
May
(101) |
Jun
(91) |
Jul
(117) |
Aug
(158) |
Sep
(100) |
Oct
(221) |
Nov
(184) |
Dec
(127) |
2009 |
Jan
(64) |
Feb
(93) |
Mar
(60) |
Apr
(74) |
May
(76) |
Jun
(218) |
Jul
(130) |
Aug
(115) |
Sep
(142) |
Oct
(76) |
Nov
(160) |
Dec
(181) |
2010 |
Jan
(229) |
Feb
(231) |
Mar
(184) |
Apr
(243) |
May
(229) |
Jun
(204) |
Jul
(293) |
Aug
(370) |
Sep
(160) |
Oct
(164) |
Nov
(163) |
Dec
(161) |
2011 |
Jan
(145) |
Feb
(147) |
Mar
(117) |
Apr
(43) |
May
(102) |
Jun
(152) |
Jul
(204) |
Aug
(98) |
Sep
(162) |
Oct
(216) |
Nov
(107) |
Dec
(98) |
2012 |
Jan
(53) |
Feb
(131) |
Mar
(105) |
Apr
(109) |
May
(155) |
Jun
(88) |
Jul
(82) |
Aug
(69) |
Sep
(96) |
Oct
(83) |
Nov
(71) |
Dec
(50) |
2013 |
Jan
(51) |
Feb
(53) |
Mar
(81) |
Apr
(143) |
May
(75) |
Jun
(103) |
Jul
(126) |
Aug
(104) |
Sep
(73) |
Oct
(136) |
Nov
(148) |
Dec
(90) |
2014 |
Jan
(82) |
Feb
(146) |
Mar
(132) |
Apr
(125) |
May
(72) |
Jun
(84) |
Jul
(35) |
Aug
(68) |
Sep
(49) |
Oct
(54) |
Nov
(58) |
Dec
(15) |
2015 |
Jan
(76) |
Feb
(82) |
Mar
(74) |
Apr
(49) |
May
(48) |
Jun
(48) |
Jul
(57) |
Aug
(66) |
Sep
(45) |
Oct
(52) |
Nov
(18) |
Dec
(33) |
2016 |
Jan
(26) |
Feb
(27) |
Mar
(60) |
Apr
(30) |
May
(51) |
Jun
(25) |
Jul
(12) |
Aug
(47) |
Sep
(11) |
Oct
(26) |
Nov
(9) |
Dec
(27) |
2017 |
Jan
(44) |
Feb
(34) |
Mar
(22) |
Apr
(108) |
May
(42) |
Jun
(17) |
Jul
(38) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
1
(4) |
2
(3) |
3
(10) |
4
(7) |
5
(4) |
6
(25) |
7
(11) |
8
|
9
(3) |
10
(5) |
11
(8) |
12
(3) |
13
(6) |
14
(8) |
15
(18) |
16
(9) |
17
(6) |
18
(7) |
19
(14) |
20
(8) |
21
(6) |
22
(7) |
23
(6) |
24
(5) |
25
|
26
|
27
|
28
|
29
(1) |
30
|
31
(5) |
|
|
|
|
|
|
From: <hansonr@us...> - 2006-12-31 04:26:34
|
Revision: 6555 http://svn.sourceforge.net/jmol/?rev=6555&view=rev Author: hansonr Date: 2006-12-30 20:26:32 -0800 (Sat, 30 Dec 2006) Log Message: ----------- implements -select atomX/atomY/atomZ [<,>,=,<=,>=,!=] x.xx -set navigationPeriodic -set zShade -expanded load "filename" {i j k} Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/BallsRenderer.java trunk/Jmol/src/org/jmol/viewer/Eval.java trunk/Jmol/src/org/jmol/viewer/Frame.java trunk/Jmol/src/org/jmol/viewer/ModelManager.java trunk/Jmol/src/org/jmol/viewer/StateManager.java trunk/Jmol/src/org/jmol/viewer/SticksRenderer.java trunk/Jmol/src/org/jmol/viewer/TransformManager.java trunk/Jmol/src/org/jmol/viewer/TransformManager10.java trunk/Jmol/src/org/jmol/viewer/TransformManager11.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/viewer/BallsRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/BallsRenderer.java 2006-12-31 04:18:19 UTC (rev 6554) +++ trunk/Jmol/src/org/jmol/viewer/BallsRenderer.java 2006-12-31 04:26:32 UTC (rev 6555) @@ -30,13 +30,14 @@ class BallsRenderer extends ShapeRenderer { int minX, maxX, minY, maxY, minZ, maxZ; - + boolean isNav; void render() { minX = rectClip.x; maxX = minX + rectClip.width; minY = rectClip.y; maxY = minY + rectClip.height; boolean slabbing = viewer.getSlabEnabled(); + isNav = viewer.getNavigationMode(); if (slabbing) { minZ = g3d.getSlab(); maxZ = g3d.getDepth(); @@ -52,6 +53,11 @@ if (slabbing) { if (g3d.isClippedZ(atom.screenZ)) { atom.clickabilityFlags = 0; + //note that in the case of navigation, + //maxZ is set to Integer.MAX_VALUE. + + if (isNav) + continue; int r = atom.screenDiameter / 2; if (atom.screenZ < minZ - r || atom.screenZ > maxZ + r) continue; @@ -91,7 +97,8 @@ } void renderBall(Atom atom) { - g3d.fillSphereCentered(atom.colixAtom, atom.screenDiameter, + short colix = atom.colixAtom; + g3d.fillSphereCentered(colix, atom.screenDiameter, atom.screenX, atom.screenY, atom.screenZ); } } Modified: trunk/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Eval.java 2006-12-31 04:18:19 UTC (rev 6554) +++ trunk/Jmol/src/org/jmol/viewer/Eval.java 2006-12-31 04:26:32 UTC (rev 6555) @@ -1304,6 +1304,15 @@ case Token.model: propertyValue = atom.getModelTagNumber(); break; + case Token.atomX: + propertyValue = (int)(atom.x * 100); + break; + case Token.atomY: + propertyValue = (int)(atom.y * 100); + break; + case Token.atomZ: + propertyValue = (int)(atom.z * 100); + break; default: unrecognizedAtomProperty(property); } @@ -1748,9 +1757,9 @@ } else if (pt.z == 0) { pt3.set(pt1.x, 0, 1); } - viewer.convertFractionalCoordinates(pt1); - viewer.convertFractionalCoordinates(pt2); - viewer.convertFractionalCoordinates(pt3); + viewer.toCartesian(pt1); + viewer.toCartesian(pt2); + viewer.toCartesian(pt3); pt1.add(offset); pt2.add(offset); pt3.add(offset); @@ -1931,7 +1940,7 @@ if (getToken(++pcLastExpressionInstruction).tok != Token.rightbrace) coordinateExpected(); if (coordinatesAreFractional && doConvert) - viewer.convertFractionalCoordinates(pt); + viewer.toCartesian(pt); return pt; } Modified: trunk/Jmol/src/org/jmol/viewer/Frame.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Frame.java 2006-12-31 04:18:19 UTC (rev 6554) +++ trunk/Jmol/src/org/jmol/viewer/Frame.java 2006-12-31 04:26:32 UTC (rev 6555) @@ -2972,6 +2972,10 @@ unitCell.toFractional(pt); } + void toUnitCell(Point3f pt, Point3f offset) { + unitCell.toUnitCell(pt, offset); + } + void showInfo() { if (Logger.isActiveLevel(Logger.LEVEL_DEBUG)) Logger.debug("cellInfos[" + modelIndex + "]:\n" + unitCell.dumpInfo(true)); @@ -2983,7 +2987,7 @@ } } - void convertFractionalCoordinates(int modelIndex, Point3f pt) { + void toCartesian(int modelIndex, Point3f pt) { if (modelIndex < 0) modelIndex = 0; if (cellInfos == null || modelIndex >= cellInfos.length || cellInfos[modelIndex] == null) @@ -2993,6 +2997,14 @@ Logger.info(str + pt); } + void toUnitCell(int modelIndex, Point3f pt, Point3f offset) { + if (modelIndex < 0) + return; + if (cellInfos == null || modelIndex >= cellInfos.length || cellInfos[modelIndex] == null) + return; + cellInfos[modelIndex].toUnitCell(pt, offset); + } + boolean reportFormalCharges = false; void setFormalCharges(BitSet bs, int formalCharge) { for (int i = 0; i < atomCount; i++) Modified: trunk/Jmol/src/org/jmol/viewer/ModelManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/ModelManager.java 2006-12-31 04:18:19 UTC (rev 6554) +++ trunk/Jmol/src/org/jmol/viewer/ModelManager.java 2006-12-31 04:26:32 UTC (rev 6555) @@ -1322,10 +1322,15 @@ return false; } - void convertFractionalCoordinates(int modelIndex, Point3f pt) { - frame.convertFractionalCoordinates(modelIndex, pt); + void toCartesian(int modelIndex, Point3f pt) { + frame.toCartesian(modelIndex, pt); return; } + + void toUnitCell(int modelIndex, Point3f pt, Point3f offset) { + frame.toUnitCell(modelIndex, pt, offset); + return; + } void clearBfactorRange(){ frame.clearBfactorRange(); Modified: trunk/Jmol/src/org/jmol/viewer/StateManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/StateManager.java 2006-12-31 04:18:19 UTC (rev 6554) +++ trunk/Jmol/src/org/jmol/viewer/StateManager.java 2006-12-31 04:26:32 UTC (rev 6555) @@ -437,6 +437,7 @@ boolean showMeasurements = true; boolean frankOn = false; boolean centerPointer = true; + boolean zShade = false; //atoms and bonds @@ -479,9 +480,11 @@ // window - int argbBackground = 0xFF000000; - String stereoState = null; - boolean navigationMode = false; + int argbBackground = 0xFF000000; + String stereoState = null; + boolean navigationMode = false; + boolean navigationPeriodic = false; + boolean navigationCentered = false; String getWindowState() { StringBuffer str = new StringBuffer("# window state;\n# height " + viewer.getScreenHeight() Modified: trunk/Jmol/src/org/jmol/viewer/SticksRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/SticksRenderer.java 2006-12-31 04:18:19 UTC (rev 6554) +++ trunk/Jmol/src/org/jmol/viewer/SticksRenderer.java 2006-12-31 04:26:32 UTC (rev 6555) @@ -53,7 +53,7 @@ short madBond; void render() { - asBits = viewer.getTestFlag2(); + asBits = false;//viewer.getTestFlag2(); endcaps = Graphics3D.ENDCAPS_SPHERICAL; showMultipleBonds = viewer.getShowMultipleBonds(); @@ -63,7 +63,6 @@ hbondsBackbone = viewer.getHbondsBackbone(); bondsBackbone = hbondsBackbone | ssbondsBackbone; hbondsSolid = viewer.getHbondsSolid(); - Bond[] bonds = frame.bonds; for (int i = frame.bondCount; --i >= 0; ) { Bond bond = bonds[i]; @@ -198,9 +197,9 @@ } else { if (lineBond) g3d.drawLine(colixA, colixB, xA, yA, zA, xB, yB, zB); - else if (asBits) // time test shows bitset method to be slower - g3d.fillCylinderBits(colixA, colixB, endcaps, - width, xA, yA, zA, xB, yB, zB); + // else if (asBits) // time test shows bitset method to be slower + // g3d.fillCylinderBits(colixA, colixB, endcaps, + // width, xA, yA, zA, xB, yB, zB); else g3d.fillCylinder(colixA, colixB, endcaps, width, xA, yA, zA, xB, yB, zB); Modified: trunk/Jmol/src/org/jmol/viewer/TransformManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/TransformManager.java 2006-12-31 04:18:19 UTC (rev 6554) +++ trunk/Jmol/src/org/jmol/viewer/TransformManager.java 2006-12-31 04:26:32 UTC (rev 6555) @@ -29,6 +29,9 @@ import javax.vecmath.Matrix4f; import javax.vecmath.Matrix3f; import javax.vecmath.AxisAngle4f; + +import org.jmol.util.Logger; + import java.util.Hashtable; abstract class TransformManager { @@ -56,6 +59,13 @@ abstract protected void calcCameraFactors(); /** + * calculate the perspective factor based on z + * @param z + * @return perspectiveFactor + */ + abstract protected float getPerspectiveFactor(float z); + + /** * sets slab and depth, possibly using visual range considerations * for setting the slab-clipping plane. (slab on; slab 0) * @@ -90,6 +100,7 @@ matrixRotate.setIdentity(); // no rotations setZoomEnabled(true); zoomToPercent(100); + zoomPercent = zoomPercentSetting; scaleFitToScreen(); if (isNavigationMode) setNavigationMode(true); @@ -552,20 +563,6 @@ zoomToPercent(percent); } - protected float getPerspectiveFactor(float z) { - // all z's SHOULD be >= 0 - // so the more positive z is, the smaller the screen scale - //new idea: phase out perspective depth when zoom is very large. - //zoomPercent 1000 or larger starts removing this effect - //we can go up to 200000 - float factor = (z <= 0 ? perspectiveScale : perspectiveScale / z); - if (zoomPercent >= MAXIMUM_ZOOM_PERSPECTIVE_DEPTH) - factor += (zoomPercent - MAXIMUM_ZOOM_PERSPECTIVE_DEPTH) - / (MAXIMUM_ZOOM_PERCENTAGE - MAXIMUM_ZOOM_PERSPECTIVE_DEPTH) - * (1 - factor); - return factor; - } - float getZoomPercentFloat() { return zoomPercent; } @@ -843,7 +840,8 @@ */ protected boolean perspectiveDepth = true; - protected float cameraDepth = 3f; + protected float cameraDepth = Float.NaN; + protected float cameraDepthSetting = 3f; protected float visualRange = 5f; protected float observerOffset; protected float cameraDistance = 1000f; // prevent divide by zero on startup @@ -866,10 +864,12 @@ * @param percent */ void setCameraDepthPercent(float percent) { + resetNavigationPoint(); float screenMultiples = (percent < 0 ? -percent / 100 : percent); if (screenMultiples == 0) return; - cameraDepth = screenMultiples; + cameraDepthSetting = screenMultiples; + cameraDepth = Float.NaN; } void setVisualRange(float angstroms) { @@ -967,7 +967,7 @@ } short scaleToScreen(int z, int milliAngstroms) { - if (milliAngstroms == 0) + if (milliAngstroms == 0 || z < 2) return 0; int pixelSize = (int) scaleToPerspective(z, milliAngstroms * scalePixelsPerAngstrom / 1000); return (short) (pixelSize > 0 ? pixelSize : 1); @@ -1010,8 +1010,6 @@ void setNavigationMode(boolean TF) { isNavigationMode = (TF && canNavigate()); resetNavigationPoint(); - if (isNavigationMode) - setPerspectiveDepth(true); } boolean getNavigating() { @@ -1059,6 +1057,9 @@ // note that the image is still centered at 0, 0 in the xy plane + if (Logger.isActiveLevel(Logger.LEVEL_DEBUG)) + Logger.debug("modelCenterOffset + matrixTransform: " +modelCenterOffset+matrixTransform); + } void transformPoints(int count, Point3f[] angstroms, Point3i[] screens) { @@ -1729,7 +1730,7 @@ vibrationScale = 0; } - /*private*/ class VibrationThread extends Thread implements Runnable { + private class VibrationThread extends Thread implements Runnable { public void run() { long startTime = System.currentTimeMillis(); Modified: trunk/Jmol/src/org/jmol/viewer/TransformManager10.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/TransformManager10.java 2006-12-31 04:18:19 UTC (rev 6554) +++ trunk/Jmol/src/org/jmol/viewer/TransformManager10.java 2006-12-31 04:26:32 UTC (rev 6555) @@ -45,6 +45,10 @@ //(s) screen coordinates = (m) * screenPixelsPerAngstrom //(p) plane coordinates = (s) / screenPixelCount + if (Float.isNaN(cameraDepth)) { + cameraDepth = cameraDepthSetting; + } + // distance from the front plane of the model at zoom=100, where p=0 cameraDistance = cameraDepth * screenPixelCount; //(s) @@ -72,6 +76,20 @@ observerOffset = 0; //(s) } + protected float getPerspectiveFactor(float z) { + // all z's SHOULD be >= 0 + // so the more positive z is, the smaller the screen scale + //new idea: phase out perspective depth when zoom is very large. + //zoomPercent 1000 or larger starts removing this effect + //we can go up to 200000 + float factor = (z <= 0 ? perspectiveScale : perspectiveScale / z); + if (zoomPercent >= MAXIMUM_ZOOM_PERSPECTIVE_DEPTH) + factor += (zoomPercent - MAXIMUM_ZOOM_PERSPECTIVE_DEPTH) + / (MAXIMUM_ZOOM_PERCENTAGE - MAXIMUM_ZOOM_PERSPECTIVE_DEPTH) + * (1 - factor); + return factor; + } + protected void calcSlabAndDepthValues() { slabValue = 0; depthValue = Integer.MAX_VALUE; Modified: trunk/Jmol/src/org/jmol/viewer/TransformManager11.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/TransformManager11.java 2006-12-31 04:18:19 UTC (rev 6554) +++ trunk/Jmol/src/org/jmol/viewer/TransformManager11.java 2006-12-31 04:26:32 UTC (rev 6555) @@ -53,6 +53,11 @@ //(s) screen coordinates = (m) * screenPixelsPerAngstrom //(p) plane coordinates = (s) / screenPixelCount + if (Float.isNaN(cameraDepth)) { + cameraDepth = cameraDepthSetting; + zoomFactor = Float.NaN; + } + // factor to apply as part of the transform (not used here) cameraScaleFactor = 1; //unitless @@ -98,6 +103,10 @@ } } + protected float getPerspectiveFactor(float z) { + return (z <= 0 ? perspectiveScale : perspectiveScale / z); + } + protected void calcSlabAndDepthValues() { slabValue = 0; depthValue = Integer.MAX_VALUE; @@ -106,9 +115,10 @@ if (perspectiveDepth && visualRange > 0 && slabPercentSetting == 0) { slabValue = (int) observerOffset; depthValue = Integer.MAX_VALUE; + depthValue = (int)(radius + modelCenterOffset); if (Logger.isActiveLevel(Logger.LEVEL_DEBUG)) Logger.debug("\n" + "\nperspectiveScale: " + perspectiveScale - + " screenPixelCount: " + screenPixelCount + + " screenPixelCount: " + screenPixelCount + "\nmodelTrailingEdge: " + (modelCenterOffset + radius) + "\nmodelCenterOffset: " + modelCenterOffset + " radius: " + radius + "\nmodelLeadingEdge: " + (modelCenterOffset - radius) @@ -212,12 +222,13 @@ //no release from navigation mode if too far zoomed in! if (zoomPercent < 5 && !isNavigationMode) { - isNavigationMode = true; + isNavigationMode = perspectiveDepth = true; return; } if (isNavigationMode) { navMode = NAV_MODE_RESET; slabPercentSetting = 0; + perspectiveDepth = true; } else { slabPercentSetting = 100; } @@ -254,7 +265,7 @@ navMode = NAV_MODE_NEWXYZ; break; } - navigationZOffset -= 5 * multiplier; + navigationZOffset -= 5 *(viewer.getNavigationPeriodic() ? 1 : multiplier); navMode = NAV_MODE_NEWZ; break; case KeyEvent.VK_DOWN: @@ -268,7 +279,7 @@ navMode = NAV_MODE_NEWXYZ; break; } - navigationZOffset += 5 * multiplier; + navigationZOffset += 5 *(viewer.getNavigationPeriodic() ? 1 : multiplier); navMode = NAV_MODE_NEWZ; break; case KeyEvent.VK_LEFT: @@ -398,7 +409,7 @@ case NAV_MODE_NONE: //update fixed rotation offset and find the new 3D navigation center fixedRotationOffset.set(fixedTranslation); - //fall through + //fall through case NAV_MODE_NEWXY: // redefine the navigation center based on its old screen position findCenterAt(fixedRotationCenter, navigationOffset, navigationCenter); @@ -420,12 +431,39 @@ unTransformPoint(navigationOffset, navigationCenter); break; } + if (viewer.getNavigationCentered()) { + fixedRotationOffset.set(navigationCenter); + } matrixTransform(navigationCenter, referenceOffset); + if (viewer.getNavigationPeriodic()) { + // but if periodic, then the navigationCenter may have to be moved back a notch + viewer.toUnitCell(navigationCenter, null); + if (pointT.distance(navigationCenter) > 0.01) { + matrixTransform(navigationCenter, pointT); + float dz = referenceOffset.z - pointT.z; + //the new navigation center determines the navigationZOffset + navigationZOffset += dz; + calcCameraFactors(); + calcTransformMatrix(); + matrixTransform(navigationCenter, referenceOffset); + } + } transformPoint(fixedRotationCenter, fixedTranslation); + /* + if (viewer.getNavigationCentered()) { + fixedRotationCenter.set(navigationCenter); + navigationZOffset -= referenceOffset.z; + calcCameraFactors(); + calcTransformMatrix(); + matrixTransform(navigationCenter, referenceOffset); + transformPoint(fixedRotationCenter, fixedTranslation); + } + */ fixedRotationOffset.set(fixedTranslation); transformPoint(navigationCenter, navigationOffset); navigationOffset.z = observerOffset; navMode = NAV_MODE_NONE; + } /** Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2006-12-31 04:18:19 UTC (rev 6554) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2006-12-31 04:26:32 UTC (rev 6555) @@ -310,6 +310,7 @@ setSpecularPercent(global.specularPercent); setSpecularExponent(global.specularExponent); setSpecularPower(global.specularPower); + setZShade(false); } String listSavedStates() { @@ -670,7 +671,7 @@ //FrameRenderer transformManager.finalizeTransformParameters(); g3d.setSlabAndDepthValues(transformManager.slabValue, - transformManager.depthValue); + transformManager.depthValue, global.zShade); } Point3i transformPoint(Point3f pointAngstroms) { @@ -929,6 +930,14 @@ return global.getSpecularState(); } + private void setZShade(boolean TF) { + global.zShade = TF; + } + + boolean getZShade() { + return global.zShade; + } + private void setAmbientPercent(int ambientPercent) { //Eval colorManager.setAmbientPercent(ambientPercent); @@ -1727,13 +1736,20 @@ return modelManager.findAtomsInRectangle(rectRubberBand); } - void convertFractionalCoordinates(Point3f pt) { + void toCartesian(Point3f pt) { int modelIndex = getCurrentModelIndex(); if (modelIndex < 0) return; - modelManager.convertFractionalCoordinates(modelIndex, pt); + modelManager.toCartesian(modelIndex, pt); } + void toUnitCell(Point3f pt, Point3f offset) { + int modelIndex = getCurrentModelIndex(); + if (modelIndex < 0) + return; + modelManager.toUnitCell(modelIndex, pt, offset); + } + public void setCenterSelected() { //depricated setCenterBitSet(selectionManager.bsSelection, true); @@ -3420,6 +3436,18 @@ boolean notFound = false; while (true) { ///11.1/// + if (key.equalsIgnoreCase("navigationCentered")) { + setNavigationCentered(value); + break; + } + if (key.equalsIgnoreCase("navigationPeriodic")) { + setNavigationPeriodic(value); + break; + } + if (key.equalsIgnoreCase("zShade")) { + setZShade(value); + break; + } if (key.equalsIgnoreCase("drawHover")) { setDrawHover(value); break; @@ -3960,6 +3988,22 @@ global.hideNameInPopup = hideNameInPopup; } + private void setNavigationPeriodic(boolean TF) { + global.navigationPeriodic = TF; + } + + boolean getNavigationPeriodic() { + return global.navigationPeriodic; + } + + private void setNavigationCentered(boolean TF) { + global.navigationCentered = TF; + } + + boolean getNavigationCentered() { + return global.navigationCentered; + } + private void setNavigationMode(boolean TF) { global.navigationMode = TF; if (TF && !transformManager.canNavigate()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hansonr@us...> - 2006-12-31 04:18:21
|
Revision: 6554 http://svn.sourceforge.net/jmol/?rev=6554&view=rev Author: hansonr Date: 2006-12-30 20:18:19 -0800 (Sat, 30 Dec 2006) Log Message: ----------- adds select atomX, atomY, atomZ comparison atom properties (tokens) Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Token.java Modified: trunk/Jmol/src/org/jmol/viewer/Token.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Token.java 2006-12-31 04:17:41 UTC (rev 6553) +++ trunk/Jmol/src/org/jmol/viewer/Token.java 2006-12-31 04:18:19 UTC (rev 6554) @@ -354,6 +354,10 @@ final static int psi = atomproperty | 21; final static int partialCharge = atomproperty | 22; + final static int atomX = atomproperty | 23; + final static int atomY = atomproperty | 24; + final static int atomZ = atomproperty | 25; + final static int opGT = comparator | 0; final static int opGE = comparator | 1; final static int opLE = comparator | 2; @@ -754,9 +758,9 @@ "dash", new Token(dash, "dash"), "user", new Token(user, "user"), -// "x", new Token(x, "x"), -// "y", new Token(y, "y"), -// "z", new Token(z, "z"), + "atomx", new Token(atomX, "atomx"), + "atomy", new Token(atomY, "atomy"), + "atomz", new Token(atomZ, "atomz"), "*", new Token(asterisk, "*"), "all", tokenAll, "none", new Token(none, "none"), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hansonr@us...> - 2006-12-31 04:17:42
|
Revision: 6553 http://svn.sourceforge.net/jmol/?rev=6553&view=rev Author: hansonr Date: 2006-12-30 20:17:41 -0800 (Sat, 30 Dec 2006) Log Message: ----------- adds select atomX, atomY, atomZ comparison atom properties Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Compiler.java Modified: trunk/Jmol/src/org/jmol/viewer/Compiler.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Compiler.java 2006-12-31 04:15:54 UTC (rev 6552) +++ trunk/Jmol/src/org/jmol/viewer/Compiler.java 2006-12-31 04:17:41 UTC (rev 6553) @@ -1291,6 +1291,9 @@ case Token.phi: case Token.surfacedistance: case Token.temperature: + case Token.atomX: + case Token.atomY: + case Token.atomZ: // int = decimal here, but comparator has to use decmimal * 100 val *= 100; // fall through This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hansonr@us...> - 2006-12-31 04:15:55
|
Revision: 6552 http://svn.sourceforge.net/jmol/?rev=6552&view=rev Author: hansonr Date: 2006-12-30 20:15:54 -0800 (Sat, 30 Dec 2006) Log Message: ----------- allows for wider range of unit cell loading and adds toUnitCell() method needed for periodic navigation Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java trunk/Jmol/src/org/jmol/symmetry/UnitCell.java Modified: trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java 2006-12-31 04:14:04 UTC (rev 6551) +++ trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java 2006-12-31 04:15:54 UTC (rev 6552) @@ -367,9 +367,12 @@ void setLatticeCells(int[] latticeCells) { //set when unit cell is determined - //large numbers for x or y indicate that z is 0 (don't normalize) or 1 (normalize) + // x <= 555 and y >= 555 indicate a range of cells to load + // AROUND the central cell 555 and that + // we should normalize (z = 1) or not (z = 0) this.latticeCells = latticeCells; - doNormalize = (latticeCells[0] < 9 && latticeCells[1] < 9 || latticeCells[2] != 0); + isLatticeRange = (latticeCells[2] == 0 || latticeCells[2] == 1) && (latticeCells[0] <= 555 && latticeCells[1] >= 555); + doNormalize = (!isLatticeRange || latticeCells[2] == 1); } boolean setNotionalUnitCell(float[] info) { @@ -412,6 +415,7 @@ } boolean doNormalize = true; + boolean isLatticeRange = false; void applySymmetry(int maxX, int maxY, int maxZ) { if (!coordinatesAreFractional || spaceGroup == null) @@ -426,7 +430,9 @@ int minX = 0; int minY = 0; int minZ = 0; - if (maxX > 9 || maxY > 9) { + if (isLatticeRange) { + //alternative format for indicating a range of cells: + //{111 666} //555 --> {0 0 0} minX = (maxX / 100) - 5; minY = (maxX % 100) / 10 - 5; Modified: trunk/Jmol/src/org/jmol/symmetry/UnitCell.java =================================================================== --- trunk/Jmol/src/org/jmol/symmetry/UnitCell.java 2006-12-31 04:14:04 UTC (rev 6551) +++ trunk/Jmol/src/org/jmol/symmetry/UnitCell.java 2006-12-31 04:15:54 UTC (rev 6552) @@ -73,6 +73,19 @@ matrixCartesianToFractional.transform(pt); } + public final void toUnitCell(Point3f pt, Point3f offset) { + if (matrixCartesianToFractional == null) + return; + matrixCartesianToFractional.transform(pt); + pt.x = (float)(pt.x - Math.floor(pt.x)); + pt.y = (float)(pt.y - Math.floor(pt.y)); + pt.z = (float)(pt.z - Math.floor(pt.z)); + if (offset == null) + offset = fractionalOffset; + pt.add(offset); + matrixFractionalToCartesian.transform(pt); + } + public void setOffset(Point3f pt) { // from "unitcell {i j k}" via uccage fractionalOffset.set(pt); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hansonr@us...> - 2006-12-31 04:14:07
|
Revision: 6551 http://svn.sourceforge.net/jmol/?rev=6551&view=rev Author: hansonr Date: 2006-12-30 20:14:04 -0800 (Sat, 30 Dec 2006) Log Message: ----------- adds g3d zShading capability (shadowy distant atoms) Modified Paths: -------------- trunk/Jmol/src/org/jmol/g3d/Cylinder3D.java trunk/Jmol/src/org/jmol/g3d/Graphics3D.java trunk/Jmol/src/org/jmol/g3d/Sphere3D.java Modified: trunk/Jmol/src/org/jmol/g3d/Cylinder3D.java =================================================================== --- trunk/Jmol/src/org/jmol/g3d/Cylinder3D.java 2006-12-29 17:52:29 UTC (rev 6550) +++ trunk/Jmol/src/org/jmol/g3d/Cylinder3D.java 2006-12-31 04:14:04 UTC (rev 6551) @@ -68,6 +68,8 @@ int sampleCount; boolean notClipped; + private int zShift; + void render(short colixA, short colixB, byte endcaps, int diameter, int xA, int yA, int zA, int xB, int yB, int zB) { if (diameter > g3d.height * 3) @@ -85,6 +87,8 @@ dxB = xB - xA; dyB = yB - yA; dzB = zB - zA; + + zShift = g3d.getZShift((zA + zB) >> 1); if (diameter <= 1) { line3d.plotLineDelta(g3d.getColixArgb(colixA), Graphics3D @@ -96,12 +100,12 @@ this.xA = xA; this.yA = yA; this.zA = zA; - this.shadesA = g3d.getShades(this.colixA = colixA); - this.shadesB = g3d.getShades(this.colixB = colixB); - this.isScreenedA = (colixA & Graphics3D.TRANSLUCENT_MASK) != 0; - this.isScreenedB = (colixB & Graphics3D.TRANSLUCENT_MASK) != 0; + this.endcaps = endcaps; + shadesA = g3d.getShades(this.colixA = colixA); + shadesB = g3d.getShades(this.colixB = colixB); + isScreenedA = (colixA & Graphics3D.TRANSLUCENT_MASK) != 0; + isScreenedB = (colixB & Graphics3D.TRANSLUCENT_MASK) != 0; - this.endcaps = endcaps; calcArgbEndcap(true); generateBaseEllipse(); @@ -175,7 +179,7 @@ } private void plotRasterBits(int i) { - int fp8Up = fp8IntensityUp[i]; + int fpz = fp8IntensityUp[i] >> (8 + zShift); int x = xRaster[i]; int y = yRaster[i]; int z = zRaster[i]; @@ -193,7 +197,7 @@ } } line3d.plotLineDeltaBits(shadesA, isScreenedA, shadesB, isScreenedB, - fp8Up >> 8, xA + x, yA + y, zA - z, dxB, dyB, dzB, notClipped); + fpz, xA + x, yA + y, zA - z, dxB, dyB, dzB, notClipped); if (endcaps == Graphics3D.ENDCAPS_OPEN) { line3d.plotLineDelta(shadesA[0], isScreenedA, shadesB[0], isScreenedB, xA - x, yA - y, zA + z, dxB, dyB, dzB, notClipped); @@ -219,9 +223,9 @@ this.yTip = yTip; this.zTip = zTip; - this.colixA = colix; - this.shadesA = g3d.getShades(colix); - this.isScreenedA = (colixA & Graphics3D.TRANSLUCENT_MASK) != 0; + colixA = colix; + shadesA = g3d.getShades(colix); + isScreenedA = (colixA & Graphics3D.TRANSLUCENT_MASK) != 0; int intensityTip = Shade3D.calcIntensity(dxB, dyB, -dzB); g3d.plotPixelClipped(shadesA[intensityTip], isScreenedA, (int) xTip, (int) yTip, (int) zTip); @@ -412,7 +416,7 @@ } private void plotRaster(int i) { - int fp8Up = fp8IntensityUp[i]; + int fpz = fp8IntensityUp[i] >> (8 + zShift); int x = xRaster[i]; int y = yRaster[i]; int z = zRaster[i]; @@ -430,7 +434,7 @@ } } line3d.plotLineDelta(shadesA, isScreenedA, shadesB, isScreenedB, - fp8Up >> 8, xA + x, yA + y, zA - z, dxB, dyB, dzB, notClipped); + fpz, xA + x, yA + y, zA - z, dxB, dyB, dzB, notClipped); if (endcaps == Graphics3D.ENDCAPS_OPEN) { line3d.plotLineDelta(shadesA[0], isScreenedA, shadesB[0], isScreenedB, xA - x, yA - y, zA + z, dxB, dyB, dzB, notClipped); @@ -559,18 +563,18 @@ g3d.plotPixelClipped(argbEndcap, isScreenedA, (int) xDn, (int) yDn, (int) zDn); } - int fp8Up = fp8IntensityUp[i]; + int fpz = fp8IntensityUp[i] >> (8 + zShift); line3d.plotLineDelta(shadesA, isScreenedA, shadesA, isScreenedA, - fp8Up >> 8, (int) xUp, (int) yUp, (int) zUp, (int) Math + fpz, (int) xUp, (int) yUp, (int) zUp, (int) Math .ceil(xTip - xUp), (int) Math.ceil(yTip - yUp), (int) Math .ceil(zTip - zUp), false); line3d.plotLineDelta(shadesA, isScreenedA, shadesA, isScreenedA, - fp8Up >> 8, (int) xUp, (int) yUp + 1, (int) zUp, (int) Math.ceil(xTip + fpz, (int) xUp, (int) yUp + 1, (int) zUp, (int) Math.ceil(xTip - xUp), (int) Math.ceil(yTip - yUp) + 1, (int) Math .ceil(zTip - zUp), false); line3d.plotLineDelta(shadesA, isScreenedA, shadesA, isScreenedA, - fp8Up >> 8, (int) xUp + 1, (int) yUp, (int) zUp, (int) Math.ceil(xTip + fpz, (int) xUp + 1, (int) yUp, (int) zUp, (int) Math.ceil(xTip - xUp) + 1, (int) Math.ceil(yTip - yUp), (int) Math .ceil(zTip - zUp), false); Modified: trunk/Jmol/src/org/jmol/g3d/Graphics3D.java =================================================================== --- trunk/Jmol/src/org/jmol/g3d/Graphics3D.java 2006-12-29 17:52:29 UTC (rev 6550) +++ trunk/Jmol/src/org/jmol/g3d/Graphics3D.java 2006-12-31 04:14:04 UTC (rev 6551) @@ -71,6 +71,7 @@ int width, height; int displayMinX, displayMaxX, displayMinY, displayMaxY; int slab, depth; + boolean zShade; int xLast, yLast; int[] pbuf; int[] zbuf; @@ -222,16 +223,21 @@ *<p> * @param slabValue front clipping percentage [0,100] * @param depthValue rear clipping percentage [0,100] + * @param zShade whether to shade along z front to back */ - public void setSlabAndDepthValues(int slabValue, int depthValue) { - slab = - slabValue < 0 ? 0 - : slabValue > ZBUFFER_BACKGROUND ? ZBUFFER_BACKGROUND : slabValue; - depth = - depthValue < 0 ? 0 - : depthValue > ZBUFFER_BACKGROUND ? ZBUFFER_BACKGROUND : depthValue; + public void setSlabAndDepthValues(int slabValue, int depthValue, + boolean zShade) { + slab = slabValue < 0 ? 0 + : slabValue > ZBUFFER_BACKGROUND ? ZBUFFER_BACKGROUND : slabValue; + depth = depthValue < 0 ? 0 + : depthValue > ZBUFFER_BACKGROUND ? ZBUFFER_BACKGROUND : depthValue; + this.zShade = zShade; } + int getZShift(int z) { + return (zShade ? (z - slab) * 5 / (depth - slab): 0); + } + /** * used internally when oversampling is enabled */ @@ -345,6 +351,7 @@ } } + /** * fills a solid sphere * Modified: trunk/Jmol/src/org/jmol/g3d/Sphere3D.java =================================================================== --- trunk/Jmol/src/org/jmol/g3d/Sphere3D.java 2006-12-29 17:52:29 UTC (rev 6550) +++ trunk/Jmol/src/org/jmol/g3d/Sphere3D.java 2006-12-31 04:14:04 UTC (rev 6551) @@ -57,6 +57,8 @@ private final static int maxSphereDiameter = 1000; private static int[][] sphereShapeCache = new int[maxSphereCache][]; + private int zShift; + static void flushImageCache() { sphereShapeCache = new int[maxSphereCache][]; } @@ -77,6 +79,7 @@ int minZ = z - radius, maxZ = z + radius; if (maxZ < g3d.slab || minZ > g3d.depth) return; + zShift = g3d.getZShift(z); if (diameter >= maxSphereCache) { if (diameter > maxSphereDiameter) return; @@ -97,6 +100,7 @@ int[] pbuf = g3d.pbuf; int[] zbuf = g3d.zbuf; int offsetSphere = 0; + int width = g3d.width; int evenSizeCorrection = 1 - (diameter & 1); int offsetSouthCenter = width * y + x; @@ -114,19 +118,19 @@ int zPixel = z - (packed & 0x7F); if (zPixel < zbuf[offsetSE]) { zbuf[offsetSE] = zPixel; - pbuf[offsetSE] = shades[(packed >> 7) & 0x3F]; + pbuf[offsetSE] = shades[((packed >> 7) & 0x3F) >> zShift]; } if (zPixel < zbuf[offsetSW]) { zbuf[offsetSW] = zPixel; - pbuf[offsetSW] = shades[(packed >> 13) & 0x3F]; + pbuf[offsetSW] = shades[((packed >> 13) & 0x3F) >> zShift]; } if (zPixel < zbuf[offsetNE]) { zbuf[offsetNE] = zPixel; - pbuf[offsetNE] = shades[(packed >> 19) & 0x3F]; + pbuf[offsetNE] = shades[((packed >> 19) & 0x3F) >> zShift]; } if (zPixel < zbuf[offsetNW]) { zbuf[offsetNW] = zPixel; - pbuf[offsetNW] = shades[(packed >> 25) & 0x3F]; + pbuf[offsetNW] = shades[((packed >> 25) & 0x3F) >> zShift]; } ++offsetSE; --offsetSW; @@ -158,19 +162,19 @@ int zPixel = z - (packed & 0x7F); if ((flipflops & 1) != 0 && zPixel < zbuf[offsetSE]) { zbuf[offsetSE] = zPixel; - pbuf[offsetSE] = shades[(packed >> 7) & 0x3F]; + pbuf[offsetSE] = shades[((packed >> 7) & 0x3F)>>zShift]; } if ((flipflops & 2) != 0 && zPixel < zbuf[offsetSW]) { zbuf[offsetSW] = zPixel; - pbuf[offsetSW] = shades[(packed >> 13) & 0x3F]; + pbuf[offsetSW] = shades[((packed >> 13) & 0x3F)>>zShift]; } if ((flipflops & 4) != 0 && zPixel < zbuf[offsetNE]) { zbuf[offsetNE] = zPixel; - pbuf[offsetNE] = shades[(packed >> 19) & 0x3F]; + pbuf[offsetNE] = shades[((packed >> 19) & 0x3F)>>zShift]; } if ((flipflops & 8) != 0 && zPixel < zbuf[offsetNW]) { zbuf[offsetNW] = zPixel; - pbuf[offsetNW] = shades[(packed >> 25) & 0x3F]; + pbuf[offsetNW] = shades[((packed >> 25) & 0x3F)>>zShift]; } ++offsetSE; --offsetSW; @@ -244,7 +248,7 @@ int i = (packed >> 7) & 0x3F; if (isCore) i = SHADE_SLAB_CLIPPED - 3 + ((randu >> 7) & 0x07); - pbuf[offsetSE] = shades[i]; + pbuf[offsetSE] = shades[i >> zShift]; } if (tWestVisible && (!tScreened || (flipflops & 2) != 0) && zPixel < zbuf[offsetSW]) { @@ -252,7 +256,7 @@ int i = (packed >> 13) & 0x3F; if (isCore) i = SHADE_SLAB_CLIPPED - 3 + ((randu >> 13) & 0x07); - pbuf[offsetSW] = shades[i]; + pbuf[offsetSW] = shades[i >> zShift]; } } if (tNorthVisible) { @@ -262,7 +266,7 @@ int i = (packed >> 19) & 0x3F; if (isCore) i = SHADE_SLAB_CLIPPED - 3 + ((randu >> 19) & 0x07); - pbuf[offsetNE] = shades[i]; + pbuf[offsetNE] = shades[i >> zShift]; } if (tWestVisible && (!tScreened || (flipflops & 8) != 0) && zPixel < zbuf[offsetNW]) { @@ -270,7 +274,7 @@ int i = (packed >> 25) & 0x3F; if (isCore) i = SHADE_SLAB_CLIPPED - 3 + ((randu >> 25) & 0x07); - pbuf[offsetNW] = shades[i]; + pbuf[offsetNW] = shades[i >> zShift]; } } } @@ -462,7 +466,7 @@ if (zbuf[offsetPbuf] <= z0) continue; int x8 = ((j * xSign + radius) << 8) / dDivisor; - pbuf[offsetPbuf] = shades[sphereIntensities[(y8 << 8) + x8]]; + pbuf[offsetPbuf] = shades[sphereIntensities[((y8 << 8) + x8) >> zShift]]; zbuf[offsetPbuf] = z0; } } @@ -544,7 +548,7 @@ int x8 = ((j * xSign + radius) << 8) / dDivisor; s = sphereIntensities[(y8 << 8) + x8]; } - pbuf[offsetPbuf] = shades[s]; + pbuf[offsetPbuf] = shades[s >> zShift]; zbuf[offsetPbuf] = zPixel; } // randu is failing me and generating moire patterns :-( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |