Package chemaxon.marvin.space
Class PharmacophoreArrow
java.lang.Object
chemaxon.marvin.space.GraphicComponent
chemaxon.marvin.space.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 Summary
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 ofPharmacophoreArrow
.PharmacophoreArrow
(double x, double y, double z) Creates aPharmacophoreArrow
at the given position.Creates aPharmacophoreArrow
at the position of the givenComponentElement
getting the coordinates bygetCoordinates()
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
void
draw()
Draws the component if it is opaque.void
Draws transparent parts of the component if there is any.getColor()
Returns the color of the component.void
getCoordinates
(ComponentElement item, float[] c) Gets the position of the component.Returns a descriptive text.Returns the name of the drawing type.getName()
Returns the name of the component.double
Returns the radius of the arrow.boolean
void
initDraw()
boolean
isControllable
(String type) Returns whether controling by the given type of controller is allowed to the component.boolean
Returns true if the component is highlighted.void
protected void
pickObject
(int offset, double[] maxZ, float[] modelview) SetsGraphicComponent.pickedItem
to be the picked part of the component.void
resize
(double x, double y, double z) Resizes the component according to the given factors in each direction.void
rotate
(float[] v, float[] center) Rotates the component around the 3 axis, x, y, z, and given center.void
select()
Sets the component to be selected.void
setDrawProperty
(String propertyName, String propertyValue) Sets adraw property
.void
setDrawType
(String type) Sets current drawing type.void
setHighlighted
(boolean flag) Sets the component to be highlighted.void
setPosition
(double x, double y, double z) Sets the position of thePharmacophoreArrow
.void
setRadius
(double r) Sets the radius of the arrow.void
setRenderingQuality
(int quality) Sets the rendering quality, seeRENDERING_*
constants.void
setRenderingQuality
(String quality) Sets the rendering quality and callssetRenderingQuality(int)
.toString()
void
translate
(float[] v) Translates the component with the parameter as a 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, projectVector, receiveNotificationOnCoordinateChange, receiveNotificationOnInvisibility, receiveNotificationOnSelection, receiveNotificationOnUnSelection, receiveNotificationOnVisibility, removeAssociation, 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
-
DRAW_TYPES
-
-
Constructor Details
-
PharmacophoreArrow
public PharmacophoreArrow()Creates a new instance ofPharmacophoreArrow
. It will be placed at the origin by default, its position can be set bysetPosition()
. -
PharmacophoreArrow
Creates aPharmacophoreArrow
at the position of the givenComponentElement
getting the coordinates bygetCoordinates()
.- Parameters:
ce
- reference to a component to get the coordinates
-
PharmacophoreArrow
public PharmacophoreArrow(double x, double y, double z) Creates aPharmacophoreArrow
at the given position.- Parameters:
x
- coordinatey
- coordinatez
- coordinate
-
-
Method Details
-
onRemoveGraphicComponent
public void onRemoveGraphicComponent()- Overrides:
onRemoveGraphicComponent
in classGraphicComponent
-
setPosition
public void setPosition(double x, double y, double z) Sets the position of thePharmacophoreArrow
.- Parameters:
x
- first coordinatey
- second coordinatez
- third coordinate
-
getCoordinates
Gets the position of the component.- Overrides:
getCoordinates
in classGraphicComponent
- Parameters:
item
- ignored here (sincePharmacophoreArrow
is not subdivided further into smaller constituting elements)c
- output parameter to store 3 coordinates (must be allocated by caller)
-
getDescription
Returns a descriptive text.- Overrides:
getDescription
in classGraphicComponent
- Returns:
- "Pharmacophore arrow"
-
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 arrow. -
setRadius
public void setRadius(double r) Sets the radius of the arrow. -
getColor
Returns the color of the component.- 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 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 classGraphicComponent
- 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 classGraphicComponent
- 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 classGraphicComponent
-
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
- "Shift", "Rotate", "Resize"- Returns:
- is the component aloowed to be controlled or not
-
hasTransparentPart
public boolean hasTransparentPart()SeeGraphicComponent.hasTransparentPart()
. Returns true if the drawing type is notDRAW_TYPE_FILLED
.- Overrides:
hasTransparentPart
in classGraphicComponent
- Returns:
- will the component draw with transparency
-
drawTransparentPart
public void drawTransparentPart()Draws transparent parts of the component if there is any.- Overrides:
drawTransparentPart
in classGraphicComponent
-
draw
public void draw()Draws the component if it is opaque.- Overrides:
draw
in classGraphicComponent
-
initDraw
public void initDraw() -
pickObject
protected void pickObject(int offset, double[] maxZ, float[] modelview) Description copied from class:GraphicComponent
SetsGraphicComponent.pickedItem
to be the picked part of the component.- Overrides:
pickObject
in classGraphicComponent
- 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.
-
cleanup
public void cleanup()- Overrides:
cleanup
in classGraphicComponent
-
setDrawType
Sets current drawing type.- Parameters:
type
- Solid, Mesh or Transparent
-
getDrawType
Returns the name of the drawing type.- Returns:
- Solid, Mesh or Transparent
-
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, seeRENDERING_*
constants. Sets the precision of the drawn arrow.- Overrides:
setRenderingQuality
in classGraphicComponent
- Parameters:
quality
- rendering quality, seeRENDERING_*
constants
-
setDrawProperty
Sets adraw property
.
Accepts:- "Quality" -- "High", "Medium", "Low"
- "PharmacophoreArrow.DrawType" -- "Mesh", "Solid", "Transparent"
- 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
-