Draw
Date: 2019-10-22

org.jmol.shapespecial

## Class Draw

- java.lang.Object
- - org.jmol.shape.Shape
  - - org.jmol.shape.MeshCollection
    - - org.jmol.shapespecial.Draw

-     public class Draw
      extends MeshCollection

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Draw.EnumDrawType`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private javajs.util.P3[]` | `boundBox`
    `private javajs.util.BS` | `bsAllModels`
    `private int` | `diameter`
    `(package private) DrawMesh[]` | `dmeshes`
    `private int` | `indicatedModelIndex`
    `private java.lang.String` | `intersectID`
    `private boolean` | `isArc`
    `private boolean` | `isArrow`
    `private boolean` | `isBarb`
    `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 javajs.util.Lst<javajs.util.P3[]>` | `lineData`
    `private boolean` | `makePoints`
    `private static int` | `MAX_OBJECT_CLICK_DISTANCE_SQUARED`
    `private int[]` | `modelInfo`
    `private float` | `newScale`
    `private boolean` | `noHead`
    `private int` | `nPoints`
    `private javajs.util.V3` | `offset`
    `private javajs.util.P4` | `plane`
    `private javajs.util.Lst<java.lang.Object>` | `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 javajs.util.P3[]` | `ptList`
    `private javajs.util.P3i` | `ptXY`
    `(package private) MeshSurface` | `slabData`
    `private DrawMesh` | `thisMesh`
    `private javajs.util.V3` | `vAB`
    `private javajs.util.Lst<java.lang.Object[]>` | `vData`
    `private float` | `width`

    - ### Fields inherited from class org.jmol.shape.MeshCollection

      `bsDisplay, colix, color, connections, currentMesh, displayWithinDistance2, displayWithinPoints, explicitID, htObjects, isDisplayWithinNot, isFixed, linkedMesh, meshCount, meshes, modelIndex, nUnnamed, pickedMesh, pickedModel, pickedPt, pickedVertex, PREVIOUS_MESH_ID, previousMeshID, title`

    - ### Fields inherited from class org.jmol.shape.Shape

      `bsColixSet, bsSizeSet, isBioShape, ms, myType, RADIUS_MAX, shapeID, translucentAllowed, translucentLevel, vf, vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Draw()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `addPoint(javajs.util.T3 newPt, int iModel)`
    `private void` | `addPoints(int type, java.lang.Object value)`
    `void` | `allocMesh(java.lang.String thisID, Mesh m)`
    `java.util.Map<java.lang.String,java.lang.Object>` | `checkObjectClicked(int x, int y, int action, javajs.util.BS bsVisible, boolean drawPicking)`
    `boolean` | `checkObjectDragged(int prevX, int prevY, int x, int y, int dragAction, javajs.util.BS bsVisible)`
    `boolean` | `checkObjectHovered(int x, int y, javajs.util.BS bsVisible)`
    `protected void` | `clean()`
    `private void` | `deleteMeshElement(int i)`
    `private void` | `deleteModels(int modelIndex)`
    `private boolean` | `findPickedObject(int x, int y, boolean isPicking, javajs.util.BS bsVisible)`
    `private java.lang.String` | `getCommand(Mesh mesh)`
    `private java.lang.String` | `getCommand2(Mesh mesh, int iModel)`
    `java.lang.Object` | `getProperty(java.lang.String property, int index)`
    `boolean` | `getPropertyData(java.lang.String property, java.lang.Object[] data)`
    `java.lang.Object` | `getShapeDetail()`
    `java.lang.String` | `getShapeState()`
    `private javajs.util.V3` | `getSpinAxis(java.lang.String axisID, int modelIndex)`
    `private javajs.util.T3` | `getSpinCenter(java.lang.String axisID, int vertexIndex, int modelIndex)`
    `private static java.lang.String` | `getVertexList(DrawMesh mesh, int iModel, int nVertices)`
    `private void` | `initDraw()`
    `void` | `initShape()`
    `static boolean` | `isPolygonDisplayable(Mesh mesh, int i)`
    `private void` | `move2D(DrawMesh mesh, int[] vertexes, int iVertex, int x, int y, boolean moveAll)`
    `static javajs.util.P3` | `randomPoint()`
    `private void` | `scale(Mesh mesh, float newScale)`
    `private static void` | `setAxes(DrawMesh m)`
    `private boolean` | `setDrawing(int[] connections)`
    `void` | `setModelVisibilityFlags(javajs.util.BS bsModels)`
    `private boolean` | `setPoints(int iModel, int n)`
    `private void` | `setPolygon(int nPoly)`
    `void` | `setProperty(java.lang.String propertyName, java.lang.Object value, javajs.util.BS bs)`
    `private void` | `setPropertySuper(java.lang.String propertyName, java.lang.Object value, javajs.util.BS bs)`

    - ### Methods inherited from class org.jmol.shape.MeshCollection

      `checkExplicit, deleteMeshI, deleteMeshKey, getIndexFromName, getMesh, getMeshList, getPickedPoint, getPropDataMC, getPropMC, merge, resetObjects, setPropMC, setStatusPicked, setTokenProperty`

    - ### Methods inherited from class org.jmol.shape.Shape

      `appendCmd, checkBoundsMinMax, coordinateInRange, encodeColor, findNearestAtomIndex, getColix, getColixA, getColixB, getColixI, getColorCommand, getColorCommandUnk, getFontCommand, getPropShape, getSize, getSizeG, getTranslucentLabel, initializeShape, initModelSet, replaceGroup, setAtomClickability, setModelSet, setPropS, setShapeSizeRD, setSize, setSizeRD, 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

          private DrawMesh thisMesh

    - #### ptList

          private javajs.util.P3[] ptList

    - #### offset

          private javajs.util.V3 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

    - #### isBarb

          private boolean isBarb

    - #### indicatedModelIndex

          private int indicatedModelIndex

    - #### modelInfo

          private int[] modelInfo

    - #### makePoints

          private boolean makePoints

    - #### plane

          private javajs.util.P4 plane

    - #### bsAllModels

          private javajs.util.BS bsAllModels

    - #### polygon

          private javajs.util.Lst<java.lang.Object> polygon

    - #### vData

          private javajs.util.Lst<java.lang.Object[]> vData

    - #### intersectID

          private java.lang.String intersectID

    - #### boundBox

          private javajs.util.P3[] boundBox

    - #### lineData

          private javajs.util.Lst<javajs.util.P3[]> 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

    - #### slabData

          MeshSurface slabData

    - #### vAB

          private final javajs.util.V3 vAB

    - #### MAX_OBJECT_CLICK_DISTANCE_SQUARED

          private static final int MAX_OBJECT_CLICK_DISTANCE_SQUARED

      See Also:
        Constant Field Values

    - #### ptXY

          private final javajs.util.P3i ptXY

  - ### Constructor Detail

    - #### Draw

          public Draw()

  - ### Method Detail

    - #### allocMesh

          public void allocMesh(java.lang.String thisID,
                                Mesh m)

      Overrides:
        `allocMesh` in class `MeshCollection`

    - #### setPropertySuper

          private void setPropertySuper(java.lang.String propertyName,
                                        java.lang.Object value,
                                        javajs.util.BS bs)

    - #### initShape

          public void initShape()

      Overrides:
        `initShape` in class `MeshCollection`

    - #### setProperty

          public void setProperty(java.lang.String propertyName,
                                  java.lang.Object value,
                                  javajs.util.BS bs)

      Specified by:
        `setProperty` in class `Shape`

    - #### addPoints

          private void addPoints(int type,
                                 java.lang.Object value)

    - #### deleteModels

          private void deleteModels(int modelIndex)

    - #### deleteMeshElement

          private void deleteMeshElement(int i)

    - #### initDraw

          private void initDraw()

    - #### getPropertyData

          public boolean getPropertyData(java.lang.String property,
                                         java.lang.Object[] data)

      Overrides:
        `getPropertyData` in class `Shape`
      Returns:
        true if serviced

    - #### getProperty

          public java.lang.Object getProperty(java.lang.String property,
                                              int index)

      Overrides:
        `getProperty` in class `Shape`
      Returns:
        true if serviced

    - #### getSpinCenter

          private javajs.util.T3 getSpinCenter(java.lang.String axisID,
                                               int vertexIndex,
                                               int modelIndex)

    - #### getSpinAxis

          private javajs.util.V3 getSpinAxis(java.lang.String axisID,
                                             int modelIndex)

    - #### setDrawing

          private boolean setDrawing(int[] connections)

    - #### clean

          protected void clean()

      Overrides:
        `clean` in class `MeshCollection`

    - #### addPoint

          private void addPoint(javajs.util.T3 newPt,
                                int iModel)

    - #### setPoints

          private boolean setPoints(int iModel,
                                    int n)

    - #### setPolygon

          private void setPolygon(int nPoly)

    - #### scale

          private void scale(Mesh mesh,
                             float newScale)

    - #### setAxes

          private static final void setAxes(DrawMesh m)

    - #### setModelVisibilityFlags

          public void setModelVisibilityFlags(javajs.util.BS bsModels)

      Overrides:
        `setModelVisibilityFlags` in class `MeshCollection`

    - #### checkObjectClicked

          public java.util.Map<java.lang.String,java.lang.Object> checkObjectClicked(int x,
                                                                                     int y,
                                                                                     int action,
                                                                                     javajs.util.BS bsVisible,
                                                                                     boolean drawPicking)

      Overrides:
        `checkObjectClicked` in class `Shape`
        `drawPicking` - TODO
      Returns:
        Hashtable containing information about pt clicked

    - #### checkObjectHovered

          public boolean checkObjectHovered(int x,
                                            int y,
                                            javajs.util.BS bsVisible)

      Overrides:
        `checkObjectHovered` in class `Shape`
      Returns:
        T/F

    - #### checkObjectDragged

          public boolean checkObjectDragged(int prevX,
                                            int prevY,
                                            int x,
                                            int y,
                                            int dragAction,
                                            javajs.util.BS bsVisible)

      Overrides:
        `checkObjectDragged` in class `Shape`
      Returns:
        T/F

    - #### 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,
                                           javajs.util.BS bsVisible)

      Parameters:
        `x` -
        `y` -
        `isPicking` - IGNORED
        `bsVisible` -
      Returns:
        true if found

    - #### getCommand

          private java.lang.String getCommand(Mesh mesh)

    - #### getCommand2

          private java.lang.String getCommand2(Mesh mesh,
                                               int iModel)

    - #### isPolygonDisplayable

          public static boolean isPolygonDisplayable(Mesh mesh,
                                                     int i)

    - #### getVertexList

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

    - #### getShapeDetail

          public java.lang.Object getShapeDetail()

      Overrides:
        `getShapeDetail` in class `Shape`

    - #### getShapeState

          public java.lang.String getShapeState()

      Specified by:
        `getShapeState` in class `Shape`

    - #### randomPoint

          public static javajs.util.P3 randomPoint()