|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.gui.viewing.Rotation
public class Rotation
Keeps track of rotation transformations of the current model.
Field Summary | |
---|---|
static double |
HALF_PI
One-half Pi is defined as 1.57079632679489, and is equal to 90 degrees. |
static double |
PI
Pi is defined as 3.14159265358979, and is equal to 180 degrees. |
static double |
RADIANS_PER_DEGREE
Pi divided by 180 degrees. |
static double |
TWO_PI
2*Pi is defined as 6.28318530717958, and is equal to 360 degrees. |
static Vec3d |
X_AXIS
Vector representing an x-axis. |
static Vec3d |
Y_AXIS
Vector representing an y-axis. |
static Vec3d |
Z_AXIS
Vector representing an z-axis. |
Constructor Summary | |
---|---|
Rotation(Mediator mediator,
FpsLabel fpsLabel)
Constructs a Renderer. |
Method Summary | |
---|---|
void |
calculateTimeAndRotation()
Calculates an x-axis and y-axis rotation based on the current system time and the previous time this method was called. |
double |
getScale()
Returns the scale factor for the image. |
void |
loadFpsFontFile(GL gl)
Tells the FpsLabel object to read in the font file that it needs for displaying a frames per second label on the canvas. |
void |
rotateAboutXY(double deltaX,
double deltaY)
Rotates the model about the x-axis and y-axis. |
void |
rotateAboutZ(double deltaZ)
Rotates the model about the z-axis. |
void |
rotateScaleAndCenterModel(GL gl)
This helper method for display() rotates, scales, and centers the model. |
void |
setCenter(double x,
double y,
double z)
Sets the xyz-coordinates for the center of gravity of the current model. |
void |
setImageOrientation(OrientationEnum orientation)
Resets the orientation of the image by resetting the angle of rotation about the x-axis and the angle of rotation about the y-axis. |
void |
setScale(double scale)
Sets the scale factor for the image. |
void |
startAnimation(double xAxisSpeed,
double yAxisSpeed,
GLCanvas canvas)
Uses an Animator object to rotate the protein image about its x-axis and/or y-axis. |
void |
stopAnimation()
Stops the rotation animation that is started with startAnimation(). |
void |
writeFps(GL gl,
GLAutoDrawable canvas)
Updates the frames per second display on the canvas. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double HALF_PI
public static final double PI
public static final double TWO_PI
public static final double RADIANS_PER_DEGREE
public static final Vec3d X_AXIS
public static final Vec3d Y_AXIS
public static final Vec3d Z_AXIS
Constructor Detail |
---|
public Rotation(Mediator mediator, FpsLabel fpsLabel)
mediator
- the Mediator that holds the currently selected model.fpsLabel
- the FpsLabel object for writing fps on canvas.Method Detail |
---|
public void setCenter(double x, double y, double z)
x
- the x-coordinate.y
- the y-coordinate.z
- the z-coordinate.public void setImageOrientation(OrientationEnum orientation)
orientation
- the desired view of the structure (original, front,
back, left, right, top, bottom).public void rotateScaleAndCenterModel(GL gl)
gl
- the current GL object.public void rotateAboutXY(double deltaX, double deltaY)
deltaX
- the change in angle of rotation about the x-axis.deltaY
- the change in angle of rotation about the y-axis.public void rotateAboutZ(double deltaZ)
deltaZ
- the change in angle of rotation about the z-axis.public void startAnimation(double xAxisSpeed, double yAxisSpeed, GLCanvas canvas)
xAxisSpeed
- the x-axis speed in degrees per second.yAxisSpeed
- the y-axis speed in degrees per second.canvas
- the GLCanvas to create an Animator for.public void stopAnimation()
public void calculateTimeAndRotation()
public void loadFpsFontFile(GL gl) throws glFont2.FontReaderException
gl
- the current GL object.
glFont2.FontReaderException
public void writeFps(GL gl, GLAutoDrawable canvas)
gl
- the current GL object.canvas
- the canvas to draw on.public double getScale()
public void setScale(double scale)
scale
- the scale factor as a double.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |