Shape
Date: 2019-10-22

org.jmol.shape

## Class Shape

- java.lang.Object
- - org.jmol.shape.Shape

- Direct Known Subclasses:
    AtomShape, BioShapeCollection, Dipoles, FontLineShape, Frank, MeshCollection, Sticks, TextShape

      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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `javajs.util.BS` | `bsColixSet`
    `javajs.util.BS` | `bsSizeSet`
    `boolean` | `isBioShape`
    `ModelSet` | `ms`
    `java.lang.String` | `myType`
    `static float` | `RADIUS_MAX`
    `int` | `shapeID`
    `boolean` | `translucentAllowed`
    `protected float` | `translucentLevel`
    `int` | `vf` shape visibility flag
    `Viewer` | `vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Shape()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static void` | `appendCmd(javajs.util.SB s, java.lang.String cmd)`
    `void` | `checkBoundsMinMax(javajs.util.P3 pointMin, javajs.util.P3 pointMax)`
    `java.util.Map<java.lang.String,java.lang.Object>` | `checkObjectClicked(int x, int y, int modifiers, 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 int` | `coordinateInRange(int x, int y, javajs.util.T3 vertex, int dmin2, javajs.util.P3i ptXY)`
    `static java.lang.String` | `encodeColor(short colix)`
    `void` | `findNearestAtomIndex(int xMouse, int yMouse, Atom[] closest, javajs.util.BS bsNot)`
    `static short` | `getColix(short[] colixes, int i, Atom atom)`
    `protected short` | `getColixA(short colix, byte paletteID, Atom atom)`
    `protected short` | `getColixB(short colix, int pid, Bond bond)`
    `short` | `getColixI(short colix, byte paletteID, int atomIndex)`
    `static java.lang.String` | `getColorCommand(java.lang.String type, byte pid, short colix, boolean translucentAllowed)`
    `static java.lang.String` | `getColorCommandUnk(java.lang.String type, short colix, boolean translucentAllowed)`
    `static java.lang.String` | `getFontCommand(java.lang.String type, Font font)`
    `int` | `getIndexFromName(java.lang.String thisID)`
    `java.lang.Object` | `getProperty(java.lang.String property, int index)`
    `boolean` | `getPropertyData(java.lang.String property, java.lang.Object[] data)`
    `protected boolean` | `getPropShape(java.lang.String property, java.lang.Object[] data)`
    `java.lang.Object` | `getShapeDetail()`
    `abstract java.lang.String` | `getShapeState()`
    `int` | `getSize(int atomIndex)` overridden in Dots, CGOMesh, and AtomShape
    `int` | `getSizeG(Group group)`
    `static java.lang.String` | `getTranslucentLabel(short colix)`
    `void` | `initializeShape(Viewer vwr, ModelSet modelSet, int shapeID)`
    `protected void` | `initModelSet()`
    `abstract void` | `initShape()`
    `void` | `replaceGroup(Group g0, Group g1)`
    `void` | `setAtomClickability()`
    `void` | `setModelSet(ModelSet modelSet)`
    `void` | `setModelVisibilityFlags(javajs.util.BS bsModels)`
    `abstract void` | `setProperty(java.lang.String propertyName, java.lang.Object value, javajs.util.BS bsSelected)`
    `protected void` | `setPropS(java.lang.String propertyName, java.lang.Object value, javajs.util.BS bsSelected)`
    `void` | `setShapeSizeRD(int size, RadiusData rd, javajs.util.BS bsSelected)`
    `protected void` | `setSize(int size, javajs.util.BS bsSelected)`
    `protected void` | `setSizeRD(RadiusData rd, javajs.util.BS bsSelected)`
    `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

    - #### myType

          public java.lang.String myType

    - #### RADIUS_MAX

          public static final float RADIUS_MAX

      See Also:
        Constant Field Values

    - #### vwr

          public Viewer vwr

    - #### ms

          public ModelSet ms

    - #### shapeID

          public int shapeID

    - #### vf

          public int vf

      shape visibility flag

    - #### translucentLevel

          protected float translucentLevel

    - #### translucentAllowed

          public boolean translucentAllowed

    - #### isBioShape

          public boolean isBioShape

    - #### bsSizeSet

          public javajs.util.BS bsSizeSet

    - #### bsColixSet

          public javajs.util.BS bsColixSet

  - ### Constructor Detail

    - #### Shape

          public Shape()

  - ### Method Detail

    - #### getShapeState

          public abstract java.lang.String getShapeState()

    - #### setProperty

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

    - #### initializeShape

          public final void initializeShape(Viewer vwr,
                                            ModelSet modelSet,
                                            int shapeID)

    - #### initShape

          public abstract void initShape()

    - #### setModelVisibilityFlags

          public void setModelVisibilityFlags(javajs.util.BS bsModels)

      Parameters:
        `bsModels` -

    - #### getSize

          public int getSize(int atomIndex)

      overridden in Dots, CGOMesh, and AtomShape
      Parameters:
        `atomIndex` -
      Returns:
        size

    - #### getSizeG

          public int getSizeG(Group group)

      Parameters:
        `group` -
      Returns:
        size

    - #### replaceGroup

          public void replaceGroup(Group g0,
                                   Group g1)

      Parameters:
        `g0` -
        `g1` -

    - #### setModelSet

          public void setModelSet(ModelSet modelSet)

    - #### initModelSet

          protected void initModelSet()

    - #### setShapeSizeRD

          public void setShapeSizeRD(int size,
                                     RadiusData rd,
                                     javajs.util.BS bsSelected)

    - #### setSize

          protected void setSize(int size,
                                 javajs.util.BS bsSelected)

      Parameters:
        `size` -
        `bsSelected` -

    - #### setSizeRD

          protected void setSizeRD(RadiusData rd,
                                   javajs.util.BS bsSelected)

      Parameters:
        `rd` -
        `bsSelected` -

    - #### setPropS

          protected void setPropS(java.lang.String propertyName,
                                  java.lang.Object value,
                                  javajs.util.BS bsSelected)

    - #### getPropertyData

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

      Parameters:
        `property` -
        `data` -
      Returns:
        true if serviced

    - #### getPropShape

          protected boolean getPropShape(java.lang.String property,
                                         java.lang.Object[] data)

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

      Parameters:
        `xMouse` -
        `yMouse` -
        `closest` -
        `bsNot` -

    - #### checkBoundsMinMax

          public void checkBoundsMinMax(javajs.util.P3 pointMin,
                                        javajs.util.P3 pointMax)

      Parameters:
        `pointMin` -
        `pointMax` -

    - #### setAtomClickability

          public void setAtomClickability()

    - #### checkObjectClicked

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

      Parameters:
        `x` -
        `y` -
        `modifiers` -
        `bsVisible` -
        `drawPicking` - TODO
      Returns:
        Hashtable containing information about pt clicked

    - #### checkObjectHovered

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

      Parameters:
        `x` -
        `y` -
        `bsVisible` -
      Returns:
        T/F

    - #### checkObjectDragged

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

      Parameters:
        `prevX` -
        `prevY` -
        `x` -
        `y` -
        `dragAction` -
        `bsVisible` -
      Returns:
        T/F

    - #### coordinateInRange

          protected int coordinateInRange(int x,
                                          int y,
                                          javajs.util.T3 vertex,
                                          int dmin2,
                                          javajs.util.P3i ptXY)

    - #### getColixI

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

    - #### getColixA

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

    - #### getColixB

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

    - #### getShapeDetail

          public java.lang.Object getShapeDetail()

    - #### getColix

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

    - #### getFontCommand

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

    - #### getColorCommandUnk

          public static java.lang.String getColorCommandUnk(java.lang.String type,
                                                            short colix,
                                                            boolean translucentAllowed)

    - #### getColorCommand

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

    - #### encodeColor

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

    - #### getTranslucentLabel

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

    - #### appendCmd

          protected static void appendCmd(javajs.util.SB s,
                                          java.lang.String cmd)