Package org.jmol.g3d
Class Graphics3D
java.lang.Object
org.jmol.util.GData
org.jmol.g3d.Graphics3D
- All Implemented Interfaces:
JmolGraphicsInterface
,JmolRendererInterface
Provides high-level graphics primitives for 3D visualization for the software
renderers. These methods should not have to be used with WebGL or OpenGL or
other hardware accelerators.
This module is linked to via reflection from org.jmol.viewer.Viewer
Bob Hanson 9/2/2012
Note added 4/2015 BH:
Well, it turns out that the calculation of the intermediate pixel z value
in all methods involving rasterization of lines is incorrect and has been
incorrect since Jmol's inception. I noticed long ago that large triangles such as
produced in DRAW could incorrectly overlay/underlay other objects, but I could
never determine why. It turns out that the assumption that z-value is linear
across a line when perspectiveDepth is TRUE is simply incorrect.
Basically, the function z(x) is non-linear. Treating it as simply a
linear function results in oddities where lines and planes
-- particularly created using DRAW and large distances -- appear
to be where they are not.
Through Jmol 13.3.13 we had the standard linear relationship:
z = (x - xa) / (xb - xa) * (zb - za) + za
I worked it out, and, amazingly, it should be
z = (xb - xa) * za * zb / ((xb - x) * zb + (x - xa) * za)
Note that it is still true that when x = xb, z = zb
and when x = xa, z = za, as required.
This equation can be rearranged to
z = a / (b - x)
where
a = (xb - xa) * za * (zb / (zb - za))
and
b = (xb * zb - xa * za) / (zb - za)
These values must be floats, not integers, to work properly, because
these are extrapolations from long distances in some cases. So there is
considerable overhead there. It will take some experimentation to figure this
out.
The practical implications are for line, cylinder, and triangle drawing.
First-pass corrections are for axes and DRAW objects. They tend to be the
larger objects that result in the issue.
Also affected is POV-Ray output, because right now POV-Ray is created using
perspective on and plotted as though it were orthographic, but although that
works in x and y, it does not work in z!
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.
- Author:
- Miguel, miguel@jmol.org with additions by Bob Hanson hansonr@stolaf.edu The above is an understatement to say the least. This is a two-pass rendering system. In the first pass, all opaque objects are rendered. In the second pass, all translucent objects are rendered. If there are no translucent objects, then that is found in the first pass as follows: The renderers first try to set the color index of the object to be rendered using setColix(short colix), and that method returns false if we are in the wrong pass for that type of object. In addition, setColix records in the boolean haveTranslucentObjects whether a translucent object was seen in the first pass. The second pass is skipped if this flag is not set. This saves immensely on rendering time when there are no translucent objects. THUS, IT IS CRITICAL THAT ALL RENDERING OPTIONS CHECK THE COLIX USING g3d.setColix(short colix) PRIOR TO RENDERING. Translucency is rendered only approximately. We can't maintain a full buffer of all translucent objects. Instead, we "cheat" by maintaining one translucent z buffer. When a translucent pixel is to be written, its z position is checked and... ...if it is behind or at the z position of any pixel, it is ignored ...if it is in front of a translucent pixel, it is added to the translucent buffer ...if it is between an opaque and translucent pixel, the translucent pixel is turned opaque, and the new pixel is added to the translucent buffer This guarantees accurate translucency when there are no more than two translucent pixels between the user and an opaque pixel. It's a fudge, for sure. But it is pretty good, and certainly fine for "draft" work. Users needing more accurate translucencty are encouraged to use the POV-Ray export facility for production-level work. Antialiasing is accomplished as full scene antialiasing. This means that the width and height are doubled (both here and in TransformManager), the scene is rendered, and then each set of four pixels is averaged (roughly) as the final pixel in the width*height buffer. Antialiasing options allow for antialiasing of all objects: antialiasDisplay = true antialiasTranslucent = true or just the opaque ones: antialiasDisplay = true antialiasTranslucent = false or not at all: antialiasDisplay = false The difference will be speed and memory. Adding translucent objects doubles the buffer requirement, and adding antialiasing quadruples the buffer requirement. So we have: Memory requirements are significant, in multiples of (width) * (height) 32-bit integers: antialias OFF ON/opaque only ON/all objects no translucent 1p + 1z = 2 4p + 4z = 8 4p + 4z = 8 objects with translucent 2p + 2z = 4 5p + 5z = 10 8p + 8z = 16 objects Note that no antialising at all is required for POV-Ray output. POV-Ray will do antialiasing on its own. In principle we could save a bit in the case of antialiasing of just opaque objects and reuse the p and z buffers for the translucent buffer, but this hasn't been implemented because the savings isn't that great, and if you are going to the trouble of having antialiasing, you probably what it all.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
private int
private boolean
private int[]
private G3DRenderer
(package private) int
private CylinderRenderer
private boolean
private G3DRenderer
private boolean
private int
(package private) LineRenderer
private static byte
int
protected int[]
protected int[]
(package private) Pixelator
(package private) Pixelator
private PixelatorScreened
private PixelatorShaded
private PixelatorT
(package private) Platform3D
private boolean
private javajs.util.P3i
private int
private int
private javajs.util.P3i
private javajs.util.P3i
private final byte[]
private final byte[]
private int[]
static Comparator<TextString>
private SphereRenderer
private int
private TextString[]
(package private) int
protected int
private G3DRenderer
private boolean
private final javajs.util.V3
private final javajs.util.V3
private final javajs.util.V3
private boolean
protected int[]
protected int[]
protected int
Fields inherited from class org.jmol.util.GData
ambientOcclusion, antialiasEnabled, antialiasThisFrame, apiPlatform, argbCurrent, argbNoisyDn, argbNoisyUp, backgroundImage, bgcolor, bufferSize, changeableColixMap, colixCurrent, currentFont, currentlyRendering, depth, displayMaxX, displayMaxX2, displayMaxY, displayMaxY2, displayMinX, displayMinX2, displayMinY, displayMinY2, ENDCAPS_FLAT, ENDCAPS_FLAT_TO_SPHERICAL, ENDCAPS_HIDDEN, ENDCAPS_NONE, ENDCAPS_OPEN_TO_SPHERICAL, ENDCAPS_SPHERICAL, EXPORT_CARTESIAN, EXPORT_NOT, EXPORT_RAYTRACER, graphicsForMetrics, height, ht3, HUGE, inGreyscaleMode, isPass2, newAntialiasing, newWindowHeight, newWindowWidth, normixCount, shader, slab, textY, transformedVectors, translucentCoverOnly, vwr, width, windowHeight, windowWidth, xGT, xLast, xLT, yGT, yLast, yLT, zGT, zLT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRenderer
(int tok) allows core JavaScript loading to not involve these classesvoid
applyAnaglygh
(STER stereoMode, int[] stereoColors) void
beginRendering
(javajs.util.M3 rotationMatrix, boolean translucentMode, boolean isImageWrite, boolean renderLow) boolean
private boolean
checkGouraud
(short colixA, short colixB, short colixC, short normixA, short normixB, short normixC) boolean
checkTranslucent
(boolean isAlphaTranslucent) void
clear()
void
void
destroy()
static void
downsample2d
(int[] pbuf, int width, int height, int bgcheck) private static void
downsample2dZ
(int[] pbuf, int[] zbuf, int width, int height, int bgcheck) private void
downsampleFullSceneAntialiasing
(boolean downsampleZBuffer) void
void
drawBond
(javajs.util.P3 atomA, javajs.util.P3 atomB, short colixA, short colixB, byte endcaps, short mad, int bondOrder) void
drawDashedLineBits
(int run, int rise, javajs.util.P3 pointA, javajs.util.P3 pointB) boolean
drawEllipse
(javajs.util.P3 ptAtom, javajs.util.P3 ptX, javajs.util.P3 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
drawHermite4
(int tension, javajs.util.P3 s0, javajs.util.P3 s1, javajs.util.P3 s2, javajs.util.P3 s3) void
drawHermite7
(boolean fill, boolean border, int tension, javajs.util.P3 s0, javajs.util.P3 s1, javajs.util.P3 s2, javajs.util.P3 s3, javajs.util.P3 s4, javajs.util.P3 s5, javajs.util.P3 s6, javajs.util.P3 s7, int aspectRatio, short colixBack) private void
drawHLine
(int x, int y, int z, int w) void
void
drawLine
(short colixA, short colixB, int x1, int y1, int z1, int x2, int y2, int z2) void
drawLineAB
(javajs.util.P3 pointA, javajs.util.P3 pointB) void
drawLineABBits
(int run, int rise, boolean andClip) void
drawLineBits
(short colixA, short colixB, javajs.util.P3 pointA, javajs.util.P3 pointB) void
drawLinePixels
(javajs.util.P3i a, javajs.util.P3i b, int z, int zslab) 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
drawRect
(int x, int y, int z, int zSlab, int rWidth, int rHeight) draws a rectanglevoid
drawString
(String str, Font font3d, int xBaseline, int yBaseline, int z, int zSlab, short bgColix) draws the specified string in the current font.void
drawStringNoSlab
(String str, Font 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
(javajs.util.P3i screenA, short colixA, javajs.util.P3i screenB, short colixB, javajs.util.P3i screenC, short colixC, int check) private void
drawVLine
(int x, int y, int z, int h) void
void
fillConeScreen3f
(byte endcap, int screenDiameter, javajs.util.P3 screenBase, javajs.util.P3 screenTip, boolean isBarb) void
fillCylinder
(byte endcaps, int diameter, javajs.util.P3i screenA, javajs.util.P3i screenB) void
fillCylinderBits
(byte endcaps, int diameter, javajs.util.P3 screenA, javajs.util.P3 screenB) void
fillCylinderBits2
(short colixA, short colixB, byte endcaps, int diameter, javajs.util.P3 screenA, javajs.util.P3 screenB) void
fillCylinderScreen3I
(byte endcaps, int diameter, javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 pt0f, javajs.util.P3 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
(javajs.util.P3 center, javajs.util.P3[] points, int x, int y, int z, int diameter, javajs.util.M3 mToEllipsoidal, double[] coef, javajs.util.M4 mDeriv, int selectedOctant, javajs.util.P3[] octantPoints) void
fillHermite
(int tension, int diameterBeg, int diameterMid, int diameterEnd, javajs.util.P3 s0, javajs.util.P3 s1, javajs.util.P3 s2, javajs.util.P3 s3) void
fillQuadrilateral
(javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC, javajs.util.P3 screenD, boolean isSolid) void
fillSphereBits
(int diameter, javajs.util.P3 center) fills a solid spherevoid
fillSphereI
(int diameter, javajs.util.P3i center) fills a solid spherevoid
fillSphereXYZ
(int diameter, int x, int y, int z) fills a solid spherevoid
fillTextRect
(int x, int y, int z, int zSlab, int widthFill, int heightFill) fills background rectangle for labelvoid
fillTriangle3CN
(javajs.util.P3i screenA, short colixA, short normixA, javajs.util.P3i screenB, short colixB, short normixB, javajs.util.P3i screenC, short colixC, short normixC) void
fillTriangle3CNBits
(javajs.util.P3 screenA, short colixA, short normixA, javajs.util.P3 screenB, short colixB, short normixB, javajs.util.P3 screenC, short colixC, short normixC, boolean twoSided) void
fillTriangle3f
(javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC, boolean isSolid) void
fillTriangle3i
(javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC, javajs.util.T3 ptA, javajs.util.T3 ptB, javajs.util.T3 ptC, boolean doShade) private void
fillTriangleP3f
(javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC, boolean useGouraud) void
fillTriangleTwoSided
(short normix, javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC) static int
fixTextImageRGB
(int argb) int
double
private G3DRenderer
getRenderer
(String type) getScreenImage
(boolean isImageWrite) int
getShadeIndex
(short normix) private int
getShadeIndexP3
(javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC, boolean isSolid) boolean
boolean
void
initialize
(Viewer vwr, GenericPlatform apiPlatform) boolean
initializeOutput
(Viewer vwr, double privateKey, Map<String, Object> params) boolean
boolean
isWebGL()
static int
mergeBufferPixel
(int argbA, int argbB, int bgcolor) void
plotImage
(int x, int y, int z, Object image, JmolRendererInterface jmolRenderer, short bgcolix, int imageWidth, int imageHeight) void
plotImagePixel
(int argb, int x, int y, int z, byte shade, int bgargb, int width, int height, int[] zbuf, Object p, int transpLog) (package private) void
plotPixelClippedArgb
(int argb, int x, int y, int z, int width, int[] zbuf, Pixelator p) void
plotPixelClippedP3i
(javajs.util.P3i screen) (package private) void
plotPixelsClippedRaster
(int count, int x, int y, int zAtLeft, int zPastRight, Rgb16 rgb16Left, Rgb16 rgb16Right) (package private) void
plotPixelsClippedRasterBits
(int count, int x, int y, int zAtLeft, int zPastRight, Rgb16 rgb16Left, Rgb16 rgb16Right, float a, float b) (package private) void
plotPixelsUnclippedCount
(int c, int count, int x, int y, int z, int width, int[] zbuf, Pixelator p) (package private) void
plotPixelsUnclippedRaster
(int count, int x, int y, int zAtLeft, int zPastRight, Rgb16 rgb16Left, Rgb16 rgb16Right) (package private) void
plotPixelsUnclippedRasterBits
(int count, int x, int y, Rgb16 rgb16Left, Rgb16 rgb16Right, float a, float b) (package private) void
plotPixelUnclipped
(int argb, int x, int y, int z, int width, int[] zbuf, Pixelator p) private void
plotPoints
(int count, int[] coordinates, int xOffset, int yOffset) void
plotText
(int x, int y, int z, int argb, int bgargb, String text, Font font3d, JmolRendererInterface jmolRenderer) private void
void
void
renderAllStrings
(Object jmolRenderer) void
renderBackground
(JmolRendererInterface jmolRenderer) void
renderCrossHairs
(int[] minMax, int screenWidth, int screenHeight, javajs.util.P3 navOffset, float navDepth) void
setBackgroundTransparent
(boolean TF) boolean
setC
(short colix) sets current color from colix color index(package private) void
setColorNoisy
(int shadeIndex) void
boolean
setPass2
(boolean antialiasTranslucent) void
setRotationMatrix
(javajs.util.M3 rotationMatrix) (package private) Pixelator
setScreened
(boolean isScreened) private void
setScreeni
(javajs.util.P3 pt, javajs.util.P3i p) void
setSlabAndZShade
(int slabValue, int depthValue, int zSlab, int zDepth, int zShadePower) private void
setTriangleTranslucency
(short colixA, short colixB, short colixC) void
setWindowParameters
(int width, int height, boolean antialias) (package private) void
setZMargin
(int dz) void
void
volumeRender
(boolean TF) void
volumeRender4
(int diameter, int x, int y, int z) Methods inherited from class org.jmol.util.GData
changeColixArgb, clipCode, clipCode3, drawQuadrilateralBits, drawTriangleBits, getAmbientPercent, getCel, getCelPower, getChangeableColix, getColorArgbOrGray, getDiffusePercent, getFont3D, getFont3DCurrent, getFont3DFS, getFont3DFSS, getFont3DScaled, getFontFidFS, getFontFidI, getHermiteList, getLightSource, getPhongExponent, getShades, getSpecular, getSpecularExponent, getSpecularPercent, getSpecularPower, getTextPosition, getTransformedVertexVectors, isAntialiased, isClipped, isClipped3, isClippedXY, isClippedZ, isDirectedTowardsCamera, isInDisplayRange, roundInt, setAmbientOcclusion, setAmbientPercent, setBackgroundArgb, setBackgroundImage, setCel, setCelPower, setColor, setDepth, setDiffusePercent, setFontBold, setGreyscaleMode, setNewWindowParametersForExport, setPhongExponent, setSlab, setSpecular, setSpecularExponent, setSpecularPercent, setSpecularPower, setTextPosition, setWidthHeight, setWinParams
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jmol.api.JmolGraphicsInterface
isAntialiased, isClippedXY, isInDisplayRange, setSlab
-
Field Details
-
platform
Platform3D platform -
line3d
LineRenderer line3d -
sphere3d
-
cylinder3d
-
triangle3d
-
circle3d
-
hermite3d
-
isFullSceneAntialiasingEnabled
private boolean isFullSceneAntialiasingEnabled -
antialias2
private boolean antialias2 -
strings
-
stringCount
private int stringCount -
anaglyphChannelBytes
private byte[] anaglyphChannelBytes -
twoPass
private boolean twoPass -
haveTranslucentObjects
private boolean haveTranslucentObjects -
pbuf
protected int[] pbuf -
pbufT
protected int[] pbufT -
zbuf
protected int[] zbuf -
zbufT
protected int[] zbufT -
translucencyMask
protected int translucencyMask -
renderLow
private boolean renderLow -
shadesCurrent
private int[] shadesCurrent -
anaglyphLength
private int anaglyphLength -
pixel
Pixelator pixel -
pixel0
Pixelator pixel0 -
pixelT0
-
pixelScreened
-
pixelShaded
-
zMargin
protected int zMargin -
aobuf
private int[] aobuf -
currentShadeIndex
int currentShadeIndex -
lastRawColor
private int lastRawColor -
translucencyLog
int translucencyLog -
wasScreened
private boolean wasScreened -
saveAmbient
private int saveAmbient -
saveDiffuse
private int saveDiffuse -
sort
-
sA
private javajs.util.P3i sA -
sB
private javajs.util.P3i sB -
sC
private javajs.util.P3i sC -
nullShadeIndex
private static byte nullShadeIndex -
vectorAB
private final javajs.util.V3 vectorAB -
vectorAC
private final javajs.util.V3 vectorAC -
vectorNormal
private final javajs.util.V3 vectorNormal -
shadeIndexes
private final byte[] shadeIndexes -
shadeIndexes2Sided
private final byte[] shadeIndexes2Sided -
pass2Flag01
public int pass2Flag01
-
-
Constructor Details
-
Graphics3D
public Graphics3D()
-
-
Method Details
-
isWebGL
public boolean isWebGL()- Specified by:
isWebGL
in interfaceJmolRendererInterface
-
clear
public void clear() -
destroy
public void destroy() -
setZMargin
void setZMargin(int dz) -
initialize
- Overrides:
initialize
in classGData
-
addRenderer
public void addRenderer(int tok) allows core JavaScript loading to not involve these classes- Specified by:
addRenderer
in interfaceJmolRendererInterface
- Overrides:
addRenderer
in classGData
- Parameters:
tok
-
-
getRenderer
-
setWindowParameters
public void setWindowParameters(int width, int height, boolean antialias) - Overrides:
setWindowParameters
in classGData
-
checkTranslucent
public boolean checkTranslucent(boolean isAlphaTranslucent) - Specified by:
checkTranslucent
in interfaceJmolRendererInterface
-
beginRendering
public void beginRendering(javajs.util.M3 rotationMatrix, boolean translucentMode, boolean isImageWrite, boolean renderLow) - Overrides:
beginRendering
in classGData
renderLow
- TODO
-
setBackgroundTransparent
public void setBackgroundTransparent(boolean TF) - Overrides:
setBackgroundTransparent
in classGData
-
releaseBuffers
private void releaseBuffers() -
setPass2
public boolean setPass2(boolean antialiasTranslucent) -
endRendering
public void endRendering()- Overrides:
endRendering
in classGData
-
mergeBufferPixel
public static int mergeBufferPixel(int argbA, int argbB, int bgcolor) -
getScreenImage
- Overrides:
getScreenImage
in classGData
- Returns:
- image object
-
applyAnaglygh
- Overrides:
applyAnaglygh
in classGData
-
snapshotAnaglyphChannelBytes
public void snapshotAnaglyphChannelBytes()- Overrides:
snapshotAnaglyphChannelBytes
in classGData
-
releaseScreenImage
public void releaseScreenImage()- Overrides:
releaseScreenImage
in classGData
-
haveTranslucentObjects
public boolean haveTranslucentObjects()- Specified by:
haveTranslucentObjects
in interfaceJmolRendererInterface
-
setSlabAndZShade
public void setSlabAndZShade(int slabValue, int depthValue, int zSlab, int zDepth, int zShadePower) - Specified by:
setSlabAndZShade
in interfaceJmolGraphicsInterface
- Overrides:
setSlabAndZShade
in classGData
zSlab
- for zShadezDepth
- for zShade
-
downsampleFullSceneAntialiasing
private void downsampleFullSceneAntialiasing(boolean downsampleZBuffer) -
downsample2d
public static void downsample2d(int[] pbuf, int width, int height, int bgcheck) -
downsample2dZ
private static void downsample2dZ(int[] pbuf, int[] zbuf, int width, int height, int bgcheck) -
hasContent
public boolean hasContent() -
setC
public boolean setC(short colix) sets current color from colix color index- Specified by:
setC
in interfaceJmolRendererInterface
- Overrides:
setC
in classGData
- Parameters:
colix
- the color index- Returns:
- true or false if this is the right pass
-
setScreened
-
drawFilledCircle
public void drawFilledCircle(short colixRing, short colixFill, int diameter, int x, int y, int z) Description copied from interface:JmolRendererInterface
draws a ring and filled circle (halos, draw CIRCLE, draw handles)- Specified by:
drawFilledCircle
in interfaceJmolRendererInterface
x
- center xy
- center yz
- center z
-
volumeRender4
public void volumeRender4(int diameter, int x, int y, int z) - Specified by:
volumeRender4
in interfaceJmolRendererInterface
-
fillSphereXYZ
public void fillSphereXYZ(int diameter, int x, int y, int z) fills a solid sphere- Specified by:
fillSphereXYZ
in interfaceJmolRendererInterface
- Parameters:
diameter
- pixel countx
- center xy
- center yz
- center z
-
volumeRender
public void volumeRender(boolean TF) - Specified by:
volumeRender
in interfaceJmolRendererInterface
-
fillSphereI
public void fillSphereI(int diameter, javajs.util.P3i center) fills a solid sphere- Specified by:
fillSphereI
in interfaceJmolRendererInterface
- Parameters:
diameter
- pixel countcenter
- javax.vecmath.Point3i defining the center
-
fillSphereBits
public void fillSphereBits(int diameter, javajs.util.P3 center) fills a solid sphere- Specified by:
fillSphereBits
in interfaceJmolRendererInterface
- Parameters:
diameter
- pixel countcenter
- a javax.vecmath.Point3f ... floats are casted to ints
-
fillEllipsoid
public void fillEllipsoid(javajs.util.P3 center, javajs.util.P3[] points, int x, int y, int z, int diameter, javajs.util.M3 mToEllipsoidal, double[] coef, javajs.util.M4 mDeriv, int selectedOctant, javajs.util.P3[] octantPoints) - Specified by:
fillEllipsoid
in interfaceJmolRendererInterface
-
drawRect
public void drawRect(int x, int y, int z, int zSlab, int rWidth, int rHeight) draws a rectangle- Specified by:
drawRect
in interfaceJmolRendererInterface
- Parameters:
x
- upper left xy
- upper left yz
- upper left zzSlab
- z for slab check (for set labelsFront)rWidth
- pixel countrHeight
- pixel count
-
drawHLine
private void drawHLine(int x, int y, int z, int w) -
drawVLine
private void drawVLine(int x, int y, int z, int h) -
fillTextRect
public void fillTextRect(int x, int y, int z, int zSlab, int widthFill, int heightFill) fills background rectangle for label- Specified by:
fillTextRect
in interfaceJmolRendererInterface
- Parameters:
x
- upper left xy
- upper left yz
- upper left zzSlab
- z value for slabbingwidthFill
- pixel countheightFill
- pixel count
-
drawString
public void drawString(String str, Font font3d, int xBaseline, int yBaseline, int z, int zSlab, short bgColix) draws the specified string in the current font. no line wrapping -- axis, labels, measures- Specified by:
drawString
in interfaceJmolRendererInterface
- Parameters:
str
- the Stringfont3d
- the Font3DxBaseline
- baseline xyBaseline
- baseline yz
- baseline zzSlab
- z for slab calculationbgColix
-
-
drawStringNoSlab
public void drawStringNoSlab(String str, Font font3d, int xBaseline, int yBaseline, int z, short bgColix) draws the specified string in the current font. no line wrapping -- echo, frank, hover, molecularOrbital, uccage- Specified by:
drawStringNoSlab
in interfaceJmolRendererInterface
- Parameters:
str
- the Stringfont3d
- the Font3DxBaseline
- baseline xyBaseline
- baseline yz
- baseline zbgColix
-
-
renderAllStrings
- Specified by:
renderAllStrings
in interfaceJmolGraphicsInterface
- Overrides:
renderAllStrings
in classGData
-
plotText
public void plotText(int x, int y, int z, int argb, int bgargb, String text, Font font3d, JmolRendererInterface jmolRenderer) -
drawImage
public void drawImage(Object objImage, int x, int y, int z, int zSlab, short bgcolix, int width, int height) - Specified by:
drawImage
in interfaceJmolRendererInterface
-
plotImage
public void plotImage(int x, int y, int z, Object image, JmolRendererInterface jmolRenderer, short bgcolix, int imageWidth, int imageHeight) -
setFont
-
drawPixel
public void drawPixel(int x, int y, int z) - Specified by:
drawPixel
in interfaceJmolRendererInterface
-
drawPoints
public void drawPoints(int count, int[] coordinates, int scale) - Specified by:
drawPoints
in interfaceJmolRendererInterface
-
drawDashedLineBits
public void drawDashedLineBits(int run, int rise, javajs.util.P3 pointA, javajs.util.P3 pointB) - Specified by:
drawDashedLineBits
in interfaceJmolRendererInterface
-
drawLineABBits
public void drawLineABBits(int run, int rise, boolean andClip) -
setScreeni
private void setScreeni(javajs.util.P3 pt, javajs.util.P3i p) -
drawLineXYZ
public void drawLineXYZ(int x1, int y1, int z1, int x2, int y2, int z2) - Specified by:
drawLineXYZ
in interfaceJmolRendererInterface
-
drawLine
public void drawLine(short colixA, short colixB, int x1, int y1, int z1, int x2, int y2, int z2) - Specified by:
drawLine
in interfaceJmolRendererInterface
-
drawLineBits
public void drawLineBits(short colixA, short colixB, javajs.util.P3 pointA, javajs.util.P3 pointB) - Specified by:
drawLineBits
in interfaceJmolRendererInterface
-
drawLinePixels
public void drawLinePixels(javajs.util.P3i a, javajs.util.P3i b, int z, int zslab) - Specified by:
drawLinePixels
in interfaceJmolGraphicsInterface
- Overrides:
drawLinePixels
in classGData
-
drawLineAB
public void drawLineAB(javajs.util.P3 pointA, javajs.util.P3 pointB) - Specified by:
drawLineAB
in interfaceJmolRendererInterface
-
fillCylinderXYZ
public void fillCylinderXYZ(short colixA, short colixB, byte endcaps, int diameter, int xA, int yA, int zA, int xB, int yB, int zB) - Specified by:
fillCylinderXYZ
in interfaceJmolRendererInterface
-
fillCylinderScreen3I
public void fillCylinderScreen3I(byte endcaps, int diameter, javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 pt0f, javajs.util.P3 pt1f, float radius) - Specified by:
fillCylinderScreen3I
in interfaceJmolRendererInterface
-
fillCylinder
public void fillCylinder(byte endcaps, int diameter, javajs.util.P3i screenA, javajs.util.P3i screenB) - Specified by:
fillCylinder
in interfaceJmolRendererInterface
-
fillCylinderBits
public void fillCylinderBits(byte endcaps, int diameter, javajs.util.P3 screenA, javajs.util.P3 screenB) - Specified by:
fillCylinderBits
in interfaceJmolRendererInterface
-
fillCylinderBits2
public void fillCylinderBits2(short colixA, short colixB, byte endcaps, int diameter, javajs.util.P3 screenA, javajs.util.P3 screenB) - Specified by:
fillCylinderBits2
in interfaceJmolRendererInterface
-
fillConeScreen3f
public void fillConeScreen3f(byte endcap, int screenDiameter, javajs.util.P3 screenBase, javajs.util.P3 screenTip, boolean isBarb) - Specified by:
fillConeScreen3f
in interfaceJmolRendererInterface
-
drawHermite4
public void drawHermite4(int tension, javajs.util.P3 s0, javajs.util.P3 s1, javajs.util.P3 s2, javajs.util.P3 s3) - Specified by:
drawHermite4
in interfaceJmolRendererInterface
-
drawHermite7
public void drawHermite7(boolean fill, boolean border, int tension, javajs.util.P3 s0, javajs.util.P3 s1, javajs.util.P3 s2, javajs.util.P3 s3, javajs.util.P3 s4, javajs.util.P3 s5, javajs.util.P3 s6, javajs.util.P3 s7, int aspectRatio, short colixBack) - Specified by:
drawHermite7
in interfaceJmolRendererInterface
-
fillHermite
public void fillHermite(int tension, int diameterBeg, int diameterMid, int diameterEnd, javajs.util.P3 s0, javajs.util.P3 s1, javajs.util.P3 s2, javajs.util.P3 s3) - Specified by:
fillHermite
in interfaceJmolRendererInterface
-
drawTriangle3C
public void drawTriangle3C(javajs.util.P3i screenA, short colixA, javajs.util.P3i screenB, short colixB, javajs.util.P3i screenC, short colixC, int check) - Specified by:
drawTriangle3C
in interfaceJmolRendererInterface
-
fillTriangleTwoSided
public void fillTriangleTwoSided(short normix, javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC) - Specified by:
fillTriangleTwoSided
in interfaceJmolRendererInterface
-
fillTriangleP3f
private void fillTriangleP3f(javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC, boolean useGouraud) -
fillTriangle3f
public void fillTriangle3f(javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC, boolean isSolid) - Specified by:
fillTriangle3f
in interfaceJmolRendererInterface
-
fillTriangle3i
public void fillTriangle3i(javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC, javajs.util.T3 ptA, javajs.util.T3 ptB, javajs.util.T3 ptC, boolean doShade) - Specified by:
fillTriangle3i
in interfaceJmolRendererInterface
-
fillTriangle3CN
public void fillTriangle3CN(javajs.util.P3i screenA, short colixA, short normixA, javajs.util.P3i screenB, short colixB, short normixB, javajs.util.P3i screenC, short colixC, short normixC) - Specified by:
fillTriangle3CN
in interfaceJmolRendererInterface
-
fillTriangle3CNBits
public void fillTriangle3CNBits(javajs.util.P3 screenA, short colixA, short normixA, javajs.util.P3 screenB, short colixB, short normixB, javajs.util.P3 screenC, short colixC, short normixC, boolean twoSided) - Specified by:
fillTriangle3CNBits
in interfaceJmolRendererInterface
-
checkGouraud
private boolean checkGouraud(short colixA, short colixB, short colixC, short normixA, short normixB, short normixC) -
getShadeIndex
public int getShadeIndex(short normix) -
setTriangleTranslucency
private void setTriangleTranslucency(short colixA, short colixB, short colixC) -
fillQuadrilateral
public void fillQuadrilateral(javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC, javajs.util.P3 screenD, boolean isSolid) - Specified by:
fillQuadrilateral
in interfaceJmolRendererInterface
-
drawSurface
- Specified by:
drawSurface
in interfaceJmolRendererInterface
-
plotPixelClippedP3i
public void plotPixelClippedP3i(javajs.util.P3i screen) - Specified by:
plotPixelClippedP3i
in interfaceJmolRendererInterface
-
plotPixelClippedArgb
-
plotPixelUnclipped
-
plotImagePixel
public void plotImagePixel(int argb, int x, int y, int z, byte shade, int bgargb, int width, int height, int[] zbuf, Object p, int transpLog) - Specified by:
plotImagePixel
in interfaceJmolRendererInterface
-
plotPixelsClippedRaster
-
plotPixelsUnclippedRaster
-
plotPixelsClippedRasterBits
-
plotPixelsUnclippedRasterBits
-
plotPixelsUnclippedCount
void plotPixelsUnclippedCount(int c, int count, int x, int y, int z, int width, int[] zbuf, Pixelator p) -
plotPoints
private void plotPoints(int count, int[] coordinates, int xOffset, int yOffset) -
setColorNoisy
void setColorNoisy(int shadeIndex) -
getShadeIndexP3
private int getShadeIndexP3(javajs.util.P3 screenA, javajs.util.P3 screenB, javajs.util.P3 screenC, boolean isSolid) -
renderBackground
- Specified by:
renderBackground
in interfaceJmolRendererInterface
- Overrides:
renderBackground
in classGData
-
drawAtom
- Specified by:
drawAtom
in interfaceJmolRendererInterface
-
getExportType
public int getExportType()- Specified by:
getExportType
in interfaceJmolRendererInterface
-
getExportName
- Specified by:
getExportName
in interfaceJmolRendererInterface
-
canDoTriangles
public boolean canDoTriangles() -
isCartesianExport
public boolean isCartesianExport() -
initializeExporter
public JmolRendererInterface initializeExporter(Viewer vwr, double privateKey, GData g3d, Map<String, Object> params) - Specified by:
initializeExporter
in interfaceJmolRendererInterface
-
finalizeOutput
- Specified by:
finalizeOutput
in interfaceJmolRendererInterface
-
drawBond
public void drawBond(javajs.util.P3 atomA, javajs.util.P3 atomB, short colixA, short colixB, byte endcaps, short mad, int bondOrder) - Specified by:
drawBond
in interfaceJmolRendererInterface
-
drawEllipse
public boolean drawEllipse(javajs.util.P3 ptAtom, javajs.util.P3 ptX, javajs.util.P3 ptY, boolean fillArc, boolean wireframeOnly) - Specified by:
drawEllipse
in interfaceJmolRendererInterface
-
getPrivateKey
public double getPrivateKey() -
clearFontCache
public void clearFontCache()- Overrides:
clearFontCache
in classGData
-
setRotationMatrix
public void setRotationMatrix(javajs.util.M3 rotationMatrix) -
renderCrossHairs
public void renderCrossHairs(int[] minMax, int screenWidth, int screenHeight, javajs.util.P3 navOffset, float navDepth) - Specified by:
renderCrossHairs
in interfaceJmolRendererInterface
- Parameters:
minMax
-screenWidth
-screenHeight
-navOffset
-navDepth
-
-
initializeOutput
- Specified by:
initializeOutput
in interfaceJmolRendererInterface
-
fixTextImageRGB
public static int fixTextImageRGB(int argb)
-