Class Isosurface

All Implemented Interfaces:
MeshDataServer, VertexDataServer
Direct Known Subclasses:
Contact, LcaoCartoon, MolecularOrbital, Pmesh

public class Isosurface extends MeshCollection implements MeshDataServer
  • Field Details

    • isomeshes

      protected IsosurfaceMesh[] isomeshes
    • thisMesh

      protected IsosurfaceMesh thisMesh
    • actualID

      private String actualID
    • iHaveBitSets

      protected boolean iHaveBitSets
    • explicitContours

      private boolean explicitContours
    • atomIndex

      private int atomIndex
    • moNumber

      private int moNumber
    • moLinearCombination

      private float[] moLinearCombination
    • colorType

      private int colorType
    • defaultColix

      private short defaultColix
    • meshColix

      private short meshColix
    • center

      private javajs.util.P3 center
    • scale3d

      private float scale3d
    • isPhaseColored

      private boolean isPhaseColored
    • isColorExplicit

      private boolean isColorExplicit
    • scriptAppendix

      private String scriptAppendix
    • sg

      protected SurfaceGenerator sg
    • withinDistance2

      private float withinDistance2
    • isWithinNot

      private boolean isWithinNot
    • withinPoints

      private javajs.util.Lst<javajs.util.P3> withinPoints
    • cutoffRange

      private float[] cutoffRange
    • allowMesh

      boolean allowMesh
    • script

      private String script
    • iHaveModelIndex

      private boolean iHaveModelIndex
    • nLCAO

      private int nLCAO
    • lcaoDir

      private javajs.util.P4 lcaoDir
    • associateNormals

      private boolean associateNormals
    • oldFileName

      private String oldFileName
    • newFileName

      private String newFileName
    • MAX_OBJECT_CLICK_DISTANCE_SQUARED

      private static final int MAX_OBJECT_CLICK_DISTANCE_SQUARED
      See Also:
    • ptXY

      private final javajs.util.P3i ptXY
    • keyXy

      public int[] keyXy
  • Constructor Details

    • Isosurface

      public Isosurface()
  • Method Details

    • allocMesh

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

      public void initShape()
      Overrides:
      initShape in class MeshCollection
    • newSg

      protected void newSg()
    • clearSg

      protected void clearSg()
    • setProperty

      public void setProperty(String propertyName, Object value, javajs.util.BS bs)
      Specified by:
      setProperty in class Shape
    • setPropI

      protected void setPropI(String propertyName, Object value, javajs.util.BS bs)
    • getFileReader

      private Object getFileReader(String fileName)
    • setIsoMeshColor

      private void setIsoMeshColor(IsosurfaceMesh m, String color)
    • setColorPhase

      private void setColorPhase(IsosurfaceMesh m, short colix0, short colix1)
    • ensureMeshSource

      private void ensureMeshSource()
    • slabPolygons

      protected void slabPolygons(Object[] slabInfo)
    • setPropertySuper

      private void setPropertySuper(String propertyName, Object value, javajs.util.BS bs)
    • getPropertyData

      public boolean getPropertyData(String property, Object[] data)
      Overrides:
      getPropertyData in class Shape
      Returns:
      true if serviced
    • getProperty

      public Object getProperty(String property, int index)
      Overrides:
      getProperty in class Shape
      Returns:
      true if serviced
    • getPropI

      protected Object getPropI(String property, int index)
    • getDataRange

      private float[] getDataRange(IsosurfaceMesh mesh)
    • calculateVolumeOrArea

      private Object calculateVolumeOrArea(IsosurfaceMesh mesh, boolean isArea)
    • getPolygonColorData

      public static String getPolygonColorData(int ccount, short[] colixes, int[][] polygons, javajs.util.BS bsSlabDisplay)
    • getShapeState

      public String getShapeState()
      Specified by:
      getShapeState in class Shape
    • getMeshCommand

      private void getMeshCommand(javajs.util.SB sb, int i)
    • getScriptBitSets

      private boolean getScriptBitSets(String script, javajs.util.BS[] bsCmd)
    • getCapSlabInfo

      protected void getCapSlabInfo(String script)
    • getCapSlabObject

      private Object[] getCapSlabObject(String s, boolean isCap)
      legacy -- for some scripts with early isosurface slabbing
      Parameters:
      s -
      isCap -
      Returns:
      slabInfo object
    • initializeIsosurface

      private void initializeIsosurface()
    • initState

      private void initState()
    • setMeshI

      private void setMeshI()
    • discardTempData

      protected void discardTempData(boolean discardAll)
    • getDefaultColix

      private short getDefaultColix()
    • drawLcaoCartoon

      private void drawLcaoCartoon(javajs.util.V3 z, javajs.util.V3 x, javajs.util.V3 rotAxis, int nElectrons)
    • createLcaoLobe

      private void createLcaoLobe(javajs.util.V3 lobeAxis, float factor, int nElectrons)
    • invalidateTriangles

      public void invalidateTriangles()
      Specified by:
      invalidateTriangles in interface MeshDataServer
    • setOutputChannel

      public void setOutputChannel(javajs.api.GenericBinaryDocument binaryDoc, javajs.util.OC out)
      Specified by:
      setOutputChannel in interface MeshDataServer
    • fillMeshData

      public void fillMeshData(MeshData meshData, int mode, IsosurfaceMesh mesh)
      Specified by:
      fillMeshData in interface MeshDataServer
    • notifySurfaceGenerationCompleted

      public boolean notifySurfaceGenerationCompleted()
      Specified by:
      notifySurfaceGenerationCompleted in interface MeshDataServer
    • notifySurfaceMappingCompleted

      public void notifySurfaceMappingCompleted()
      Specified by:
      notifySurfaceMappingCompleted in interface MeshDataServer
    • setBsVdw

      private void setBsVdw()
    • calculateGeodesicSurface

      public javajs.util.P3[] calculateGeodesicSurface(javajs.util.BS bsSelected, float envelopeRadius)
      Specified by:
      calculateGeodesicSurface in interface MeshDataServer
    • getSurfacePointIndexAndFraction

      public int getSurfacePointIndexAndFraction(float cutoff, boolean isCutoffAbsolute, int x, int y, int z, javajs.util.P3i offset, int vA, int vB, float valueA, float valueB, javajs.util.T3 pointA, javajs.util.V3 edgeVector, boolean isContourType, float[] fReturn)
      Description copied from interface: VertexDataServer
      getSurfacePointIndex is used by the Marching Cubes algorithm and must return a unique integer identifier for a vertex created by the Marching Cube algorithm when it finds an edge. If a vertex is discarded, then Integer.MAX_VALUE should be returned. the 3D coordinate of the point can be calculated using surfacePoint.scaleAdd(fraction, edgeVector, pointA); where fraction is generally calculated as: fraction = (cutoff - valueA) / (valueB - valueA); if (isCutoffAbsolute && (fraction < 0 || fraction > 1)) fraction = (-cutoff - valueA) / (valueB - valueA); This method is also used by MarchingCubes to deliver the appropriate oblique planar coordinate to MarchingSquares for later contouring.
      Specified by:
      getSurfacePointIndexAndFraction in interface VertexDataServer
      vA - [0:7]
      vB - [0:7]
      edgeVector - vector from A to B
      Returns:
      new vertex index or Integer.MAX_VALUE
    • addVertexCopy

      public int addVertexCopy(javajs.util.T3 vertexXYZ, float value, int assocVertex, boolean asCopy)
      Description copied from interface: VertexDataServer
      addVertexCopy is used by the Marching Squares algorithm to uniquely identify a new vertex when an edge is crossed in the 2D plane. The implementing method should COPY the Point3f using Point3f.set(). The data consumer can use the association key to group this vertex with others near the same gridpoint.
      Specified by:
      addVertexCopy in interface VertexDataServer
      assocVertex - unique association vertex or -1
      Returns:
      new vertex index
    • addTriangleCheck

      public int addTriangleCheck(int iA, int iB, int iC, int check, int iContour, boolean isAbsolute, int color)
      Description copied from interface: VertexDataServer
      addTriangleCheck adds a triangle along with a 3-bit check indicating which edges to draw in mesh mode: 1 (iA-iB) + 2 (iB-iC) + 4 (iC-iA)
      Specified by:
      addTriangleCheck in interface VertexDataServer
      iContour - TODO
      Returns:
      polygon index or -1
    • setScriptInfo

      protected void setScriptInfo(String strCommand)
    • addRequiredFile

      public void addRequiredFile(String fileName)
      Specified by:
      addRequiredFile in interface MeshDataServer
    • setRequiredFile

      public void setRequiredFile(String oldName, String fileName)
      Specified by:
      setRequiredFile in interface MeshDataServer
    • setJvxlInfo

      private void setJvxlInfo()
    • getShapeDetail

      public Object getShapeDetail()
      Overrides:
      getShapeDetail in class Shape
    • addMeshInfo

      protected void addMeshInfo(IsosurfaceMesh mesh, Map<String,Object> info)
    • getPlane

      public float[] getPlane(int x)
      Specified by:
      getPlane in interface VertexDataServer
    • getValue

      public float getValue(int x, int y, int z, int ptyz)
      Description copied from interface: VertexDataServer
      for readers only
      Specified by:
      getValue in interface VertexDataServer
      Returns:
      value[x][y][z]
    • checkObjectHovered

      public boolean checkObjectHovered(int x, int y, javajs.util.BS bsVisible)
      Overrides:
      checkObjectHovered in class Shape
      Returns:
      T/F
    • hoverKey

      private void hoverKey(int x, int y)
    • checkObjectClicked

      public Map<String,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
    • isPickable

      private boolean isPickable(IsosurfaceMesh m, javajs.util.BS bsVisible)
    • findValue

      private String findValue(int x, int y, boolean isPicking, javajs.util.BS bsVisible)
      Parameters:
      x -
      y -
      isPicking - IGNORED
      bsVisible -
      Returns:
      value found
    • getCmd

      public String getCmd(int index)
    • getValues

      protected Object getValues(Mesh mesh)
      Overrides:
      getValues in class MeshCollection
    • getVertices

      protected Object getVertices(Mesh mesh)
      Overrides:
      getVertices in class MeshCollection