From: <ha...@us...> - 2007-01-03 06:31:45
|
Revision: 6567 http://svn.sourceforge.net/jmol/?rev=6567&view=rev Author: hansonr Date: 2007-01-02 22:31:44 -0800 (Tue, 02 Jan 2007) Log Message: ----------- 11.1 navigation -- natural switch from navigation-centered to window-centered -- cursor color indicates this -- red (outside model) window-centered; -- gold (inside model) navigation-centered rotation. This make it harder to lose the model. Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/BallsRenderer.java trunk/Jmol/src/org/jmol/viewer/TransformManager.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 2007-01-03 06:12:14 UTC (rev 6566) +++ trunk/Jmol/src/org/jmol/viewer/BallsRenderer.java 2007-01-03 06:31:44 UTC (rev 6567) @@ -81,7 +81,7 @@ int x = Math.max(Math.min(viewer.getScreenWidth(),(int) T.x),0); int y = Math.max(Math.min(viewer.getScreenHeight(),(int) T.y),0); int z = (int) T.z + 1; - short colix = Graphics3D.GOLD; + short colix = (viewer.getNavigationCentered() ? Graphics3D.GOLD : Graphics3D.RED); g3d.drawLine(colix, colix, x - 10, y, z, x + 10, y, z); g3d.drawLine(colix, colix, x, y - 10, z, x, y + 10, z); g3d.drawLine(colix, colix, x - 4, y - 4, z, x + 6, y - 4, z); Modified: trunk/Jmol/src/org/jmol/viewer/TransformManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/TransformManager.java 2007-01-03 06:12:14 UTC (rev 6566) +++ trunk/Jmol/src/org/jmol/viewer/TransformManager.java 2007-01-03 06:31:44 UTC (rev 6567) @@ -2022,6 +2022,10 @@ } void setNavigationSlabOffset(float offset) { - } + } + boolean isNavigationCentered() { + return false; + } + } Modified: trunk/Jmol/src/org/jmol/viewer/TransformManager11.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/TransformManager11.java 2007-01-03 06:12:14 UTC (rev 6566) +++ trunk/Jmol/src/org/jmol/viewer/TransformManager11.java 2007-01-03 06:31:44 UTC (rev 6567) @@ -120,8 +120,8 @@ if (perspectiveDepth && visualRange > 0 && slabPercentSetting == 0) { slabValue = (int) (observerOffset - navigationSlabOffset / 100f * screenPixelCount); - depthValue = Integer.MAX_VALUE; - depthValue = (int) (radius + modelCenterOffset); + float depth = getNavigationDepthPercent(); + depthValue = (depth > 0 ? (int) (radius + modelCenterOffset) : Integer.MAX_VALUE); if (Logger.isActiveLevel(Logger.LEVEL_DEBUG)) Logger.debug("\n" + "\nperspectiveScale: " + perspectiveScale + " screenPixelCount: " + screenPixelCount @@ -130,7 +130,7 @@ + radius + "\nmodelLeadingEdge: " + (modelCenterOffset - radius) + "\nzoom: " + zoomPercent + " observerOffset/navDepth: " + observerOffset + "/" - + (((int) (100 * getNavigationDepthPercent())) / 100f) + + ((int) (100 * depth) / 100f) + " visualRange: " + visualRange + "\nnavX/Y/Z: " + navigationOffset.x + "/" + navigationOffset.y + "/" + navigationOffset.z + "/" + navigationZOffset + " navCenter:" @@ -403,7 +403,8 @@ * */ protected void calcNavigationPoint() { - isNavigationCentered = (getNavigationDepthPercent() < 100); + float depth = getNavigationDepthPercent(); + isNavigationCentered = (depth < 100 && depth > 0); if (!navigating && navMode != NAV_MODE_RESET) { // rotations are different from zoom changes if (isNavigationCentered && navMode != NAV_MODE_ZOOMED) @@ -695,6 +696,10 @@ return navigationCenter; } + boolean isNavigationCentered() { + return isNavigationCentered; + } + void setNavigationSlabOffset(float offset) { navigationSlabOffset = offset; } @@ -732,7 +737,8 @@ + StateManager.escape(getNavigationCenter()) + ";\nnavigate 0 translate " + getNavigationOffsetPercent('X') + " " + getNavigationOffsetPercent('Y') + ";\nset navigationDepth " - + getNavigationDepthPercent() + ";\n\n"; + + getNavigationDepthPercent() + ";\nset navigationSlab " + + navigationSlabOffset+ ";\n\n"; } } Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2007-01-03 06:12:14 UTC (rev 6566) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2007-01-03 06:31:44 UTC (rev 6567) @@ -404,6 +404,10 @@ return transformManager.getNavigationCenter(); } + boolean getNavigationCentered() { + return transformManager.isNavigationCentered(); + } + float getNavigationDepthPercent() { return transformManager.getNavigationDepthPercent(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |