# Class ModulationSet

java.lang.Object
javajs.util.T3
javajs.util.V3
org.jmol.util.Vibration
org.jmol.util.ModulationSet

All Implemented Interfaces:
  `Serializable, JSONEncodable, JmolModulationSet`

public class ModulationSet extends Vibration implements JmolModulationSet
A class to group a set of modulations for an atom as a "vibration" Extends V3 so that it will be a displacement, and its value will be an occupancy

Author:
  Bob Hanson hansonr@stolaf.edu 8/9/2013
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`Map<String,Float>`
`htUij`
current value of anisotropic parameter modulation
`V3`
`mxyz`
the modulated magnetic spin
`Vibration`
`vib`
vib is a spin vector when the model has modulation; otherwise an unmodulated vibration.
`float`
`vOcc`
the current value of the occupancy modulation

### Fields inherited from class Vibration

`isFractional, isFrom000, magMoment, modDim, modScale, showTrace, symmform, tracePt, twoPI, TYPE_SPIN, TYPE_VIBRATION, TYPE_WYCKOFF`

### Fields inherited from class T3

`x, y, z`

## Constructor Summary

Constructors
Constructor
Description
`ModulationSet()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addTo(T3 a, float scale)`
`void`
`addUTens(String utens, float v)`
`ModulationSet`
`calculate(T3 tuv, boolean isQ)`
Calculate r_I internal d-space coordinate of an atom.
`void`
`getInfo(Map<String,Object> info)`
`T3`
`getModPoint(boolean asEnabled)`
`Object`
`getModulation(char type, T3 tuv, boolean occ100)`
`int`
`getOccupancy100(boolean forVibVis)`
`float`
`getScale()`
`String`
`getState()`
`SymmetryInterface`
`getSubSystemUnitCell()`
`V3`
`getV3()`
`Vibration`
`getVibration(boolean forceNew)`
`boolean`
`isEnabled()`
`boolean`
`isNonzero()`
`void`
`scaleVibration(float m)`
`T3`
`setCalcPoint(T3 pt, T3 t456, float vibScale, float scale)`
get updated value for offset vector and for occupancy
`ModulationSet`
`setMod(String id, P3 r00, P3 r0, int d, Lst<Modulation> mods, M3 gammaE, Matrix[] factors, SymmetryInterface symmetry, int nOps, int iop, Vibration v, boolean isCommensurate)`
A collection of modulations for a specific atom.
`void`
`setModTQ(T3 a, boolean isOn, T3 qtOffset, boolean isQ, float scale)`
Set modulation "t" value, which sets which unit cell in sequence we are looking at; d=1 only.
`void`
`setMoment()`
`float`
`setOccupancy(double[] pt, double foccupancy, double siteMult)`
get the occupancy, first from the reader, then from renderer
`void`
`setXYZ(T3 v)`

### Methods inherited from class Vibration

`addTracePt, clone, find, getApproxString100, rotateModelSpinVectors, rotateSpin, setType, setV0, startTrace`

### Methods inherited from class V3

`angle, new3, newV, newVsub`

### Methods inherited from class T3

`add, add2, add3, ave, cross, distance, distanceSquared, dot, equals, floatToIntBits, hashCode, length, lengthSquared, normalize, putP, scale, scaleAdd2, scaleT, set, setA, setP, setT, sub, sub2, toJSON, toString`

### Methods inherited from class Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### vib

public Vibration vib
vib is a spin vector when the model has modulation; otherwise an unmodulated vibration.

### mxyz

public V3 mxyz
the modulated magnetic spin

### htUij

public Map<String,Float> htUij
current value of anisotropic parameter modulation

### vOcc

public float vOcc
the current value of the occupancy modulation

## Constructor Details

### ModulationSet

public ModulationSet()

## Method Details

### getSubSystemUnitCell

public SymmetryInterface getSubSystemUnitCell()

Specified by:
  `getSubSystemUnitCell` in interface `JmolModulationSet`

### isEnabled

public boolean isEnabled()

Specified by:
  `isEnabled` in interface `JmolModulationSet`

### getScale

public float getScale()

Specified by:
  `getScale` in interface `JmolModulationSet`

### setMod

public ModulationSet setMod(String id, P3 r00, P3 r0, int d, Lst<Modulation> mods, M3 gammaE, Matrix[] factors, SymmetryInterface symmetry, int nOps, int iop, Vibration v, boolean isCommensurate)
A collection of modulations for a specific atom.

Parameters:
  `id` -
  `r00` - originating atom position prior to application of symmetry
  `r0` - unmodulated (average) position after application of symmetry
  `d` -
  `mods` -
  `gammaE` -
  `factors` - including sigma and tFactor
  `symmetry` -
  `nOps` -
  `iop` -
  `v` - TODO
  `isCommensurate` - TODO
Returns:
  this

### calculate

public ModulationSet calculate(T3 tuv, boolean isQ)
Calculate r_I internal d-space coordinate of an atom.

Parameters:
  `tuv` -
  `isQ` -
Returns:
  this ModulationSet, with this.rI set to the coordinate

### addUTens

public void addUTens(String utens, float v)

### setModTQ

public void setModTQ(T3 a, boolean isOn, T3 qtOffset, boolean isQ, float scale)
Set modulation "t" value, which sets which unit cell in sequence we are looking at; d=1 only.

Specified by:
  `setModTQ` in interface `JmolModulationSet`
Parameters:
  `isOn` -
  `qtOffset` -
  `isQ` -
  `scale` -

### addTo

public void addTo(T3 a, float scale)

Specified by:
  `addTo` in interface `JmolModulationSet`

### getState

public String getState()

Specified by:
  `getState` in interface `JmolModulationSet`

### getModPoint

public T3 getModPoint(boolean asEnabled)

Specified by:
  `getModPoint` in interface `JmolModulationSet`

### getModulation

public Object getModulation(char type, T3 tuv, boolean occ100)

Specified by:
  `getModulation` in interface `JmolModulationSet`

### setCalcPoint

public T3 setCalcPoint(T3 pt, T3 t456, float vibScale, float scale)
get updated value for offset vector and for occupancy

Overrides:
  `setCalcPoint` in class `Vibration`
Parameters:
  `pt` -
  `t456` -
  `vibScale` -
  `scale` -
Returns:
  pt

### getInfo

public void getInfo(Map<String,Object> info)

Overrides:
  `getInfo` in class `Vibration`

### setXYZ

public void setXYZ(T3 v)

Overrides:
  `setXYZ` in class `Vibration`

### getVibration

public Vibration getVibration(boolean forceNew)

Specified by:
  `getVibration` in interface `JmolModulationSet`

### getV3

public V3 getV3()

Specified by:
  `getV3` in interface `JmolModulationSet`

### scaleVibration

public void scaleVibration(float m)

Specified by:
  `scaleVibration` in interface `JmolModulationSet`

### setMoment

public void setMoment()

Specified by:
  `setMoment` in interface `JmolModulationSet`

### isNonzero

public boolean isNonzero()

Overrides:
  `isNonzero` in class `Vibration`

### setOccupancy

public float setOccupancy(double[] pt, double foccupancy, double siteMult)
get the occupancy, first from the reader, then from renderer

Parameters:
  `pt` -
  `foccupancy` -
  `siteMult` - or 0 is this is not relevant
Returns:
  occupancy on [0,1]

### getOccupancy100

public int getOccupancy100(boolean forVibVis)

Overrides:
  `getOccupancy100` in class `Vibration`
Parameters:
  `forVibVis` - used only in ModulationSet when calculating actual display offset
Returns:
  Integer.MIN_VALUE if not applicable, occupancy if enabled, -occupancy if not enabled