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.V3
aaStepCenter
private javajs.util.V3
axis
private javajs.util.P3
center
private javajs.util.P3
centerStart
private float
degrees
private float
degreeStep
private float
depthDelta
private float
depthPercent
private float
depthStart
private float
floatSecondsTotal
private int
frameTimeMillis
private int
iList
private boolean
isNavTo
private boolean
isPathGuide
private boolean
isStep
private int
iStep
private int
multiplier
private javajs.util.Lst<java.lang.Object[]>
navigationList
private int
nHits
private javajs.util.P3[]
pointGuides
private javajs.util.P3[]
points
private TransformManager
tm
private int
totalSteps
private float
xTrans
private float
xTransDelta
private float
xTransStart
private float
yTrans
private float
yTransDelta
private float
yTransStart
-
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, useTimeout, vwr
-
-
Constructor Summary
Constructors Constructor Description Navigator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 planeprivate void
calcNavigationDepthPercent()
void
calcNavigationPoint()
private void
calcNavSlabAndDepthValues()
private void
doNavStep(int iStep)
private float
getNavigationSlabOffsetPercent()
java.lang.String
getNavigationState()
private void
navigate(float seconds, javajs.util.P3[][] pathGuide, javajs.util.P3[] path, float[] theta, int indexStart, int indexEnd)
void
navigateAxis(javajs.util.V3 rotAxis, float degrees)
void
navigateKey(int keyCode, int modifiers)
void
navigateList(JmolScriptEvaluator eval, javajs.util.Lst<java.lang.Object[]> list)
private void
navigateTo(float seconds, javajs.util.V3 axis, float degrees, javajs.util.P3 center, float depthPercent, float xTrans, float yTrans)
void
navTranslatePercentOrTo(float seconds, float x, float y)
private void
newNavigationCenter()
We do not want the fixed navigation offset to change, but we need a new model-based equivalent position.private void
nextList(java.lang.Object[] o, javajs.util.P3 ptTemp)
protected void
oops(java.lang.Exception e)
protected void
run1(int mode)
void
set(TransformManager tm, Viewer vwr)
void
setNavigationDepthPercent(float percent)
void
setNavigationOffsetRelative()
private void
setNavPercent(javajs.util.P3 pt1)
private void
setupNav(float seconds, javajs.util.P3[][] pathGuide, javajs.util.P3[] path, int indexStart, int indexEnd)
private void
setupNavTo()
void
zoomByFactor(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:
set
in interfaceJmolNavigatorInterface
-
navigateList
public void navigateList(JmolScriptEvaluator eval, javajs.util.Lst<java.lang.Object[]> list)
- Specified by:
navigateList
in interfaceJmolNavigatorInterface
-
run1
protected void run1(int mode) throws java.lang.InterruptedException
- Specified by:
run1
in classJmolThread
- Throws:
java.lang.InterruptedException
-
nextList
private void nextList(java.lang.Object[] o, javajs.util.P3 ptTemp)
- Parameters:
o
- Object[] {int tok, Float seconds, ...}ptTemp
-
-
navigate
private void navigate(float seconds, javajs.util.P3[][] pathGuide, javajs.util.P3[] path, float[] theta, int indexStart, int indexEnd)
-
navigateTo
private void navigateTo(float seconds, javajs.util.V3 axis, float degrees, javajs.util.P3 center, float depthPercent, float xTrans, float yTrans)
-
setNavPercent
private void setNavPercent(javajs.util.P3 pt1)
-
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:
zoomByFactor
in interfaceJmolNavigatorInterface
-
calcNavigationPoint
public void calcNavigationPoint()
- Specified by:
calcNavigationPoint
in 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:
setNavigationOffsetRelative
in interfaceJmolNavigatorInterface
-
navigateKey
public void navigateKey(int keyCode, int modifiers)
- Specified by:
navigateKey
in interfaceJmolNavigatorInterface
-
setNavigationDepthPercent
public void setNavigationDepthPercent(float percent)
- Specified by:
setNavigationDepthPercent
in interfaceJmolNavigatorInterface
-
calcNavigationDepthPercent
private void calcNavigationDepthPercent()
-
getNavigationState
public java.lang.String getNavigationState()
- Specified by:
getNavigationState
in interfaceJmolNavigatorInterface
-
getNavigationSlabOffsetPercent
private float getNavigationSlabOffsetPercent()
-
navigateAxis
public void navigateAxis(javajs.util.V3 rotAxis, float degrees)
- Specified by:
navigateAxis
in interfaceJmolNavigatorInterface
-
navTranslatePercentOrTo
public void navTranslatePercentOrTo(float seconds, float x, float y)
- Specified by:
navTranslatePercentOrTo
in interfaceJmolNavigatorInterface
-
oops
protected void oops(java.lang.Exception e)
- Overrides:
oops
in classJmolThread
-
-