chemaxon.marvin.space
Class PharmacophorePoint

java.lang.Object
  extended bychemaxon.marvin.space.GraphicComponent
      extended bychemaxon.marvin.space.PharmacophorePoint
All Implemented Interfaces:
chemaxon.marvin.space.UsableObject

public class PharmacophorePoint
extends GraphicComponent
implements chemaxon.marvin.space.UsableObject

Simple spherical representation of a pharmacophoric point/area. Three properties are considered: location, radius and pharmacophore point type. Current implementation provides wired in types: acceptor, donor, anionic, cationic, hydrophobic, aromatic and excluded.
At present PharmacophorePoint serves mere visualisation purposes. The graphical representation in the MarvinSpace canvas is a translucent sphere.

Since:
Marvin 4.0.2
Version:
MarvinSpace 1.0
Author:
Judit Papp

Field Summary
static int ACCEPTOR_TYPE
           
static int ANIONIC_TYPE
           
static int AROMATIC_TYPE
           
static int CATIONIC_TYPE
           
static float DEFAULT_RADIUS
           
static int DONOR_TYPE
           
static java.lang.String[] DRAW_TYPES
           
static int EXCLUDED_TYPE
           
static int HYDROPHOBIC_TYPE
           
protected  boolean needRecreateBall
           
protected  boolean needRecreateDisplayList
           
static int UNKONWN_TYPE
           
 
Fields inherited from class chemaxon.marvin.space.GraphicComponent
active, associatedComponents, boundingBox, COMPONENT_TYPE_ENTIRE, drawProperties, drawType, gl, glu, graphicCell, irm, modifiesOrigin, motionMode, mousex, mousey, name, pickedItem, RENDERING_QUALITY_HIGH, RENDERING_QUALITY_LOW, RENDERING_QUALITY_MEDIUM, renderingQuality, rm, uoid, visible
 
Constructor Summary
PharmacophorePoint()
          Creates a new instance of PharmacophorePoint.
PharmacophorePoint(ComponentElement ce)
          Creates a PharmacophorePoint at the position of the given ComponentElement getting the coordinates by getCoordinates().
PharmacophorePoint(double x, double y, double z)
          Creates a PharmacophorePoint at the given position.
 
Method Summary
 void draw()
          Draws the entire component if it is opaque.
 void drawTransparentPart()
          Draws transparent parts of the component if there is any.
 java.awt.Color getColor()
          Returns the color of the PharmacophorePoint.
 void getCoordinates(ComponentElement item, float[] c)
          Gets the position of the pharmacophore point.
 java.lang.String getDescription()
          Returns textual description.
 java.lang.String getDrawType()
          Returns the name of the drawing type.
 java.lang.String getName()
          Returns the name of the component.
 double getRadius()
          Returns the radius of the PharmacophorePoint in angstroms.
 boolean hasTransparentPart()
          Checks is component has transparent part.
 boolean isAcceptor()
          Checks if actual pharmacophore type includes ACCEPTOR_TYPE.
 boolean isAnionic()
          Check if actual pharmacophore type includes ANIONIC_TYPE.
 boolean isAromatic()
          Checks if actual pharmacophore type includes AROMATIC_TYPE.
 boolean isCationic()
          Check if actual pharmacophore type includes CATIONIC_TYPE.
 boolean isControllable(java.lang.String type)
          Returns whether controling by the given type of controller is allowed to the component.
 boolean isDonor()
          Checks if actual pharmacophore type includes DONOR_TYPE.
 boolean isExcluded()
          Check if actual pharmacophore type is EXCLUDED_TYPE.
 boolean isHighlighted()
          Returns true if the component is highlighted.
 boolean isHydrophobic()
          Checks if actual pharmacophore type includes HYDROPHOBIC_TYPE.
protected  void pickObject(int offset, double[] maxZ, float[] modelview)
          Sets GraphicComponent.pickedItem to the pharmacophore point.
 void resize(double x, double y, double z)
          Resizes the component according to given factors.
 void select()
          Sets the component to be selected.
 void setAcceptor(boolean flag)
          Sets or clears the acceptor property of the PharmacophorePoint.
 void setAnionic(boolean flag)
          Sets or clears the anionic property of the PharmacophorePoint.
 void setAromatic(boolean flag)
          Sets or clears the aromatic property of the PharmacophorePoint.
 void setCationic(boolean flag)
          Sets or clears the cationic property of the PharmacophorePoint.
 void setDonor(boolean flag)
          Sets or clears the donor property of the PharmacophorePoint.
 void setDrawProperty(java.lang.String propertyName, java.lang.String propertyValue)
          Sets drawing properties specific to PharmacophoreSphere.
 void setDrawType(java.lang.String type)
          Sets current drawing type.
 void setExcluded(boolean flag)
          Sets or clears the excluded property of the PharmacophorePoint.
 void setHighlighted(boolean flag)
          Sets the highlighted state of the pharmacophore point.
 void setHydrophobic(boolean flag)
          Sets or clears the hydrophobic property of the PharmacophorePoint.
 void setPosition(double x, double y, double z)
          Sets the position of the PharmacophorePoint.
 void setRadius(float r)
          Sets the radius of the PharmaCophorePoint.
 void setRenderingQuality(int quality)
          Sets the rendering quality, see GraphicComponent.RENDERING_QUALITY_HIGH constants.
 void setRenderingQuality(java.lang.String quality)
          Sets the rendering quality and calls setRenderingQuality(int).
 java.lang.String toString()
           
 void translate(float[] v)
          Translates the component with the given translation vector.
 void unSelect()
          Sets the component to be unselected.
 
Methods inherited from class chemaxon.marvin.space.GraphicComponent
addDrawProperties, associate, draw2DPart, drawBoundingBox, drawCoordinateAxes, drawSelection, exclusiveSelection, exclusiveSelection, extendSelection, extendSelection, fadeSelected, fadeUnselected, getAssociatedComponents, getBoundingBox, getBoundingSphereRadius, getCell, getComponentElement, getCoordinates, getDescription, getDrawProperties, getDrawProperty, getGraphicComponent, getId, getLabelInformation, getRenderingQuality, getUsableObject, getZCoordinateTo2DPart, has2DPart, hasSelectedElements, hideSelected, hideUnselected, invertSelection, invertSelection, isGraphicComponent, isSelected, isSelected, isVisible, isVisible, locateObject, notifyCoordinateChange, notifyInvisibility, notifySelection, notifyUnSelection, notifyVisibility, onRemoveGraphicComponent, projectVector, receiveNotificationOnCoordinateChange, receiveNotificationOnInvisibility, receiveNotificationOnSelection, receiveNotificationOnUnSelection, receiveNotificationOnVisibility, removeAssociation, rotate, select, selectComponentElementsInside, setColor, setDrawProperties, setGL, setMotionMode, setName, setProgressBar, setRotateMatrix, setVisible, showFaded, storeDrawProperty, touchObject, unSelect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface chemaxon.marvin.space.UsableObject
getGraphicComponent, getId, isGraphicComponent, isSelected, isVisible, setColor, setName, setVisible
 

Field Detail

DEFAULT_RADIUS

public static final float DEFAULT_RADIUS
See Also:
Constant Field Values

DRAW_TYPES

public static final java.lang.String[] DRAW_TYPES

UNKONWN_TYPE

public static final int UNKONWN_TYPE
See Also:
Constant Field Values

ACCEPTOR_TYPE

public static final int ACCEPTOR_TYPE
See Also:
Constant Field Values

DONOR_TYPE

public static final int DONOR_TYPE
See Also:
Constant Field Values

ANIONIC_TYPE

public static final int ANIONIC_TYPE
See Also:
Constant Field Values

CATIONIC_TYPE

public static final int CATIONIC_TYPE
See Also:
Constant Field Values

HYDROPHOBIC_TYPE

public static final int HYDROPHOBIC_TYPE
See Also:
Constant Field Values

AROMATIC_TYPE

public static final int AROMATIC_TYPE
See Also:
Constant Field Values

EXCLUDED_TYPE

public static final int EXCLUDED_TYPE
See Also:
Constant Field Values

needRecreateBall

protected boolean needRecreateBall

needRecreateDisplayList

protected boolean needRecreateDisplayList
Constructor Detail

PharmacophorePoint

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


PharmacophorePoint

public PharmacophorePoint(ComponentElement ce)
Creates a PharmacophorePoint at the position of the given ComponentElement getting the coordinates by getCoordinates(). Radius is set to by default.

Parameters:
ce - a visible component around which the pharmacophore sphere is placed

PharmacophorePoint

public PharmacophorePoint(double x,
                          double y,
                          double z)
Creates a PharmacophorePoint at the given position. Radius is set to by default.

Parameters:
x - first coordinate of the pharmacophore point to create
y - second coordinate of the pharmacophore point to create
z - third coordinate of the pharmacophore point to create
Method Detail

setPosition

public void setPosition(double x,
                        double y,
                        double z)
Sets the position of the PharmacophorePoint. Size is not affected.


getCoordinates

public void getCoordinates(ComponentElement item,
                           float[] c)
Gets the position of the pharmacophore point. The position of the pharmacophore point is the centre of the sphere.

Overrides:
getCoordinates in class GraphicComponent
Parameters:
item - not used
c - coordinates of the pharmacophore point are stored in this array, it has to be pre-allocated by the caller of this method

getDescription

public java.lang.String getDescription()
Returns textual description.

Overrides:
getDescription in class GraphicComponent
Returns:
description that contains pharmacophore type name

getName

public java.lang.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 java.lang.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 PharmacophorePoint in angstroms.


setRadius

public void setRadius(float r)
Sets the radius of the PharmaCophorePoint.

Parameters:
r - radius in angstroms

getColor

public java.awt.Color getColor()
Returns the color of the PharmacophorePoint. The color depends on the type of the PharmacophorePoint, and in case of multiple types, the individual colors are mixed. Note, that current implementation uses wired in colors.

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 highlighted state of the pharmacophore point. The highlighted component appears brighter.

Parameters:
flag - highligth indicator

translate

public void translate(float[] v)
Translates the component with the given translation vector.

Overrides:
translate in class GraphicComponent
Parameters:
v - 3D translation vector

resize

public void resize(double x,
                   double y,
                   double z)
Resizes the component according to given factors. Due to spherical representation only one direction is considered. The sphere cannot be resized arbitrarily, the upper limit is 10 Angstrom.

Overrides:
resize in class GraphicComponent
Parameters:
x - ignored
y - size increment/decrement
z - ignored

isControllable

public boolean isControllable(java.lang.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 - control event type, Shift and Resize are interpreted by this component
Returns:
true if type is either Shift or Resize

hasTransparentPart

public boolean hasTransparentPart()
Checks is component has transparent part. For detailed discussion see GraphicComponent.hasTransparentPart().

Overrides:
hasTransparentPart in class GraphicComponent
Returns:
true if the current drawing type is not DRAW_TYPE_FILLED.

drawTransparentPart

public void drawTransparentPart()
Draws transparent parts of the component if there is any. Note, that PharmacophorePoint has no subpart, thus the whole component is either transparent or opaque.

Overrides:
drawTransparentPart in class GraphicComponent

draw

public void draw()
Draws the entire component if it is opaque.

Overrides:
draw in class GraphicComponent

pickObject

protected void pickObject(int offset,
                          double[] maxZ,
                          float[] modelview)
Sets GraphicComponent.pickedItem to the pharmacophore point.

Overrides:
pickObject in class GraphicComponent
Parameters:
offset - see GraphicComponent.pickObject(int,double[],float[])
maxZ - see GraphicComponent.pickObject(int,double[],float[])
modelview - see GraphicComponent.pickObject(int,double[],float[])

setDrawType

public void setDrawType(java.lang.String type)
Sets current drawing type.

Parameters:
type - Solid, Mesh or Transparent

getDrawType

public java.lang.String getDrawType()
Returns the name of the drawing type.

Returns:
Solid, Mesh or Transparent

isAcceptor

public boolean isAcceptor()
Checks if actual pharmacophore type includes ACCEPTOR_TYPE. Types are not exclusive, a PharmacophorePoint can have multiple types, though certain combinations are senseless (like ANIONIC_TYPE and CATIONIC_TYPE at the same time).

Returns:
true if current type includes ACCEPTOR_TYPE

setAcceptor

public void setAcceptor(boolean flag)
Sets or clears the acceptor property of the PharmacophorePoint.

Parameters:
flag - if true, current pharmacophore type will include ACCEPTOR_TYPE otherwise it will not be an acceptor

isDonor

public boolean isDonor()
Checks if actual pharmacophore type includes DONOR_TYPE. Types are not exclusive, a PharmacophorePoint can have multiple types.

Returns:
true if current type includes ADONOR_TYPE

setDonor

public void setDonor(boolean flag)
Sets or clears the donor property of the PharmacophorePoint.

Parameters:
flag - if true, current pharmacophore type will include DONOR_TYPE otherwise it will not be a donor

isHydrophobic

public boolean isHydrophobic()
Checks if actual pharmacophore type includes HYDROPHOBIC_TYPE. Types are not exclusive, a PharmacophorePoint can have multiple types.

Returns:
true if current type includes HYDROPHOBIC_TYPE

setHydrophobic

public void setHydrophobic(boolean flag)
Sets or clears the hydrophobic property of the PharmacophorePoint.

Parameters:
flag - if true, current pharmacophore type will include HYDROPHOBIC_TYPE otherwise it will not be hydrophobic

isAromatic

public boolean isAromatic()
Checks if actual pharmacophore type includes AROMATIC_TYPE. Types are not exclusive, a PharmacophorePoint can have multiple types.

Returns:
true if current type includes AROMATIC_TYPE

setAromatic

public void setAromatic(boolean flag)
Sets or clears the aromatic property of the PharmacophorePoint.

Parameters:
flag - if true, current pharmacophore type will include AROMATIC_TYPE otherwise it will not be aromatic

isAnionic

public boolean isAnionic()
Check if actual pharmacophore type includes ANIONIC_TYPE. Types are not exclusive, a PharmacophorePoint can have multiple types.

Returns:
true if current type includes ANIONIC_TYPE

setAnionic

public void setAnionic(boolean flag)
Sets or clears the anionic property of the PharmacophorePoint.

Parameters:
flag - if true, current pharmacophore type will include ANIONIC_TYPE otherwise it will not be anionic

isCationic

public boolean isCationic()
Check if actual pharmacophore type includes CATIONIC_TYPE. Types are not exclusive, a PharmacophorePoint can have multiple types.

Returns:
true if current type includes CATIONIC_TYPE

setCationic

public void setCationic(boolean flag)
Sets or clears the cationic property of the PharmacophorePoint.

Parameters:
flag - if true, current pharmacophore type will include CATIONIC_TYPE otherwise it will not be cationic

isExcluded

public boolean isExcluded()
Check if actual pharmacophore type is EXCLUDED_TYPE. This can be used to represent excluded volumes.

Returns:
true if current type is EXCLUDED_TYPE

setExcluded

public void setExcluded(boolean flag)
Sets or clears the excluded property of the PharmacophorePoint.

Parameters:
flag - if true, current pharmacophore type will be set to EXCLUDED_TYPE otherwise it will not be an excluded volume

setRenderingQuality

public void setRenderingQuality(java.lang.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 GraphicComponent.RENDERING_QUALITY_HIGH constants. Sets the precision (resolution) of the drawn sphere.

Overrides:
setRenderingQuality in class GraphicComponent
Parameters:
quality -

setDrawProperty

public void setDrawProperty(java.lang.String propertyName,
                            java.lang.String propertyValue)
Sets drawing properties specific to PharmacophoreSphere. Generic properties are processed by GraphicComponent.setDrawProperty(String, String).
Specific properties accepted:

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