public final class Graphics3D extends GData
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 | Field | Description |
---|---|---|
protected int[] |
pbuf |
|
protected int[] |
pbufT |
|
static java.util.Comparator<org.jmol.g3d.TextString> |
sort |
|
protected int |
translucencyMask |
|
protected boolean |
translucentCoverOnly |
|
protected int[] |
zbuf |
|
protected int[] |
zbufT |
|
protected int |
zMargin |
antialiasEnabled, antialiasThisFrame, apiPlatform, argbCurrent, backgroundImage, bgcolor, bufferSize, changeableColixMap, colixCurrent, depth, displayMaxX, displayMaxY, displayMinX, displayMinY, ENDCAPS_FLAT, ENDCAPS_NONE, ENDCAPS_OPEN, ENDCAPS_OPENEND, ENDCAPS_SPHERICAL, EXPORT_CARTESIAN, EXPORT_NOT, EXPORT_RAYTRACER, graphicsForMetrics, height, inGreyscaleMode, isPass2, newAntialiasing, newWindowHeight, newWindowWidth, slab, width, windowHeight, windowWidth, xGT, xLast, xLT, yGT, yLast, yLT, zDepth, zGT, zLT, zShadeB, zShadeG, zShadePower, zShadeR, zSlab
Constructor | Description |
---|---|
Graphics3D() |
Modifier and Type | Method | Description |
---|---|---|
void |
applyAnaglygh(EnumStereoMode stereoMode,
int[] stereoColors) |
|
void |
applyBlueAnaglyph() |
|
void |
applyCustomAnaglyph(int[] stereoColors) |
|
void |
applyCyanAnaglyph() |
|
void |
applyGreenAnaglyph() |
|
void |
beginRendering(Matrix3f rotationMatrix) |
|
boolean |
canDoTriangles() |
|
boolean |
checkTranslucent(boolean isAlphaTranslucent) |
|
void |
clear() |
|
void |
clearFontCache() |
|
boolean |
currentlyRendering() |
|
void |
destroy() |
|
void |
drawBond(Point3f atomA,
Point3f atomB,
short colixA,
short colixB,
byte endcaps,
short mad,
int bondOrder) |
|
void |
drawDashedLine(int run,
int rise,
Point3i pointA,
Point3i pointB) |
|
void |
drawDottedLine(Point3i pointA,
Point3i pointB) |
|
boolean |
drawEllipse(Point3f ptAtom,
Point3f ptX,
Point3f ptY,
boolean fillArc,
boolean wireframeOnly) |
|
void |
drawFilledCircle(short colixRing,
short colixFill,
int diameter,
int x,
int y,
int z) |
|
void |
drawHermite4(int tension,
Point3i s0,
Point3i s1,
Point3i s2,
Point3i s3) |
|
void |
drawHermite7(boolean fill,
boolean border,
int tension,
Point3i s0,
Point3i s1,
Point3i s2,
Point3i s3,
Point3i s4,
Point3i s5,
Point3i s6,
Point3i s7,
int aspectRatio,
short colixBack) |
|
void |
drawImage(java.lang.Object objImage,
int x,
int y,
int z,
int zSlab,
short bgcolix,
int width,
int height) |
|
void |
drawLine(short colixA,
short colixB,
int x1,
int y1,
int z1,
int x2,
int y2,
int z2) |
|
void |
drawLineAB(Point3i pointA,
Point3i pointB) |
|
void |
drawLineXYZ(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,
Point3i screenA,
Point3i screenB,
Point3i screenC,
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,
JmolFont font3d,
int xBaseline,
int yBaseline,
int z,
int zSlab,
short bgColix) |
draws the specified string in the current font.
|
void |
drawStringNoSlab(java.lang.String str,
JmolFont font3d,
int xBaseline,
int yBaseline,
int z,
short bgColix) |
draws the specified string in the current font.
|
void |
drawSurface(MeshSurface meshSurface,
short colix) |
|
void |
drawTriangle3C(Point3i screenA,
short colixA,
Point3i screenB,
short colixB,
Point3i screenC,
short colixC,
int check) |
|
void |
drawTriangle3I(Point3i screenA,
Point3i screenB,
Point3i screenC,
int check) |
|
void |
endRendering() |
|
void |
fillConeSceen3f(byte endcap,
int screenDiameter,
Point3f screenBase,
Point3f screenTip) |
|
void |
fillConeScreen(byte endcap,
int screenDiameter,
Point3i screenBase,
Point3i screenTip,
boolean isBarb) |
|
void |
fillCylinder(byte endcaps,
int diameter,
Point3i screenA,
Point3i screenB) |
|
void |
fillCylinderBits(byte endcaps,
int diameter,
Point3f screenA,
Point3f screenB) |
|
void |
fillCylinderScreen(byte endcaps,
int diameter,
int xA,
int yA,
int zA,
int xB,
int yB,
int zB) |
|
void |
fillCylinderScreen3I(byte endcaps,
int diameter,
Point3i screenA,
Point3i screenB,
Point3f pt0f,
Point3f pt1f,
float radius) |
|
void |
fillCylinderXYZ(short colixA,
short colixB,
byte endcaps,
int diameter,
int xA,
int yA,
int zA,
int xB,
int yB,
int zB) |
|
void |
fillEllipsoid(Point3f center,
Point3f[] points,
int x,
int y,
int z,
int diameter,
Matrix3f mToEllipsoidal,
double[] coef,
Matrix4f mDeriv,
int selectedOctant,
Point3i[] octantPoints) |
|
void |
fillHermite(int tension,
int diameterBeg,
int diameterMid,
int diameterEnd,
Point3i s0,
Point3i s1,
Point3i s2,
Point3i s3) |
|
void |
fillQuadrilateral(Point3f screenA,
Point3f screenB,
Point3f screenC,
Point3f screenD) |
|
void |
fillQuadrilateral3i(Point3i screenA,
short colixA,
short normixA,
Point3i screenB,
short colixB,
short normixB,
Point3i screenC,
short colixC,
short normixC,
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,
Point3f center) |
fills a solid sphere
|
void |
fillSphereI(int diameter,
Point3i center) |
fills a solid sphere
|
void |
fillSphereXYZ(int diameter,
int x,
int y,
int z) |
fills a solid sphere
|
void |
fillTriangle(Point3i screenA,
short colixA,
short normixA,
Point3i screenB,
short colixB,
short normixB,
Point3i screenC,
short colixC,
short normixC,
float factor) |
|
void |
fillTriangle3CN(Point3i screenA,
short colixA,
short normixA,
Point3i screenB,
short colixB,
short normixB,
Point3i screenC,
short colixC,
short normixC) |
|
void |
fillTriangle3f(Point3f screenA,
Point3f screenB,
Point3f screenC,
boolean setNoisy) |
|
void |
fillTriangle3i(Point3i screenA,
Point3i screenB,
Point3i screenC,
Point3f ptA,
Point3f ptB,
Point3f ptC) |
|
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() |
|
java.lang.String |
getExportName() |
|
int |
getExportType() |
|
JmolFont |
getFont3DCurrent() |
|
GData |
getGData() |
underlying GData object handles all general graphics setup.
|
double |
getPrivateKey() |
|
java.lang.Object |
getScreenImage() |
|
int |
getShadeIndex(short normix) |
|
Vector3f[] |
getTransformedVertexVectors() |
|
boolean |
hasContent() |
|
boolean |
haveTranslucentObjects() |
|
void |
initialize(ApiPlatform apiPlatform) |
|
boolean |
isCartesianExport() |
|
boolean |
isDirectedTowardsCamera(short normix) |
|
void |
plotImage(int x,
int y,
int z,
java.lang.Object image,
Graphics3D jmolRenderer,
short bgcolix,
int width,
int height) |
|
void |
plotImagePixel(int argb,
int x,
int y,
int z,
int shade,
int bgargb) |
|
void |
plotPixelClippedP3i(Point3i screen) |
|
void |
plotText(int x,
int y,
int z,
int argb,
int bgargb,
java.lang.String text,
JmolFont font3d,
Graphics3D jmolRenderer) |
|
void |
releaseScreenImage() |
|
void |
renderAllStrings(java.lang.Object jmolRenderer) |
|
void |
renderBackground(Graphics3D jmolRenderer) |
|
void |
renderCrossHairs(int[] minMax,
int screenWidth,
int screenHeight,
Point3f navOffset,
float navDepth) |
|
void |
setBackgroundTransparent(boolean TF) |
|
boolean |
setColix(short colix) |
sets current color from colix color index
|
void |
setColor(int argb) |
|
void |
setFont(JmolFont font3d) |
|
void |
setFontFid(byte fid) |
|
void |
setNoisySurfaceShade(Point3i screenA,
Point3i screenB,
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) |
|
void |
setRotationMatrix(Matrix3f rotationMatrix) |
|
void |
setTempZSlab(int zSlab) |
|
void |
setTranslucentCoverOnly(boolean TF) |
|
void |
setWindowParameters(int width,
int height,
boolean antialias) |
|
void |
setZShade(boolean zShade,
int zSlab,
int zDepth,
int zShadePower) |
|
void |
snapshotAnaglyphChannelBytes() |
|
void |
volumeRender(boolean TF) |
|
void |
volumeRender4(int diameter,
int x,
int y,
int z) |
changeColixArgb, clipCode, clipCode3, getAmbientPercent, getBgColixes, getChangeableColix, getColorArgbOrGray, getDepth, getDiffusePercent, getFont3D, getFont3DFS, getFont3DFSS, getFont3DScaled, getFontFid, getFontFidFS, getFontStyleID, getLightSource, getPhongExponent, getRenderHeight, getRenderWidth, getShades, getSlab, getSpecular, getSpecularExponent, getSpecularPercent, getSpecularPower, isAntialiased, isClipped, isClipped3, isClippedXY, isClippedZ, isDisplayAntialiased, isInDisplayRange, isPass2, plotImage, roundInt, setAmbientPercent, setBackgroundArgb, setBackgroundImage, setDepth, setDiffusePercent, setGreyscaleMode, setNewWindowParametersForExport, setPhongExponent, setSlab, setSpecular, setSpecularExponent, setSpecularPercent, setSpecularPower, setWidthHeight
protected boolean translucentCoverOnly
protected int[] pbuf
protected int[] pbufT
protected int[] zbuf
protected int[] zbufT
protected int translucencyMask
protected int zMargin
public static java.util.Comparator<org.jmol.g3d.TextString> sort
public GData getGData()
public void setTranslucentCoverOnly(boolean TF)
public void initialize(ApiPlatform apiPlatform)
initialize
in class GData
public boolean currentlyRendering()
public void setWindowParameters(int width, int height, boolean antialias)
setWindowParameters
in class GData
public boolean checkTranslucent(boolean isAlphaTranslucent)
public void beginRendering(Matrix3f rotationMatrix)
beginRendering
in class GData
public void setBackgroundTransparent(boolean TF)
setBackgroundTransparent
in class GData
public boolean setPass2(boolean antialiasTranslucent)
public void endRendering()
endRendering
in class GData
public void applyAnaglygh(EnumStereoMode stereoMode, int[] stereoColors)
applyAnaglygh
in class GData
public void snapshotAnaglyphChannelBytes()
snapshotAnaglyphChannelBytes
in class GData
public void applyCustomAnaglyph(int[] stereoColors)
public void applyGreenAnaglyph()
public void applyBlueAnaglyph()
public void applyCyanAnaglyph()
public java.lang.Object getScreenImage()
getScreenImage
in class GData
public void releaseScreenImage()
releaseScreenImage
in class GData
public boolean haveTranslucentObjects()
public void setTempZSlab(int zSlab)
public void setZShade(boolean zShade, int zSlab, int zDepth, int zShadePower)
public boolean hasContent()
public boolean setColix(short colix)
public void drawFilledCircle(short colixRing, short colixFill, int diameter, int x, int y, int z)
public void volumeRender4(int diameter, int x, int y, int z)
public void fillSphereXYZ(int diameter, int x, int y, int z)
diameter
- pixel countx
- center xy
- center yz
- center zpublic void volumeRender(boolean TF)
public void fillSphereI(int diameter, Point3i center)
diameter
- pixel countcenter
- javax.vecmath.Point3i defining the centerpublic void fillSphere(int diameter, Point3f center)
diameter
- pixel countcenter
- a javax.vecmath.Point3f ... floats are casted to intspublic void fillEllipsoid(Point3f center, Point3f[] points, int x, int y, int z, int diameter, Matrix3f mToEllipsoidal, double[] coef, Matrix4f mDeriv, int selectedOctant, Point3i[] octantPoints)
public void drawRect(int x, int y, int z, int zSlab, int rWidth, int rHeight)
x
- upper left xy
- upper left yz
- upper left zzSlab
- z for slab check (for set labelsFront)rWidth
- pixel countrHeight
- pixel countpublic void fillRect(int x, int y, int z, int zSlab, int widthFill, int heightFill)
x
- upper left xy
- upper left yz
- upper left zzSlab
- z value for slabbingwidthFill
- pixel countheightFill
- pixel countpublic void drawString(java.lang.String str, JmolFont font3d, int xBaseline, int yBaseline, int z, int zSlab, short bgColix)
str
- the Stringfont3d
- the Font3DxBaseline
- baseline xyBaseline
- baseline yz
- baseline zzSlab
- z for slab calculationbgColix
- public void drawStringNoSlab(java.lang.String str, JmolFont font3d, int xBaseline, int yBaseline, int z, short bgColix)
str
- the Stringfont3d
- the Font3DxBaseline
- baseline xyBaseline
- baseline yz
- baseline zbgColix
- public void renderAllStrings(java.lang.Object jmolRenderer)
renderAllStrings
in class GData
public void plotText(int x, int y, int z, int argb, int bgargb, java.lang.String text, JmolFont font3d, Graphics3D jmolRenderer)
public void drawImage(java.lang.Object objImage, int x, int y, int z, int zSlab, short bgcolix, int width, int height)
public void plotImage(int x, int y, int z, java.lang.Object image, Graphics3D jmolRenderer, short bgcolix, int width, int height)
public void setFontFid(byte fid)
setFontFid
in class GData
public JmolFont getFont3DCurrent()
getFont3DCurrent
in class GData
public void drawPixel(int x, int y, int z)
public void drawPoints(int count, int[] coordinates, int scale)
public void drawLineXYZ(int x1, int y1, int z1, int x2, int y2, int z2)
public void drawLine(short colixA, short colixB, int x1, int y1, int z1, int x2, int y2, int z2)
public void fillCylinderXYZ(short colixA, short colixB, byte endcaps, int diameter, int xA, int yA, int zA, int xB, int yB, int zB)
public void fillCylinderScreen(byte endcaps, int diameter, int xA, int yA, int zA, int xB, int yB, int zB)
public void fillCylinderScreen3I(byte endcaps, int diameter, Point3i screenA, Point3i screenB, Point3f pt0f, Point3f pt1f, float radius)
public void fillCylinder(byte endcaps, int diameter, Point3i screenA, Point3i screenB)
public void fillCylinderBits(byte endcaps, int diameter, Point3f screenA, Point3f screenB)
public void fillConeScreen(byte endcap, int screenDiameter, Point3i screenBase, Point3i screenTip, boolean isBarb)
public void fillConeSceen3f(byte endcap, int screenDiameter, Point3f screenBase, Point3f screenTip)
public void drawHermite7(boolean fill, boolean border, int tension, Point3i s0, Point3i s1, Point3i s2, Point3i s3, Point3i s4, Point3i s5, Point3i s6, Point3i s7, int aspectRatio, short colixBack)
public void fillHermite(int tension, int diameterBeg, int diameterMid, int diameterEnd, Point3i s0, Point3i s1, Point3i s2, Point3i s3)
public void drawTriangle3C(Point3i screenA, short colixA, Point3i screenB, short colixB, Point3i screenC, short colixC, int check)
public void drawTriangle3I(Point3i screenA, Point3i screenB, Point3i screenC, int check)
public void fillTriangleTwoSided(short normix, int xScreenA, int yScreenA, int zScreenA, int xScreenB, int yScreenB, int zScreenB, int xScreenC, int yScreenC, int zScreenC)
public void fillTriangle3f(Point3f screenA, Point3f screenB, Point3f screenC, boolean setNoisy)
public void fillTriangle3i(Point3i screenA, Point3i screenB, Point3i screenC, Point3f ptA, Point3f ptB, Point3f ptC)
public void fillTriangle(Point3i screenA, short colixA, short normixA, Point3i screenB, short colixB, short normixB, Point3i screenC, short colixC, short normixC, float factor)
public void fillTriangle3CN(Point3i screenA, short colixA, short normixA, Point3i screenB, short colixB, short normixB, Point3i screenC, short colixC, short normixC)
public void drawQuadrilateral(short colix, Point3i screenA, Point3i screenB, Point3i screenC, Point3i screenD)
public void fillQuadrilateral(Point3f screenA, Point3f screenB, Point3f screenC, Point3f screenD)
public void fillQuadrilateral3i(Point3i screenA, short colixA, short normixA, Point3i screenB, short colixB, short normixB, Point3i screenC, short colixC, short normixC, Point3i screenD, short colixD, short normixD)
public void drawSurface(MeshSurface meshSurface, short colix)
public void plotPixelClippedP3i(Point3i screen)
public void plotImagePixel(int argb, int x, int y, int z, int shade, int bgargb)
public void setNoisySurfaceShade(Point3i screenA, Point3i screenB, Point3i screenC)
setNoisySurfaceShade
in class GData
screenA
- screenB
- screenC
- public void renderBackground(Graphics3D jmolRenderer)
renderBackground
in class GData
public int getExportType()
public java.lang.String getExportName()
public boolean canDoTriangles()
public boolean isCartesianExport()
public java.lang.String finalizeOutput()
public void drawBond(Point3f atomA, Point3f atomB, short colixA, short colixB, byte endcaps, short mad, int bondOrder)
public boolean drawEllipse(Point3f ptAtom, Point3f ptX, Point3f ptY, boolean fillArc, boolean wireframeOnly)
public double getPrivateKey()
public void clearFontCache()
clearFontCache
in class GData
public Vector3f[] getTransformedVertexVectors()
getTransformedVertexVectors
in class GData
public boolean isDirectedTowardsCamera(short normix)
isDirectedTowardsCamera
in class GData
public void setRotationMatrix(Matrix3f rotationMatrix)
public int getShadeIndex(short normix)
public void renderCrossHairs(int[] minMax, int screenWidth, int screenHeight, Point3f navOffset, float navDepth)
minMax
- screenWidth
- screenHeight
- navOffset
- navDepth
-