etomica.atom
Class AtomFilterInShape

java.lang.Object
  extended by etomica.atom.AtomFilterInShape
All Implemented Interfaces:
AtomFilter, Serializable

public class AtomFilterInShape
extends Object
implements AtomFilter, Serializable

Filter that accepts atom if it is inside a specified Shape instance. Position of atom is determined by an AtomPositionDefinition, which if unspecified defaults for each atom to that given by the atom's type.

See Also:
Serialized Form

Constructor Summary
AtomFilterInShape(Shape shape)
          Create filter in which position definition is given by atom's type.
 
Method Summary
 boolean accept(IAtom atom)
          Returns true if the atom's position is inside the shape.
 boolean accept(IMolecule mole)
           
 IAtomPositionDefinition getPositionDefinition()
           
 Shape getShape()
           
 void setPositionDefinition(IAtomPositionDefinition positionDefinition)
          Sets position definition.
 void setShape(Shape shape)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtomFilterInShape

public AtomFilterInShape(Shape shape)
Create filter in which position definition is given by atom's type.

Method Detail

accept

public boolean accept(IAtom atom)
Returns true if the atom's position is inside the shape.

Specified by:
accept in interface AtomFilter

accept

public boolean accept(IMolecule mole)
Specified by:
accept in interface AtomFilter

getShape

public Shape getShape()
Returns:
Returns the shape.

setShape

public void setShape(Shape shape)
Parameters:
shape - The shape to set.

getPositionDefinition

public IAtomPositionDefinition getPositionDefinition()
Returns:
Returns the positionDefinition.

setPositionDefinition

public void setPositionDefinition(IAtomPositionDefinition positionDefinition)
Sets position definition. If given null, positionDefinition from each atom's type will be used.

Parameters:
positionDefinition - The positionDefinition to set.