Package chemaxon.marvin.space
Class PharmacophorePoint
java.lang.Object
chemaxon.marvin.space.GraphicComponent
chemaxon.marvin.space.PharmacophorePoint
- All Implemented Interfaces:
chemaxon.marvin.space.UsableObject
@PublicAPI
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
At present
PharmacophorePoint
serves mere visualisation purposes.
The graphical representation in the MarvinSpace canvas is a translucent sphere.- Since:
- Marvin 4.0.2
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final float
static final int
static final String[]
static final int
static final int
protected boolean
protected boolean
static final int
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
ConstructorDescriptionCreates a new instance ofPharmacophorePoint
.PharmacophorePoint
(double x, double y, double z) Creates a PharmacophorePoint at the given position.Creates aPharmacophorePoint
at the position of the givenComponentElement
getting the coordinates bygetCoordinates()
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
void
draw()
Draws the entire component if it is opaque.void
Draws transparent parts of the component if there is any.getColor()
Returns the color of the PharmacophorePoint.void
getCoordinates
(ComponentElement item, float[] c) Gets the position of the pharmacophore point.Returns textual description.Returns the name of the drawing type.getName()
Returns the name of the component.double
Returns the radius of the PharmacophorePoint in angstroms.boolean
Checks is component has transparent part.void
initDraw()
Initializes all internal data structure needed for drawing the component.boolean
Checks if actual pharmacophore type includesACCEPTOR_TYPE
.boolean
Check if actual pharmacophore type includesANIONIC_TYPE
.boolean
Checks if actual pharmacophore type includesAROMATIC_TYPE
.boolean
Check if actual pharmacophore type includesCATIONIC_TYPE
.boolean
isControllable
(String type) Returns whether controling by the given type of controller is allowed to the component.boolean
isDonor()
Checks if actual pharmacophore type includesDONOR_TYPE
.boolean
Check if actual pharmacophore type isEXCLUDED_TYPE
.boolean
Returns true if the component is highlighted.boolean
Checks if actual pharmacophore type includesHYDROPHOBIC_TYPE
.protected void
pickObject
(int offset, double[] maxZ, float[] modelview) SetsGraphicComponent.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
(String propertyName, String propertyValue) Sets drawing properties specific toPharmacophoreSphere
.void
setDrawType
(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, seeGraphicComponent.RENDERING_QUALITY_HIGH
constants.void
setRenderingQuality
(String quality) Sets the rendering quality and callssetRenderingQuality(int)
.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, getLabelInformation, getRenderingQuality, getUsableObject, getZCoordinateTo2DPart, glColor, 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, rotate, rotate, select, selectComponentElementsInside, setColor, setColor, setColor, 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 Details
-
DEFAULT_RADIUS
public static final float DEFAULT_RADIUS- See Also:
-
DRAW_TYPES
-
UNKONWN_TYPE
public static final int UNKONWN_TYPE- See Also:
-
ACCEPTOR_TYPE
public static final int ACCEPTOR_TYPE- See Also:
-
DONOR_TYPE
public static final int DONOR_TYPE- See Also:
-
ANIONIC_TYPE
public static final int ANIONIC_TYPE- See Also:
-
CATIONIC_TYPE
public static final int CATIONIC_TYPE- See Also:
-
HYDROPHOBIC_TYPE
public static final int HYDROPHOBIC_TYPE- See Also:
-
AROMATIC_TYPE
public static final int AROMATIC_TYPE- See Also:
-
EXCLUDED_TYPE
public static final int EXCLUDED_TYPE- See Also:
-
needRecreateBall
protected boolean needRecreateBall -
needRecreateDisplayList
protected boolean needRecreateDisplayList
-
-
Constructor Details
-
PharmacophorePoint
public PharmacophorePoint()Creates a new instance ofPharmacophorePoint
. It will be placed at the origo by default, its position can be set bysetPosition()
. -
PharmacophorePoint
Creates aPharmacophorePoint
at the position of the givenComponentElement
getting the coordinates bygetCoordinates()
. Radius is set toby 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 toby default
.- Parameters:
x
- first coordinate of the pharmacophore point to createy
- second coordinate of the pharmacophore point to createz
- third coordinate of the pharmacophore point to create
-
-
Method Details
-
setPosition
public void setPosition(double x, double y, double z) Sets the position of the PharmacophorePoint. Size is not affected. -
getCoordinates
Gets the position of the pharmacophore point. The position of the pharmacophore point is the centre of the sphere.- Overrides:
getCoordinates
in classGraphicComponent
- Parameters:
item
- not usedc
- coordinates of the pharmacophore point are stored in this array, it has to be pre-allocated by the caller of this method
-
getDescription
Returns textual description.- Overrides:
getDescription
in classGraphicComponent
- Returns:
- description that contains pharmacophore type name
-
getName
Description copied from class:GraphicComponent
Returns the name of the component.- Specified by:
getName
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
getName
in classGraphicComponent
- Returns:
- name that is
getClass.getName()
by default.
-
toString
- Specified by:
toString
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
toString
in classGraphicComponent
-
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
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.- Anionic - Dark red
- Cationic - Dark blue
- Acceptor - Red
- Donor - Blue
- Hydrophobe - Yellow
- Aromatic - Green
- Excluded - Gray
- Specified by:
getColor
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
getColor
in classGraphicComponent
-
select
public void select()Sets the component to be selected.- Specified by:
select
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
select
in classGraphicComponent
-
unSelect
public void unSelect()Sets the component to be unselected.- Specified by:
unSelect
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
unSelect
in classGraphicComponent
-
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 classGraphicComponent
- 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 classGraphicComponent
- Parameters:
x
- ignoredy
- size increment/decrementz
- ignored
-
isControllable
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 classGraphicComponent
- Parameters:
type
- control event type,Shift
andResize
are interpreted by this component- Returns:
- true if
type
is eitherShift
orResize
-
hasTransparentPart
public boolean hasTransparentPart()Checks is component has transparent part. For detailed discussion seeGraphicComponent.hasTransparentPart()
.- Overrides:
hasTransparentPart
in classGraphicComponent
- 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, thatPharmacophorePoint
has no subpart, thus the whole component is either transparent or opaque.- Overrides:
drawTransparentPart
in classGraphicComponent
-
draw
public void draw()Draws the entire component if it is opaque.- Overrides:
draw
in classGraphicComponent
-
initDraw
public void initDraw()Initializes all internal data structure needed for drawing the component. It is called prior todraw()
. -
pickObject
protected void pickObject(int offset, double[] maxZ, float[] modelview) SetsGraphicComponent.pickedItem
to the pharmacophore point.- Overrides:
pickObject
in classGraphicComponent
- Parameters:
offset
- seeGraphicComponent.pickObject(int,double[],float[])
maxZ
- seeGraphicComponent.pickObject(int,double[],float[])
modelview
- seeGraphicComponent.pickObject(int,double[],float[])
-
setDrawType
Sets current drawing type.- Parameters:
type
- Solid, Mesh or Transparent
-
getDrawType
Returns the name of the drawing type.- Returns:
- Solid, Mesh or Transparent
-
isAcceptor
public boolean isAcceptor()Checks if actual pharmacophore type includesACCEPTOR_TYPE
. Types are not exclusive, a PharmacophorePoint can have multiple types, though certain combinations are senseless (likeANIONIC_TYPE
andCATIONIC_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 includeACCEPTOR_TYPE
otherwise it will not be an acceptor
-
isDonor
public boolean isDonor()Checks if actual pharmacophore type includesDONOR_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 includeDONOR_TYPE
otherwise it will not be a donor
-
isHydrophobic
public boolean isHydrophobic()Checks if actual pharmacophore type includesHYDROPHOBIC_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 includeHYDROPHOBIC_TYPE
otherwise it will not be hydrophobic
-
isAromatic
public boolean isAromatic()Checks if actual pharmacophore type includesAROMATIC_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 includeAROMATIC_TYPE
otherwise it will not be aromatic
-
isAnionic
public boolean isAnionic()Check if actual pharmacophore type includesANIONIC_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 includeANIONIC_TYPE
otherwise it will not be anionic
-
isCationic
public boolean isCationic()Check if actual pharmacophore type includesCATIONIC_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 includeCATIONIC_TYPE
otherwise it will not be cationic
-
isExcluded
public boolean isExcluded()Check if actual pharmacophore type isEXCLUDED_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 toEXCLUDED_TYPE
otherwise it will not be an excluded volume
-
setRenderingQuality
Sets the rendering quality and callssetRenderingQuality(int)
.- Parameters:
quality
- Can be "High", "Medium", "Low".
-
setRenderingQuality
public void setRenderingQuality(int quality) Sets the rendering quality, seeGraphicComponent.RENDERING_QUALITY_HIGH
constants. Sets the precision (resolution) of the drawn sphere.- Overrides:
setRenderingQuality
in classGraphicComponent
- Parameters:
quality
- rendering quality, seeRENDERING_*
constants
-
setDrawProperty
Sets drawing properties specific toPharmacophoreSphere
. Generic properties are processed byGraphicComponent.setDrawProperty(String, String)
.
Specific properties accepted:- "Quality" -- "High", "Medium", "Low"
- "PharmacophorePoint.DrawType" -- "Mesh", "Solid", "Transparent"
- "Acceptor" -- Boolean value as
String
- "Donor" -- Boolean value as
String
- "Hydrophobe" -- Boolean value as
String
- "Aromatic" -- Boolean value as
String
- "Anionic" -- Boolean value as
String
- "Cationic" -- Boolean value as
String
- "Excluded" -- Boolean value as
String
- Specified by:
setDrawProperty
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
setDrawProperty
in classGraphicComponent
- Parameters:
propertyName
- identifier of the draw propertypropertyValue
- value of the draw property as aString
-
cleanup
public void cleanup()- Overrides:
cleanup
in classGraphicComponent
-