Package org.jmol.navigate
Class Navigator
- java.lang.Object
-
- java.lang.Thread
-
- org.jmol.thread.JmolThread
-
- org.jmol.navigate.Navigator
-
- All Implemented Interfaces:
java.lang.Runnable,JmolNavigatorInterface
public final class Navigator extends JmolThread implements JmolNavigatorInterface
Navigator is a user input mechanism that utilizes the keypad to drive through the model. It is created by reflection only from org.jmol.viewer.TransformManager
-
-
Field Summary
Fields Modifier and Type Field Description private javajs.util.V3aaStepCenterprivate javajs.util.V3axisprivate javajs.util.P3centerprivate javajs.util.P3centerStartprivate floatdegreesprivate floatdegreeStepprivate floatdepthDeltaprivate floatdepthPercentprivate floatdepthStartprivate floatfloatSecondsTotalprivate intframeTimeMillisprivate intiListprivate booleanisNavToprivate booleanisPathGuideprivate booleanisStepprivate intiStepprivate intmultiplierprivate javajs.util.Lst<java.lang.Object[]>navigationListprivate intnHitsprivate javajs.util.P3[]pointGuidesprivate javajs.util.P3[]pointsprivate TransformManagertmprivate inttotalStepsprivate floatxTransprivate floatxTransDeltaprivate floatxTransStartprivate floatyTransprivate floatyTransDeltaprivate floatyTransStart-
Fields inherited from class org.jmol.thread.JmolThread
CHECK1, CHECK2, CHECK3, currentTime, eval, FINISH, haveReference, hoverEnabled, INIT, isJS, isReset, lastRepaintTime, MAIN, name, sc, sleepTime, startTime, stopped, targetTime, vwr
-
-
Constructor Summary
Constructors Constructor Description Navigator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidalignZX(javajs.util.P3 pt0, javajs.util.P3 pt1, javajs.util.P3 ptVectorWing)brings pt0-pt1 vector to [0 0 -1], then rotates about [0 0 1] until ptVectorWing is in xz planeprivate voidcalcNavigationDepthPercent()voidcalcNavigationPoint()private voidcalcNavSlabAndDepthValues()private voiddoNavStep(int iStep)private floatgetNavigationSlabOffsetPercent()java.lang.StringgetNavigationState()voidnavigate(float seconds, javajs.util.P3[][] pathGuide, javajs.util.P3[] path, float[] theta, int indexStart, int indexEnd)voidnavigateAxis(javajs.util.V3 rotAxis, float degrees)voidnavigateKey(int keyCode, int modifiers)voidnavigateList(JmolScriptEvaluator eval, javajs.util.Lst<java.lang.Object[]> list)voidnavigateTo(float seconds, javajs.util.V3 axis, float degrees, javajs.util.P3 center, float depthPercent, float xTrans, float yTrans)voidnavTranslatePercentOrTo(float seconds, float x, float y)private voidnewNavigationCenter()We do not want the fixed navigation offset to change, but we need a new model-based equivalent position.private voidnextList(int i, javajs.util.P3 ptTemp)protected voidoops(java.lang.Exception e)protected voidrun1(int mode)voidset(TransformManager tm, Viewer vwr)voidsetNavigationDepthPercent(float percent)voidsetNavigationOffsetRelative()private voidsetNavPercent(javajs.util.P3 pt1)private voidsetupNav(float seconds, javajs.util.P3[][] pathGuide, javajs.util.P3[] path, int indexStart, int indexEnd)private voidsetupNavTo()voidzoomByFactor(float factor, int x, int y)-
Methods inherited from class org.jmol.thread.JmolThread
checkInterrupted, interrupt, reset, resumeEval, run, runSleep, setEval, setManager, setViewer, start
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jmol.api.JmolNavigatorInterface
interrupt
-
-
-
-
Field Detail
-
tm
private TransformManager tm
-
nHits
private int nHits
-
multiplier
private int multiplier
-
isPathGuide
private boolean isPathGuide
-
points
private javajs.util.P3[] points
-
pointGuides
private javajs.util.P3[] pointGuides
-
frameTimeMillis
private int frameTimeMillis
-
floatSecondsTotal
private float floatSecondsTotal
-
axis
private javajs.util.V3 axis
-
degrees
private float degrees
-
center
private javajs.util.P3 center
-
depthPercent
private float depthPercent
-
xTrans
private float xTrans
-
yTrans
private float yTrans
-
depthStart
private float depthStart
-
depthDelta
private float depthDelta
-
xTransStart
private float xTransStart
-
xTransDelta
private float xTransDelta
-
yTransStart
private float yTransStart
-
yTransDelta
private float yTransDelta
-
degreeStep
private float degreeStep
-
centerStart
private javajs.util.P3 centerStart
-
totalSteps
private int totalSteps
-
aaStepCenter
private javajs.util.V3 aaStepCenter
-
isNavTo
private boolean isNavTo
-
iStep
private int iStep
-
navigationList
private javajs.util.Lst<java.lang.Object[]> navigationList
-
iList
private int iList
-
isStep
private boolean isStep
-
-
Method Detail
-
set
public void set(TransformManager tm, Viewer vwr)
- Specified by:
setin interfaceJmolNavigatorInterface
-
navigateList
public void navigateList(JmolScriptEvaluator eval, javajs.util.Lst<java.lang.Object[]> list)
- Specified by:
navigateListin interfaceJmolNavigatorInterface
-
nextList
private void nextList(int i, javajs.util.P3 ptTemp)
-
setNavPercent
private void setNavPercent(javajs.util.P3 pt1)
-
navigateTo
public void navigateTo(float seconds, javajs.util.V3 axis, float degrees, javajs.util.P3 center, float depthPercent, float xTrans, float yTrans)- Specified by:
navigateToin interfaceJmolNavigatorInterface
-
navigate
public void navigate(float seconds, javajs.util.P3[][] pathGuide, javajs.util.P3[] path, float[] theta, int indexStart, int indexEnd)- Specified by:
navigatein interfaceJmolNavigatorInterface
-
run1
protected void run1(int mode) throws java.lang.InterruptedException- Specified by:
run1in classJmolThread- Throws:
java.lang.InterruptedException
-
doNavStep
private void doNavStep(int iStep)
-
setupNavTo
private void setupNavTo()
-
setupNav
private void setupNav(float seconds, javajs.util.P3[][] pathGuide, javajs.util.P3[] path, int indexStart, int indexEnd)
-
alignZX
private void alignZX(javajs.util.P3 pt0, javajs.util.P3 pt1, javajs.util.P3 ptVectorWing)brings pt0-pt1 vector to [0 0 -1], then rotates about [0 0 1] until ptVectorWing is in xz plane- Parameters:
pt0-pt1-ptVectorWing-
-
zoomByFactor
public void zoomByFactor(float factor, int x, int y)- Specified by:
zoomByFactorin interfaceJmolNavigatorInterface
-
calcNavigationPoint
public void calcNavigationPoint()
- Specified by:
calcNavigationPointin interfaceJmolNavigatorInterface
-
calcNavSlabAndDepthValues
private void calcNavSlabAndDepthValues()
-
newNavigationCenter
private void newNavigationCenter()
We do not want the fixed navigation offset to change, but we need a new model-based equivalent position. The fixed rotation center is at a fixed offset as well. This means that the navigationCenter must be recalculated based on its former offset in the new context. We have two points, N(navigation) and R(rotation). We know where they ARE: fixedNavigationOffset and fixedRotationOffset. From these we must derive navigationCenter.
-
setNavigationOffsetRelative
public void setNavigationOffsetRelative()
- Specified by:
setNavigationOffsetRelativein interfaceJmolNavigatorInterface
-
navigateKey
public void navigateKey(int keyCode, int modifiers)- Specified by:
navigateKeyin interfaceJmolNavigatorInterface
-
setNavigationDepthPercent
public void setNavigationDepthPercent(float percent)
- Specified by:
setNavigationDepthPercentin interfaceJmolNavigatorInterface
-
calcNavigationDepthPercent
private void calcNavigationDepthPercent()
-
getNavigationState
public java.lang.String getNavigationState()
- Specified by:
getNavigationStatein interfaceJmolNavigatorInterface
-
getNavigationSlabOffsetPercent
private float getNavigationSlabOffsetPercent()
-
navigateAxis
public void navigateAxis(javajs.util.V3 rotAxis, float degrees)- Specified by:
navigateAxisin interfaceJmolNavigatorInterface
-
navTranslatePercentOrTo
public void navTranslatePercentOrTo(float seconds, float x, float y)- Specified by:
navTranslatePercentOrToin interfaceJmolNavigatorInterface
-
oops
protected void oops(java.lang.Exception e)
- Overrides:
oopsin classJmolThread
-
-