Class TransformManager

java.lang.Object
org.jmol.viewer.TransformManager
Direct Known Subclasses:
TransformManager4D

public class TransformManager extends Object
  • Field Details

    • vwr

      protected Viewer 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

      public JmolThread movetoThread
    • vibrationThread

      public JmolThread vibrationThread
    • spinThread

      public JmolThread 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

      protected final M4 matrixTemp
    • vectorTemp

      protected final V3 vectorTemp
    • 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

      public final P3 fixedRotationOffset
    • fixedRotationCenter

      public final P3 fixedRotationCenter
    • perspectiveOffset

      protected final P3 perspectiveOffset
    • perspectiveShiftXY

      protected final P3 perspectiveShiftXY
    • fixedRotationAxis

      public final A4 fixedRotationAxis
    • internalRotationAxis

      public final A4 internalRotationAxis
    • internalTranslation

      protected V3 internalTranslation
    • matrixRotate

      public final M3 matrixRotate
    • matrixTemp3

      protected final M3 matrixTemp3
    • MAXIMUM_ZOOM_PERCENTAGE

      public static final int MAXIMUM_ZOOM_PERCENTAGE
      See Also:
    • fixedTranslation

      public final P3 fixedTranslation
    • camera

      public final P3 camera
    • cameraSetting

      public final P3 cameraSetting
    • prevZoomSetting

      protected float prevZoomSetting
    • previousX

      public float previousX
    • previousY

      public float previousY
    • zoomEnabled

      public boolean zoomEnabled
    • zmPct

      public float zmPct
      zoom 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

      public P3 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

      public final M4 matrixTransform
    • matrixTransformInv

      public final M4 matrixTransformInv
    • fScrPt

      protected final P3 fScrPt
    • iScrPt

      protected final P3i iScrPt
    • mode

      public int mode
    • defaultMode

      public int defaultMode
    • untransformedPoint

      protected final P3 untransformedPoint
    • ptTest1

      protected final P3 ptTest1
    • ptTest2

      protected final P3 ptTest2
    • ptTest3

      protected final P3 ptTest3
    • aaTest1

      protected final A4 aaTest1
    • matrixTest

      protected final M3 matrixTest
    • spinOn

      public boolean spinOn
    • vibrationOn

      public boolean vibrationOn
    • vibrationPeriodMs

      public int vibrationPeriodMs
    • matrixStereo

      protected final M3 matrixStereo
    • windowCentered

      public boolean windowCentered
    • bsFrameOffsets

      public BS bsFrameOffsets
    • zoomFactor

      public float zoomFactor
  • Constructor Details

    • TransformManager

      public TransformManager()
  • Method Details

    • homePosition

      public void homePosition(boolean resetSpin)
    • setRotation

      public void setRotation(M3 m)
    • resetRotation

      public void resetRotation()
    • rotateXYBy

      protected void rotateXYBy(float degX, float degY, BS bsAtoms)
    • rotate3DBall

      protected void rotate3DBall(float xDeg, float yDeg, BS bsAtoms)
    • rotateXRadians

      public void rotateXRadians(float angleRadians, BS bsAtoms)
    • rotateYRadians

      public void rotateYRadians(float angleRadians, BS bsAtoms)
    • rotateZRadians

      public void rotateZRadians(float angleRadians)
    • rotateAxisAngle

      public void rotateAxisAngle(V3 rotAxis, float radians)
    • rotateAxisAngleRadiansFixed

      public void rotateAxisAngleRadiansFixed(float angleRadians, BS bsAtoms)
    • rotateAxisAngleRadiansInternal

      public void rotateAxisAngleRadiansInternal(float radians, BS bsAtoms, M4 m4, boolean useModelKit)
    • centerAt

      public void centerAt(int x, int y, P3 pt)
    • 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

      public String getTranslationScript()
    • getRotationQ

      public Quat getRotationQ()
    • getRotation

      public void getRotation(M3 m)
    • 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

      public void slabInternal(P4 plane, boolean isDepth)
    • setSlabDepthInternal

      public void setSlabDepthInternal(boolean isDepth)
      set internal slab or depth from screen-based slab or depth
      Parameters:
      isDepth -
    • getCameraFactors

      public P3[] 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)
    • isNavigating

      public boolean isNavigating()
    • 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

      public void rotatePoint(T3 pt, T3 ptRot)
    • getScreenTemp

      protected void getScreenTemp(T3 ptXYZ)
    • transformPtScr

      public void transformPtScr(T3 ptXYZ, P3i pointScreen)
    • transformPtScrT3

      public void transformPtScrT3(T3 ptXYZ, T3 pointScreen)
    • transformPt3f

      public void transformPt3f(T3 ptXYZ, P3 screen)
    • transformPtNoClip

      public void transformPtNoClip(T3 ptXYZ, T3 pointScreen)
    • transformPt

      public P3i transformPt(T3 ptXYZ)
      CAUTION! returns a POINTER TO A TEMPORARY VARIABLE
      Parameters:
      ptXYZ -
      Returns:
      POINTER TO point3iScreenTemp
    • transformPtVib

      public P3i transformPtVib(P3 ptXYZ, Vibration v)
      Parameters:
      ptXYZ -
      v -
      Returns:
      POINTER TO TEMPORARY VARIABLE (caution!) point3iScreenTemp
    • getVibrationPoint

      public T3 getVibrationPoint(Vibration v, T3 pt, float scale)
      return
      Parameters:
      v -
      pt - temporary value; also returned
      scale -
      Returns:
      pt
    • transformPt2Df

      public void transformPt2Df(T3 v, P3 pt)
    • transformPtScrT32D

      public void transformPtScrT32D(T3 v, P3 pt)
    • transformPt2D

      public P3i transformPt2D(T3 ptXyp)
    • xyzIsSlabbedInternal

      public boolean xyzIsSlabbedInternal(T3 ptRef)
    • isInPosition

      public boolean isInPosition(V3 axis, float degrees)
    • moveToPyMOL

      public boolean moveToPyMOL(JmolScriptEvaluator eval, float floatSecondsTotal, float[] pymolView)
    • setAll

      public void setAll(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)
    • stopMotion

      public void stopMotion()
    • getMoveToText

      public String getMoveToText(float timespan, boolean addComments)
    • setNavXYZ

      public void setNavXYZ(float x, float y, float z)
    • setSpinOn

      public void setSpinOn()
    • setSpinOff

      public void setSpinOff()
    • setNavOn

      public void setNavOn(boolean navOn)
    • setVibrationPeriod

      public void setVibrationPeriod(float period)
      sets the period of vibration -- period > 0: sets the period and turns vibration on -- 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 Float.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

      public void moveRotationCenter(P3 center, boolean toXY)
    • setCenterAt

      public void setCenterAt(int relativeTo, P3 pt)
    • setNavFps

      protected void setNavFps(int navFps)
    • 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

      public void unTransformPoint(T3 screenPt, T3 coordPt)
    • resetNavigationPoint

      protected void resetNavigationPoint(boolean doResetSlab)
      something has arisen that requires resetting of the navigation point.
      Parameters:
      doResetSlab -
    • setNavigatePt

      public void setNavigatePt(P3 pt)
      scripted entry point for navigation
      Parameters:
      pt -
    • getNavigationOffset

      public P3 getNavigationOffset()
    • getNavPtHeight

      public float getNavPtHeight()
    • getNavigationOffsetPercent

      public float getNavigationOffsetPercent(char XorY)
    • getNavigationText

      protected String getNavigationText(boolean addComments)
    • setNavigationOffsetRelative

      public void setNavigationOffsetRelative()
    • setNavigationDepthPercent

      public void setNavigationDepthPercent(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)
      Parameters:
      percent -
    • calcNavigationPoint

      protected void calcNavigationPoint()
      All the magic happens here. all navigation effects go through this method
    • getNavigationState

      protected String getNavigationState()
      Returns:
      the script that defines the current navigation state