etomica.lattice
Class LatticePlane

java.lang.Object
  extended by etomica.lattice.LatticePlane
All Implemented Interfaces:
AtomFilter, Serializable

public class LatticePlane
extends Object
implements AtomFilter, Serializable

Class describing a plane through a lattice. Holds a Plane object and a Primitive. The orientation of the plane is specified using Miller indices defined according to the primitive.

See Also:
Serialized Form

Constructor Summary
LatticePlane(Primitive primitive, int[] h)
           
 
Method Summary
 boolean accept(IAtom a)
          Returns true if atom is passes test of filter.
 boolean accept(IMolecule mole)
           
 int getMillerIndex(int i)
          Returns the current value of the i-th Miller index.
 IVector getOrigin()
           
 Plane getPlane()
           
 double getPosition()
          Returns the position i, such the the plane is located at the i-th from the origin.
 double getSpacePosition()
          Gets the position of the plane as the distance from the origin in the direction of the normal.
 boolean inPlane(IVector p)
          Returns true if the given point is inside the plane (within some small tolerance).
 void invert()
          Changes the direction of the normal vector so that it points toward the other side of the plane from its present orientation.
 boolean isPositiveSide(IVector p)
          Returns true if the given point is on the side of the plane toward which the normal vector points.
 void setMillerIndex(int i, int h)
          Sets the i-th Miller index to h, keeping the others fixed.
 void setMillerIndices(int[] h)
          Sets the plane to the orientation specified by the given Miller indices applied to the current primitive.
 void setOrigin(IVector origin)
          Sets the origin from which the position of the atom is measured.
 void setPosition(double d)
          Sets to the position of the i-th plane from the one through the origin.
 void setPrimitive(Primitive primitive)
           
 void setSpacePosition(double d)
          Sets the position of the plane to be the given distance from the origin in the direction of the normal.
 void setTolerance(double tolerance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LatticePlane

public LatticePlane(Primitive primitive,
                    int[] h)
Method Detail

accept

public boolean accept(IAtom a)
Description copied from interface: AtomFilter
Returns true if atom is passes test of filter.

Specified by:
accept in interface AtomFilter

accept

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

setTolerance

public void setTolerance(double tolerance)

setPrimitive

public void setPrimitive(Primitive primitive)

setMillerIndices

public void setMillerIndices(int[] h)
Sets the plane to the orientation specified by the given Miller indices applied to the current primitive.


getMillerIndex

public int getMillerIndex(int i)
Returns the current value of the i-th Miller index.


setMillerIndex

public void setMillerIndex(int i,
                           int h)
Sets the i-th Miller index to h, keeping the others fixed. If setting causes all indices to be zero, change is not implemented.


setSpacePosition

public void setSpacePosition(double d)
Sets the position of the plane to be the given distance from the origin in the direction of the normal.


getSpacePosition

public double getSpacePosition()
Gets the position of the plane as the distance from the origin in the direction of the normal.


setPosition

public void setPosition(double d)
Sets to the position of the i-th plane from the one through the origin.


getPosition

public double getPosition()
Returns the position i, such the the plane is located at the i-th from the origin.


isPositiveSide

public boolean isPositiveSide(IVector p)
Returns true if the given point is on the side of the plane toward which the normal vector points. The direction of the normal vector can be inverted using the invert method.


inPlane

public boolean inPlane(IVector p)
Returns true if the given point is inside the plane (within some small tolerance).


getPlane

public Plane getPlane()

setOrigin

public void setOrigin(IVector origin)
Sets the origin from which the position of the atom is measured.


getOrigin

public IVector getOrigin()

invert

public void invert()
Changes the direction of the normal vector so that it points toward the other side of the plane from its present orientation. Does not affect the location or absolute orientation of the plane.