org.jmol.shape
Class Shape

java.lang.Object
  extended by org.jmol.shape.Shape
Direct Known Subclasses:
AtomShape, BioShapeCollection, Dipoles, FontShape, Measures, MeshCollection, Object2dShape, Sticks

public abstract class Shape
extends java.lang.Object

Shape now encompasses: AtomShape (abstract) | Balls, Dots, Ellipsoids, Halos, Labels, Polyhedra, Stars, Vectors | GeoSurface BioShapeCollection (abstract) | Backbone, Cartoon, MeshRibbon, Ribbons, Rockets, Strands, Trace Dipoles FontLineShape (abstract) | Axes, Bbcage, Frank, Uccage Measures MeshCollection (abstract) | | Draw Isosurface | LcaoCartoon, MolecularOrbital, Pmesh Sticks | Hsticks, Sssticks TextShape (abstract) | Echo, Hover


Field Summary
 Graphics3D g3d
           
 boolean isBioShape
           
 ModelSet modelSet
           
 int myVisibilityFlag
           
static float RADIUS_MAX
           
 int shapeID
           
protected  boolean translucentAllowed
           
protected  float translucentLevel
           
 Viewer viewer
           
protected  java.util.List<java.lang.Object> xmlProperties
           
 
Constructor Summary
Shape()
           
 
Method Summary
static void appendCmd(java.lang.StringBuffer s, java.lang.String cmd)
           
 void checkBoundsMinMax(javax.vecmath.Point3f pointMin, javax.vecmath.Point3f pointMax)
           
 Point3fi checkObjectClicked(int x, int y, int modifiers, java.util.BitSet bsVisible)
           
 boolean checkObjectDragged(int prevX, int prevY, int x, int y, int modifiers, java.util.BitSet bsVisible)
           
 boolean checkObjectHovered(int x, int y, java.util.BitSet bsVisible)
           
protected  int coordinateInRange(int x, int y, javax.vecmath.Point3f vertex, int dmin2, javax.vecmath.Point3i ptXY)
           
(package private) static java.lang.String encodeColor(short colix)
           
private static java.lang.String encodeTransColor(byte pid, short colix, boolean translucentAllowed)
           
 void findNearestAtomIndex(int xMouse, int yMouse, Atom[] closest, java.util.BitSet bsNot)
           
static short getColix(short[] colixes, int i, Atom atom)
           
 java.lang.String getColorCommand(java.lang.String type, byte pid, short colix)
           
 java.lang.String getColorCommand(java.lang.String type, short colix)
           
static java.lang.String getFontCommand(java.lang.String type, Font3D font)
           
 int getIndexFromName(java.lang.String thisID)
           
 java.lang.Object getProperty(java.lang.String property, int index)
           
 boolean getProperty(java.lang.String property, java.lang.Object[] data)
           
static java.lang.String getShapeCommands(java.util.Map<java.lang.String,java.util.BitSet> htDefine, java.util.Map<java.lang.String,java.util.BitSet> htMore)
           
static java.lang.String getShapeCommands(java.util.Map<java.lang.String,java.util.BitSet> htDefine, java.util.Map<java.lang.String,java.util.BitSet> htMore, java.lang.String selectCmd)
           
 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getShapeDetail()
           
 java.lang.String getShapeState()
           
 int getSize(Group group)
           
 int getSize(int atomIndex)
           
private static java.lang.String getTranslucentLabel(short colix)
           
 Viewer getViewer()
           
 void initializeShape(Viewer viewer, Graphics3D g3d, ModelSet modelSet, int shapeID)
           
protected  void initModelSet()
           
 void initShape()
           
 void merge(Shape shape)
           
protected  short setColix(short colix, byte paletteID, Atom atom)
           
 short setColix(short colix, byte paletteID, int atomIndex)
           
protected  short setColix(short colix, int pid, Bond bond)
           
 void setModelClickability()
           
 void setModelSet(ModelSet modelSet)
           
 void setProperty(java.lang.String propertyName, java.lang.Object value, java.util.BitSet bsSelected)
          may come from any source -- executed AFTER a shape's own setProperty method
 void setShapeProperty(java.lang.String propertyName, java.lang.Object value, java.util.BitSet bsSelected)
          specifically from modelSet.setShapeProperty, mostly from ScriptEvaluation, but not always -- definitely not from "super.setProperty"
 void setShapeSize(int size, RadiusData rd, java.util.BitSet bsSelected)
           
protected  void setSize(int size, java.util.BitSet bsSelected)
           
protected  void setSize(RadiusData rd, java.util.BitSet bsSelected)
           
static void setStateInfo(java.util.Map<java.lang.String,java.util.BitSet> ht, int i1, int i2, java.lang.String key)
           
static void setStateInfo(java.util.Map<java.lang.String,java.util.BitSet> ht, int i, java.lang.String key)
           
 void setVisibilityFlags(java.util.BitSet bs)
           
private  boolean setXmlProperty(java.lang.String propertyName, java.lang.Object value, java.util.BitSet bs)
          may NOT be over-ridden by shape; executed BEFORE shape's setProperty
 boolean wasClicked(int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RADIUS_MAX

public static final float RADIUS_MAX
See Also:
Constant Field Values

viewer

public Viewer viewer

modelSet

public ModelSet modelSet

g3d

public Graphics3D g3d

shapeID

public int shapeID

myVisibilityFlag

public int myVisibilityFlag

translucentLevel

protected float translucentLevel

translucentAllowed

protected boolean translucentAllowed

isBioShape

public boolean isBioShape

xmlProperties

protected java.util.List<java.lang.Object> xmlProperties
Constructor Detail

Shape

public Shape()
Method Detail

getViewer

public Viewer getViewer()

initializeShape

public final void initializeShape(Viewer viewer,
                                  Graphics3D g3d,
                                  ModelSet modelSet,
                                  int shapeID)

setModelSet

public void setModelSet(ModelSet modelSet)

initModelSet

protected void initModelSet()

initShape

public void initShape()

merge

public void merge(Shape shape)
Parameters:
shape -

setShapeSize

public void setShapeSize(int size,
                         RadiusData rd,
                         java.util.BitSet bsSelected)

setSize

protected void setSize(int size,
                       java.util.BitSet bsSelected)
Parameters:
size -
bsSelected -

setSize

protected void setSize(RadiusData rd,
                       java.util.BitSet bsSelected)
Parameters:
rd -
bsSelected -

setShapeProperty

public void setShapeProperty(java.lang.String propertyName,
                             java.lang.Object value,
                             java.util.BitSet bsSelected)
specifically from modelSet.setShapeProperty, mostly from ScriptEvaluation, but not always -- definitely not from "super.setProperty"

Parameters:
propertyName -
value -
bsSelected -

setXmlProperty

private boolean setXmlProperty(java.lang.String propertyName,
                               java.lang.Object value,
                               java.util.BitSet bs)
may NOT be over-ridden by shape; executed BEFORE shape's setProperty

Parameters:
propertyName -
value -
bs -
Returns:
true if we are done

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object value,
                        java.util.BitSet bsSelected)
may come from any source -- executed AFTER a shape's own setProperty method

Parameters:
propertyName -
value -
bsSelected -

getProperty

public boolean getProperty(java.lang.String property,
                           java.lang.Object[] data)
Parameters:
property -
data -
Returns:
true if serviced

getProperty

public java.lang.Object getProperty(java.lang.String property,
                                    int index)
Parameters:
property -
index -
Returns:
true if serviced

getIndexFromName

public int getIndexFromName(java.lang.String thisID)
Parameters:
thisID -
Returns:
index

wasClicked

public boolean wasClicked(int x,
                          int y)
Parameters:
x -
y -
Returns:
T/F

findNearestAtomIndex

public void findNearestAtomIndex(int xMouse,
                                 int yMouse,
                                 Atom[] closest,
                                 java.util.BitSet bsNot)
Parameters:
xMouse -
yMouse -
closest -
bsNot -

checkBoundsMinMax

public void checkBoundsMinMax(javax.vecmath.Point3f pointMin,
                              javax.vecmath.Point3f pointMax)
Parameters:
pointMin -
pointMax -

setModelClickability

public void setModelClickability()

checkObjectClicked

public Point3fi checkObjectClicked(int x,
                                   int y,
                                   int modifiers,
                                   java.util.BitSet bsVisible)
Parameters:
x -
y -
modifiers -
bsVisible -
Returns:
pt clicked

checkObjectHovered

public boolean checkObjectHovered(int x,
                                  int y,
                                  java.util.BitSet bsVisible)
Parameters:
x -
y -
bsVisible -
Returns:
T/F

checkObjectDragged

public boolean checkObjectDragged(int prevX,
                                  int prevY,
                                  int x,
                                  int y,
                                  int modifiers,
                                  java.util.BitSet bsVisible)
Parameters:
prevX -
prevY -
x -
y -
modifiers -
bsVisible -
Returns:
T/F

coordinateInRange

protected int coordinateInRange(int x,
                                int y,
                                javax.vecmath.Point3f vertex,
                                int dmin2,
                                javax.vecmath.Point3i ptXY)

setColix

public short setColix(short colix,
                      byte paletteID,
                      int atomIndex)

setColix

protected short setColix(short colix,
                         byte paletteID,
                         Atom atom)

setColix

protected short setColix(short colix,
                         int pid,
                         Bond bond)

getShapeDetail

public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getShapeDetail()

getShapeState

public java.lang.String getShapeState()

setVisibilityFlags

public void setVisibilityFlags(java.util.BitSet bs)
Parameters:
bs -

setStateInfo

public static void setStateInfo(java.util.Map<java.lang.String,java.util.BitSet> ht,
                                int i,
                                java.lang.String key)

setStateInfo

public static void setStateInfo(java.util.Map<java.lang.String,java.util.BitSet> ht,
                                int i1,
                                int i2,
                                java.lang.String key)

getShapeCommands

public static java.lang.String getShapeCommands(java.util.Map<java.lang.String,java.util.BitSet> htDefine,
                                                java.util.Map<java.lang.String,java.util.BitSet> htMore)

getShapeCommands

public static java.lang.String getShapeCommands(java.util.Map<java.lang.String,java.util.BitSet> htDefine,
                                                java.util.Map<java.lang.String,java.util.BitSet> htMore,
                                                java.lang.String selectCmd)

appendCmd

public static void appendCmd(java.lang.StringBuffer s,
                             java.lang.String cmd)

getFontCommand

public static java.lang.String getFontCommand(java.lang.String type,
                                              Font3D font)

getColorCommand

public java.lang.String getColorCommand(java.lang.String type,
                                        short colix)

getColorCommand

public java.lang.String getColorCommand(java.lang.String type,
                                        byte pid,
                                        short colix)

encodeTransColor

private static java.lang.String encodeTransColor(byte pid,
                                                 short colix,
                                                 boolean translucentAllowed)

encodeColor

static java.lang.String encodeColor(short colix)

getTranslucentLabel

private static java.lang.String getTranslucentLabel(short colix)

getColix

public static short getColix(short[] colixes,
                             int i,
                             Atom atom)

getSize

public int getSize(int atomIndex)
Parameters:
atomIndex -
Returns:
size

getSize

public int getSize(Group group)
Parameters:
group -
Returns:
size