public final class Graphics3D extends java.lang.Object implements JmolRendererInterface
A pure software implementation of a 3D graphics engine. No hardware required. Depending upon what you are rendering ... some people say it is pretty fast.
Modifier and Type | Class and Description |
---|---|
(package private) class |
Graphics3D.Pixel |
(package private) class |
Graphics3D.ShadePixel |
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
addAllPixels |
private static int |
ALPHA_SHIFT |
(package private) byte[] |
anaglyphChannelBytes |
(package private) int |
anaglyphLength |
private boolean |
antialias2 |
private boolean |
antialiasEnabled |
private boolean |
antialiasThisFrame |
(package private) int |
argbCurrent |
(package private) int |
argbNoisyDn |
(package private) int |
argbNoisyUp |
java.awt.Image |
backgroundImage |
int |
bgcolor |
static short |
BLACK |
static short |
BLUE |
(package private) int |
bufferSize |
private static short |
CHANGEABLE_MASK |
private short[] |
changeableColixMap
changeable colixes
give me a short ID and a color, and I will give you a colix
later, you can reassign the color if you want
Used only for colorManager coloring of elements
|
(package private) Circle3D |
circle3d |
(package private) short |
colixCurrent |
private static int[] |
colorArgbs |
private static java.lang.String[] |
colorNames |
(package private) boolean |
currentlyRendering |
private int |
currentShadeIndex |
static short |
CYAN |
(package private) Cylinder3D |
cylinder3d |
(package private) int |
depth |
(package private) int |
displayMaxX |
(package private) int |
displayMaxY |
(package private) int |
displayMinX |
(package private) int |
displayMinY |
static byte |
ENDCAPS_FLAT |
static byte |
ENDCAPS_NONE |
static byte |
ENDCAPS_OPEN |
static byte |
ENDCAPS_OPENEND |
static byte |
ENDCAPS_SPHERICAL |
static int |
EXPORT_CARTESIAN |
static int |
EXPORT_NOT |
static int |
EXPORT_RAYTRACER |
(package private) Font3D |
font3dCurrent |
static short |
GOLD |
static short |
GRAY |
static short |
GREEN |
(package private) boolean |
haveTranslucentObjects |
(package private) int |
height |
(package private) Hermite3D |
hermite3d |
static short |
HOTPINK |
(package private) boolean |
inGreyscaleMode |
static short |
INHERIT_ALL |
private static short |
INHERIT_COLOR |
(package private) boolean |
isFullSceneAntialiasingEnabled |
(package private) boolean |
isPass2 |
(package private) boolean |
isScreened |
static short |
LIME |
(package private) Line3D |
line3d |
static short |
MAGENTA |
private static java.util.Hashtable |
mapJavaScriptColors |
static short |
MAROON |
static short |
NAVY |
(package private) boolean |
newAntialiasing |
(package private) int |
newWindowHeight |
(package private) int |
newWindowWidth |
static short |
NORMIX_NULL |
(package private) Normix3D |
normix3d |
static short |
OLIVE |
static short |
OPAQUE_MASK |
static short |
ORANGE |
(package private) int[] |
pbuf |
(package private) int[] |
pbufT |
static short |
PINK |
(package private) Graphics3D.Pixel |
pixel |
(package private) Platform3D |
platform |
static short |
PURPLE |
double |
random |
static short |
RED |
(package private) int[] |
shadesCurrent |
static short |
SILVER |
(package private) int |
slab |
(package private) static short |
SPECIAL_COLIX_MAX |
(package private) Sphere3D |
sphere3d |
static short |
TEAL |
(package private) int |
translucencyMask |
(package private) static int |
TRANSLUCENT_50 |
private static int |
TRANSLUCENT_MASK |
private static int |
TRANSLUCENT_SCREENED |
private static int |
TRANSLUCENT_SHIFT |
(package private) boolean |
translucentCoverOnly |
private static int |
TRANSPARENT |
(package private) Triangle3D |
triangle3d |
(package private) boolean |
twoPass |
private static short |
UNMASK_CHANGEABLE_TRANSLUCENT |
(package private) static short |
UNUSED_OPTION3 |
static short |
USE_PALETTE |
private javax.vecmath.Vector3f |
vectorAB |
private javax.vecmath.Vector3f |
vectorAC |
private javax.vecmath.Vector3f |
vectorNormal |
static short |
WHITE |
(package private) int |
width |
(package private) int |
windowHeight |
(package private) int |
windowWidth |
(package private) static int |
xGT |
(package private) int |
xLast |
(package private) static int |
xLT |
static short |
YELLOW |
(package private) static int |
yGT |
(package private) int |
yLast |
(package private) static int |
yLT |
(package private) int[] |
zbuf |
(package private) int[] |
zbufT |
(package private) int |
zDepth |
(package private) static int |
zGT |
(package private) static int |
zLT |
(package private) int |
zMargin |
(package private) boolean |
zShade |
(package private) int |
zShadeB |
(package private) int |
zShadeG |
(package private) int |
zShadeR |
(package private) int |
zSlab |
Constructor and Description |
---|
Graphics3D(java.awt.Component awtComponent)
Allocates a g3d object
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addPixel(int offset,
int z,
int p) |
void |
applyBlueAnaglyph() |
private static short |
applyColorTranslucencyLevel(short colix,
float translucentLevel) |
void |
applyCustomAnaglyph(int[] stereoColors) |
void |
applyCyanAnaglyph() |
void |
applyGreenAnaglyph() |
(package private) static void |
averageBufferPixel(int[] pIn,
int[] pOut,
int pt,
int dp) |
void |
beginRendering(javax.vecmath.Matrix3f rotationMatrix) |
static int |
calcGreyscaleRgbFromRgb(int rgb)
Return a greyscale rgb value 0-FF using NTSC color luminance algorithm
|
boolean |
canDoTriangles() |
void |
changeColixArgb(short id,
int argb) |
boolean |
checkTranslucent(boolean isAlphaTranslucent) |
int |
clipCode(int z) |
int |
clipCode(int x,
int y,
int z) |
static javax.vecmath.Point3f |
colorPointFromInt(int color,
javax.vecmath.Point3f pt) |
static javax.vecmath.Point3f |
colorPointFromInt2(int color) |
static javax.vecmath.Point3f |
colorPointFromString(java.lang.String colorName,
javax.vecmath.Point3f pt) |
static int |
colorPtToInt(javax.vecmath.Point3f pt) |
static int |
colorTriadToInt(float x,
float y,
float z) |
boolean |
currentlyRendering() |
void |
destroy() |
private void |
downsampleFullSceneAntialiasing(boolean downsampleZBuffer) |
void |
drawAtom(Atom atom) |
void |
drawBond(Atom atomA,
Atom atomB,
short colixA,
short colixB,
byte endcaps,
short mad) |
void |
drawDashedLine(int run,
int rise,
javax.vecmath.Point3i pointA,
javax.vecmath.Point3i pointB) |
void |
drawDottedLine(javax.vecmath.Point3i pointA,
javax.vecmath.Point3i pointB) |
boolean |
drawEllipse(javax.vecmath.Point3f ptAtom,
javax.vecmath.Point3f ptX,
javax.vecmath.Point3f ptY,
boolean fillArc,
boolean wireframeOnly) |
void |
drawFilledCircle(short colixRing,
short colixFill,
int diameter,
int x,
int y,
int z)
draws a ring and filled circle (halos, draw CIRCLE, draw handles)
|
void |
drawHermite(boolean fill,
boolean border,
int tension,
javax.vecmath.Point3i s0,
javax.vecmath.Point3i s1,
javax.vecmath.Point3i s2,
javax.vecmath.Point3i s3,
javax.vecmath.Point3i s4,
javax.vecmath.Point3i s5,
javax.vecmath.Point3i s6,
javax.vecmath.Point3i s7,
int aspectRatio) |
void |
drawHermite(int tension,
javax.vecmath.Point3i s0,
javax.vecmath.Point3i s1,
javax.vecmath.Point3i s2,
javax.vecmath.Point3i s3) |
private void |
drawHLine(int x,
int y,
int z,
int w) |
void |
drawImage(java.awt.Image image,
int x,
int y,
int z,
int zSlab,
short bgcolix,
int width,
int height) |
void |
drawLine(int x1,
int y1,
int z1,
int x2,
int y2,
int z2) |
void |
drawLine(javax.vecmath.Point3i pointA,
javax.vecmath.Point3i pointB) |
void |
drawLine(short colixA,
short colixB,
int x1,
int y1,
int z1,
int x2,
int y2,
int z2) |
void |
drawPixel(int x,
int y,
int z) |
void |
drawPoints(int count,
int[] coordinates,
int scale) |
void |
drawQuadrilateral(short colix,
javax.vecmath.Point3i screenA,
javax.vecmath.Point3i screenB,
javax.vecmath.Point3i screenC,
javax.vecmath.Point3i screenD) |
void |
drawRect(int x,
int y,
int z,
int zSlab,
int rWidth,
int rHeight)
draws a rectangle
|
void |
drawString(java.lang.String str,
Font3D font3d,
int xBaseline,
int yBaseline,
int z,
int zSlab)
draws the specified string in the current font.
|
void |
drawStringNoSlab(java.lang.String str,
Font3D font3d,
int xBaseline,
int yBaseline,
int z)
draws the specified string in the current font.
|
void |
drawSurface(MeshSurface meshSurface,
javax.vecmath.Point3f[] vertices,
javax.vecmath.Point3f offset) |
void |
drawTriangle(javax.vecmath.Point3i screenA,
javax.vecmath.Point3i screenB,
javax.vecmath.Point3i screenC,
int check) |
void |
drawTriangle(javax.vecmath.Point3i screenA,
short colixA,
javax.vecmath.Point3i screenB,
short colixB,
javax.vecmath.Point3i screenC,
short colixC,
int check) |
private void |
drawVLine(int x,
int y,
int z,
int h) |
void |
endRendering() |
void |
fillConeSceen(byte endcap,
int screenDiameter,
javax.vecmath.Point3f screenBase,
javax.vecmath.Point3f screenTip) |
void |
fillConeScreen(byte endcap,
int screenDiameter,
javax.vecmath.Point3i screenBase,
javax.vecmath.Point3i screenTip) |
void |
fillCylinder(byte endcaps,
int diameter,
javax.vecmath.Point3i screenA,
javax.vecmath.Point3i screenB) |
void |
fillCylinder(short colixA,
short colixB,
byte endcaps,
int diameter,
int xA,
int yA,
int zA,
int xB,
int yB,
int zB) |
void |
fillCylinderBits(byte endcaps,
int diameter,
javax.vecmath.Point3f screenA,
javax.vecmath.Point3f screenB) |
void |
fillCylinderScreen(byte endcaps,
int diameter,
int xA,
int yA,
int zA,
int xB,
int yB,
int zB) |
void |
fillCylinderScreen(byte endcaps,
int diameter,
javax.vecmath.Point3i screenA,
javax.vecmath.Point3i screenB) |
void |
fillEllipsoid(javax.vecmath.Point3f center,
javax.vecmath.Point3f[] points,
int x,
int y,
int z,
int diameter,
javax.vecmath.Matrix3f mToEllipsoidal,
double[] coef,
javax.vecmath.Matrix4f mDeriv,
int selectedOctant,
javax.vecmath.Point3i[] octantPoints) |
void |
fillHermite(int tension,
int diameterBeg,
int diameterMid,
int diameterEnd,
javax.vecmath.Point3i s0,
javax.vecmath.Point3i s1,
javax.vecmath.Point3i s2,
javax.vecmath.Point3i s3) |
void |
fillQuadrilateral(javax.vecmath.Point3f screenA,
javax.vecmath.Point3f screenB,
javax.vecmath.Point3f screenC,
javax.vecmath.Point3f screenD) |
void |
fillQuadrilateral(javax.vecmath.Point3i screenA,
short colixA,
short normixA,
javax.vecmath.Point3i screenB,
short colixB,
short normixB,
javax.vecmath.Point3i screenC,
short colixC,
short normixC,
javax.vecmath.Point3i screenD,
short colixD,
short normixD) |
void |
fillRect(int x,
int y,
int z,
int zSlab,
int widthFill,
int heightFill)
fills background rectangle for label
|
void |
fillSphere(int diameter,
int x,
int y,
int z)
fills a solid sphere
|
void |
fillSphere(int diameter,
javax.vecmath.Point3f center)
fills a solid sphere
|
void |
fillSphere(int diameter,
javax.vecmath.Point3i center)
fills a solid sphere
|
void |
fillTriangle(javax.vecmath.Point3f screenA,
javax.vecmath.Point3f screenB,
javax.vecmath.Point3f screenC) |
void |
fillTriangle(javax.vecmath.Point3i screenA,
javax.vecmath.Point3i screenB,
javax.vecmath.Point3i screenC) |
void |
fillTriangle(javax.vecmath.Point3i screenA,
short colixA,
short normixA,
javax.vecmath.Point3i screenB,
short colixB,
short normixB,
javax.vecmath.Point3i screenC,
short colixC,
short normixC) |
void |
fillTriangle(javax.vecmath.Point3i screenA,
short colixA,
short normixA,
javax.vecmath.Point3i screenB,
short colixB,
short normixB,
javax.vecmath.Point3i screenC,
short colixC,
short normixC,
float factor) |
void |
fillTriangleTwoSided(short normix,
int xScreenA,
int yScreenA,
int zScreenA,
int xScreenB,
int yScreenB,
int zScreenB,
int xScreenC,
int yScreenC,
int zScreenC) |
java.lang.String |
finalizeOutput() |
private static void |
flushCaches() |
static short |
get2SidedNormix(javax.vecmath.Vector3f vector,
java.util.BitSet bsTemp) |
static int |
getAmbientPercent() |
static int |
getArgb(short colix) |
static int |
getArgbFromString(java.lang.String strColor)
accepts [xRRGGBB] or [0xRRGGBB] or [0xFFRRGGBB] or #RRGGBB or
[red,green,blue] or a valid JavaScript color
|
short[] |
getBgColixes(short[] bgcolixes) |
short |
getChangeableColix(short id,
int argb) |
static short |
getChangeableColixIndex(short colix) |
static short |
getColix(int argb) |
static short |
getColix(java.lang.Object obj) |
static short |
getColix(java.lang.String colorName) |
static short[] |
getColixArray(java.lang.String colorNames) |
static short |
getColixInherited(short myColix,
short parentColix) |
static int |
getColixTranslucencyLevel(short colix) |
static short |
getColixTranslucent(int argb) |
static short |
getColixTranslucent(short colix,
boolean isTranslucent,
float translucentLevel) |
int |
getColorArgbOrGray(short colix) |
int |
getDepth()
gets g3d depth
|
static int |
getDiffusePercent() |
java.lang.String |
getExportName() |
int |
getExportType() |
Font3D |
getFont3D(float fontSize) |
Font3D |
getFont3D(java.lang.String fontFace,
float fontSize) |
Font3D |
getFont3D(java.lang.String fontFace,
java.lang.String fontStyle,
float fontSize) |
Font3D |
getFont3DCurrent() |
Font3D |
getFont3DScaled(Font3D font,
float scale) |
byte |
getFontFid(float fontSize) |
byte |
getFontFid(java.lang.String fontFace,
float fontSize) |
static int |
getFontStyleID(java.lang.String fontStyle) |
static void |
getHermiteList(int tension,
javax.vecmath.Tuple3f s0,
javax.vecmath.Tuple3f s1,
javax.vecmath.Tuple3f s2,
javax.vecmath.Tuple3f s3,
javax.vecmath.Tuple3f s4,
javax.vecmath.Tuple3f[] list,
int index0,
int n) |
static java.lang.String |
getHexCode(short colix) |
static java.lang.String |
getHexCodes(short[] colixes) |
static short |
getInverseNormix(short normix) |
static javax.vecmath.Point3f |
getLightSource() |
static short |
getNormix(javax.vecmath.Vector3f vector,
java.util.BitSet bsTemp) |
static javax.vecmath.Vector3f |
getNormixVector(short normix) |
static int |
getPhongExponent() |
int |
getRenderHeight()
gets g3d height
|
int |
getRenderWidth()
gets g3d width
|
java.awt.Image |
getScreenImage() |
private int |
getShadeIndex(javax.vecmath.Point3f screenA,
javax.vecmath.Point3f screenB,
javax.vecmath.Point3f screenC) |
(package private) int[] |
getShades(short colix) |
int |
getSlab()
gets g3d slab
|
static boolean |
getSpecular() |
static int |
getSpecularExponent() |
static int |
getSpecularPercent() |
static int |
getSpecularPower() |
javax.vecmath.Vector3f[] |
getTransformedVertexVectors() |
static int |
getZShadePower() |
boolean |
hasContent() |
boolean |
haveTranslucentObjects() |
boolean |
initializeExporter(java.lang.String type,
Viewer viewer,
Graphics3D g3d,
java.lang.Object output) |
boolean |
isAntialiased()
is full scene / oversampling antialiasing in effect
|
boolean |
isCartesianExport() |
boolean |
isClipped(int x,
int y) |
boolean |
isClipped(int x,
int y,
int z) |
boolean |
isClippedXY(int diameter,
int x,
int y) |
boolean |
isClippedZ(int z) |
static boolean |
isColixColorInherited(short colix) |
static boolean |
isColixTranslucent(short colix) |
boolean |
isDirectedTowardsCamera(short normix) |
boolean |
isDisplayAntialiased()
is full scene / oversampling antialiasing GENERALLY in effect
|
boolean |
isInDisplayRange(int x,
int y) |
(package private) static void |
mergeBufferPixel(int[] pbuf,
int argbB,
int pt,
int bgcolor) |
(package private) void |
mergeOpaqueAndTranslucentBuffers() |
void |
plotImage(int x,
int y,
int z,
java.awt.Image image,
JmolRendererInterface jmolRenderer,
short bgcolix,
int width,
int height) |
(package private) void |
plotPixelClipped(int argb,
boolean isScreened,
int x,
int y,
int z) |
(package private) void |
plotPixelClipped(int x,
int y,
int z) |
(package private) void |
plotPixelClipped(int argb,
int x,
int y,
int z) |
void |
plotPixelClipped(javax.vecmath.Point3i screen) |
void |
plotPixelClippedNoSlab(int argb,
int x,
int y,
int z) |
(package private) void |
plotPixelsClipped(int count,
int x,
int y,
int z) |
(package private) void |
plotPixelsClipped(int count,
int x,
int y,
int zAtLeft,
int zPastRight,
Rgb16 rgb16Left,
Rgb16 rgb16Right) |
(package private) void |
plotPixelsUnclipped(int count,
int x,
int y,
int z) |
(package private) void |
plotPixelsUnclipped(int count,
int x,
int y,
int zAtLeft,
int zPastRight,
Rgb16 rgb16Left,
Rgb16 rgb16Right) |
(package private) void |
plotPixelUnclipped(int x,
int y,
int z) |
(package private) void |
plotPixelUnclipped(int argb,
int x,
int y,
int z) |
private void |
plotPoints(int count,
int[] coordinates,
int xOffset,
int yOffset) |
void |
plotText(int x,
int y,
int z,
int argb,
java.lang.String text,
Font3D font3d,
JmolRendererInterface jmolRenderer) |
private void |
releaseBuffers() |
void |
releaseScreenImage() |
void |
renderBackground() |
void |
renderBackground(JmolRendererInterface jmolRenderer) |
static void |
setAmbientPercent(int val)
fractional distance from black for ambient color
|
void |
setBackgroundArgb(int argb)
sets background color to the specified argb value
|
void |
setBackgroundImage(java.awt.Image image) |
void |
setBackgroundTransparent(boolean TF) |
boolean |
setColix(short colix)
sets current color from colix color index
|
(package private) void |
setColorNoisy(int shadeIndex) |
static void |
setDiffusePercent(int val)
df in I = df * (N dot L) + sf * (R dot V)^p
|
void |
setFont(byte fid) |
void |
setFont(Font3D font3d) |
void |
setGreyscaleMode(boolean greyscaleMode)
controls greyscale rendering
|
void |
setNewWindowParametersForExport() |
void |
setNoisySurfaceShade(javax.vecmath.Point3i screenA,
javax.vecmath.Point3i screenB,
javax.vecmath.Point3i screenC)
used by CartoonRenderer (DNA surface) and GeoSurfaceRenderer (face) to
assign a noisy shade to the surface it will render
|
boolean |
setPass2(boolean antialiasTranslucent) |
static void |
setPhongExponent(int val)
p in I = df * (N dot L) + sf * (R dot V)^p
|
void |
setSlab(int slabValue) |
void |
setSlabAndDepthValues(int slabValue,
int depthValue,
boolean zShade,
int zSlab,
int zDepth)
clipping from the front and the back
|
static void |
setSpecular(boolean val) |
static void |
setSpecularExponent(int val)
log_2(p) in I = df * (N dot L) + sf * (R dot V)^p
for faster calculation of shades
|
static void |
setSpecularPercent(int val)
sf in I = df * (N dot L) + sf * (R dot V)^p
not a percent of anything, really
|
static void |
setSpecularPower(int val)
fractional distance to white for specular dot
|
void |
setTranslucentCoverOnly(boolean TF) |
private void |
setTriangleColixAndShadeIndex(short colix,
int shadeIndex) |
private boolean |
setTriangleTranslucency(short colixA,
short colixB,
short colixC) |
private void |
setWidthHeight(boolean isAntialiased) |
void |
setWindowParameters(int width,
int height,
boolean antialias) |
(package private) void |
setZMargin(int dz) |
static void |
setZShadePower(int val)
fractional distance from black for ambient color
|
void |
snapshotAnaglyphChannelBytes() |
static float |
translucencyFractionalFromColix(short colix) |
Platform3D platform
Line3D line3d
Circle3D circle3d
Sphere3D sphere3d
Triangle3D triangle3d
Cylinder3D cylinder3d
Hermite3D hermite3d
Normix3D normix3d
boolean isFullSceneAntialiasingEnabled
private boolean antialiasThisFrame
private boolean antialias2
private boolean antialiasEnabled
boolean inGreyscaleMode
byte[] anaglyphChannelBytes
boolean twoPass
boolean isPass2
boolean addAllPixels
boolean haveTranslucentObjects
boolean translucentCoverOnly
int windowWidth
int windowHeight
int width
int height
int displayMinX
int displayMaxX
int displayMinY
int displayMaxY
int slab
int depth
int zSlab
int zDepth
boolean zShade
int xLast
int yLast
int[] pbuf
int[] pbufT
int[] zbuf
int[] zbufT
int bufferSize
short colixCurrent
int[] shadesCurrent
int argbCurrent
boolean isScreened
int translucencyMask
int argbNoisyUp
int argbNoisyDn
Font3D font3dCurrent
public static final byte ENDCAPS_NONE
public static final byte ENDCAPS_OPEN
public static final byte ENDCAPS_FLAT
public static final byte ENDCAPS_SPHERICAL
public static final byte ENDCAPS_OPENEND
public static final short INHERIT_ALL
public static final short USE_PALETTE
public static final short BLACK
public static final short ORANGE
public static final short PINK
public static final short BLUE
public static final short WHITE
public static final short CYAN
public static final short RED
public static final short GREEN
public static final short GRAY
public static final short SILVER
public static final short LIME
public static final short MAROON
public static final short NAVY
public static final short OLIVE
public static final short PURPLE
public static final short TEAL
public static final short MAGENTA
public static final short YELLOW
public static final short HOTPINK
public static final short GOLD
int newWindowWidth
int newWindowHeight
boolean newAntialiasing
public double random
int anaglyphLength
public java.awt.Image backgroundImage
public int bgcolor
Graphics3D.Pixel pixel
int zShadeR
int zShadeG
int zShadeB
private int currentShadeIndex
int zMargin
boolean currentlyRendering
static final int yGT
static final int yLT
static final int xGT
static final int xLT
static final int zGT
static final int zLT
private static final short CHANGEABLE_MASK
private static final short UNMASK_CHANGEABLE_TRANSLUCENT
private static final int TRANSLUCENT_SHIFT
private static final int ALPHA_SHIFT
private static final int TRANSLUCENT_MASK
private static final int TRANSLUCENT_SCREENED
private static final int TRANSPARENT
static final int TRANSLUCENT_50
public static final short OPAQUE_MASK
private static final short INHERIT_COLOR
static final short UNUSED_OPTION3
static final short SPECIAL_COLIX_MAX
private short[] changeableColixMap
private final javax.vecmath.Vector3f vectorAB
private final javax.vecmath.Vector3f vectorAC
private final javax.vecmath.Vector3f vectorNormal
private static final java.lang.String[] colorNames
private static final int[] colorArgbs
private static final java.util.Hashtable mapJavaScriptColors
public static final short NORMIX_NULL
public static final int EXPORT_NOT
public static final int EXPORT_CARTESIAN
public static final int EXPORT_RAYTRACER
public Graphics3D(java.awt.Component awtComponent)
awtComponent
- the java.awt.Component where the image will be drawnpublic void destroy()
public boolean isDisplayAntialiased()
public boolean isAntialiased()
isAntialiased
in interface JmolRendererInterface
public void setTranslucentCoverOnly(boolean TF)
setTranslucentCoverOnly
in interface JmolRendererInterface
public boolean currentlyRendering()
public void setWindowParameters(int width, int height, boolean antialias)
public void setNewWindowParametersForExport()
private void setWidthHeight(boolean isAntialiased)
public boolean checkTranslucent(boolean isAlphaTranslucent)
checkTranslucent
in interface JmolRendererInterface
public void beginRendering(javax.vecmath.Matrix3f rotationMatrix)
private void releaseBuffers()
public boolean setPass2(boolean antialiasTranslucent)
public void endRendering()
public void snapshotAnaglyphChannelBytes()
public void applyCustomAnaglyph(int[] stereoColors)
public void applyGreenAnaglyph()
public void applyBlueAnaglyph()
public void applyCyanAnaglyph()
public java.awt.Image getScreenImage()
public void releaseScreenImage()
public boolean haveTranslucentObjects()
haveTranslucentObjects
in interface JmolRendererInterface
public int getRenderWidth()
getRenderWidth
in interface JmolRendererInterface
public int getRenderHeight()
getRenderHeight
in interface JmolRendererInterface
public int getSlab()
getSlab
in interface JmolRendererInterface
public int getDepth()
getDepth
in interface JmolRendererInterface
public void setBackgroundTransparent(boolean TF)
public void setBackgroundArgb(int argb)
argb
- an argb value with alpha channelpublic void setBackgroundImage(java.awt.Image image)
public void setGreyscaleMode(boolean greyscaleMode)
greyscaleMode
- Flag for greyscale renderingpublic void setSlabAndDepthValues(int slabValue, int depthValue, boolean zShade, int zSlab, int zDepth)
the plane is defined as a percentage from the back of the image to the front
For slab values:
for depth values:
slabValue
- front clipping percentage [0,100]depthValue
- rear clipping percentage [0,100]zShade
- whether to shade along z front to backzSlab
- for zShadezDepth
- for zShadepublic void setSlab(int slabValue)
setSlab
in interface JmolRendererInterface
private void downsampleFullSceneAntialiasing(boolean downsampleZBuffer)
void mergeOpaqueAndTranslucentBuffers()
static void averageBufferPixel(int[] pIn, int[] pOut, int pt, int dp)
static void mergeBufferPixel(int[] pbuf, int argbB, int pt, int bgcolor)
public boolean hasContent()
public boolean setColix(short colix)
setColix
in interface JmolRendererInterface
colix
- the color indexvoid setZMargin(int dz)
void addPixel(int offset, int z, int p)
public void drawFilledCircle(short colixRing, short colixFill, int diameter, int x, int y, int z)
JmolRendererInterface
drawFilledCircle
in interface JmolRendererInterface
x
- center xy
- center yz
- center zpublic void fillSphere(int diameter, int x, int y, int z)
fillSphere
in interface JmolRendererInterface
diameter
- pixel countx
- center xy
- center yz
- center zpublic void fillSphere(int diameter, javax.vecmath.Point3i center)
fillSphere
in interface JmolRendererInterface
diameter
- pixel countcenter
- javax.vecmath.Point3i defining the centerpublic void fillSphere(int diameter, javax.vecmath.Point3f center)
fillSphere
in interface JmolRendererInterface
diameter
- pixel countcenter
- a javax.vecmath.Point3f ... floats are casted to intspublic void fillEllipsoid(javax.vecmath.Point3f center, javax.vecmath.Point3f[] points, int x, int y, int z, int diameter, javax.vecmath.Matrix3f mToEllipsoidal, double[] coef, javax.vecmath.Matrix4f mDeriv, int selectedOctant, javax.vecmath.Point3i[] octantPoints)
fillEllipsoid
in interface JmolRendererInterface
public void drawRect(int x, int y, int z, int zSlab, int rWidth, int rHeight)
drawRect
in interface JmolRendererInterface
x
- upper left xy
- upper left yz
- upper left zzSlab
- z for slab check (for set labelsFront)rWidth
- pixel countrHeight
- pixel countprivate void drawHLine(int x, int y, int z, int w)
private void drawVLine(int x, int y, int z, int h)
public void fillRect(int x, int y, int z, int zSlab, int widthFill, int heightFill)
fillRect
in interface JmolRendererInterface
x
- upper left xy
- upper left yz
- upper left zzSlab
- z value for slabbingwidthFill
- pixel countheightFill
- pixel countpublic void drawString(java.lang.String str, Font3D font3d, int xBaseline, int yBaseline, int z, int zSlab)
drawString
in interface JmolRendererInterface
str
- the Stringfont3d
- the Font3DxBaseline
- baseline xyBaseline
- baseline yz
- baseline zzSlab
- z for slab calculationpublic void drawStringNoSlab(java.lang.String str, Font3D font3d, int xBaseline, int yBaseline, int z)
drawStringNoSlab
in interface JmolRendererInterface
str
- the Stringfont3d
- the Font3DxBaseline
- baseline xyBaseline
- baseline yz
- baseline zpublic void plotText(int x, int y, int z, int argb, java.lang.String text, Font3D font3d, JmolRendererInterface jmolRenderer)
public void drawImage(java.awt.Image image, int x, int y, int z, int zSlab, short bgcolix, int width, int height)
drawImage
in interface JmolRendererInterface
public void plotImage(int x, int y, int z, java.awt.Image image, JmolRendererInterface jmolRenderer, short bgcolix, int width, int height)
public void setFont(byte fid)
setFont
in interface JmolRendererInterface
public void setFont(Font3D font3d)
public Font3D getFont3DCurrent()
getFont3DCurrent
in interface JmolRendererInterface
public void drawPixel(int x, int y, int z)
drawPixel
in interface JmolRendererInterface
public void drawPoints(int count, int[] coordinates, int scale)
drawPoints
in interface JmolRendererInterface
public void drawDashedLine(int run, int rise, javax.vecmath.Point3i pointA, javax.vecmath.Point3i pointB)
drawDashedLine
in interface JmolRendererInterface
public void drawDottedLine(javax.vecmath.Point3i pointA, javax.vecmath.Point3i pointB)
drawDottedLine
in interface JmolRendererInterface
public void drawLine(int x1, int y1, int z1, int x2, int y2, int z2)
drawLine
in interface JmolRendererInterface
public void drawLine(short colixA, short colixB, int x1, int y1, int z1, int x2, int y2, int z2)
drawLine
in interface JmolRendererInterface
public void drawLine(javax.vecmath.Point3i pointA, javax.vecmath.Point3i pointB)
drawLine
in interface JmolRendererInterface
public void fillCylinder(short colixA, short colixB, byte endcaps, int diameter, int xA, int yA, int zA, int xB, int yB, int zB)
fillCylinder
in interface JmolRendererInterface
public void fillCylinderScreen(byte endcaps, int diameter, int xA, int yA, int zA, int xB, int yB, int zB)
fillCylinderScreen
in interface JmolRendererInterface
public void fillCylinderScreen(byte endcaps, int diameter, javax.vecmath.Point3i screenA, javax.vecmath.Point3i screenB)
fillCylinderScreen
in interface JmolRendererInterface
public void fillCylinder(byte endcaps, int diameter, javax.vecmath.Point3i screenA, javax.vecmath.Point3i screenB)
fillCylinder
in interface JmolRendererInterface
public void fillCylinderBits(byte endcaps, int diameter, javax.vecmath.Point3f screenA, javax.vecmath.Point3f screenB)
fillCylinderBits
in interface JmolRendererInterface
public void fillConeScreen(byte endcap, int screenDiameter, javax.vecmath.Point3i screenBase, javax.vecmath.Point3i screenTip)
fillConeScreen
in interface JmolRendererInterface
public void fillConeSceen(byte endcap, int screenDiameter, javax.vecmath.Point3f screenBase, javax.vecmath.Point3f screenTip)
fillConeSceen
in interface JmolRendererInterface
public void drawHermite(int tension, javax.vecmath.Point3i s0, javax.vecmath.Point3i s1, javax.vecmath.Point3i s2, javax.vecmath.Point3i s3)
drawHermite
in interface JmolRendererInterface
public void drawHermite(boolean fill, boolean border, int tension, javax.vecmath.Point3i s0, javax.vecmath.Point3i s1, javax.vecmath.Point3i s2, javax.vecmath.Point3i s3, javax.vecmath.Point3i s4, javax.vecmath.Point3i s5, javax.vecmath.Point3i s6, javax.vecmath.Point3i s7, int aspectRatio)
drawHermite
in interface JmolRendererInterface
public void fillHermite(int tension, int diameterBeg, int diameterMid, int diameterEnd, javax.vecmath.Point3i s0, javax.vecmath.Point3i s1, javax.vecmath.Point3i s2, javax.vecmath.Point3i s3)
fillHermite
in interface JmolRendererInterface
public static void getHermiteList(int tension, javax.vecmath.Tuple3f s0, javax.vecmath.Tuple3f s1, javax.vecmath.Tuple3f s2, javax.vecmath.Tuple3f s3, javax.vecmath.Tuple3f s4, javax.vecmath.Tuple3f[] list, int index0, int n)
public void drawTriangle(javax.vecmath.Point3i screenA, short colixA, javax.vecmath.Point3i screenB, short colixB, javax.vecmath.Point3i screenC, short colixC, int check)
drawTriangle
in interface JmolRendererInterface
public void drawTriangle(javax.vecmath.Point3i screenA, javax.vecmath.Point3i screenB, javax.vecmath.Point3i screenC, int check)
drawTriangle
in interface JmolRendererInterface
public void fillTriangleTwoSided(short normix, int xScreenA, int yScreenA, int zScreenA, int xScreenB, int yScreenB, int zScreenB, int xScreenC, int yScreenC, int zScreenC)
fillTriangleTwoSided
in interface JmolRendererInterface
public void fillTriangle(javax.vecmath.Point3f screenA, javax.vecmath.Point3f screenB, javax.vecmath.Point3f screenC)
fillTriangle
in interface JmolRendererInterface
public void fillTriangle(javax.vecmath.Point3i screenA, javax.vecmath.Point3i screenB, javax.vecmath.Point3i screenC)
fillTriangle
in interface JmolRendererInterface
public void fillTriangle(javax.vecmath.Point3i screenA, short colixA, short normixA, javax.vecmath.Point3i screenB, short colixB, short normixB, javax.vecmath.Point3i screenC, short colixC, short normixC, float factor)
fillTriangle
in interface JmolRendererInterface
public void fillTriangle(javax.vecmath.Point3i screenA, short colixA, short normixA, javax.vecmath.Point3i screenB, short colixB, short normixB, javax.vecmath.Point3i screenC, short colixC, short normixC)
fillTriangle
in interface JmolRendererInterface
private void setTriangleColixAndShadeIndex(short colix, int shadeIndex)
private boolean setTriangleTranslucency(short colixA, short colixB, short colixC)
public void drawQuadrilateral(short colix, javax.vecmath.Point3i screenA, javax.vecmath.Point3i screenB, javax.vecmath.Point3i screenC, javax.vecmath.Point3i screenD)
drawQuadrilateral
in interface JmolRendererInterface
public void fillQuadrilateral(javax.vecmath.Point3f screenA, javax.vecmath.Point3f screenB, javax.vecmath.Point3f screenC, javax.vecmath.Point3f screenD)
fillQuadrilateral
in interface JmolRendererInterface
public void fillQuadrilateral(javax.vecmath.Point3i screenA, short colixA, short normixA, javax.vecmath.Point3i screenB, short colixB, short normixB, javax.vecmath.Point3i screenC, short colixC, short normixC, javax.vecmath.Point3i screenD, short colixD, short normixD)
fillQuadrilateral
in interface JmolRendererInterface
public void drawSurface(MeshSurface meshSurface, javax.vecmath.Point3f[] vertices, javax.vecmath.Point3f offset)
drawSurface
in interface JmolRendererInterface
public boolean isClipped(int x, int y, int z)
public boolean isClipped(int x, int y)
public boolean isInDisplayRange(int x, int y)
isInDisplayRange
in interface JmolRendererInterface
public boolean isClippedXY(int diameter, int x, int y)
isClippedXY
in interface JmolRendererInterface
public boolean isClippedZ(int z)
isClippedZ
in interface JmolRendererInterface
public int clipCode(int x, int y, int z)
public int clipCode(int z)
void plotPixelClipped(int x, int y, int z)
public void plotPixelClipped(javax.vecmath.Point3i screen)
plotPixelClipped
in interface JmolRendererInterface
void plotPixelClipped(int argb, int x, int y, int z)
public void plotPixelClippedNoSlab(int argb, int x, int y, int z)
plotPixelClippedNoSlab
in interface JmolRendererInterface
void plotPixelClipped(int argb, boolean isScreened, int x, int y, int z)
void plotPixelUnclipped(int x, int y, int z)
void plotPixelUnclipped(int argb, int x, int y, int z)
void plotPixelsClipped(int count, int x, int y, int z)
void plotPixelsClipped(int count, int x, int y, int zAtLeft, int zPastRight, Rgb16 rgb16Left, Rgb16 rgb16Right)
void plotPixelsUnclipped(int count, int x, int y, int zAtLeft, int zPastRight, Rgb16 rgb16Left, Rgb16 rgb16Right)
void plotPixelsUnclipped(int count, int x, int y, int z)
private void plotPoints(int count, int[] coordinates, int xOffset, int yOffset)
public static int calcGreyscaleRgbFromRgb(int rgb)
the alpha component is set to 0xFF. If you want a value in the range 0-255 then & the result with 0xFF;
rgb
- the rgb valuepublic static short getColix(int argb)
public short[] getBgColixes(short[] bgcolixes)
getBgColixes
in interface JmolRendererInterface
public static short getColixTranslucent(int argb)
public static java.lang.String getHexCodes(short[] colixes)
public static java.lang.String getHexCode(short colix)
public static short[] getColixArray(java.lang.String colorNames)
public static final javax.vecmath.Point3f colorPointFromInt(int color, javax.vecmath.Point3f pt)
public static int colorPtToInt(javax.vecmath.Point3f pt)
public static int colorTriadToInt(float x, float y, float z)
public static final javax.vecmath.Point3f colorPointFromInt2(int color)
public static final javax.vecmath.Point3f colorPointFromString(java.lang.String colorName, javax.vecmath.Point3f pt)
public static short getColix(java.lang.String colorName)
public static int getArgbFromString(java.lang.String strColor)
strColor
- private static final short applyColorTranslucencyLevel(short colix, float translucentLevel)
public static final int getColixTranslucencyLevel(short colix)
public static float translucencyFractionalFromColix(short colix)
public static short getColix(java.lang.Object obj)
public static final short getColixTranslucent(short colix, boolean isTranslucent, float translucentLevel)
public int getColorArgbOrGray(short colix)
getColorArgbOrGray
in interface JmolRendererInterface
int[] getShades(short colix)
public static final short getChangeableColixIndex(short colix)
public static final boolean isColixTranslucent(short colix)
public static final short getColixInherited(short myColix, short parentColix)
public static final boolean isColixColorInherited(short colix)
public static int getArgb(short colix)
public short getChangeableColix(short id, int argb)
public void changeColixArgb(short id, int argb)
private static void flushCaches()
public static javax.vecmath.Point3f getLightSource()
public static void setSpecular(boolean val)
public static boolean getSpecular()
public static void setZShadePower(int val)
val
- public static int getZShadePower()
public static void setAmbientPercent(int val)
val
- public static int getAmbientPercent()
public static void setDiffusePercent(int val)
val
- public static int getDiffusePercent()
public static void setPhongExponent(int val)
val
- public static int getPhongExponent()
public static void setSpecularExponent(int val)
val
- public static int getSpecularExponent()
public static void setSpecularPercent(int val)
val
- public static int getSpecularPercent()
public static void setSpecularPower(int val)
val
- public static int getSpecularPower()
void setColorNoisy(int shadeIndex)
public void setNoisySurfaceShade(javax.vecmath.Point3i screenA, javax.vecmath.Point3i screenB, javax.vecmath.Point3i screenC)
setNoisySurfaceShade
in interface JmolRendererInterface
screenA
- screenB
- screenC
- private int getShadeIndex(javax.vecmath.Point3f screenA, javax.vecmath.Point3f screenB, javax.vecmath.Point3f screenC)
public Font3D getFont3D(float fontSize)
public Font3D getFont3D(java.lang.String fontFace, float fontSize)
public static int getFontStyleID(java.lang.String fontStyle)
public Font3D getFont3D(java.lang.String fontFace, java.lang.String fontStyle, float fontSize)
public Font3D getFont3DScaled(Font3D font, float scale)
getFont3DScaled
in interface JmolRendererInterface
public byte getFontFid(float fontSize)
getFontFid
in interface JmolRendererInterface
public byte getFontFid(java.lang.String fontFace, float fontSize)
getFontFid
in interface JmolRendererInterface
public static short getInverseNormix(short normix)
public static short getNormix(javax.vecmath.Vector3f vector, java.util.BitSet bsTemp)
public static short get2SidedNormix(javax.vecmath.Vector3f vector, java.util.BitSet bsTemp)
public static javax.vecmath.Vector3f getNormixVector(short normix)
public boolean isDirectedTowardsCamera(short normix)
isDirectedTowardsCamera
in interface JmolRendererInterface
public javax.vecmath.Vector3f[] getTransformedVertexVectors()
getTransformedVertexVectors
in interface JmolRendererInterface
public void renderBackground()
renderBackground
in interface JmolRendererInterface
public void renderBackground(JmolRendererInterface jmolRenderer)
public void drawAtom(Atom atom)
drawAtom
in interface JmolRendererInterface
public int getExportType()
getExportType
in interface JmolRendererInterface
public java.lang.String getExportName()
getExportName
in interface JmolRendererInterface
public boolean canDoTriangles()
public boolean isCartesianExport()
public boolean initializeExporter(java.lang.String type, Viewer viewer, Graphics3D g3d, java.lang.Object output)
initializeExporter
in interface JmolRendererInterface
public java.lang.String finalizeOutput()
finalizeOutput
in interface JmolRendererInterface
public void drawBond(Atom atomA, Atom atomB, short colixA, short colixB, byte endcaps, short mad)
drawBond
in interface JmolRendererInterface
public boolean drawEllipse(javax.vecmath.Point3f ptAtom, javax.vecmath.Point3f ptX, javax.vecmath.Point3f ptY, boolean fillArc, boolean wireframeOnly)
drawEllipse
in interface JmolRendererInterface