Class TransformManager
java.lang.Object
org.jmol.viewer.TransformManager
- Direct Known Subclasses:
TransformManager4D
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final A4protected booleanprotected floatfinal P3protected floatprotected floatfloatprotected floatprotected floatfinal P3static final intstatic final floatintstatic final doubleintprotected booleanfinal A4final P3final P3final P3protected final P3protected booleanintfinal A4booleanprotected V3booleanbooleanfinal M3protected final M3protected final M4protected final M3protected final M3final M4final M4static final intintstatic final intstatic final intstatic final intfloatfloatfloatstatic final int//////////////////////// old TransfomManager11 ////////////////////static final intstatic final intstatic final intstatic final intstatic final intstatic final intfloatbooleanfinal P3floatfinal P3final P3floatintbooleanfloatfloatfloatbooleanprotected intprotected final P3protected final P3floatfloatprotected floatprotected final P3protected final P3protected final P3floatprotected booleanfloatintbooleanintfloatbooleanfloatfloatfloatintright-hand split frame has fewer capabilities than right-handprotected final P3booleanprotected final V3booleanintfloatprotected Viewerintboolean//////// rotation center ////////////intintfloatzoom percent zmPct is the current displayed zoom value, AFTER rendering; may not be the same as zmPctSet, particularly if zoom is not enabledbooleanfloatbooleanintint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsets all camera and scale factors needed by the specific perspective model instantiatedprotected voidAll the magic happens here.voidsets slab and depth, possibly using visual range considerations for setting the slab-clipping plane.voidvoidfloatdefaultScaleToScreen(float radius) voiddepthToPercent(int percentDepth) voidfloatP3[]This method returns data needed by the VRML, X3D, and IDTF/U3D exporters.getMoveToText(float timespan, boolean addComments) floatgetNavigationOffsetPercent(char XorY) protected Stringprotected StringgetNavigationText(boolean addComments) floatbooleanfloatgetPerspectiveFactor(float z) calculate the perspective factor based on zvoidgetRotation(M3 m) protected voidgetScreenTemp(T3 ptXYZ, P3 fScrPt) intfloatfloatgetVibrationPoint(Vibration v, T3 pt, float scale) returnfloatvoidhomePosition(boolean resetSpin) booleanisInPosition(V3 axis, float degrees) booleanbooleanvoidmoveRotationCenter(P3 center, boolean toXY) booleanmoveToPyMOL(JmolScriptEvaluator eval, float floatSecondsTotal, float[] pymolView) voidnavigateAxis(V3 rotAxis, float degrees) scripted entry point for navigationvoidnavigateList(JmolScriptEvaluator eval, Lst<Object[]> list) voidnavTranslatePercentOrTo(float seconds, float x, float y) seconds invalid input: '<' 0 means "to (x,y)"; >= 0 mean "to (x%, y%)"intpercentToPixels(char xyz, float percent) protected voidresetNavigationPoint(boolean doResetSlab) something has arisen that requires resetting of the navigation point.voidprotected voidrotate3DBall(float xDeg, float yDeg, BS bsAtoms) voidrotateAxisAngle(V3 rotAxis, float radians) voidrotateAxisAngleRadiansFixed(float angleRadians, BS bsAtoms) voidrotateAxisAngleRadiansInternal(float radians, BS bsAtoms, M4 m4, boolean useModelKit) voidrotatePoint(T3 pt, T3 ptRot) voidrotateXRadians(float angleRadians, BS bsAtoms) protected voidrotateXYBy(float degX, float degY, BS bsAtoms) voidrotateYRadians(float angleRadians, BS bsAtoms) voidrotateZRadians(float angleRadians) floatscaleToPerspective(int z, float sizeAngstroms) floatscaleToScreen(int z, int milliAngstroms) voidsetAll(P3 center, M3 m, P3 navCenter, float zoom, float xTrans, float yTrans, float rotationRadius, float pixelScale, float navDepth, float xNav, float yNav, float cameraDepth, float cameraX, float cameraY) voidsetCamera(float x, float y) voidsetCameraDepthPercent(float percent, boolean resetSlab) either as a percent -300, or as a float 3.0 note this percent is of zoom=100 size of modelvoidsetCenterAt(int relativeTo, P3 pt) protected voidsetNavFps(int navFps) voidsetNavigatePt(P3 pt) scripted entry point for navigationvoidsetNavigationDepthPercent(float percent) sets the position of the navigation offset relative to the model (50% center; 0% rear, 100% front; can be invalid input: '<'0 or >100)voidvoidsetNavOn(boolean navOn) voidsetNavXYZ(float x, float y, float z) voidsetRotation(M3 m) floatsetRotationRadius(float angstroms, boolean doAll) voidsetSlabDepthInternal(boolean isDepth) set internal slab or depth from screen-based slab or depthvoidsetSlabRange(float value) voidvoidvoidsetVibrationPeriod(float period) sets the period of vibration -- period > 0: sets the period and turns -- period invalid input: '<' 0: sets the period but does not turn vibration on -- period = 0: sets the period to zero and turns vibration off -- period Double.NaN: uses current setting (frame change)voidsetVibrationT(float t) voidsetZoomHeight(boolean zoomHeight, boolean zoomLarge) voidslabInternal(P4 plane, boolean isDepth) voidvoidslabToPercent(int percentSlab) voidtransformPt(T3 ptXYZ) RENDERERS ONLY CAUTION! returns a POINTER TO A TEMPORARY VARIABLEtransformPt2D(T3 ptXyp) RENDERERS ONLYvoidtransformPt3f(T3 ptXYZ, P3 screen) RENDERERS ONLYvoidtransformPt3fSafe(T3 ptXYZ, P3 screen) voidtransformPtNoClip(T3 ptXYZ, T3 pointScreen) RENDERERS ONLYtransformPtSafe(T3 ptXYZ) voidtransformPtScr(T3 ptXYZ, P3i pointScreen) RENDERERS ONLYvoidtransformPtScrSafe(T3 ptXYZ, P3i pointScreen) voidtransformPtScrT3(T3 ptXYZ, T3 pointScreen) RENDERERS ONLYtransformPtVib(P3 ptXYZ, Vibration v) RENDERERS ONLYtransformPtVibSafe(P3 ptXYZ, Vibration v) voidtranslateToPercent(char type, float percent) floatunscaleToScreen(float z, float screenDistance) voidunTransformPoint(T3 screenPt, T3 coordPt) booleanxyzIsSlabbedInternal(T3 ptRef) protected voidzoomBy(int pixels) standard response to user mouse vertical shift-dragvoidzoomToPercent(float percentZoom) intzValueFromPercent(int zPercent)
-
Field Details
-
vwr
-
DEFAULT_VISUAL_RANGE
public static final float DEFAULT_VISUAL_RANGE- See Also:
-
DEFAULT_STEREO_DEGREES
public static final int DEFAULT_STEREO_DEGREES- See Also:
-
MODE_STANDARD
public static final int MODE_STANDARD- See Also:
-
MODE_NAVIGATION
public static final int MODE_NAVIGATION- See Also:
-
MODE_PERSPECTIVE_PYMOL
public static final int MODE_PERSPECTIVE_PYMOL- See Also:
-
movetoThread
-
vibrationThread
-
spinThread
-
degreesPerRadian
public static final double degreesPerRadian- See Also:
-
perspectiveModel
protected int perspectiveModel -
cameraScaleFactor
protected float cameraScaleFactor -
referencePlaneOffset
public float referencePlaneOffset -
aperatureAngle
protected float aperatureAngle -
cameraDistanceFromCenter
protected float cameraDistanceFromCenter -
modelCenterOffset
public float modelCenterOffset -
modelRadius
public float modelRadius -
modelRadiusPixels
public float modelRadiusPixels -
matrixTemp
-
vectorTemp
-
splitFrameCurrentlyRendering
public int splitFrameCurrentlyRenderingright-hand split frame has fewer capabilities than right-hand -
haveNotifiedNaN
protected boolean haveNotifiedNaN -
spinX
public float spinX -
spinY
public float spinY -
spinZ
public float spinZ -
spinFps
public float spinFps -
isSpinInternal
public boolean isSpinInternal -
isSpinFixed
public boolean isSpinFixed -
doTransform4D
protected boolean doTransform4D -
fixedRotationOffset
-
fixedRotationCenter
-
perspectiveOffset
-
perspectiveShiftXY
-
fixedRotationAxis
-
internalRotationAxis
-
internalTranslation
-
matrixRotate
-
matrixTemp3
-
MAXIMUM_ZOOM_PERCENTAGE
public static final int MAXIMUM_ZOOM_PERCENTAGE- See Also:
-
fixedTranslation
-
camera
-
cameraSetting
-
prevZoomSetting
protected float prevZoomSetting -
previousX
public float previousX -
previousY
public float previousY -
zoomEnabled
public boolean zoomEnabled -
zmPct
public float zmPctzoom percent zmPct is the current displayed zoom value, AFTER rendering; may not be the same as zmPctSet, particularly if zoom is not enabled -
slabEnabled
public boolean slabEnabled -
zShadeEnabled
public boolean zShadeEnabled -
internalSlab
public boolean internalSlab -
slabValue
public int slabValue -
depthValue
public int depthValue -
zSlabPercentSetting
public int zSlabPercentSetting -
zDepthPercentSetting
public int zDepthPercentSetting -
zSlabPoint
-
zSlabValue
public int zSlabValue -
zDepthValue
public int zDepthValue -
perspectiveDepth
public boolean perspectiveDepth -
scale3D
protected boolean scale3D -
cameraDepth
protected float cameraDepth -
cameraDepthSetting
protected float cameraDepthSetting -
visualRangeAngstroms
public float visualRangeAngstroms -
cameraDistance
public float cameraDistance -
width
public int width -
height
public int height -
screenPixelCount
public int screenPixelCount -
scaleDefaultPixelsPerAngstrom
public float scaleDefaultPixelsPerAngstrom -
antialias
protected boolean antialias -
matrixTransform
-
matrixTransformInv
-
fScrPtSafe
-
mode
public int mode -
defaultMode
public int defaultMode -
untransformedPoint
-
ptTest1
-
ptTest2
-
ptTest3
-
aaTest1
-
matrixTest
-
spinOn
public boolean spinOn -
vectorSpinOnly
public boolean vectorSpinOnly -
vibrationOn
public boolean vibrationOn -
vibrationPeriodMs
public int vibrationPeriodMs -
matrixStereo
-
windowCentered
public boolean windowCentered//////// rotation center //////////// -
bsFrameOffsets
-
NAV_MODE_IGNORE
public static final int NAV_MODE_IGNORE//////////////////////// old TransfomManager11 ////////////////////- See Also:
-
NAV_MODE_ZOOMED
public static final int NAV_MODE_ZOOMED- See Also:
-
NAV_MODE_NONE
public static final int NAV_MODE_NONE- See Also:
-
NAV_MODE_RESET
public static final int NAV_MODE_RESET- See Also:
-
NAV_MODE_NEWXY
public static final int NAV_MODE_NEWXY- See Also:
-
NAV_MODE_NEWXYZ
public static final int NAV_MODE_NEWXYZ- See Also:
-
NAV_MODE_NEWZ
public static final int NAV_MODE_NEWZ- See Also:
-
zoomFactor
public float zoomFactor
-
-
Constructor Details
-
TransformManager
public TransformManager()
-
-
Method Details
-
homePosition
public void homePosition(boolean resetSpin) -
setRotation
-
resetRotation
public void resetRotation() -
rotateXYBy
-
rotate3DBall
-
rotateXRadians
-
rotateYRadians
-
rotateZRadians
public void rotateZRadians(float angleRadians) -
rotateAxisAngle
-
rotateAxisAngleRadiansFixed
-
rotateAxisAngleRadiansInternal
-
centerAt
-
percentToPixels
public int percentToPixels(char xyz, float percent) -
setCamera
public void setCamera(float x, float y) -
translateToPercent
public void translateToPercent(char type, float percent) -
getTranslationXPercent
public float getTranslationXPercent() -
getTranslationYPercent
public float getTranslationYPercent() -
getTranslationScript
-
getRotationQ
-
getRotation
-
setZoomHeight
public void setZoomHeight(boolean zoomHeight, boolean zoomLarge) -
zoomBy
protected void zoomBy(int pixels) standard response to user mouse vertical shift-drag- Parameters:
pixels-
-
zoomToPercent
public void zoomToPercent(float percentZoom) -
setSlabRange
public void setSlabRange(float value) -
slabReset
public void slabReset() -
getSlabPercentSetting
public int getSlabPercentSetting() -
slabToPercent
public void slabToPercent(int percentSlab) -
depthToPercent
public void depthToPercent(int percentDepth) -
slabInternal
-
setSlabDepthInternal
public void setSlabDepthInternal(boolean isDepth) set internal slab or depth from screen-based slab or depth- Parameters:
isDepth-
-
getCameraFactors
This method returns data needed by the VRML, X3D, and IDTF/U3D exporters. It also should serve as a valuable resource for anyone adapting Jmol and wanting to know how the Jmol 11+ camera business works.- Returns:
- a set of camera data
-
getPerspectiveDepth
public boolean getPerspectiveDepth() -
setCameraDepthPercent
public void setCameraDepthPercent(float percent, boolean resetSlab) either as a percent -300, or as a float 3.0 note this percent is of zoom=100 size of model- Parameters:
percent-resetSlab-
-
getCameraDepth
public float getCameraDepth() -
defaultScaleToScreen
public float defaultScaleToScreen(float radius) -
scaleToScreen
public float scaleToScreen(int z, int milliAngstroms) -
unscaleToScreen
public float unscaleToScreen(float z, float screenDistance) -
scaleToPerspective
public float scaleToPerspective(int z, float sizeAngstroms) -
finalizeTransformParameters
public void finalizeTransformParameters() -
getZoomSetting
public float getZoomSetting() -
calcSlabAndDepthValues
public void calcSlabAndDepthValues()sets slab and depth, possibly using visual range considerations for setting the slab-clipping plane. (slab on; slab 0) superceded in navigation mode -
zValueFromPercent
public int zValueFromPercent(int zPercent) -
calcTransformMatrix
public void calcTransformMatrix() -
rotatePoint
-
getScreenTemp
-
transformPtScr
-
transformPtScrSafe
-
transformPtScrT3
-
transformPt3f
-
transformPt3fSafe
-
transformPtNoClip
-
transformPt
-
transformPtSafe
-
transformPtVib
-
transformPtVibSafe
-
getVibrationPoint
-
transformPt2D
-
xyzIsSlabbedInternal
-
isInPosition
-
moveToPyMOL
-
setAll
-
stopMotion
public void stopMotion() -
getMoveToText
-
setSpinOn
public void setSpinOn() -
setSpinOff
public void setSpinOff() -
setVibrationPeriod
public void setVibrationPeriod(float period) sets the period of vibration -- period > 0: sets the period and turns -- period invalid input: '<' 0: sets the period but does not turn vibration on -- period = 0: sets the period to zero and turns vibration off -- period Double.NaN: uses current setting (frame change)- Parameters:
period-
-
setVibrationT
public void setVibrationT(float t) -
isWindowCentered
public boolean isWindowCentered() -
setRotationRadius
public float setRotationRadius(float angstroms, boolean doAll) -
moveRotationCenter
-
setCenterAt
-
calcCameraFactors
public void calcCameraFactors()sets all camera and scale factors needed by the specific perspective model instantiated -
getPerspectiveFactor
public float getPerspectiveFactor(float z) calculate the perspective factor based on z- Parameters:
z-- Returns:
- perspectiveFactor
-
unTransformPoint
-