lib/model.js~ AtomImage

An 'image' of a single atom from a model. This represents a specific periodic copy of that atom (if applicable).

Constructor

new AtomImage(model, index, ijk)

Parameters:
NameTypeDescription
modelModel

The model from which the image is from

indexint

Index of the atom in the model

ijkArray

Indices of the cell in which the image is located

Members

(readonly) aura :AuraMesh

Aura used to highlight this atom image

Type:
  • AuraMesh

baseRadius :float

Starting radius of the atom

Type:
  • float

(readonly) bondedAtoms :Array.<AtomImage>

All atoms bonded to this atom

Type:
  • Array.<AtomImage>

(readonly) bonds :Array.<BondImage>

All bonds connected to this atom

Type:
  • Array.<BondImage>

(readonly) bondsFrom :Array.<BondImage>

Bonds from this atom

Type:
  • Array.<BondImage>

(readonly) bondsTo :Array.<BondImage>

Bonds to this atom

Type:
  • Array.<BondImage>

color :int

Color of the atom

Type:
  • int

(readonly) cpkColor :int

Hex integer code of the conventional CPK color used for this element (altered in case of non-standard isotopes)

Type:
  • int

(readonly) crystLabel :String

Crystal site label of this atom

Type:
  • String

(readonly) element :String

Symbol of this atom's element

Type:
  • String

(readonly) elementData :Object

Periodic table information for this atom's element

Type:
  • Object

(readonly) fxyz :Array.<float>

Fractional coordinates of this atom image

Type:
  • Array.<float>

(readonly) fxyz0 :Array.<float>

Fractional coordinates of this atom's original

Type:
  • Array.<float>

highlighted :bool

Whether the atom is highlighted

Type:
  • bool

(readonly) id :String

String ID of the image

Type:
  • String

(readonly) ijk :Array.<int>

Cell indices of this atom image

Type:
  • Array.<int>

(readonly) imgIndex :int

Index of this image

Type:
  • int

(readonly) index :int

Index of the atom

Type:
  • int

isotope :int

Atomic mass of this atom's isotope

Type:
  • int

(readonly) isotopeData :Object

Information for this atom's isotope

Type:
  • Object

isotopeGlobal :int

Atomic mass of the global isotope set as default for this atom's species

Type:
  • int

(readonly) mesh :AtomMesh

Mesh corresponding to this atom image

Type:
  • AtomMesh

(readonly) model :Model

Model this atom belongs to

Type:
  • Model

(readonly) moleculeIndex :int

Index of the molecule this atom belongs to

Type:
  • int

(readonly) number :int

Atomic number of element

Type:
  • int

opacity :float

Opacity of the atom

Type:
  • float

radius :float

Final radius of the atom (starting radius * scale)

Type:
  • float

(readonly) renderer :Renderer

Renderer used by this atom

Type:
  • Renderer

scale :float

Scale of the atom

Type:
  • float

(readonly) speciesIndex :int

Index of the species of this atom

Type:
  • int

(readonly) vdwRadius :float

Van dew Waals radius for this element

Type:
  • float

visible :bool

Whether the atom is visible

Type:
  • bool

(readonly) xyz :Array.<float>

Position of this atom image

Type:
  • Array.<float>

(readonly) xyz0 :Array.<float>

Position of this atom's original

Type:
  • Array.<float>

Methods

addEllipsoid(data, name, parameters)

Add an ellipsoid to the atom.

Parameters:
NameTypeDescription
dataTensorData | Object | Array

The data to base the ellipsoid on. Can be: - a TensorData object; - an Object with 'eigenvalues' and 'eigenvectors' members - an Array of the form [eigenvalues, eigenvectors]

nameString

Name of the ellipsoid

parametersObject

Additional options to pass (see EllipsoidMesh)

addLabel(text, name, parameters)

Add a text label to the atom.

Parameters:
NameTypeDescription
textString

Content of the label

nameString

Name to use to refer to the label (necessary to overwrite/erase later)

parametersObject

Dictionary of other options (e.g. font family, text color, etc. See TextSprite)

ellipsoidProperty(name, property, value)

Retrieve or set an ellipsoid's properties

Parameters:
NameTypeDefaultDescription
nameString

Name of the ellipsoid

propertyString

Property to set

value?null

Value to set. If omitted, returns the current value instead.

getArrayValue(name) → {*}

Get the value for one array for this image

Parameters:
NameTypeDescription
nameString

Name of the array

Returns:

Value of the array for this atom

Type: 
*

labelProperty(name, property, value)

Retrieve or set a label's properties

Parameters:
NameTypeDefaultDescription
nameString

Name of the label

propertyString

Property to set

value?null

Value to set. If omitted, returns the current value instead.

removeEllipsoid(name)

Remove the ellipsoid with a given name

Parameters:
NameTypeDescription
nameString

Name of the ellipsoid

removeLabel(name)

Remove the label of a given name

Parameters:
NameTypeDescription
nameString

Name of the label