From: <ha...@us...> - 2006-10-16 22:21:20
|
Revision: 5969 http://svn.sourceforge.net/jmol/?rev=5969&view=rev Author: hansonr Date: 2006-10-16 15:21:14 -0700 (Mon, 16 Oct 2006) Log Message: ----------- adds center to moveTo command -- effectively allows (protected) infinite zoom moveto 1.0 {point4f} zoom 45 45 (atomno=3) Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Eval.java trunk/Jmol/src/org/jmol/viewer/Token.java trunk/Jmol/src/org/jmol/viewer/TransformManager.java Modified: trunk/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Eval.java 2006-10-16 21:11:45 UTC (rev 5968) +++ trunk/Jmol/src/org/jmol/viewer/Eval.java 2006-10-16 22:21:14 UTC (rev 5969) @@ -1863,7 +1863,10 @@ if (i != statementLength) { center = atomCenterOrCoordinateParameter(i); i = pcLastExpressionInstruction + 1; - rotationRadius = floatParameter(i++); + if (i == statementLength) + rotationRadius = viewer.calcRotationRadius(center); + else + rotationRadius = floatParameter(i++); } refresh(); viewer.moveTo(floatSecondsTotal, center, pt, degrees, zoom, xTrans, yTrans, rotationRadius); Modified: trunk/Jmol/src/org/jmol/viewer/Token.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Token.java 2006-10-16 21:11:45 UTC (rev 5968) +++ trunk/Jmol/src/org/jmol/viewer/Token.java 2006-10-16 22:21:14 UTC (rev 5969) @@ -173,7 +173,7 @@ final static int halo = command | 85; final static int rocket = command | 86; final static int geosurface = command | 87; - final static int moveto = command | 88 | negnums; + final static int moveto = command | 88 | negnums | embeddedExpression; final static int bondorder = command | 89; final static int console = command | 90; final static int pmesh = command | 91; Modified: trunk/Jmol/src/org/jmol/viewer/TransformManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/TransformManager.java 2006-10-16 21:11:45 UTC (rev 5968) +++ trunk/Jmol/src/org/jmol/viewer/TransformManager.java 2006-10-16 22:21:14 UTC (rev 5969) @@ -733,6 +733,8 @@ float scaleToScreen(int z, float sizeAngstroms) { // all z's are >= 0 // so the more positive z is, the smaller the screen scale + if (z <= 0) + z = 1; float pixelSize = sizeAngstroms * scalePixelsPerAngstrom; if (perspectiveDepth) pixelSize = (pixelSize * cameraDistance) / z; @@ -740,6 +742,8 @@ } short scaleToScreen(int z, int milliAngstroms) { + if (z <= 0) + z = 1; if (milliAngstroms == 0) return 0; int pixelSize = (int) (milliAngstroms * scalePixelsPerAngstrom / 1000); @@ -751,9 +755,10 @@ } float scaleToPerspective(int z, float sizeAngstroms) { + if (z <= 0) + z = 1; return (perspectiveDepth - // mth 2004 04 02 ... what the hell is this ... must be a bug - ? (sizeAngstroms * cameraDistance) / +z // <-- ?? + ? (sizeAngstroms * cameraDistance) / z : sizeAngstroms); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |