org.jmol.g3d
Class Graphics3D

java.lang.Object
  extended by org.jmol.g3d.Graphics3D
All Implemented Interfaces:
JmolRendererInterface

public final class Graphics3D
extends java.lang.Object
implements JmolRendererInterface

Provides high-level graphics primitives for 3D visualization.

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.

Nested Class Summary
(package private)  class Graphics3D.Pixel
           
(package private)  class Graphics3D.ShadePixel
           
 
Field Summary
(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)  ApiPlatform apiPlatform
           
(package private)  int argbCurrent
           
(package private)  int argbNoisyDn
           
(package private)  int argbNoisyUp
           
 java.lang.Object 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
           
static short INHERIT_COLOR
           
(package private)  boolean isFullSceneAntialiasingEnabled
           
(package private)  boolean isPass2
           
(package private)  boolean isScreened
           
static int LAST_AVAILABLE_COLIX
           
private  int lastRawColor
           
static short LIME
           
(package private)  Line3D line3d
           
static short MAGENTA
           
private static java.util.Map<java.lang.String,java.lang.Integer> 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
           
(package private) static short RAW_RGB
           
static short RED
           
private  int saveAmbient
           
private  int saveDiffuse
           
(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
           
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 Summary
Graphics3D(ApiPlatform apiPlatform, boolean isDataOnly)
          Allocates a g3d object
 
Method Summary
(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)
           
static short copyColixTranslucency(short colixFrom, short colixTo)
           
 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.lang.Object objImage, 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, short colix)
           
 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, boolean isBarb)
           
 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 float getColixTranslucencyFractional(short colix)
           
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()
           
 double getPrivateKey()
           
 int getRenderHeight()
          gets g3d height
 int getRenderWidth()
          gets g3d width
 java.lang.Object 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, double privateKey, 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 isColixLastAvailable(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)
           
 boolean isPass2()
           
(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.lang.Object 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.lang.Object image)
           
 void setBackgroundTransparent(boolean TF)
           
 boolean setColix(short colix)
          sets current color from colix color index
 void setColor(int argb)
           
(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 setTempZSlab(int zSlab)
           
 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()
           
 void volumeRender(boolean TF)
           
 void volumeRender(int diameter, int x, int y, int z)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

platform

Platform3D platform

line3d

Line3D line3d

circle3d

Circle3D circle3d

sphere3d

Sphere3D sphere3d

triangle3d

Triangle3D triangle3d

cylinder3d

Cylinder3D cylinder3d

hermite3d

Hermite3D hermite3d

normix3d

Normix3D normix3d

isFullSceneAntialiasingEnabled

boolean isFullSceneAntialiasingEnabled

antialiasThisFrame

private boolean antialiasThisFrame

antialias2

private boolean antialias2

antialiasEnabled

private boolean antialiasEnabled

inGreyscaleMode

boolean inGreyscaleMode

anaglyphChannelBytes

byte[] anaglyphChannelBytes

twoPass

boolean twoPass

isPass2

boolean isPass2

addAllPixels

boolean addAllPixels

haveTranslucentObjects

boolean haveTranslucentObjects

translucentCoverOnly

boolean translucentCoverOnly

windowWidth

int windowWidth

windowHeight

int windowHeight

width

int width

height

int height

displayMinX

int displayMinX

displayMaxX

int displayMaxX

displayMinY

int displayMinY

displayMaxY

int displayMaxY

slab

int slab

depth

int depth

zSlab

int zSlab

zDepth

int zDepth

zShade

boolean zShade

xLast

int xLast

yLast

int yLast

pbuf

int[] pbuf

pbufT

int[] pbufT

zbuf

int[] zbuf

zbufT

int[] zbufT

bufferSize

int bufferSize

colixCurrent

short colixCurrent

shadesCurrent

int[] shadesCurrent

argbCurrent

int argbCurrent

isScreened

boolean isScreened

translucencyMask

int translucencyMask

argbNoisyUp

int argbNoisyUp

argbNoisyDn

int argbNoisyDn

font3dCurrent

Font3D font3dCurrent

apiPlatform

ApiPlatform apiPlatform

ENDCAPS_NONE

public static final byte ENDCAPS_NONE
See Also:
Constant Field Values

ENDCAPS_OPEN

public static final byte ENDCAPS_OPEN
See Also:
Constant Field Values

ENDCAPS_FLAT

public static final byte ENDCAPS_FLAT
See Also:
Constant Field Values

ENDCAPS_SPHERICAL

public static final byte ENDCAPS_SPHERICAL
See Also:
Constant Field Values

ENDCAPS_OPENEND

public static final byte ENDCAPS_OPENEND
See Also:
Constant Field Values

BLACK

public static final short BLACK
See Also:
Constant Field Values

ORANGE

public static final short ORANGE
See Also:
Constant Field Values

PINK

public static final short PINK
See Also:
Constant Field Values

BLUE

public static final short BLUE
See Also:
Constant Field Values

WHITE

public static final short WHITE
See Also:
Constant Field Values

CYAN

public static final short CYAN
See Also:
Constant Field Values

RED

public static final short RED
See Also:
Constant Field Values

GREEN

public static final short GREEN
See Also:
Constant Field Values

GRAY

public static final short GRAY
See Also:
Constant Field Values

SILVER

public static final short SILVER
See Also:
Constant Field Values

LIME

public static final short LIME
See Also:
Constant Field Values

MAROON

public static final short MAROON
See Also:
Constant Field Values

NAVY

public static final short NAVY
See Also:
Constant Field Values

OLIVE

public static final short OLIVE
See Also:
Constant Field Values

PURPLE

public static final short PURPLE
See Also:
Constant Field Values

TEAL

public static final short TEAL
See Also:
Constant Field Values

MAGENTA

public static final short MAGENTA
See Also:
Constant Field Values

YELLOW

public static final short YELLOW
See Also:
Constant Field Values

HOTPINK

public static final short HOTPINK
See Also:
Constant Field Values

GOLD

public static final short GOLD
See Also:
Constant Field Values

newWindowWidth

int newWindowWidth

newWindowHeight

int newWindowHeight

newAntialiasing

boolean newAntialiasing

random

public double random

anaglyphLength

int anaglyphLength

backgroundImage

public java.lang.Object backgroundImage

bgcolor

public int bgcolor

pixel

Graphics3D.Pixel pixel

zShadeR

int zShadeR

zShadeG

int zShadeG

zShadeB

int zShadeB

currentShadeIndex

private int currentShadeIndex

lastRawColor

private int lastRawColor

zMargin

int zMargin

saveAmbient

private int saveAmbient

saveDiffuse

private int saveDiffuse

currentlyRendering

boolean currentlyRendering

yGT

static final int yGT
See Also:
Constant Field Values

yLT

static final int yLT
See Also:
Constant Field Values

xGT

static final int xGT
See Also:
Constant Field Values

xLT

static final int xLT
See Also:
Constant Field Values

zGT

static final int zGT
See Also:
Constant Field Values

zLT

static final int zLT
See Also:
Constant Field Values

UNMASK_CHANGEABLE_TRANSLUCENT

private static final short UNMASK_CHANGEABLE_TRANSLUCENT
See Also:
Constant Field Values

CHANGEABLE_MASK

private static final short CHANGEABLE_MASK
See Also:
Constant Field Values

LAST_AVAILABLE_COLIX

public static final int LAST_AVAILABLE_COLIX
See Also:
Constant Field Values

TRANSLUCENT_SHIFT

private static final int TRANSLUCENT_SHIFT
See Also:
Constant Field Values

ALPHA_SHIFT

private static final int ALPHA_SHIFT
See Also:
Constant Field Values

TRANSLUCENT_MASK

private static final int TRANSLUCENT_MASK
See Also:
Constant Field Values

TRANSLUCENT_SCREENED

private static final int TRANSLUCENT_SCREENED
See Also:
Constant Field Values

TRANSPARENT

private static final int TRANSPARENT
See Also:
Constant Field Values

TRANSLUCENT_50

static final int TRANSLUCENT_50
See Also:
Constant Field Values

OPAQUE_MASK

public static final short OPAQUE_MASK
See Also:
Constant Field Values

INHERIT_ALL

public static final short INHERIT_ALL
See Also:
Constant Field Values

INHERIT_COLOR

public static final short INHERIT_COLOR
See Also:
Constant Field Values

USE_PALETTE

public static final short USE_PALETTE
See Also:
Constant Field Values

RAW_RGB

static final short RAW_RGB
See Also:
Constant Field Values

SPECIAL_COLIX_MAX

static final short SPECIAL_COLIX_MAX
See Also:
Constant Field Values

changeableColixMap

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


vectorAB

private final javax.vecmath.Vector3f vectorAB

vectorAC

private final javax.vecmath.Vector3f vectorAC

vectorNormal

private final javax.vecmath.Vector3f vectorNormal

colorNames

private static final java.lang.String[] colorNames

colorArgbs

private static final int[] colorArgbs

mapJavaScriptColors

private static final java.util.Map<java.lang.String,java.lang.Integer> mapJavaScriptColors

NORMIX_NULL

public static final short NORMIX_NULL
See Also:
Constant Field Values

EXPORT_NOT

public static final int EXPORT_NOT
See Also:
Constant Field Values

EXPORT_CARTESIAN

public static final int EXPORT_CARTESIAN
See Also:
Constant Field Values

EXPORT_RAYTRACER

public static final int EXPORT_RAYTRACER
See Also:
Constant Field Values
Constructor Detail

Graphics3D

public Graphics3D(ApiPlatform apiPlatform,
                  boolean isDataOnly)
Allocates a g3d object

Parameters:
apiPlatform -
isDataOnly -
Method Detail

destroy

public void destroy()

isDisplayAntialiased

public boolean isDisplayAntialiased()
is full scene / oversampling antialiasing GENERALLY in effect

Returns:
the answer

isAntialiased

public boolean isAntialiased()
is full scene / oversampling antialiasing in effect

Specified by:
isAntialiased in interface JmolRendererInterface
Returns:
the answer

isPass2

public boolean isPass2()
Specified by:
isPass2 in interface JmolRendererInterface

setTranslucentCoverOnly

public void setTranslucentCoverOnly(boolean TF)
Specified by:
setTranslucentCoverOnly in interface JmolRendererInterface

currentlyRendering

public boolean currentlyRendering()

setWindowParameters

public void setWindowParameters(int width,
                                int height,
                                boolean antialias)

setNewWindowParametersForExport

public void setNewWindowParametersForExport()

setWidthHeight

private void setWidthHeight(boolean isAntialiased)

checkTranslucent

public boolean checkTranslucent(boolean isAlphaTranslucent)
Specified by:
checkTranslucent in interface JmolRendererInterface

beginRendering

public void beginRendering(javax.vecmath.Matrix3f rotationMatrix)

releaseBuffers

private void releaseBuffers()

setPass2

public boolean setPass2(boolean antialiasTranslucent)

endRendering

public void endRendering()

snapshotAnaglyphChannelBytes

public void snapshotAnaglyphChannelBytes()

applyCustomAnaglyph

public void applyCustomAnaglyph(int[] stereoColors)

applyGreenAnaglyph

public void applyGreenAnaglyph()

applyBlueAnaglyph

public void applyBlueAnaglyph()

applyCyanAnaglyph

public void applyCyanAnaglyph()

getScreenImage

public java.lang.Object getScreenImage()

releaseScreenImage

public void releaseScreenImage()

haveTranslucentObjects

public boolean haveTranslucentObjects()
Specified by:
haveTranslucentObjects in interface JmolRendererInterface

getRenderWidth

public int getRenderWidth()
gets g3d width

Specified by:
getRenderWidth in interface JmolRendererInterface
Returns:
width pixel count;

getRenderHeight

public int getRenderHeight()
gets g3d height

Specified by:
getRenderHeight in interface JmolRendererInterface
Returns:
height pixel count

getSlab

public int getSlab()
gets g3d slab

Specified by:
getSlab in interface JmolRendererInterface
Returns:
slab

getDepth

public int getDepth()
gets g3d depth

Specified by:
getDepth in interface JmolRendererInterface
Returns:
depth

setBackgroundTransparent

public void setBackgroundTransparent(boolean TF)

setBackgroundArgb

public void setBackgroundArgb(int argb)
sets background color to the specified argb value

Parameters:
argb - an argb value with alpha channel

setBackgroundImage

public void setBackgroundImage(java.lang.Object image)

setGreyscaleMode

public void setGreyscaleMode(boolean greyscaleMode)
controls greyscale rendering

Parameters:
greyscaleMode - Flag for greyscale rendering

setSlabAndDepthValues

public void setSlabAndDepthValues(int slabValue,
                                  int depthValue,
                                  boolean zShade,
                                  int zSlab,
                                  int zDepth)
clipping from the front and the back

the plane is defined as a percentage from the back of the image to the front

For slab values:

for depth values:

Parameters:
slabValue - front clipping percentage [0,100]
depthValue - rear clipping percentage [0,100]
zShade - whether to shade along z front to back
zSlab - for zShade
zDepth - for zShade

setTempZSlab

public void setTempZSlab(int zSlab)

setSlab

public void setSlab(int slabValue)
Specified by:
setSlab in interface JmolRendererInterface

downsampleFullSceneAntialiasing

private void downsampleFullSceneAntialiasing(boolean downsampleZBuffer)

mergeOpaqueAndTranslucentBuffers

void mergeOpaqueAndTranslucentBuffers()

averageBufferPixel

static void averageBufferPixel(int[] pIn,
                               int[] pOut,
                               int pt,
                               int dp)

mergeBufferPixel

static void mergeBufferPixel(int[] pbuf,
                             int argbB,
                             int pt,
                             int bgcolor)

hasContent

public boolean hasContent()

setColor

public void setColor(int argb)
Specified by:
setColor in interface JmolRendererInterface

isColixLastAvailable

public static boolean isColixLastAvailable(short colix)

setColix

public boolean setColix(short colix)
sets current color from colix color index

Specified by:
setColix in interface JmolRendererInterface
Parameters:
colix - the color index
Returns:
true or false if this is the right pass

setZMargin

void setZMargin(int dz)

addPixel

void addPixel(int offset,
              int z,
              int p)

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 interface JmolRendererInterface
x - center x
y - center y
z - center z

volumeRender

public void volumeRender(int diameter,
                         int x,
                         int y,
                         int z)
Specified by:
volumeRender in interface JmolRendererInterface

fillSphere

public void fillSphere(int diameter,
                       int x,
                       int y,
                       int z)
fills a solid sphere

Specified by:
fillSphere in interface JmolRendererInterface
Parameters:
diameter - pixel count
x - center x
y - center y
z - center z

volumeRender

public void volumeRender(boolean TF)
Specified by:
volumeRender in interface JmolRendererInterface

fillSphere

public void fillSphere(int diameter,
                       javax.vecmath.Point3i center)
fills a solid sphere

Specified by:
fillSphere in interface JmolRendererInterface
Parameters:
diameter - pixel count
center - javax.vecmath.Point3i defining the center

fillSphere

public void fillSphere(int diameter,
                       javax.vecmath.Point3f center)
fills a solid sphere

Specified by:
fillSphere in interface JmolRendererInterface
Parameters:
diameter - pixel count
center - a javax.vecmath.Point3f ... floats are casted to ints

fillEllipsoid

public 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)
Specified by:
fillEllipsoid in interface JmolRendererInterface

drawRect

public void drawRect(int x,
                     int y,
                     int z,
                     int zSlab,
                     int rWidth,
                     int rHeight)
draws a rectangle

Specified by:
drawRect in interface JmolRendererInterface
Parameters:
x - upper left x
y - upper left y
z - upper left z
zSlab - z for slab check (for set labelsFront)
rWidth - pixel count
rHeight - 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)

fillRect

public void fillRect(int x,
                     int y,
                     int z,
                     int zSlab,
                     int widthFill,
                     int heightFill)
fills background rectangle for label

Specified by:
fillRect in interface JmolRendererInterface
Parameters:
x - upper left x
y - upper left y
z - upper left z
zSlab - z value for slabbing
widthFill - pixel count
heightFill - pixel count

drawString

public void drawString(java.lang.String str,
                       Font3D font3d,
                       int xBaseline,
                       int yBaseline,
                       int z,
                       int zSlab)
draws the specified string in the current font. no line wrapping -- axis, labels, measures

Specified by:
drawString in interface JmolRendererInterface
Parameters:
str - the String
font3d - the Font3D
xBaseline - baseline x
yBaseline - baseline y
z - baseline z
zSlab - z for slab calculation

drawStringNoSlab

public void drawStringNoSlab(java.lang.String str,
                             Font3D font3d,
                             int xBaseline,
                             int yBaseline,
                             int z)
draws the specified string in the current font. no line wrapping -- echo, frank, hover, molecularOrbital, uccage

Specified by:
drawStringNoSlab in interface JmolRendererInterface
Parameters:
str - the String
font3d - the Font3D
xBaseline - baseline x
yBaseline - baseline y
z - baseline z

plotText

public void plotText(int x,
                     int y,
                     int z,
                     int argb,
                     java.lang.String text,
                     Font3D font3d,
                     JmolRendererInterface jmolRenderer)

drawImage

public void drawImage(java.lang.Object objImage,
                      int x,
                      int y,
                      int z,
                      int zSlab,
                      short bgcolix,
                      int width,
                      int height)
Specified by:
drawImage in interface JmolRendererInterface

plotImage

public void plotImage(int x,
                      int y,
                      int z,
                      java.lang.Object image,
                      JmolRendererInterface jmolRenderer,
                      short bgcolix,
                      int width,
                      int height)

setFont

public void setFont(byte fid)
Specified by:
setFont in interface JmolRendererInterface

setFont

public void setFont(Font3D font3d)

getFont3DCurrent

public Font3D getFont3DCurrent()
Specified by:
getFont3DCurrent in interface JmolRendererInterface

drawPixel

public void drawPixel(int x,
                      int y,
                      int z)
Specified by:
drawPixel in interface JmolRendererInterface

drawPoints

public void drawPoints(int count,
                       int[] coordinates,
                       int scale)
Specified by:
drawPoints in interface JmolRendererInterface

drawDashedLine

public void drawDashedLine(int run,
                           int rise,
                           javax.vecmath.Point3i pointA,
                           javax.vecmath.Point3i pointB)
Specified by:
drawDashedLine in interface JmolRendererInterface

drawDottedLine

public void drawDottedLine(javax.vecmath.Point3i pointA,
                           javax.vecmath.Point3i pointB)
Specified by:
drawDottedLine in interface JmolRendererInterface

drawLine

public void drawLine(int x1,
                     int y1,
                     int z1,
                     int x2,
                     int y2,
                     int z2)
Specified by:
drawLine in interface JmolRendererInterface

drawLine

public void drawLine(short colixA,
                     short colixB,
                     int x1,
                     int y1,
                     int z1,
                     int x2,
                     int y2,
                     int z2)
Specified by:
drawLine in interface JmolRendererInterface

drawLine

public void drawLine(javax.vecmath.Point3i pointA,
                     javax.vecmath.Point3i pointB)
Specified by:
drawLine in interface JmolRendererInterface

fillCylinder

public void fillCylinder(short colixA,
                         short colixB,
                         byte endcaps,
                         int diameter,
                         int xA,
                         int yA,
                         int zA,
                         int xB,
                         int yB,
                         int zB)
Specified by:
fillCylinder in interface JmolRendererInterface

fillCylinderScreen

public void fillCylinderScreen(byte endcaps,
                               int diameter,
                               int xA,
                               int yA,
                               int zA,
                               int xB,
                               int yB,
                               int zB)
Specified by:
fillCylinderScreen in interface JmolRendererInterface

fillCylinderScreen

public void fillCylinderScreen(byte endcaps,
                               int diameter,
                               javax.vecmath.Point3i screenA,
                               javax.vecmath.Point3i screenB)
Specified by:
fillCylinderScreen in interface JmolRendererInterface

fillCylinder

public void fillCylinder(byte endcaps,
                         int diameter,
                         javax.vecmath.Point3i screenA,
                         javax.vecmath.Point3i screenB)
Specified by:
fillCylinder in interface JmolRendererInterface

fillCylinderBits

public void fillCylinderBits(byte endcaps,
                             int diameter,
                             javax.vecmath.Point3f screenA,
                             javax.vecmath.Point3f screenB)
Specified by:
fillCylinderBits in interface JmolRendererInterface

fillConeScreen

public void fillConeScreen(byte endcap,
                           int screenDiameter,
                           javax.vecmath.Point3i screenBase,
                           javax.vecmath.Point3i screenTip,
                           boolean isBarb)
Specified by:
fillConeScreen in interface JmolRendererInterface

fillConeSceen

public void fillConeSceen(byte endcap,
                          int screenDiameter,
                          javax.vecmath.Point3f screenBase,
                          javax.vecmath.Point3f screenTip)
Specified by:
fillConeSceen in interface JmolRendererInterface

drawHermite

public void drawHermite(int tension,
                        javax.vecmath.Point3i s0,
                        javax.vecmath.Point3i s1,
                        javax.vecmath.Point3i s2,
                        javax.vecmath.Point3i s3)
Specified by:
drawHermite in interface JmolRendererInterface

drawHermite

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)
Specified by:
drawHermite in interface JmolRendererInterface

fillHermite

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)
Specified by:
fillHermite in interface JmolRendererInterface

getHermiteList

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)

drawTriangle

public void drawTriangle(javax.vecmath.Point3i screenA,
                         short colixA,
                         javax.vecmath.Point3i screenB,
                         short colixB,
                         javax.vecmath.Point3i screenC,
                         short colixC,
                         int check)
Specified by:
drawTriangle in interface JmolRendererInterface

drawTriangle

public void drawTriangle(javax.vecmath.Point3i screenA,
                         javax.vecmath.Point3i screenB,
                         javax.vecmath.Point3i screenC,
                         int check)
Specified by:
drawTriangle in interface JmolRendererInterface

fillTriangleTwoSided

public void fillTriangleTwoSided(short normix,
                                 int xScreenA,
                                 int yScreenA,
                                 int zScreenA,
                                 int xScreenB,
                                 int yScreenB,
                                 int zScreenB,
                                 int xScreenC,
                                 int yScreenC,
                                 int zScreenC)
Specified by:
fillTriangleTwoSided in interface JmolRendererInterface

fillTriangle

public void fillTriangle(javax.vecmath.Point3f screenA,
                         javax.vecmath.Point3f screenB,
                         javax.vecmath.Point3f screenC)
Specified by:
fillTriangle in interface JmolRendererInterface

fillTriangle

public void fillTriangle(javax.vecmath.Point3i screenA,
                         javax.vecmath.Point3i screenB,
                         javax.vecmath.Point3i screenC)
Specified by:
fillTriangle in interface JmolRendererInterface

fillTriangle

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)
Specified by:
fillTriangle in interface JmolRendererInterface

fillTriangle

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)
Specified by:
fillTriangle in interface JmolRendererInterface

setTriangleColixAndShadeIndex

private void setTriangleColixAndShadeIndex(short colix,
                                           int shadeIndex)

setTriangleTranslucency

private boolean setTriangleTranslucency(short colixA,
                                        short colixB,
                                        short colixC)

drawQuadrilateral

public void drawQuadrilateral(short colix,
                              javax.vecmath.Point3i screenA,
                              javax.vecmath.Point3i screenB,
                              javax.vecmath.Point3i screenC,
                              javax.vecmath.Point3i screenD)
Specified by:
drawQuadrilateral in interface JmolRendererInterface

fillQuadrilateral

public void fillQuadrilateral(javax.vecmath.Point3f screenA,
                              javax.vecmath.Point3f screenB,
                              javax.vecmath.Point3f screenC,
                              javax.vecmath.Point3f screenD)
Specified by:
fillQuadrilateral in interface JmolRendererInterface

fillQuadrilateral

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)
Specified by:
fillQuadrilateral in interface JmolRendererInterface

drawSurface

public void drawSurface(MeshSurface meshSurface,
                        short colix)
Specified by:
drawSurface in interface JmolRendererInterface

isClipped

public boolean isClipped(int x,
                         int y,
                         int z)

isClipped

public boolean isClipped(int x,
                         int y)

isInDisplayRange

public boolean isInDisplayRange(int x,
                                int y)
Specified by:
isInDisplayRange in interface JmolRendererInterface

isClippedXY

public boolean isClippedXY(int diameter,
                           int x,
                           int y)
Specified by:
isClippedXY in interface JmolRendererInterface

isClippedZ

public boolean isClippedZ(int z)
Specified by:
isClippedZ in interface JmolRendererInterface

clipCode

public int clipCode(int x,
                    int y,
                    int z)

clipCode

public int clipCode(int z)

plotPixelClipped

void plotPixelClipped(int x,
                      int y,
                      int z)

plotPixelClipped

public void plotPixelClipped(javax.vecmath.Point3i screen)
Specified by:
plotPixelClipped in interface JmolRendererInterface

plotPixelClipped

void plotPixelClipped(int argb,
                      int x,
                      int y,
                      int z)

plotPixelClippedNoSlab

public void plotPixelClippedNoSlab(int argb,
                                   int x,
                                   int y,
                                   int z)
Specified by:
plotPixelClippedNoSlab in interface JmolRendererInterface

plotPixelClipped

void plotPixelClipped(int argb,
                      boolean isScreened,
                      int x,
                      int y,
                      int z)

plotPixelUnclipped

void plotPixelUnclipped(int x,
                        int y,
                        int z)

plotPixelUnclipped

void plotPixelUnclipped(int argb,
                        int x,
                        int y,
                        int z)

plotPixelsClipped

void plotPixelsClipped(int count,
                       int x,
                       int y,
                       int z)

plotPixelsClipped

void plotPixelsClipped(int count,
                       int x,
                       int y,
                       int zAtLeft,
                       int zPastRight,
                       Rgb16 rgb16Left,
                       Rgb16 rgb16Right)

plotPixelsUnclipped

void plotPixelsUnclipped(int count,
                         int x,
                         int y,
                         int zAtLeft,
                         int zPastRight,
                         Rgb16 rgb16Left,
                         Rgb16 rgb16Right)

plotPixelsUnclipped

void plotPixelsUnclipped(int count,
                         int x,
                         int y,
                         int z)

plotPoints

private void plotPoints(int count,
                        int[] coordinates,
                        int xOffset,
                        int yOffset)

calcGreyscaleRgbFromRgb

public static int calcGreyscaleRgbFromRgb(int rgb)
Return a greyscale rgb value 0-FF using NTSC color luminance algorithm

the alpha component is set to 0xFF. If you want a value in the range 0-255 then & the result with 0xFF;

Parameters:
rgb - the rgb value
Returns:
a grayscale value in the range 0 - 255 decimal

getColix

public static short getColix(int argb)

getBgColixes

public short[] getBgColixes(short[] bgcolixes)
Specified by:
getBgColixes in interface JmolRendererInterface

getColixTranslucent

public static short getColixTranslucent(int argb)

getHexCodes

public static java.lang.String getHexCodes(short[] colixes)

getHexCode

public static java.lang.String getHexCode(short colix)

getColixArray

public static short[] getColixArray(java.lang.String colorNames)

colorPointFromInt

public static final javax.vecmath.Point3f colorPointFromInt(int color,
                                                            javax.vecmath.Point3f pt)

colorPtToInt

public static int colorPtToInt(javax.vecmath.Point3f pt)

colorTriadToInt

public static int colorTriadToInt(float x,
                                  float y,
                                  float z)

colorPointFromInt2

public static final javax.vecmath.Point3f colorPointFromInt2(int color)

colorPointFromString

public static final javax.vecmath.Point3f colorPointFromString(java.lang.String colorName,
                                                               javax.vecmath.Point3f pt)

getColix

public static short getColix(java.lang.String colorName)

getArgbFromString

public static int getArgbFromString(java.lang.String strColor)
accepts [xRRGGBB] or [0xRRGGBB] or [0xFFRRGGBB] or #RRGGBB or [red,green,blue] or a valid JavaScript color

Parameters:
strColor -
Returns:
0 if invalid or integer color

applyColorTranslucencyLevel

private static final short applyColorTranslucencyLevel(short colix,
                                                       float translucentLevel)

getColixTranslucencyLevel

public static final int getColixTranslucencyLevel(short colix)

getColixTranslucencyFractional

public static float getColixTranslucencyFractional(short colix)

getColix

public static short getColix(java.lang.Object obj)

getColixTranslucent

public static final short getColixTranslucent(short colix,
                                              boolean isTranslucent,
                                              float translucentLevel)

copyColixTranslucency

public static final short copyColixTranslucency(short colixFrom,
                                                short colixTo)

getColorArgbOrGray

public int getColorArgbOrGray(short colix)
Specified by:
getColorArgbOrGray in interface JmolRendererInterface

getShades

int[] getShades(short colix)

getChangeableColixIndex

public static final short getChangeableColixIndex(short colix)

isColixTranslucent

public static final boolean isColixTranslucent(short colix)

getColixInherited

public static final short getColixInherited(short myColix,
                                            short parentColix)

isColixColorInherited

public static final boolean isColixColorInherited(short colix)

getArgb

public static int getArgb(short colix)

getChangeableColix

public short getChangeableColix(short id,
                                int argb)

changeColixArgb

public void changeColixArgb(short id,
                            int argb)

flushCaches

private static void flushCaches()

getLightSource

public static javax.vecmath.Point3f getLightSource()

setSpecular

public static void setSpecular(boolean val)

getSpecular

public static boolean getSpecular()

setZShadePower

public static void setZShadePower(int val)
fractional distance from black for ambient color

Parameters:
val -

getZShadePower

public static int getZShadePower()

setAmbientPercent

public static void setAmbientPercent(int val)
fractional distance from black for ambient color

Parameters:
val -

getAmbientPercent

public static int getAmbientPercent()

setDiffusePercent

public static void setDiffusePercent(int val)
df in I = df * (N dot L) + sf * (R dot V)^p

Parameters:
val -

getDiffusePercent

public static int getDiffusePercent()

setPhongExponent

public static void setPhongExponent(int val)
p in I = df * (N dot L) + sf * (R dot V)^p

Parameters:
val -

getPhongExponent

public static int getPhongExponent()

setSpecularExponent

public static void setSpecularExponent(int val)
log_2(p) in I = df * (N dot L) + sf * (R dot V)^p for faster calculation of shades

Parameters:
val -

getSpecularExponent

public static int getSpecularExponent()

setSpecularPercent

public static void setSpecularPercent(int val)
sf in I = df * (N dot L) + sf * (R dot V)^p not a percent of anything, really

Parameters:
val -

getSpecularPercent

public static int getSpecularPercent()

setSpecularPower

public static void setSpecularPower(int val)
fractional distance to white for specular dot

Parameters:
val -

getSpecularPower

public static int getSpecularPower()

setColorNoisy

void setColorNoisy(int shadeIndex)

setNoisySurfaceShade

public 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

Specified by:
setNoisySurfaceShade in interface JmolRendererInterface
Parameters:
screenA -
screenB -
screenC -

getShadeIndex

private int getShadeIndex(javax.vecmath.Point3f screenA,
                          javax.vecmath.Point3f screenB,
                          javax.vecmath.Point3f screenC)

getFont3D

public Font3D getFont3D(float fontSize)

getFont3D

public Font3D getFont3D(java.lang.String fontFace,
                        float fontSize)

getFontStyleID

public static int getFontStyleID(java.lang.String fontStyle)

getFont3D

public Font3D getFont3D(java.lang.String fontFace,
                        java.lang.String fontStyle,
                        float fontSize)

getFont3DScaled

public Font3D getFont3DScaled(Font3D font,
                              float scale)
Specified by:
getFont3DScaled in interface JmolRendererInterface

getFontFid

public byte getFontFid(float fontSize)
Specified by:
getFontFid in interface JmolRendererInterface

getFontFid

public byte getFontFid(java.lang.String fontFace,
                       float fontSize)
Specified by:
getFontFid in interface JmolRendererInterface

getInverseNormix

public static short getInverseNormix(short normix)

getNormix

public static short getNormix(javax.vecmath.Vector3f vector,
                              java.util.BitSet bsTemp)

get2SidedNormix

public static short get2SidedNormix(javax.vecmath.Vector3f vector,
                                    java.util.BitSet bsTemp)

getNormixVector

public static javax.vecmath.Vector3f getNormixVector(short normix)

isDirectedTowardsCamera

public boolean isDirectedTowardsCamera(short normix)
Specified by:
isDirectedTowardsCamera in interface JmolRendererInterface

getTransformedVertexVectors

public javax.vecmath.Vector3f[] getTransformedVertexVectors()
Specified by:
getTransformedVertexVectors in interface JmolRendererInterface

renderBackground

public void renderBackground()
Specified by:
renderBackground in interface JmolRendererInterface

renderBackground

public void renderBackground(JmolRendererInterface jmolRenderer)

drawAtom

public void drawAtom(Atom atom)
Specified by:
drawAtom in interface JmolRendererInterface

getExportType

public int getExportType()
Specified by:
getExportType in interface JmolRendererInterface

getExportName

public java.lang.String getExportName()
Specified by:
getExportName in interface JmolRendererInterface

canDoTriangles

public boolean canDoTriangles()

isCartesianExport

public boolean isCartesianExport()

initializeExporter

public boolean initializeExporter(java.lang.String type,
                                  Viewer viewer,
                                  double privateKey,
                                  Graphics3D g3d,
                                  java.lang.Object output)
Specified by:
initializeExporter in interface JmolRendererInterface

finalizeOutput

public java.lang.String finalizeOutput()
Specified by:
finalizeOutput in interface JmolRendererInterface

drawBond

public void drawBond(Atom atomA,
                     Atom atomB,
                     short colixA,
                     short colixB,
                     byte endcaps,
                     short mad)
Specified by:
drawBond in interface JmolRendererInterface

drawEllipse

public boolean drawEllipse(javax.vecmath.Point3f ptAtom,
                           javax.vecmath.Point3f ptX,
                           javax.vecmath.Point3f ptY,
                           boolean fillArc,
                           boolean wireframeOnly)
Specified by:
drawEllipse in interface JmolRendererInterface

getPrivateKey

public double getPrivateKey()