Class PharmacophoreArrow

  • All Implemented Interfaces:
    chemaxon.marvin.space.UsableObject

    @PublicAPI
    public class PharmacophoreArrow
    extends GraphicComponent
    implements chemaxon.marvin.space.UsableObject
    PharmacophoreArrow provides an extension of PharmacophorePoint to represent pharmacophores by introducing directionality. The direction, the length and the thickness of the arrow can be changed.
    Since:
    Marvin 4.0.2
    • Field Detail

      • DRAW_TYPES

        public static final String[] DRAW_TYPES
    • Constructor Detail

      • PharmacophoreArrow

        public PharmacophoreArrow()
        Creates a new instance of PharmacophoreArrow. It will be placed at the origin by default, its position can be set by setPosition().
      • PharmacophoreArrow

        public PharmacophoreArrow​(ComponentElement ce)
        Creates a PharmacophoreArrow at the position of the given ComponentElement getting the coordinates by getCoordinates().
        Parameters:
        ce - reference to a component to get the coordinates
      • PharmacophoreArrow

        public PharmacophoreArrow​(double x,
                                  double y,
                                  double z)
        Creates a PharmacophoreArrow at the given position.
        Parameters:
        x - coordinate
        y - coordinate
        z - coordinate
    • Method Detail

      • setPosition

        public void setPosition​(double x,
                                double y,
                                double z)
        Sets the position of the PharmacophoreArrow.
        Parameters:
        x - first coordinate
        y - second coordinate
        z - third coordinate
      • getCoordinates

        public void getCoordinates​(ComponentElement item,
                                   float[] c)
        Gets the position of the component.
        Overrides:
        getCoordinates in class GraphicComponent
        Parameters:
        item - ignored here (since PharmacophoreArrow is not subdivided further into smaller constituting elements)
        c - output parameter to store 3 coordinates (must be allocated by caller)
      • getName

        public String getName()
        Description copied from class: GraphicComponent
        Returns the name of the component.
        Specified by:
        getName in interface chemaxon.marvin.space.UsableObject
        Overrides:
        getName in class GraphicComponent
        Returns:
        name that is getClass.getName() by default.
      • toString

        public String toString()
        Specified by:
        toString in interface chemaxon.marvin.space.UsableObject
        Overrides:
        toString in class GraphicComponent
      • getRadius

        public double getRadius()
        Returns the radius of the arrow.
      • setRadius

        public void setRadius​(double r)
        Sets the radius of the arrow.
      • getColor

        public Color getColor()
        Returns the color of the component.
        Specified by:
        getColor in interface chemaxon.marvin.space.UsableObject
        Overrides:
        getColor in class GraphicComponent
      • select

        public void select()
        Sets the component to be selected.
        Specified by:
        select in interface chemaxon.marvin.space.UsableObject
        Overrides:
        select in class GraphicComponent
      • unSelect

        public void unSelect()
        Sets the component to be unselected.
        Specified by:
        unSelect in interface chemaxon.marvin.space.UsableObject
        Overrides:
        unSelect in class GraphicComponent
      • isHighlighted

        public boolean isHighlighted()
        Returns true if the component is highlighted.
      • setHighlighted

        public void setHighlighted​(boolean flag)
        Sets the component to be highlighted. The highlighted component will appear brighter.
      • translate

        public void translate​(float[] v)
        Translates the component with the parameter as a translation vector.
        Overrides:
        translate in class GraphicComponent
        Parameters:
        v - The translation vector.
      • rotate

        public void rotate​(float[] v,
                           float[] center)
        Rotates the component around the 3 axis, x, y, z, and given center.
        Overrides:
        rotate in class GraphicComponent
        Parameters:
        v - Measurement of the rotation around the 3 axis, x, y, z.
        center - Center of the rotation.
      • resize

        public void resize​(double x,
                           double y,
                           double z)
        Resizes the component according to the given factors in each direction.
        Overrides:
        resize in class GraphicComponent
      • isControllable

        public boolean isControllable​(String type)
        Returns whether controling by the given type of controller is allowed to the component. This component is allowed to be translated and resized.
        Overrides:
        isControllable in class GraphicComponent
        Parameters:
        type - "Shift", "Rotate", "Resize"
        Returns:
        is the component aloowed to be controlled or not
      • draw

        public void draw()
        Draws the component if it is opaque.
        Overrides:
        draw in class GraphicComponent
      • initDraw

        public void initDraw()
      • pickObject

        protected void pickObject​(int offset,
                                  double[] maxZ,
                                  float[] modelview)
        Description copied from class: GraphicComponent
        Sets GraphicComponent.pickedItem to be the picked part of the component.
        Overrides:
        pickObject in class GraphicComponent
        Parameters:
        offset - Integer used in the name stack to identify the part of the component.
        maxZ - Stores the z coordinate of the part with maximum z coordinate in the actual picking. It has to be set if the part with the current offset has greater z coordinate than the stored one. Example to compute: int aIdx = GeomCalc.newVector( picked.x(), picked.y(), picked.z() ); GeomCalc.multVectorWithMatrix(aIdx, modelview); z coordinate: maxZ[0] = GeomCalc.getZ(aIdx)
        modelview - Is to compute the proper z coordinate.
      • setDrawType

        public void setDrawType​(String type)
        Sets current drawing type.
        Parameters:
        type - Solid, Mesh or Transparent
      • getDrawType

        public String getDrawType()
        Returns the name of the drawing type.
        Returns:
        Solid, Mesh or Transparent
      • setRenderingQuality

        public void setRenderingQuality​(String quality)
        Sets the rendering quality and calls setRenderingQuality(int).
        Parameters:
        quality - Can be "High", "Medium", "Low".
      • setRenderingQuality

        public void setRenderingQuality​(int quality)
        Sets the rendering quality, see RENDERING_* constants. Sets the precision of the drawn arrow.
        Overrides:
        setRenderingQuality in class GraphicComponent
        Parameters:
        quality -
      • setDrawProperty

        public void setDrawProperty​(String propertyName,
                                    String propertyValue)
        Sets a draw property.
        Accepts:
        • "Quality" -- "High", "Medium", "Low"
        • "PharmacophoreArrow.DrawType" -- "Mesh", "Solid", "Transparent"
        Specified by:
        setDrawProperty in interface chemaxon.marvin.space.UsableObject
        Overrides:
        setDrawProperty in class GraphicComponent
        Parameters:
        propertyName - identifier of the draw property
        propertyValue - value of the draw property as a String