Class DihedralMonitor

All Implemented Interfaces:
chemaxon.marvin.space.UsableObject

@PublicAPI public class DihedralMonitor extends MeasurementMonitor
Monitor for measuring dihedral. Dihedral of 4 components is the angle between the 2 planes determinde by the first 3 and the second 3 components. Measuring dihedral has only sense if the 4 elements are 4 atoms of a molecule.
Since:
Marvin 4.0.2
  • Field Details

  • Constructor Details

    • DihedralMonitor

      public DihedralMonitor()
      Creates a new instance of DihedralMonitor
  • Method Details

    • maximumItemCount

      public int maximumItemCount()
      Returns 4, as measuring dihedral is defined on 4 components.
      Specified by:
      maximumItemCount in class Monitor
    • getCoordinates

      public void getCoordinates(float[] c)
      Returns the centroid of the second and third selected elements.
      Overrides:
      getCoordinates in class MeasurementMonitor
      Parameters:
      c - allocated array where coordinates will be put
    • select

      public void select()
      When the monitor is selected, a DihedralControl is created or changes its direction if it was alredy created.
      Specified by:
      select in interface chemaxon.marvin.space.UsableObject
      Overrides:
      select in class GraphicComponent
    • unSelect

      public void unSelect()
      Sets the monitor to be unselected and destroys the DihedralControl.
      Specified by:
      unSelect in interface chemaxon.marvin.space.UsableObject
      Overrides:
      unSelect in class Monitor
    • getComponent

      public GraphicComponent getComponent()
      Returns the molecule whose atoms are monitored.
    • setControl

      public void setControl(DihedralControl control)
      Sets a DihedralControl to the monitor. It will change the coordinates of the elements, and makes the monitor refresh.
    • control

      public void control(int v)
      Passes the control event to the control.
    • measurement

      public double measurement()
      Measures the dihedral.
      Specified by:
      measurement in class MeasurementMonitor
    • draw

      public void draw()
      Draws dotted lines between the components, and a circle around the middle line.
      Overrides:
      draw in class GraphicComponent
    • getMonitorColor

      protected byte[] getMonitorColor()
      Returns the color of the control if it exists.
      Overrides:
      getMonitorColor in class MeasurementMonitor