|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gishur.x2.core.XObject | +--gishur.x2.core.XIntersectableObject | +--gishur.x2.core.XParametricCurve | +--gishur.x2.core.XQuadCurve
A quadratic curve segment.
Fields inherited from class gishur.x2.core.XParametricCurve |
DIRECTION_DOWN, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, STATE_BOTH_END, STATE_SOURCE_END, STATE_TARGET_END |
Fields inherited from class gishur.x2.core.XObject |
RESERVED_STATE_MAX_MASK, STATE_DIRTY, STATE_LOCKED, STATE_MUTABLE |
Fields inherited from interface gishur.x2.core.Intersectable |
FACES, POINT_INSIDE, POINT_ON_BORDER, POINT_OUTSIDE, POINTS, POINTS_CURVES |
Fields inherited from interface gishur.core.geom.Intersectable |
DEFAULT |
Constructor Summary | |
XQuadCurve(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Creates a parabola segment defined by the control points (x1,y1) ,
(x2,y2) and (x3,y3) . |
|
XQuadCurve(double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
boolean se,
boolean te)
Creates a parabola segment defined by the control points (x1,y1) ,
(x2,y2) and (x3,y3) .
|
|
XQuadCurve(XPoint control0,
XPoint control1,
XPoint control2)
Creates a parabola segment defined by the control points control0 ,
control1 and control2 and the state state . |
|
XQuadCurve(XPoint control0,
XPoint control1,
XPoint control2,
boolean se,
boolean te)
Creates a parabola segment defined by the control points control0 ,
control1 and control2 and the state state .
|
Method Summary | |
java.lang.Object |
clone()
Creates a new object of the same class as this object. |
XPoint |
control0()
Return the first control point of the parabola. |
XPoint |
control1()
Return the second control point of the parabola. |
XPoint |
control2()
Return the third control point of the parabola. |
static XQuadCurve |
createBisector(XPoint p,
XSegment l)
|
boolean |
equals(java.lang.Object o)
Determines whether two objects ( this and o )
are equal. |
boolean |
equals(XQuadCurve q)
Determines whether two parabolas are equal. |
XQuadCurve |
flip()
Flips source and target control points. |
java.lang.Object |
getOldXObject()
Returns corresponding old gishur.x-object. |
protected XObject[] |
getXObjectMembers()
This method should return all XObject members that contain geometric information. |
XPoint[] |
intersectHorizontal(double y)
Calculates the intersection points between this curve and the
horizontal line with y-coordinate y . |
java.lang.Object |
intersection(int mode,
java.lang.Object o)
Calculates the intersection between this object and the given object o. |
XPoint[] |
intersectVertical(double x)
Calculates the intersection points between this curve and the
vertical line with x-coordinate x . |
int |
locate(XPoint p)
Locates the specified point. |
void |
makeImmutable()
Makes this object immutable. |
void |
makeMutable()
Makes this object mutable. |
double |
param(XPoint p)
Calculates the parameter for the curve of a given point. |
XPoint |
point(double t)
Calculates a point on the curve with parameter t .
|
void |
setControl0(XPoint control0)
Sets the first control point to control0
(if not null ).
|
void |
setControl1(XPoint control1)
Sets the second control point to control1
(if not null ).
|
void |
setControl2(XPoint control2)
Sets the third control point to control2
(if not null ).
|
void |
setSource(double t)
Sets the source control point to the curve point with parameter t . |
void |
setSource(XPoint source)
Sets the source point to source . |
void |
setTarget(double t)
Sets the target control point to the curve point with parameter t . |
void |
setTarget(XPoint target)
Sets the target point to target . |
XPoint |
source()
Return the source point of the parabola segment. |
boolean |
supportIntersection(int mode,
java.lang.Object o)
Returns true, if this class (or object) provides intersection with the given object o. |
XPoint |
target()
Return the target point of the parabola segment. |
java.lang.String |
toString()
Returns a string representation of the parabola. |
XObject |
transform(double m00,
double m01,
double m02,
double m10,
double m11,
double m12)
Transforms this XObject by the given affine
transformation matrix. |
XPoint |
vector(double t,
int dir,
boolean normalize)
Returns a (normalized) vector in the specified direction relative to this curve at a point on the curve with parameter
t . |
Methods inherited from class gishur.x2.core.XParametricCurve |
checkParam, finite, hasNoEnd, inverseDirection, liesInterior, majorEndPoint, minorEndPoint, normal, normal, setSourceEnd, setTargetEnd, sourceEnd, tangent, tangent, targetEnd |
Methods inherited from class gishur.x2.core.XIntersectableObject |
contains, contains, liesOn |
Methods inherited from class gishur.x2.core.XObject |
checkState, checkStateCleared, clearDirty, clearState, copy, dirty, getMutable, inverseTransform, lock, locked, modify, mutable, restoreMutability, rotate, scale, setState, state, state, toString_complete, toString_state, transform, translate, translate, unlock |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public XQuadCurve(double x1, double y1, double x2, double y2, double x3, double y3, boolean se, boolean te)
(x1,y1)
,
(x2,y2)
and (x3,y3)
.
The values of se
and te
define, if the curve
ends at the source point (se==true
) or/and at the target point
(te==true
).x1,y1
- first control pointx2,y2
- second control pointx3,y3
- third control pointse
- curve ends at source pointte
- curve ends at target pointpublic XQuadCurve(XPoint control0, XPoint control1, XPoint control2, boolean se, boolean te)
control0
,
control1
and control2
and the state state
.
The values of se
and te
define, if the curve
ends at the source point (se==true
) or/and at the target point
(te==true
).control0
- first control pointcontrol1
- second control pointcontrol2
- third control pointse
- curve ends at source pointte
- curve ends at target pointpublic XQuadCurve(XPoint control0, XPoint control1, XPoint control2)
control0
,
control1
and control2
and the state state
.control0
- first control pointcontrol1
- second control pointcontrol2
- third control pointpublic XQuadCurve(double x1, double y1, double x2, double y2, double x3, double y3)
(x1,y1)
,
(x2,y2)
and (x3,y3)
.x1,y1
- first control pointx2,y2
- second control pointx3,y3
- third control pointMethod Detail |
public static final XQuadCurve createBisector(XPoint p, XSegment l)
public java.lang.String toString()
toString
in class XObject
public java.lang.Object clone()
clone
in class XObject
OutOfMemoryError
- if there is not enough memory.Cloneable
public boolean equals(XQuadCurve q)
q
- parabola to compare with this
.public boolean equals(java.lang.Object o)
this
and o
)
are equal.equals
in class java.lang.Object
o
- Object to compare with.public void makeMutable()
this
Object
can modify its coordinates (and some other geometric
information). This must be assured by every subclass of XObject
itself - but propagation to all XObject members contained by
this class (returned by getXObjectMembers()
) is assured
by this method.makeMutable
in class XObject
public void makeImmutable()
this
Object
cannot modify its coordinates (and some other geometric
information). This must be assured by every subclass of XObject
itself - but propagation to all XObject members contained by
this class (returned by getXObjectMembers()
) is assured
by this method.makeImmutable
in class XObject
protected XObject[] getXObjectMembers()
makeMutable()
, makeImmutable()
,
XObject.clearDirty()
, XObject.lock()
and XObject.unlock()
. To make this
work there must not occur circular dependencies.getXObjectMembers
in class XObject
null
if none).public XPoint source()
source
in class XParametricCurve
control0()
if
the parabola is unbounded on the source side.public XPoint target()
target
in class XParametricCurve
control2()
if
the parabola is unbounded on the target side.public XPoint control0()
public XPoint control1()
public XPoint control2()
public XPoint point(double t)
t
.
If the curve is XParametricCurve.finite()
, then holds 0≤t≤1
.point
in class XParametricCurve
t
- parameterPoint
- on the curve with parameter t
or
null
if the parameter is not valid.public double param(XPoint p)
GeomException
will be
thrown.param
in class XParametricCurve
p
- pointp
.GeomException
- if p
does not lie on the curvepublic XPoint vector(double t, int dir, boolean normalize)
this
curve at a point on the curve with parameter
t
. The value of dir
specifies if
the vector should point tangential along the curve (XParametricCurve.DIRECTION_UP
),
point tangential in the opposite direction (XParametricCurve.DIRECTION_DOWN
),
point normal to the curve to the right (XParametricCurve.DIRECTION_RIGHT
) or
point normal to the curve to the left (XParametricCurve.DIRECTION_LEFT
).vector
in class XParametricCurve
t
- parameter of the curve point where to calculate the vectordir
- direction constantnormalize
- true, if result vector should be normalizedGeomException
- if dir
has an illegal valuepublic XQuadCurve flip()
public void setSource(double t)
t
. Setting the source point has no effect on the parabola
itself (but on the second control point), it moves only the segment borders.
The object must be mutable.t
- parameter for new source control pointGeomException
- if object is immutablepublic void setTarget(double t)
t
. Setting the target point has no effect on the parabola
itself (but on the second control point), it moves only the segment borders.
The object must be mutable.t
- parameter for new target control pointGeomException
- if object is immutablepublic void setSource(XPoint source)
source
. source
must lie
on the curve or must be null
. Setting the source point has no
effect on the parabola itself, it moves only the segment borders.
The value null
removes the bound on the source side.
(if not null
).
The object must be mutable.setSource
in class XParametricCurve
source
- new source pointGeomException
- if object is immutablepublic void setTarget(XPoint target)
target
. target
must lie
on the curve or must be null
. Setting the target point has no
effect on the parabola itself, it moves only the segment borders.
The value null
removes the bound on the target side.
(if not null
).
The object must be mutable.setTarget
in class XParametricCurve
target
- new target pointGeomException
- if object is immutablepublic void setControl0(XPoint control0)
control0
(if not null
).
The object must be mutable.control0
- first control pointGeomException
- if object is immutablepublic void setControl1(XPoint control1)
control1
(if not null
).
The object must be mutable.control1
- second control pointGeomException
- if object is immutablepublic void setControl2(XPoint control2)
control2
(if not null
).
The object must be mutable.control2
- third pointGeomException
- if object is immutablepublic XObject transform(double m00, double m01, double m02, double m10, double m11, double m12)
this
XObject by the given affine
transformation matrix.transform
in class XObject
m00,m01,m02
- first row of the transformation matrixm10,m11,m12
- second row of the transformation matrixthis
, only if it is
mutable, otherwise a new XObject represeting the transformed object)public boolean supportIntersection(int mode, java.lang.Object o)
XPoint
, XSegment
and XQuadCurve
with
intersection modes Intersectable.DEFAULT
, Intersectable.POINTS
and
Intersectable.POINTS_CURVES
.mode
- intersection modeo
- object for intersectionpublic java.lang.Object intersection(int mode, java.lang.Object o)
BasicList
) of intersection objects.
This method does not verify, if the intersection with o can be
calculated (use supportIntersection(int, java.lang.Object)
instead), but throws an
IntersectionException
, if an error occures.
This means, it supportIntersection(int, java.lang.Object)
returns true and this method does
The resulted objects are always newly created and do not point to existing objects.
mode
- intersection modeo
- object for intersectionIntersectionException
- if an error occuredpublic int locate(XPoint p)
Intersectable.POINT_INSIDE
,Intersectable.POINT_OUTSIDE
,
Intersectable.POINT_ON_BORDER
}).
Because this class represents line objects, Intersectable.POINT_INSIDE
cannot occur as return value.p
- point to locateGeomException
- p
is null
public XPoint[] intersectVertical(double x)
this
curve and the
vertical line with x-coordinate x
.x
- x-coordinate of the vertical linepublic XPoint[] intersectHorizontal(double y)
this
curve and the
horizontal line with y-coordinate y
.y
- y-coordinate of the horizontal linepublic java.lang.Object getOldXObject()
getOldXObject
in class XObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |