Packages

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)

Linear Supertypes
Serializable, Product, Equals, CurvilinearShape, Error, Double, Serializable, QuadCurve2D, Cloneable, Shape, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. QCurve
  2. Serializable
  3. Product
  4. Equals
  5. CurvilinearShape
  6. Error
  7. Double
  8. Serializable
  9. QuadCurve2D
  10. Cloneable
  11. Shape
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. 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

  2. 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)

  3. 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

  4. 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

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. var _traj: Double

    Trajectory parameter t ranges from 0.

    Trajectory parameter t ranges from 0. to 1. (indicates how far along the curve)

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Definition Classes
    QuadCurve2D → AnyRef
  7. def contains(arg0: Rectangle2D): Boolean
    Definition Classes
    QuadCurve2D → Shape
  8. def contains(arg0: Double, arg1: Double, arg2: Double, arg3: Double): Boolean
    Definition Classes
    QuadCurve2D → Shape
  9. def contains(arg0: Point2D): Boolean
    Definition Classes
    QuadCurve2D → Shape
  10. def contains(arg0: Double, arg1: Double): Boolean
    Definition Classes
    QuadCurve2D → Shape
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. 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

  13. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. 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
  15. def getBounds(): java.awt.Rectangle
    Definition Classes
    QuadCurve2D → Shape
  16. def getBounds2D(): Rectangle2D
    Definition Classes
    Double → Shape
  17. 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
    QCurveCurvilinearShape
  18. 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
    QCurveCurvilinearShape
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  20. def getControl: R2

    Get the control point of the quad curve.

  21. def getCtrlPt(): Point2D
    Definition Classes
    Double → QuadCurve2D
  22. def getCtrlX(): Double
    Definition Classes
    Double → QuadCurve2D
  23. def getCtrlY(): Double
    Definition Classes
    Double → QuadCurve2D
  24. 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

  25. def getFirst: R2

    Get the first/start point of the quad curve.

  26. def getFlatness(): Double
    Definition Classes
    QuadCurve2D
  27. def getFlatnessSq(): Double
    Definition Classes
    QuadCurve2D
  28. 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

  29. def getLast: R2

    Get the last/end-point of the quad curve.

  30. def getP1(): Point2D
    Definition Classes
    Double → QuadCurve2D
  31. def getP2(): Point2D
    Definition Classes
    Double → QuadCurve2D
  32. def getPathIterator(arg0: AffineTransform, arg1: Double): PathIterator
    Definition Classes
    QuadCurve2D → Shape
  33. def getPathIterator(arg0: AffineTransform): PathIterator
    Definition Classes
    QuadCurve2D → Shape
  34. def getX1(): Double
    Definition Classes
    Double → QuadCurve2D
  35. def getX2(): Double
    Definition Classes
    Double → QuadCurve2D
  36. def getY1(): Double
    Definition Classes
    Double → QuadCurve2D
  37. def getY2(): Double
    Definition Classes
    Double → QuadCurve2D
  38. def intersects(arg0: Rectangle2D): Boolean
    Definition Classes
    QuadCurve2D → Shape
  39. def intersects(arg0: Double, arg1: Double, arg2: Double, arg3: Double): Boolean
    Definition Classes
    QuadCurve2D → Shape
  40. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  41. def isSame(x: Double, y: Double, xe: Double, ye: Double, step: Double): Boolean

    Whether ('x', 'y') and ('xe', 'ye') are essentially the same.

  42. def length: Double

    Return the length of this QCurve.

  43. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  44. 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
    QCurveCurvilinearShape
  45. 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).

  46. final def notify(): Unit
    Definition Classes
    AnyRef
  47. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  48. var p1: R2
  49. var p2: R2
  50. var pc: R2
  51. def setCurve(arg0: Double, arg1: Double, arg2: Double, arg3: Double, arg4: Double, arg5: Double): Unit
    Definition Classes
    Double → QuadCurve2D
  52. def setCurve(arg0: QuadCurve2D): Unit
    Definition Classes
    QuadCurve2D
  53. def setCurve(arg0: Array[Point2D], arg1: Int): Unit
    Definition Classes
    QuadCurve2D
  54. def setCurve(arg0: Point2D, arg1: Point2D, arg2: Point2D): Unit
    Definition Classes
    QuadCurve2D
  55. def setCurve(arg0: Array[Double], arg1: Int): Unit
    Definition Classes
    QuadCurve2D
  56. 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
    QCurveCurvilinearShape
  57. 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
    QCurveCurvilinearShape
  58. 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
    QCurveCurvilinearShape
  59. def setSteps(_steps: Int): Unit

    Set the number of steps for tokens to take as move along the quad curve.

  60. var straight: Boolean
  61. def subdivide(arg0: QuadCurve2D, arg1: QuadCurve2D): Unit
    Definition Classes
    QuadCurve2D
  62. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  63. 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
  64. def traj: Double

    Get the current trajectory '_traj' of the curve.

  65. 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

  66. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from CurvilinearShape

Inherited from Error

Inherited from Double

Inherited from Serializable

Inherited from QuadCurve2D

Inherited from Cloneable

Inherited from Shape

Inherited from AnyRef

Inherited from Any

Ungrouped