org.jmol.shapespecial
Class Draw

java.lang.Object
  extended by org.jmol.shape.Shape
      extended by org.jmol.shape.MeshCollection
          extended by org.jmol.shapespecial.Draw

public class Draw
extends MeshCollection


Field Summary
private  javax.vecmath.Point3f[] boundBox
           
private  java.util.BitSet bsAllModels
           
private  java.util.BitSet bsTemp
           
private  int diameter
           
(package private)  DrawMesh[] dmeshes
           
private  int indicatedModelIndex
           
private  java.lang.String intersectID
           
private  boolean isArc
           
private  boolean isArrow
           
private  boolean isCircle
           
private  boolean isCrossed
           
private  boolean isCurve
           
private  boolean isCylinder
           
private  boolean isLine
           
private  boolean isPerpendicular
           
private  boolean isPlane
           
private  boolean isReversed
           
private  boolean isRotated45
           
private  boolean isValid
           
private  boolean isVector
           
private  boolean isVertices
           
private  float length
           
private  java.util.List lineData
           
private  boolean makePoints
           
private static int MAX_OBJECT_CLICK_DISTANCE_SQUARED
           
private  int[] modelInfo
           
private  int nbitsets
           
private  float newScale
           
private  int nidentifiers
           
private  boolean noHead
           
private  int nPoints
           
private  javax.vecmath.Vector3f offset
           
private  javax.vecmath.Point4f plane
           
private  java.util.List polygon
           
private static int PT_BITSET
           
private static int PT_COORD
           
private static int PT_IDENTIFIER
           
private static int PT_MODEL_BASED_POINTS
           
private static int PT_MODEL_INDEX
           
private  Point3fi PT_NAN
           
private  javax.vecmath.Point3f[] ptList
           
private  javax.vecmath.Point3i ptXY
           
(package private)  DrawMesh thisMesh
           
private  javax.vecmath.Vector3f vAB
           
private  javax.vecmath.Vector3f vAC
           
private  java.util.List vData
           
private  float width
           
 
Fields inherited from class org.jmol.shape.MeshCollection
actualID, allowContourLines, allowMesh, colix, currentMesh, explicitID, haveContours, htObjects, iHaveModelIndex, isFixed, linkedMesh, meshCount, meshes, modelCount, modelIndex, myType, nUnnamed, pickedMesh, pickedModel, pickedVertex, previousMeshID, script, title
 
Fields inherited from class org.jmol.shape.Shape
g3d, isBioShape, modelSet, myVisibilityFlag, RADIUS_MAX, shapeID, translucentAllowed, translucentLevel, viewer, xmlProperties
 
Constructor Summary
Draw()
           
 
Method Summary
private  void addPoint(javax.vecmath.Point3f newPt, int iModel)
           
 void allocMesh(java.lang.String thisID, Mesh m)
           
 Point3fi checkObjectClicked(int x, int y, int action, java.util.BitSet bsVisible)
           
 boolean checkObjectDragged(int prevX, int prevY, int x, int y, int action, java.util.BitSet bsVisible)
           
 boolean checkObjectHovered(int x, int y, java.util.BitSet bsVisible)
           
private  boolean findPickedObject(int x, int y, boolean isPicking, java.util.BitSet bsVisible)
           
private  java.lang.String getDrawCommand(DrawMesh mesh)
           
private  java.lang.String getDrawCommand(DrawMesh mesh, int iModel)
           
private  Point3fi getPickedPoint(javax.vecmath.Point3f v)
           
 java.lang.Object getProperty(java.lang.String property, int index)
           
 boolean getProperty(java.lang.String property, java.lang.Object[] data)
           
 java.util.List getShapeDetail()
           
 java.lang.String getShapeState()
           
private  javax.vecmath.Vector3f getSpinAxis(java.lang.String axisID, int modelIndex)
           
private  javax.vecmath.Point3f getSpinCenter(java.lang.String axisID, int vertexIndex, int modelIndex)
           
private static java.lang.String getVertexList(DrawMesh mesh, int iModel, int nVertices)
           
 void initShape()
           
(package private) static boolean isPolygonDisplayable(Mesh mesh, int i)
           
private  void move2D(DrawMesh mesh, int[] vertexes, int iVertex, int x, int y, boolean moveAll)
           
(package private) static javax.vecmath.Point3f randomPoint()
           
private  void resetObjects()
           
private static void scaleDrawing(DrawMesh mesh, float newScale)
           
private static void setAxes(DrawMesh m)
           
private  boolean setDrawing()
           
private  void setIntersectData()
           
private  boolean setPoints(int iModel, int n)
           
private  void setPolygon(int nPoly)
           
 void setProperty(java.lang.String propertyName, java.lang.Object value, java.util.BitSet bs)
          may come from any source -- executed AFTER a shape's own setProperty method
(package private)  void setPropertySuper(java.lang.String propertyName, java.lang.Object value, java.util.BitSet bs)
           
 void setVisibilityFlags(java.util.BitSet bs)
           
 
Methods inherited from class org.jmol.shape.MeshCollection
checkExplicit, clean, deleteMesh, deleteMesh, getIndexFromName, getMesh, getModelIndex, merge, setModelIndex, setStatusPicked
 
Methods inherited from class org.jmol.shape.Shape
appendCmd, checkBoundsMinMax, coordinateInRange, findNearestAtomIndex, getColix, getColorCommand, getColorCommand, getFontCommand, getShapeCommands, getShapeCommands, getSize, getSize, getViewer, initializeShape, initModelSet, setColix, setColix, setColix, setModelClickability, setModelSet, setShapeProperty, setShapeSize, setSize, setSize, setStateInfo, setStateInfo, wasClicked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dmeshes

DrawMesh[] dmeshes

thisMesh

DrawMesh thisMesh

ptList

private javax.vecmath.Point3f[] ptList

offset

private javax.vecmath.Vector3f offset

nPoints

private int nPoints

diameter

private int diameter

width

private float width

newScale

private float newScale

length

private float length

isCurve

private boolean isCurve

isArc

private boolean isArc

isArrow

private boolean isArrow

isLine

private boolean isLine

isVector

private boolean isVector

isCircle

private boolean isCircle

isPerpendicular

private boolean isPerpendicular

isCylinder

private boolean isCylinder

isVertices

private boolean isVertices

isPlane

private boolean isPlane

isReversed

private boolean isReversed

isRotated45

private boolean isRotated45

isCrossed

private boolean isCrossed

isValid

private boolean isValid

noHead

private boolean noHead

indicatedModelIndex

private int indicatedModelIndex

modelInfo

private int[] modelInfo

makePoints

private boolean makePoints

nidentifiers

private int nidentifiers

nbitsets

private int nbitsets

plane

private javax.vecmath.Point4f plane

bsAllModels

private java.util.BitSet bsAllModels

polygon

private java.util.List polygon

vData

private java.util.List vData

intersectID

private java.lang.String intersectID

boundBox

private javax.vecmath.Point3f[] boundBox

lineData

private java.util.List lineData

PT_COORD

private static final int PT_COORD
See Also:
Constant Field Values

PT_IDENTIFIER

private static final int PT_IDENTIFIER
See Also:
Constant Field Values

PT_BITSET

private static final int PT_BITSET
See Also:
Constant Field Values

PT_MODEL_INDEX

private static final int PT_MODEL_INDEX
See Also:
Constant Field Values

PT_MODEL_BASED_POINTS

private static final int PT_MODEL_BASED_POINTS
See Also:
Constant Field Values

vAB

private final javax.vecmath.Vector3f vAB

vAC

private final javax.vecmath.Vector3f vAC

bsTemp

private final java.util.BitSet bsTemp

MAX_OBJECT_CLICK_DISTANCE_SQUARED

private static final int MAX_OBJECT_CLICK_DISTANCE_SQUARED
See Also:
Constant Field Values

ptXY

private final javax.vecmath.Point3i ptXY

PT_NAN

private final Point3fi PT_NAN
Constructor Detail

Draw

public Draw()
Method Detail

allocMesh

public void allocMesh(java.lang.String thisID,
                      Mesh m)
Overrides:
allocMesh in class MeshCollection

setPropertySuper

void setPropertySuper(java.lang.String propertyName,
                      java.lang.Object value,
                      java.util.BitSet bs)

initShape

public void initShape()
Overrides:
initShape in class MeshCollection

setProperty

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

Overrides:
setProperty in class MeshCollection

resetObjects

private void resetObjects()

getProperty

public boolean getProperty(java.lang.String property,
                           java.lang.Object[] data)
Overrides:
getProperty in class MeshCollection

getProperty

public java.lang.Object getProperty(java.lang.String property,
                                    int index)
Overrides:
getProperty in class MeshCollection

getSpinCenter

private javax.vecmath.Point3f getSpinCenter(java.lang.String axisID,
                                            int vertexIndex,
                                            int modelIndex)

getSpinAxis

private javax.vecmath.Vector3f getSpinAxis(java.lang.String axisID,
                                           int modelIndex)

setDrawing

private boolean setDrawing()

setIntersectData

private void setIntersectData()

addPoint

private void addPoint(javax.vecmath.Point3f newPt,
                      int iModel)

setPoints

private boolean setPoints(int iModel,
                          int n)

setPolygon

private void setPolygon(int nPoly)

scaleDrawing

private static void scaleDrawing(DrawMesh mesh,
                                 float newScale)

setAxes

private static final void setAxes(DrawMesh m)

setVisibilityFlags

public void setVisibilityFlags(java.util.BitSet bs)
Overrides:
setVisibilityFlags in class MeshCollection

checkObjectClicked

public Point3fi checkObjectClicked(int x,
                                   int y,
                                   int action,
                                   java.util.BitSet bsVisible)
Overrides:
checkObjectClicked in class Shape

getPickedPoint

private Point3fi getPickedPoint(javax.vecmath.Point3f v)

checkObjectHovered

public boolean checkObjectHovered(int x,
                                  int y,
                                  java.util.BitSet bsVisible)
Overrides:
checkObjectHovered in class Shape

checkObjectDragged

public boolean checkObjectDragged(int prevX,
                                  int prevY,
                                  int x,
                                  int y,
                                  int action,
                                  java.util.BitSet bsVisible)
Overrides:
checkObjectDragged in class Shape

move2D

private void move2D(DrawMesh mesh,
                    int[] vertexes,
                    int iVertex,
                    int x,
                    int y,
                    boolean moveAll)

findPickedObject

private boolean findPickedObject(int x,
                                 int y,
                                 boolean isPicking,
                                 java.util.BitSet bsVisible)

getDrawCommand

private java.lang.String getDrawCommand(DrawMesh mesh)

getDrawCommand

private java.lang.String getDrawCommand(DrawMesh mesh,
                                        int iModel)

isPolygonDisplayable

static boolean isPolygonDisplayable(Mesh mesh,
                                    int i)

getVertexList

private static java.lang.String getVertexList(DrawMesh mesh,
                                              int iModel,
                                              int nVertices)

getShapeDetail

public java.util.List getShapeDetail()
Overrides:
getShapeDetail in class Shape

getShapeState

public java.lang.String getShapeState()
Overrides:
getShapeState in class Shape

randomPoint

static javax.vecmath.Point3f randomPoint()