|
|||||||||
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
An abstract class for parametric curves.
Field Summary | |
static int |
DIRECTION_DOWN
Direction constant "downwards". |
static int |
DIRECTION_LEFT
Direction constant "to the left". |
static int |
DIRECTION_RIGHT
Direction constant "to the right". |
static int |
DIRECTION_UP
Direction constant "upwards". |
static short |
STATE_BOTH_END
Curve ends at source and target points (parameters must lie between 0 and 1). |
static short |
STATE_SOURCE_END
Curve ends at the source point (parameters <0 are prohibited). |
static short |
STATE_TARGET_END
Curve ends at the target point (parameters >1 are prohibited). |
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 | |
XParametricCurve()
|
Method Summary | |
boolean |
checkParam(double t)
Checks the parameter for this curve. |
boolean |
finite()
Returns true, if the curve fits in a finite rectangle. |
boolean |
hasNoEnd()
Returns true, if the curve that neither end at the source nor at the target point. |
static int |
inverseDirection(int direction)
Returns the inverse direction to direction . |
boolean |
liesInterior(XPoint p)
Returns true, if p |
XPoint |
majorEndPoint()
Returns the lexicographical bigger end point of the curve, e.g. that point of { source,target } with higher x-coordinate or -
in the case of equality - with higher y-coordinate. |
XPoint |
minorEndPoint()
Returns the lexicographical smaller end point of the curve, e.g. that point of { source,target } with lower x-coordinate or -
in the case of equality - with lower y-coordinate. |
XSegment |
normal(double t)
Returns the normal line to the curve at the point with parameter t .
|
XSegment |
normal(XPoint p)
Returns the normal line to the curve at the point p .
|
abstract double |
param(XPoint p)
Calculates the parameter for the curve of a given point. |
abstract XPoint |
point(double t)
Calculates a point on the curve with parameter t .
|
abstract void |
setSource(XPoint source)
Sets the source point to source (if not null ).
|
void |
setSourceEnd(boolean sc)
Determines if the curve ends at the source point. |
abstract void |
setTarget(XPoint target)
Sets the target point to target (if not null ).
|
void |
setTargetEnd(boolean tc)
Determines if the curve ends at the target point. |
abstract XPoint |
source()
Return the source point of the curve. |
boolean |
sourceEnd()
Returns true, if the curve ends at the source point. |
XSegment |
tangent(double t)
Returns the tangent line to the curve at the point with parameter t .
|
XSegment |
tangent(XPoint p)
Returns the tangent line to the curve at the point p .
|
abstract XPoint |
target()
Return the target point of the curve. |
boolean |
targetEnd()
Returns true, if the curve ends at the target point. |
abstract 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.XIntersectableObject |
contains, contains, liesOn |
Methods inherited from class gishur.x2.core.XObject |
checkState, checkStateCleared, clearDirty, clearState, clone, copy, dirty, getMutable, getOldXObject, getXObjectMembers, inverseTransform, lock, locked, makeImmutable, makeMutable, modify, mutable, restoreMutability, rotate, scale, setState, state, state, toString_complete, toString_state, toString, transform, transform, translate, translate, unlock |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface gishur.x2.core.Intersectable |
locate |
Methods inherited from interface gishur.core.geom.Intersectable |
intersection, supportIntersection |
Field Detail |
public static final int DIRECTION_RIGHT
public static final int DIRECTION_LEFT
public static final int DIRECTION_UP
public static final int DIRECTION_DOWN
public static final short STATE_SOURCE_END
public static final short STATE_TARGET_END
public static final short STATE_BOTH_END
Constructor Detail |
public XParametricCurve()
Method Detail |
public abstract XPoint source()
public abstract XPoint target()
public abstract void setSource(XPoint source)
source
(if not null
).
The object must be mutable.source
- source pointGeomException
- if object is immutablepublic abstract void setTarget(XPoint target)
target
(if not null
).
The object must be mutable.target
- target pointGeomException
- if object is immutablepublic abstract XPoint point(double t)
t
.
If the curve is finite()
, then holds 0≤t≤1
.t
- parameterPoint
- on the curve with parameter t
or
null
if the parameter is not valid.public abstract double param(XPoint p)
GeomException
will be
thrown.p
- pointp
.GeomException
- if p
does not lie on the curvepublic abstract 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 (DIRECTION_UP
),
point tangential in the opposite direction (DIRECTION_DOWN
),
point normal to the curve to the right (DIRECTION_RIGHT
) or
point normal to the curve to the left (DIRECTION_LEFT
).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 value.public XPoint minorEndPoint()
source,target
} with lower x-coordinate or -
in the case of equality - with lower y-coordinate.public XPoint majorEndPoint()
source,target
} with higher x-coordinate or -
in the case of equality - with higher y-coordinate.public XSegment tangent(double t)
t
.
The resulting tangent points along the curve.t
- parameter for curve pointpoint(t)
.public XSegment tangent(XPoint p)
p
.
The resulting tangent points along the curve.
The given point must lie on the curve or the result will
be useless.p
- curve pointp
.public XSegment normal(double t)
t
.
The resulting normal points to the left of the line.t
- parameter for curve pointpoint(t)
.public XSegment normal(XPoint p)
p
.
The resulting normal points to the left of the line.
The given point must lie on the curve or the result will
be useless.p
- curve pointp
.public boolean sourceEnd()
public boolean targetEnd()
public boolean hasNoEnd()
public boolean finite()
public boolean liesInterior(XPoint p)
p lies in the interior of the curve.
- Parameters:
p
- test point- Returns:
- True, if it lies in the interior of the segment.
public void setSourceEnd(boolean sc)
sc
- if true, curve will end at sourceGeomException
- if object is immutablepublic void setTargetEnd(boolean tc)
tc
- if true, curve will end at targetGeomException
- if object is immutablepublic boolean checkParam(double t)
t
- parameter to checkt
is valid.public static final int inverseDirection(int direction)
direction
.direction
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |