AtomImage

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:
Name Type Description
model Model

The model from which the image is from

index int

Index of the atom in the model

ijk Array

Indices of the cell in which the image is located

Source:

Members

# (readonly) aura :AuraMesh

Aura used to highlight this atom image

Type:
  • AuraMesh
Source:

# baseRadius :float

Starting radius of the atom

Type:
  • float
Source:

# (readonly) bondedAtoms :Array.<AtomImage>

All atoms bonded to this atom

Type:
  • Array.<AtomImage>
Source:

# (readonly) bonds :Array.<BondImage>

All bonds connected to this atom

Type:
  • Array.<BondImage>
Source:

# (readonly) bondsFrom :Array.<BondImage>

Bonds from this atom

Type:
  • Array.<BondImage>
Source:

# (readonly) bondsTo :Array.<BondImage>

Bonds to this atom

Type:
  • Array.<BondImage>
Source:

# color :int

Color of the atom

Type:
  • int
Source:

# (readonly) cpkColor :int

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

Type:
  • int
Source:

# (readonly) crystLabel :String

Crystal site label of this atom

Type:
  • String
Source:

# (readonly) element :String

Symbol of this atom's element

Type:
  • String
Source:

# (readonly) elementData :Object

Periodic table information for this atom's element

Type:
  • Object
Source:

# (readonly) fxyz :Array.<float>

Fractional coordinates of this atom image

Type:
  • Array.<float>
Source:

# (readonly) fxyz0 :Array.<float>

Fractional coordinates of this atom's original

Type:
  • Array.<float>
Source:

# highlighted :bool

Whether the atom is highlighted

Type:
  • bool
Source:

# (readonly) id :String

String ID of the image

Type:
  • String
Source:

# (readonly) ijk :Array.<int>

Cell indices of this atom image

Type:
  • Array.<int>
Source:

# (readonly) imgIndex :int

Index of this image

Type:
  • int
Source:

# (readonly) index :int

Index of the atom

Type:
  • int
Source:

# isotope :int

Atomic mass of this atom's isotope

Type:
  • int
Source:

# (readonly) isotopeData :Object

Information for this atom's isotope

Type:
  • Object
Source:

# isotopeGlobal :int

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

Type:
  • int
Source:

# (readonly) mesh :AtomMesh

Mesh corresponding to this atom image

Type:
  • AtomMesh
Source:

# (readonly) model :Model

Model this atom belongs to

Type:
  • Model
Source:

# (readonly) moleculeIndex :int

Index of the molecule this atom belongs to

Type:
  • int
Source:

# (readonly) number :int

Atomic number of element

Type:
  • int
Source:

# opacity :float

Opacity of the atom

Type:
  • float
Source:

# radius :float

Final radius of the atom (starting radius * scale)

Type:
  • float
Source:

# (readonly) renderer :Renderer

Renderer used by this atom

Type:
  • Renderer
Source:

# scale :float

Scale of the atom

Type:
  • float
Source:

# (readonly) speciesIndex :int

Index of the species of this atom

Type:
  • int
Source:

# (readonly) vdwRadius :float

Van dew Waals radius for this element

Type:
  • float
Source:

# visible :bool

Whether the atom is visible

Type:
  • bool
Source:

# (readonly) xyz :Array.<float>

Position of this atom image

Type:
  • Array.<float>
Source:

# (readonly) xyz0 :Array.<float>

Position of this atom's original

Type:
  • Array.<float>
Source:

Methods

# addEllipsoid(data, name, parameters)

Add an ellipsoid to the atom.

Parameters:
Name Type Description
data TensorData | 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]

name String

Name of the ellipsoid

parameters Object

Additional options to pass (see EllipsoidMesh)

Source:

# addLabel(text, name, parameters)

Add a text label to the atom.

Parameters:
Name Type Description
text String

Content of the label

name String

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

parameters Object

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

Source:

# ellipsoidProperty(name, property, value)

Retrieve or set an ellipsoid's properties

Parameters:
Name Type Default Description
name String

Name of the ellipsoid

property String

Property to set

value ? null

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

Source:

# getArrayValue(name) → {*}

Get the value for one array for this image

Parameters:
Name Type Description
name String

Name of the array

Source:
Returns:

Value of the array for this atom

Type
*

# labelProperty(name, property, value)

Retrieve or set a label's properties

Parameters:
Name Type Default Description
name String

Name of the label

property String

Property to set

value ? null

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

Source:

# removeEllipsoid(name)

Remove the ellipsoid with a given name

Parameters:
Name Type Description
name String

Name of the ellipsoid

Source:

# removeLabel(name)

Remove the label of a given name

Parameters:
Name Type Description
name String

Name of the label

Source: