case class QCurve(p1: R2 = R2 (0.0, 0.0), pc: R2 = R2 (0.0, 0.0), p2: R2 = R2 (0.0, 0.0), straight: Boolean = true) extends Double with CurvilinearShape with Product with Serializable
The QCurve
class enhances the QuadCurve.Double
class (from the java.awt.geom
package) by allowing entities to move along such quadratic curves as well as
lines. Although the curve could be developed as a quadratic function where
'y = ax2 + bx + c'. The following quadratic bezier formulation is used:
p(t) = (x(t), y(t)) = [(1-t)2 * p1] + [2 * (1-t) * t * pc] + [t^2 * p2].
- p1
the starting point for the quad curve
- pc
the control point for the quad curve
- p2
the ending point for the quad curve
- straight
whether the quad curve is straight (i.e., a line)
- Alphabetic
- By Inheritance
- QCurve
- Serializable
- Product
- Equals
- CurvilinearShape
- Error
- Double
- Serializable
- QuadCurve2D
- Cloneable
- Shape
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
QCurve(p1: R2, pc: R2, p2: R2)
Construct a quad curve using an explicitly given control point.
Construct a quad curve using an explicitly given control point.
- p1
the starting point
- pc
the control point
- p2
the ending point
-
new
QCurve(p1: R2, p2: R2, bend: Double)
Construct a quad curve where bend indicates the distance to the control point.
Construct a quad curve where bend indicates the distance to the control point.
- p1
the starting point
- p2
the ending point
- bend
the bend or curvature (1. => line length)
-
new
QCurve(p1: R2, p2: R2)
Construct a straight line (degenerate quad curve).
Construct a straight line (degenerate quad curve).
- p1
the starting point
- p2
the ending point
-
new
QCurve(p1: R2 = R2 (0.0, 0.0), pc: R2 = R2 (0.0, 0.0), p2: R2 = R2 (0.0, 0.0), straight: Boolean = true)
- p1
the starting point for the quad curve
- pc
the control point for the quad curve
- p2
the ending point for the quad curve
- straight
whether the quad curve is straight (i.e., a line)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
var
_traj: Double
Trajectory parameter t ranges from 0.
Trajectory parameter t ranges from 0. to 1. (indicates how far along the curve)
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Definition Classes
- QuadCurve2D → AnyRef
-
def
contains(arg0: Rectangle2D): Boolean
- Definition Classes
- QuadCurve2D → Shape
-
def
contains(arg0: Double, arg1: Double, arg2: Double, arg3: Double): Boolean
- Definition Classes
- QuadCurve2D → Shape
-
def
contains(arg0: Point2D): Boolean
- Definition Classes
- QuadCurve2D → Shape
-
def
contains(arg0: Double, arg1: Double): Boolean
- Definition Classes
- QuadCurve2D → Shape
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
eval(): R2
Given a value for the trajectory parameter 't' (in [0., 1.]) calculate the point on the curve using the Quadratic Bezier equation.
Given a value for the trajectory parameter 't' (in [0., 1.]) calculate the point on the curve using the Quadratic Bezier equation.
- See also
en.wikipedia.org/wiki/Bézier_curve#Quadratic_curves
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
flaw(method: String, message: String): Unit
Show the flaw by printing the error message.
Show the flaw by printing the error message.
- method
the method where the error occurred
- message
the error message
- Definition Classes
- Error
-
def
getBounds(): java.awt.Rectangle
- Definition Classes
- QuadCurve2D → Shape
-
def
getBounds2D(): Rectangle2D
- Definition Classes
- Double → Shape
-
def
getCenterX(): Double
Get the x-coordinate of the center of the line/curve.
Get the x-coordinate of the center of the line/curve.
- Definition Classes
- QCurve → CurvilinearShape
-
def
getCenterY(): Double
Get the y-coordinate of the center of the line/curve.
Get the y-coordinate of the center of the line/curve.
- Definition Classes
- QCurve → CurvilinearShape
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getControl: R2
Get the control point of the quad curve.
-
def
getCtrlPt(): Point2D
- Definition Classes
- Double → QuadCurve2D
-
def
getCtrlX(): Double
- Definition Classes
- Double → QuadCurve2D
-
def
getCtrlY(): Double
- Definition Classes
- Double → QuadCurve2D
-
def
getFirst(width: Double, height: Double): R2
Get the first/start point of the quad curve, adjusted from top-left to center coordinates.
Get the first/start point of the quad curve, adjusted from top-left to center coordinates.
- width
the width of object traversing the curve
- height
the height of object traversing the curve
-
def
getFirst: R2
Get the first/start point of the quad curve.
-
def
getFlatness(): Double
- Definition Classes
- QuadCurve2D
-
def
getFlatnessSq(): Double
- Definition Classes
- QuadCurve2D
-
def
getLast(width: Double, height: Double): R2
Get the last/end-point of the quad curve, adjusted from top-left to center coordinates.
Get the last/end-point of the quad curve, adjusted from top-left to center coordinates.
- width
the width of object traversing the curve
- height
the height of object traversing the curve
-
def
getLast: R2
Get the last/end-point of the quad curve.
-
def
getP1(): Point2D
- Definition Classes
- Double → QuadCurve2D
-
def
getP2(): Point2D
- Definition Classes
- Double → QuadCurve2D
-
def
getPathIterator(arg0: AffineTransform, arg1: Double): PathIterator
- Definition Classes
- QuadCurve2D → Shape
-
def
getPathIterator(arg0: AffineTransform): PathIterator
- Definition Classes
- QuadCurve2D → Shape
-
def
getX1(): Double
- Definition Classes
- Double → QuadCurve2D
-
def
getX2(): Double
- Definition Classes
- Double → QuadCurve2D
-
def
getY1(): Double
- Definition Classes
- Double → QuadCurve2D
-
def
getY2(): Double
- Definition Classes
- Double → QuadCurve2D
-
def
intersects(arg0: Rectangle2D): Boolean
- Definition Classes
- QuadCurve2D → Shape
-
def
intersects(arg0: Double, arg1: Double, arg2: Double, arg3: Double): Boolean
- Definition Classes
- QuadCurve2D → Shape
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isSame(x: Double, y: Double, xe: Double, ye: Double, step: Double): Boolean
Whether ('x', 'y') and ('xe', 'ye') are essentially the same.
-
def
length: Double
Return the length of this
QCurve
. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
next(width: Double, height: Double): R2
Return the next point on the quad curve (one step beyond current point) and adjust from top-left to center coordinates for the object traversing the curve based on its width and height.
Return the next point on the quad curve (one step beyond current point) and adjust from top-left to center coordinates for the object traversing the curve based on its width and height. Return null if 't > 1.0' (i.e., past end-point).
- width
the width of object traversing the curve
- height
the height of object traversing the curve
- Definition Classes
- QCurve → CurvilinearShape
-
def
next(): R2
Return the next point on the quad curve (one step beyond current point).
Return the next point on the quad curve (one step beyond current point). Return null if 't > 1.0' (i.e., past end-point).
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- var p1: R2
- var p2: R2
- var pc: R2
-
def
setCurve(arg0: Double, arg1: Double, arg2: Double, arg3: Double, arg4: Double, arg5: Double): Unit
- Definition Classes
- Double → QuadCurve2D
-
def
setCurve(arg0: QuadCurve2D): Unit
- Definition Classes
- QuadCurve2D
-
def
setCurve(arg0: Array[Point2D], arg1: Int): Unit
- Definition Classes
- QuadCurve2D
-
def
setCurve(arg0: Point2D, arg1: Point2D, arg2: Point2D): Unit
- Definition Classes
- QuadCurve2D
-
def
setCurve(arg0: Array[Double], arg1: Int): Unit
- Definition Classes
- QuadCurve2D
-
def
setLine(_p1: R2, _pc: R2, _p2: R2): Unit
Set (or reset) the location for the
QCurve
as a curve using an explicitly given control point.Set (or reset) the location for the
QCurve
as a curve using an explicitly given control point.- _p1
the starting point
- _pc
the control point
- _p2
the ending point
- Definition Classes
- QCurve → CurvilinearShape
-
def
setLine(_p1: R2, _p2: R2, bend: Double): Unit
Set (or reset) the location for the
QCurve
as a curve using bend to calculate the control point.Set (or reset) the location for the
QCurve
as a curve using bend to calculate the control point.- _p1
the starting point
- _p2
the ending point
- bend
the bend or curvature (1. => line-length)
- Definition Classes
- QCurve → CurvilinearShape
-
def
setLine(_p1: R2, _p2: R2): Unit
Set (or reset) the location for the
QCurve
as a line.Set (or reset) the location for the
QCurve
as a line.- _p1
the starting point
- _p2
the ending point
- Definition Classes
- QCurve → CurvilinearShape
-
def
setSteps(_steps: Int): Unit
Set the number of steps for tokens to take as move along the quad curve.
- var straight: Boolean
-
def
subdivide(arg0: QuadCurve2D, arg1: QuadCurve2D): Unit
- Definition Classes
- QuadCurve2D
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
Show the start, control and end-points of the the
QCurve
.Show the start, control and end-points of the the
QCurve
.- Definition Classes
- QCurve → AnyRef → Any
-
def
traj: Double
Get the current trajectory '_traj' of the curve.
-
def
traj_=(traj: Double): Unit
Set the trajectory '_traj' to a new value.
Set the trajectory '_traj' to a new value.
- traj
the new trajectory for the curve
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )