public class CubicBezier extends LineSegment
In order to be able to represent smooth curves the &ldquolayout&rdquo
package defines the class CubicBezier
. It represents a Bezier curve, and
is readily available in most graphics APIs. The class CubicBezier
is
derived from LineSegment
. It consists of four elements: the two inherited
elements 'start' and 'end', which specify the starting point and the
endpoint of the cubic bezier curve, and two elements 'basePoint1' and
'basePoint2', which specify the two additional base points that are needed
to describe a cubic bezier curve.
Constructor and Description |
---|
CubicBezier()
Creates a
CubicBezier and returns the pointer. |
CubicBezier(CubicBezier orig)
Copy constructor.
|
CubicBezier(LayoutPkgNamespaces layoutns)
Ctor.
|
CubicBezier(LayoutPkgNamespaces layoutns,
double x1,
double y1,
double x2,
double y2)
Creates a
CubicBezier with the given 2D coordinates and returns the
pointer. |
CubicBezier(LayoutPkgNamespaces layoutns,
double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Creates a
CubicBezier with the given 3D coordinates and returns the
pointer. |
CubicBezier(LayoutPkgNamespaces layoutns,
Point start,
Point end)
Creates a
CubicBezier with the given points and returns the pointer. |
CubicBezier(LayoutPkgNamespaces layoutns,
Point start,
Point base1,
Point base2,
Point end)
Creates a
CubicBezier with the given points and returns the pointer. |
CubicBezier(long level)
Creates a
CubicBezier and returns the pointer. |
CubicBezier(long level,
long version)
Creates a
CubicBezier and returns the pointer. |
CubicBezier(long level,
long version,
long pkgVersion)
Creates a
CubicBezier and returns the pointer. |
CubicBezier(XMLNode node)
|
CubicBezier(XMLNode node,
long l2version)
|
Modifier and Type | Method and Description |
---|---|
CubicBezier |
cloneObject()
Creates and returns a deep copy of this
CubicBezier . |
void |
connectToChild()   |
void |
delete()
Explicitly deletes the underlying native object.
|
Point |
getBasePoint1()
Returns the first base point of the curve (the one closer to the
starting point).
|
Point |
getBasePoint2()
Returns the second base point of the curve (the one closer to the end
point).
|
String |
getElementName()
Returns the XML element name of
this SBML object.
|
int |
getTypeCode()
Returns the libSBML type code of this object instance.
|
void |
initDefaults()
Calls initDefaults from
LineSegment . |
void |
setBasePoint1(double x,
double y)
Initializes first base point with the given coordinates.
|
void |
setBasePoint1(double x,
double y,
double z)
Initializes first base point with the given coordinates.
|
void |
setBasePoint1(Point p)
Initializes first base point with a copy of the given point.
|
void |
setBasePoint2(double x,
double y)
Initializes second base point with the given coordinates.
|
void |
setBasePoint2(double x,
double y,
double z)
Initializes second base point with the given coordinates.
|
void |
setBasePoint2(Point p)
Initializes second base point with a copy of the given point.
|
void |
straighten()
Makes a line from a
CubicBezier by setting both base points into the
middle between the start and the end point. |
XMLNode |
toXML()
Creates an
XMLNode object from this. |
getEnd, getStart, setEnd, setEnd, setEnd, setStart, setStart, setStart
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getElementByMetaId, getElementBySId, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetId, unsetMetaId, unsetModelHistory, unsetName, unsetNotes, unsetSBOTerm, unsetUserData
public CubicBezier(long level, long version, long pkgVersion) throws SBMLConstructorException
CubicBezier
and returns the pointer.SBMLConstructorException
public CubicBezier(long level, long version) throws SBMLConstructorException
CubicBezier
and returns the pointer.SBMLConstructorException
public CubicBezier(long level) throws SBMLConstructorException
CubicBezier
and returns the pointer.SBMLConstructorException
public CubicBezier() throws SBMLConstructorException
CubicBezier
and returns the pointer.SBMLConstructorException
public CubicBezier(LayoutPkgNamespaces layoutns) throws SBMLConstructorException
SBMLConstructorException
public CubicBezier(LayoutPkgNamespaces layoutns, double x1, double y1, double x2, double y2) throws SBMLConstructorException
CubicBezier
with the given 2D coordinates and returns the
pointer.
(FOR BACKWARD COMPATIBILITY)
SBMLConstructorException
public CubicBezier(LayoutPkgNamespaces layoutns, double x1, double y1, double z1, double x2, double y2, double z2) throws SBMLConstructorException
CubicBezier
with the given 3D coordinates and returns the
pointer.
(FOR BACKWARD COMPATIBILITY)
SBMLConstructorException
public CubicBezier(CubicBezier orig) throws SBMLConstructorException
(FOR BACKWARD COMPATIBILITY)
SBMLConstructorException
public CubicBezier(LayoutPkgNamespaces layoutns, Point start, Point end) throws SBMLConstructorException
CubicBezier
with the given points and returns the pointer.
(FOR BACKWARD COMPATIBILITY)
SBMLConstructorException
public CubicBezier(LayoutPkgNamespaces layoutns, Point start, Point base1, Point base2, Point end) throws SBMLConstructorException
CubicBezier
with the given points and returns the pointer.
(FOR BACKWARD COMPATIBILITY)
SBMLConstructorException
public CubicBezier(XMLNode node, long l2version) throws SBMLConstructorException
SBMLConstructorException
public CubicBezier(XMLNode node) throws SBMLConstructorException
SBMLConstructorException
public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the CubicBezier.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke CubicBezier.delete()
themselves.
delete
 in class LineSegment
public Point getBasePoint1()
public void setBasePoint1(Point p)
public void setBasePoint1(double x, double y, double z)
public void setBasePoint1(double x, double y)
public Point getBasePoint2()
public void setBasePoint2(Point p)
public void setBasePoint2(double x, double y, double z)
public void setBasePoint2(double x, double y)
public void initDefaults()
LineSegment
.initDefaults
 in class LineSegment
public void straighten()
CubicBezier
by setting both base points into the
middle between the start and the end point.public String getElementName()
getElementName
 in class LineSegment
public CubicBezier cloneObject()
CubicBezier
.
cloneObject
 in class LineSegment
CubicBezier
.public int getTypeCode()
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters SBML_
.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants
. Note that different Level 3
package plug-ins may use overlapping type codes to identify the package
to which a given object belongs, call the getPackageName()
method on the object.
getTypeCode
 in class LineSegment
SBML_LAYOUT_CUBICBEZIER
CubicBezier.getElementName()
,
SBase.getPackageName()
public XMLNode toXML()
XMLNode
object from this.toXML
 in class LineSegment
public void connectToChild()
connectToChild
 in class LineSegment