public class G3DSys
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static int |
AXES |
|
static int |
BALL |
implemented shapes
|
static int |
BOX |
|
static int |
CYLINDER |
|
static int |
LINE |
|
static int |
RECTANGLE |
|
static int |
TIMEDBALL |
Constructor | Description |
---|---|
G3DSys(java.awt.Container window) |
Modifier and Type | Method | Description |
---|---|---|
void |
addFig(Figure f) |
Adds the Figure to the associated FigureManager
|
float |
calcRotationRadius(Point3f center) |
Finds the atom distance furthest from the given point; for rotation
|
void |
calcZbufferLimits() |
|
void |
draw() |
|
void |
fastRefresh() |
A less thorough redraw for a quick refresh
|
float |
getAngstromDepth() |
Gets the Angstrom depth of the model
|
float |
getAngstromHeight() |
Gets the Angstrom height of the model
|
float |
getAngstromWidth() |
Gets the Angstrom width of the model
|
Point3f |
getAverageAtomPoint() |
|
double[] |
getBoundaryVectors() |
Gets the boundary vectors used for calculating image shells
|
IndexIterator |
getBoundaryVectorsIterator() |
Gets the index iterator used for calculating image shells
|
Point3f |
getBoundingBoxCenter() |
|
Point3f |
getCenterOfRotation() |
|
static short |
getColix(int argb) |
Converts the given argb int to a G3D Colix
|
static short |
getColix(java.awt.Color color) |
Converts the given AWT color to a G3D Colix
|
double |
getDepthPercent() |
|
Figure[] |
getFigs() |
For use only by ImageShell class for iteration
|
g3dsys.control.FigureManager |
getFM() |
Only to be used internally to escape endless delegation
|
Graphics3D |
getG3D() |
Get G3D
|
float |
getMaxX() |
|
float |
getMaxY() |
|
float |
getMaxZ() |
|
float |
getMinX() |
|
float |
getMinY() |
|
float |
getMinZ() |
|
boolean |
getPerspectiveDepth() |
|
int |
getPixelDepth() |
Gets the pixel depth of the display (zbuffer)
|
int |
getPixelHeight() |
Gets the pixel height of the display
|
int |
getPixelWidth() |
Gets the pixel width of the display
|
double |
getSlabPercent() |
|
TransformManager |
getTM() |
|
boolean |
isXFlipped() |
|
boolean |
isYFlipped() |
|
short |
perspective(int z,
float d) |
Handles perspective based on depth and diameter.
|
void |
refresh() |
For a thorough redraw of the display
|
Figure |
removeFig(Figure f) |
Removes the Figure to from associated FigureManager
|
void |
rotateByX(float degrees) |
Rotate the display around the x axis
|
void |
rotateByXY(float degx,
float degy) |
Rotate the display around the x and y axes
|
void |
rotateByY(float degrees) |
Rotate the display around the y axis
|
void |
rotateByZ(float degrees) |
Rotate the display around the z axis
|
void |
rotateToHome() |
Remove all rotation (and translation) and return to the home position
|
void |
scaleFitToScreen() |
|
void |
screenSpace(Point3f p,
Point3i s) |
Converts molspace point p (in Angstroms) to a point on the display
in pixels.
|
void |
setBGColor(java.awt.Color color) |
Change the background color of the G3D display
|
void |
setBoundaryVectors(double[] values) |
Sets the boundary vectors to be used for calculating image shells
|
void |
setBoundaryVectorsIterator(IndexIterator i) |
Sets the index iterator to use for calculating image shells
|
void |
setBoundingBox(float minx,
float miny,
float minz,
float maxx,
float maxy,
float maxz) |
Set the min and maximum coordinates for the model.
|
void |
setCenterOfRotation(Point3f p) |
Set the molecule space location around which rotation occurs
|
void |
setDefaultRotation() |
Rescales slab and depth after image shell mode is toggled
or the number of layers changed.
|
void |
setDepthPercent(float val) |
|
void |
setPerspectiveDepth(boolean b) |
|
void |
setSlabPercent(float val) |
|
void |
setXFlipped(boolean x) |
|
void |
setYFlipped(boolean y) |
|
void |
startRotation(int deltaY,
int deltaX) |
|
void |
stopRotation() |
|
void |
xlateDown() |
Translate model 10% of pixel width down (+y)
|
void |
xlateLeft() |
Translate model 10% of pixel width to the left (-x)
|
void |
xlateRight() |
Translate model 10% of pixel width to the right (+x)
|
void |
xlateUp() |
Translate model 10% of pixel width up (-y)
|
void |
xlateXY(int x,
int y) |
Trnaslate model x,y pixels
|
void |
zoomDown(int i) |
Decrease the zoom level by i percent
|
void |
zoomUp(int i) |
Increase the zoom level by i percent
|
public static final int BALL
public static final int CYLINDER
public static final int RECTANGLE
public static final int LINE
public static final int BOX
public static final int AXES
public static final int TIMEDBALL
public void refresh()
public void fastRefresh()
public void setBGColor(java.awt.Color color)
color
- the G3d background color to usepublic Graphics3D getG3D()
public int getPixelWidth()
public int getPixelHeight()
public int getPixelDepth()
public float getAngstromWidth()
public float getAngstromHeight()
public float getAngstromDepth()
public void addFig(Figure f)
f
- the Figure to addpublic Figure removeFig(Figure f)
f
- the Figure to removepublic boolean isYFlipped()
public boolean isXFlipped()
public void setYFlipped(boolean y)
public void setXFlipped(boolean x)
public void rotateByXY(float degx, float degy)
degx
- the number of degrees to rotate xdegy
- the number of degrees to rotate ypublic void rotateByX(float degrees)
degrees
- the number of degrees to rotatepublic void rotateByY(float degrees)
degrees
- the number of degrees to rotatepublic void rotateByZ(float degrees)
degrees
- the number of degrees to rotatepublic void rotateToHome()
public void xlateLeft()
public void xlateRight()
public void xlateUp()
public void xlateDown()
public void xlateXY(int x, int y)
public void setCenterOfRotation(Point3f p)
public Point3f getCenterOfRotation()
public void startRotation(int deltaY, int deltaX)
public void stopRotation()
public void setBoundingBox(float minx, float miny, float minz, float maxx, float maxy, float maxz)
minx
- minimum xminy
- minimum yminz
- minimum zmaxx
- maximum xmaxy
- maximum ymaxz
- maximum zpublic Point3f getBoundingBoxCenter()
public void screenSpace(Point3f p, Point3i s)
p
- the point to convertpublic short perspective(int z, float d)
z
- depth of an objectd
- diameter of an objectpublic void zoomUp(int i)
i
- the percentage amount to increasepublic void zoomDown(int i)
i
- the percentage amount to decreasepublic void setPerspectiveDepth(boolean b)
public boolean getPerspectiveDepth()
public double getSlabPercent()
public double getDepthPercent()
public void setSlabPercent(float val)
public void setDepthPercent(float val)
public void scaleFitToScreen()
public float getMinX()
public float getMinY()
public float getMinZ()
public float getMaxX()
public float getMaxY()
public float getMaxZ()
public void draw()
public void setBoundaryVectors(double[] values)
values
- the vectors to usepublic void setBoundaryVectorsIterator(IndexIterator i)
i
- the iterator to usepublic IndexIterator getBoundaryVectorsIterator()
public double[] getBoundaryVectors()
public static short getColix(java.awt.Color color)
color
- the color to be convertedpublic static short getColix(int argb)
argb
- the argb integer to be converted.public float calcRotationRadius(Point3f center)
center
- the reference pointpublic Point3f getAverageAtomPoint()
public void calcZbufferLimits()
public Figure[] getFigs()
public void setDefaultRotation()
public g3dsys.control.FigureManager getFM()
public TransformManager getTM()