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  Point3f[] boundBox
           
private  BitSet bsAllModels
           
private  BitSet bsTemp
           
private  int diameter
           
(package private)  DrawMesh[] dmeshes
           
private  int indicatedModelIndex
           
private  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  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  Vector3f offset
           
private  Point4f plane
           
private  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  Point3f[] ptList
           
private  Point3i ptXY
           
(package private)  DrawMesh thisMesh
           
private  Vector3f vAB
           
private  Vector3f vAC
           
private  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(Point3f newPt, int iModel)
           
 void allocMesh(String thisID, Mesh m)
           
 Point3fi checkObjectClicked(int x, int y, int action, BitSet bsVisible)
           
 boolean checkObjectDragged(int prevX, int prevY, int x, int y, int action, BitSet bsVisible)
           
 boolean checkObjectHovered(int x, int y, BitSet bsVisible)
           
private  boolean findPickedObject(int x, int y, boolean isPicking, BitSet bsVisible)
           
private  String getDrawCommand(DrawMesh mesh)
           
private  String getDrawCommand(DrawMesh mesh, int iModel)
           
private  Point3fi getPickedPoint(Point3f v)
           
 Object getProperty(String property, int index)
           
 boolean getProperty(String property, Object[] data)
           
 List getShapeDetail()
           
 String getShapeState()
           
private  Vector3f getSpinAxis(String axisID, int modelIndex)
           
private  Point3f getSpinCenter(String axisID, int vertexIndex, int modelIndex)
           
private static 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 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(String propertyName, Object value, BitSet bs)
          may come from any source -- executed AFTER a shape's own setProperty method
(package private)  void setPropertySuper(String propertyName, Object value, BitSet bs)
           
 void setVisibilityFlags(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 Point3f[] ptList

offset

private 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 Point4f plane

bsAllModels

private BitSet bsAllModels

polygon

private List polygon

vData

private List vData

intersectID

private String intersectID

boundBox

private Point3f[] boundBox

lineData

private 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 Vector3f vAB

vAC

private final Vector3f vAC

bsTemp

private final BitSet bsTemp

MAX_OBJECT_CLICK_DISTANCE_SQUARED

private static final int MAX_OBJECT_CLICK_DISTANCE_SQUARED
See Also:
Constant Field Values

ptXY

private final Point3i ptXY

PT_NAN

private final Point3fi PT_NAN
Constructor Detail

Draw

public Draw()
Method Detail

allocMesh

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

setPropertySuper

void setPropertySuper(String propertyName,
                      Object value,
                      BitSet bs)

initShape

public void initShape()
Overrides:
initShape in class MeshCollection

setProperty

public void setProperty(String propertyName,
                        Object value,
                        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(String property,
                           Object[] data)
Overrides:
getProperty in class MeshCollection

getProperty

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

getSpinCenter

private Point3f getSpinCenter(String axisID,
                              int vertexIndex,
                              int modelIndex)

getSpinAxis

private Vector3f getSpinAxis(String axisID,
                             int modelIndex)

setDrawing

private boolean setDrawing()

setIntersectData

private void setIntersectData()

addPoint

private void addPoint(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(BitSet bs)
Overrides:
setVisibilityFlags in class MeshCollection

checkObjectClicked

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

getPickedPoint

private Point3fi getPickedPoint(Point3f v)

checkObjectHovered

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

checkObjectDragged

public boolean checkObjectDragged(int prevX,
                                  int prevY,
                                  int x,
                                  int y,
                                  int action,
                                  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,
                                 BitSet bsVisible)

getDrawCommand

private String getDrawCommand(DrawMesh mesh)

getDrawCommand

private String getDrawCommand(DrawMesh mesh,
                              int iModel)

isPolygonDisplayable

static boolean isPolygonDisplayable(Mesh mesh,
                                    int i)

getVertexList

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

getShapeDetail

public List getShapeDetail()
Overrides:
getShapeDetail in class Shape

getShapeState

public String getShapeState()
Overrides:
getShapeState in class Shape

randomPoint

static Point3f randomPoint()