etomica.action
Class MoleculeActionTranslateTo

java.lang.Object
  extended by etomica.action.MoleculeActionTranslateTo
All Implemented Interfaces:
MoleculeAction, Serializable

public class MoleculeActionTranslateTo
extends Object
implements MoleculeAction, Serializable

Moves (translates) an atom to a specified position. Location of the atom (which may be an atom group) is determined by an AtomPositionDefinition instance that may be set for this class.

See Also:
Serialized Form

Constructor Summary
MoleculeActionTranslateTo(ISpace space)
          Creates new action with atom position defined by its center of mass (via AtomPositionCOM).
 
Method Summary
 void actionPerformed(IMolecule atom)
           
 IAtomPositionDefinition getAtomPositionDefinition()
           
 IVectorMutable getDestination()
           
 IVector getTranslationVector()
          Returns the vector that was used to accomplish the most recent translation action.
 void setAtomPositionDefinition(IAtomPositionDefinition atomPositionDefinition)
           
 void setDestination(IVector newDestination)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoleculeActionTranslateTo

public MoleculeActionTranslateTo(ISpace space)
Creates new action with atom position defined by its center of mass (via AtomPositionCOM).

Parameters:
space -
Method Detail

actionPerformed

public void actionPerformed(IMolecule atom)
Specified by:
actionPerformed in interface MoleculeAction

getDestination

public IVectorMutable getDestination()
Returns:
Returns the destination, the position that the atom will be moved to by this action.

setDestination

public void setDestination(IVector newDestination)
Parameters:
destination - The destination to set. A local copy is made of the given vector.

getAtomPositionDefinition

public IAtomPositionDefinition getAtomPositionDefinition()
Returns:
Returns the atomPositionDefinition.

setAtomPositionDefinition

public void setAtomPositionDefinition(IAtomPositionDefinition atomPositionDefinition)
Parameters:
atomPositionDefinition - The atomPositionDefinition to set.

getTranslationVector

public IVector getTranslationVector()
Returns the vector that was used to accomplish the most recent translation action. This vector can be used to reverse the translation by multiplying it by -1 and performing an atomActionTranslateBy with it.