Class MAtomSetPoint

java.lang.Object
chemaxon.struc.MObject
chemaxon.struc.MPoint
chemaxon.struc.graphics.MAtomSetPoint
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
MElectron

@PublicApi public class MAtomSetPoint extends MPoint
Point fixed to the location of one or more atoms. The point's location is the weighted average of the atom locations. Useful for creating bond or atom pair type electron source/sink points for MEFlow.
Since:
Marvin 3.5, 07/05/2004
See Also:
  • Constructor Details

    • MAtomSetPoint

      public MAtomSetPoint()
      Contructs an empty point object.
    • MAtomSetPoint

      public MAtomSetPoint(MolAtom[] a)
      Contructs a point object.
      Parameters:
      a - array of atoms
    • MAtomSetPoint

      public MAtomSetPoint(MAtomSetPoint p)
      Copy constructor.
      Parameters:
      p - the point
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class MPoint
    • equals

      public boolean equals(Object o)
      Two points equal if their atoms equal.
      Overrides:
      equals in class MPoint
      Parameters:
      o - the other point
      Returns:
      true if they equal, false otherwise
    • clone

      public MAtomSetPoint clone()
      Description copied from class: MObject
      Creates a clone.
      Overrides:
      clone in class MPoint
      Returns:
      the clone
    • setAtoms

      public void setAtoms(MolAtom[] a)
      Sets the atoms.
      Parameters:
      a - the atoms
    • getAtoms

      public MolAtom[] getAtoms()
      Gets the atoms.
      Returns:
      the atoms
    • containsAtom

      public boolean containsAtom(MolAtom a)
      Checks if the atom set contains the specified atom object.
      Overrides:
      containsAtom in class MObject
      Returns:
      true if the atom set contains the specified object, false otherwise
      Since:
      Marvin 3.5, 07/04/2004
    • connectToSgroupOfAtom

      public void connectToSgroupOfAtom(SuperatomSgroup sg, MolAtom a)
      Overrides:
      connectToSgroupOfAtom in class MObject
    • replaceAtom

      public void replaceAtom(MolAtom orig, MolAtom a)
      Replaces a contained atom with another one.
      Overrides:
      replaceAtom in class MObject
      Parameters:
      orig - the original atom
      a - the new atom
      Since:
      Marvin 3.5, 07/04/2004
    • getLocation

      public void getLocation(DPoint3 q, CTransform3D trot)
      Gets the location. The atom set's location is the weighted average of the atom locations.
      Overrides:
      getLocation in class MPoint
      Parameters:
      q - the output point object
      trot - the viewing transformation or null
      Since:
      Marvin 4.1, 04/28/2006
    • setLocation

      public void setLocation(DPoint3 p, CTransform3D trot)
      Sets the atom coordinates. The atom set's location is the weighted average of the atom locations.
      Overrides:
      setLocation in class MPoint
      Parameters:
      p - the new location
      trot - the viewing transformation or null
    • getPoint

      public MPoint getPoint(int i)
      Gets the point.
      Overrides:
      getPoint in class MPoint
      Parameters:
      i - the point index (must be 0)
      Returns:
      the point's clone
    • getWeights

      public double[] getWeights()
      Gets the atom weights used in average location calculation.
      Returns:
      the weights or null
      Since:
      Marvin 4.1, 04/21/2006
    • setWeights

      public void setWeights(double[] w)
      Sets the atom weights for location calculation.
      Parameters:
      w - the atom weights or null
      Since:
      Marvin 4.1, 04/21/2006
    • transform

      public void transform(CTransform3D t, int opts, CTransform3D trot)
      Does not perform any operation. An atom set point's location is fixed to the atoms.
      Overrides:
      transform in class MPoint
      Parameters:
      t - the transformation matrix
      opts - transform options or 0
      trot - the viewing transformation or null
      See Also:
    • isTransformable

      public boolean isTransformable()
      Is it a transformable object?
      Overrides:
      isTransformable in class MObject
      Returns:
      true if the object can be transformed, false otherwise
      Since:
      Marvin 3.5, 07/06/2004
    • checkValidity

      public boolean checkValidity(MDocument doc, Collection<MolAtom> invec)
      Is it a valid object in the document?
      Overrides:
      checkValidity in class MObject
      Parameters:
      doc - the document
      invec - collection of invalid atoms or null
      Returns:
      true if the object is valid, false if it contains an unknown atom
      Since:
      Marvin 3.5, 07/06/2004
    • finishCloning

      public void finishCloning(MDocument olddoc, MDocument newdoc)
      Finish cloning a document. Called by the copy constructor.
      Overrides:
      finishCloning in class MObject
      Since:
      Marvin 3.5, 07/02/2004
    • getAtomArray

      protected MolAtom[] getAtomArray()
    • toString

      public String toString()
      Description copied from class: MObject
      Overrides Object.toString() to ease debugging. Returns a string consisting of the classname (without the package name!), the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object.
      Overrides:
      toString in class MPoint
      Returns:
      a string representation of the object