Package chemaxon.struc
Class MPoint
- java.lang.Object
-
- chemaxon.struc.MObject
-
- chemaxon.struc.MPoint
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
MAtomSetPoint
,MEFlowBasePoint
,MMidPoint
,MRectanglePoint
@PublicAPI public class MPoint extends MObject
Point object.- Since:
- Marvin 3.3, 10/18/2003
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class chemaxon.struc.MObject
TRANSFORM_DISTORT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calcCenter(DPoint3 p, CTransform3D t)
Calculates the geometrical center.MPoint
clone()
Creates a clone.double
distanceFrom(double x, double y, CTransform3D t)
Gets the 2D distance from the specified point.boolean
equals(Object o)
Two points equal if their location equals.DPoint3
getLocation()
Gets the point's location.DPoint3
getLocation(CTransform3D t)
Gets the point's location.void
getLocation(DPoint3 p, CTransform3D t)
Gets the point's location.MPoint
getPoint(int i)
Gets the point.int
getPointCount()
Gets the number of points.MPoint
getPointRef(int i, CTransform3D trot)
Gets a point of the line.int
getPointRefCount()
Gets the number of point references.int
hashCode()
boolean
isChildOf(MObject o)
Is this object a children of another one?boolean
isInternalSelectable()
Is it a selection only internal object?void
setLocation(DPoint3 p, CTransform3D t)
Sets the point's location.String
toString()
Overrides Object.toString() to ease debugging.void
transform(CTransform3D t, int opts, CTransform3D trot)
Transforms all points.-
Methods inherited from class chemaxon.struc.MObject
addAttributeKeys, addCdataAttributeKeys, addNotify, checkValidity, connectToSgroupOfAtom, containsAtom, containsPoint, distanceFrom, finishCloning, fixClonedPoints, getAttribute, getBackground, getColor, getContainerMObject, getLineColor, hasBackground, hasColor, hasLineColor, isEmpty, isReactionArrow, isSelectableNow, isSelected, isTransformable, makeColor, removeAtom, removeChild, removeNotify, replaceAtom, setAttribute, setBackground, setColor, setLineColor, setSelected, unselectContents, updateBoundingRect, updateBoundingRect
-
-
-
-
Constructor Detail
-
MPoint
public MPoint(double x, double y, double z)
Contructs a point object.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinate
-
MPoint
public MPoint(double x, double y)
Contructs a point object.- Parameters:
x
- the x coordinatey
- the y coordinate- Since:
- Marvin 4.1, 03/06/2006
-
MPoint
public MPoint(DPoint3 p)
Constructs a point object.- Parameters:
p
- the point
-
MPoint
public MPoint(MPoint p)
Copy constructor.- Parameters:
p
- the point
-
-
Method Detail
-
equals
public boolean equals(Object o)
Two points equal if their location equals.
-
isChildOf
public boolean isChildOf(MObject o)
Is this object a children of another one?
-
isInternalSelectable
public boolean isInternalSelectable()
Is it a selection only internal object?- Overrides:
isInternalSelectable
in classMObject
- Returns:
- true
-
getLocation
public void getLocation(DPoint3 p, CTransform3D t)
Gets the point's location.- Parameters:
p
- the output point objectt
- transformation or null- Since:
- Marvin 4.1, 04/28/2006
-
getLocation
public final DPoint3 getLocation(CTransform3D t)
Gets the point's location.- Parameters:
t
- transformation or null- Returns:
- the point
- Since:
- Marvin 4.1, 04/28/2006
-
getLocation
public final DPoint3 getLocation()
Gets the point's location.- Returns:
- the point
-
setLocation
public void setLocation(DPoint3 p, CTransform3D t)
Sets the point's location.- Parameters:
p
- new location in the 'absolute' system (null transform)t
- viewing transformation- Since:
- Marvin 4.1, 04/28/2006
-
getPointCount
public int getPointCount()
Gets the number of points.- Specified by:
getPointCount
in classMObject
- Returns:
- 1
-
getPoint
public MPoint getPoint(int i)
Gets the point.
-
getPointRefCount
public int getPointRefCount()
Gets the number of point references.- Overrides:
getPointRefCount
in classMObject
- Returns:
- 1
-
getPointRef
public MPoint getPointRef(int i, CTransform3D trot)
Gets a point of the line.- Overrides:
getPointRef
in classMObject
- Parameters:
i
- the point indextrot
- the viewing transformation or null- Returns:
- the point's reference
- Since:
- Marvin 4.1, 05/01/2006
-
transform
public void transform(CTransform3D t, int opts, CTransform3D trot)
Transforms all points.- Specified by:
transform
in classMObject
- Parameters:
t
- the transformation matrixopts
- transform options or 0trot
- the viewing transformation or null- See Also:
MObject.TRANSFORM_DISTORT
-
calcCenter
public final void calcCenter(DPoint3 p, CTransform3D t)
Calculates the geometrical center.- Specified by:
calcCenter
in classMObject
- Parameters:
p
- store the coordinates heret
- the transformation matrix or null- Since:
- Marvin 4.1, 04/28/2006
-
distanceFrom
public final double distanceFrom(double x, double y, CTransform3D t)
Gets the 2D distance from the specified point.- Specified by:
distanceFrom
in classMObject
- Parameters:
x
- the x coordinatey
- the y coordinatet
- transformation or null- Since:
- Marvin 3.5, 11/04/2004
-
-