Class MChemicalStruct

java.lang.Object
chemaxon.struc.MObject
chemaxon.struc.graphics.MChemicalStruct
All Implemented Interfaces:
Serializable, Cloneable

@PublicApi public class MChemicalStruct extends MObject
Molecule graph object.
Since:
Marvin 3.3
See Also:
  • Constructor Details

    • MChemicalStruct

      public MChemicalStruct(MoleculeGraph m)
      Contructs a molecule graph object.
      Parameters:
      m - the molecule graph
    • MChemicalStruct

      protected MChemicalStruct(MChemicalStruct mcs)
      Copy constructor.
      Parameters:
      mcs - the original object
  • Method Details

    • getMoleculeGraph

      public MoleculeGraph getMoleculeGraph()
      Gets the stored molecule graph.
      Returns:
      the molecule graph
    • clone

      public MChemicalStruct clone()
      Creates a clone.
      Overrides:
      clone in class MObject
      Returns:
      the clone
    • isEmpty

      public boolean isEmpty()
      A chemical structure object is empty if the molecule graph is empty.
      Overrides:
      isEmpty in class MObject
      Returns:
      true if empty, false otherwise
    • getPointCount

      public int getPointCount()
      Gets the number of points (atoms).
      Specified by:
      getPointCount in class MObject
      Returns:
      the number of points
    • getPoint

      public MPoint getPoint(int i)
      Gets a point of the object.
      Specified by:
      getPoint in class MObject
      Parameters:
      i - the point index
      Returns:
      the point's clone
    • 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
    • transform

      public void transform(CTransform3D t, int opts, CTransform3D trot)
      Transforms all points.
      Specified by:
      transform in class MObject
      Parameters:
      t - the transformation matrix
      opts - transform options or 0
      trot - the viewing transformation or null
      See Also:
    • calcCenter

      public void calcCenter(DPoint3 p, CTransform3D t)
      Calculates the geometrical center.
      Specified by:
      calcCenter in class MObject
      Parameters:
      p - store the coordinates here
      t - the transformation matrix or null
      Since:
      Marvin 4.1, 04/28/2006
    • distanceFrom

      public double distanceFrom(double x, double y, CTransform3D t)
      Gets the 2D distance from the specified point.
      Specified by:
      distanceFrom in class MObject
      Parameters:
      x - the x coordinate
      y - the y coordinate
      t - transformation or null
      Since:
      3.5, 11/04/2004
    • distanceFrom

      public static double distanceFrom(MoleculeGraph molg, double x, double y, CTransform3D t)
      Gets the 2D distance from the specified point.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      t - transformation or null
      Since:
      4.0, 06/30/2005
    • setSelected

      public void setSelected(boolean s)
      Selects or unselects the object.
      Overrides:
      setSelected in class MObject
      Parameters:
      s - use true to select, false to unselect
    • setSelected

      public static void setSelected(MoleculeGraph molg, boolean s)
      Selects or unselects atoms in a molecule graph.
      Parameters:
      s - use true to select, false to unselect
      Since:
      Marvin 4.0, 06/30/2005
    • hasSelection

      public boolean hasSelection()
      Checks the existence of the selection.
      Returns:
      true if selection exists, false otherwise
    • hasSelection

      public static boolean hasSelection(MoleculeGraph molg)
      Checks the existence of the selection.
      Returns:
      true if selection exists, false otherwise
      Since:
      Marvin 4.0, 06/30/2005
    • unselectContents

      public void unselectContents()
      Unselects atoms.
      Overrides:
      unselectContents in class MObject
    • setElectronToAtomMapping

      public void setElectronToAtomMapping(MolAtom atom, MElectronContainer container)
    • removeElectronToAtomMapping

      public void removeElectronToAtomMapping(MolAtom atom, MElectronContainer container)
    • removeAtom

      public void removeAtom(MolAtom atom)
      Description copied from class: MObject
      Removes the atom from the corresponding molecule object.
      Overrides:
      removeAtom in class MObject
      Parameters:
      atom - the atom to remove
    • getAtomOf

      public MolAtom getAtomOf(MElectronContainer container)
    • getElectronContainersOf

      public List<MElectronContainer> getElectronContainersOf(MolAtom atom)
    • hasElectronContainer

      public boolean hasElectronContainer(MolAtom atom)
    • getMElectronContainerIndexInAtom

      public int getMElectronContainerIndexInAtom(MolAtom atom, MElectronContainer container)
    • getMElectronContainerOf

      Deprecated, for removal: This API element is subject to removal in a future version.