scalation.scala2d

QCurve

case class QCurve(p1: R2 = R2.apply(0.0, 0.0), pc: R2 = R2.apply(0.0, 0.0), p2: R2 = R2.apply(0.0, 0.0), straight: Boolean = true) extends Double with CurvilinearShape with Error 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
Learn more about member selection
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.apply(0.0, 0.0), pc: R2 = R2.apply(0.0, 0.0), p2: R2 = R2.apply(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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Definition Classes
    QuadCurve2D → AnyRef
  8. def contains(arg0: Rectangle2D): Boolean

    Definition Classes
    QuadCurve2D → Shape
  9. def contains(arg0: Double, arg1: Double, arg2: Double, arg3: Double): Boolean

    Definition Classes
    QuadCurve2D → Shape
  10. def contains(arg0: Point2D): Boolean

    Definition Classes
    QuadCurve2D → Shape
  11. def contains(arg0: Double, arg1: Double): Boolean

    Definition Classes
    QuadCurve2D → Shape
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def eval(): R2

    Given a value for the trajectory parameter t (in [0.

    Given a value for the trajectory parameter t (in [0., 1.]) calculate the point on the curve using the Quadratic Bezier equation. See http://en.wikipedia.org/wiki/Bézier_curve#Quadratic_curves

  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. 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
  16. def getBounds(): java.awt.Rectangle

    Definition Classes
    QuadCurve2D → Shape
  17. def getBounds2D(): Rectangle2D

    Definition Classes
    Double → Shape
  18. 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
  19. 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
  20. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  21. def getControl: R2

    Get the control point of the quad curve.

  22. def getCtrlPt(): Point2D

    Definition Classes
    Double → QuadCurve2D
  23. def getCtrlX(): Double

    Definition Classes
    Double → QuadCurve2D
  24. def getCtrlY(): Double

    Definition Classes
    Double → QuadCurve2D
  25. 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

  26. def getFirst: R2

    Get the first/start point of the quad curve.

  27. def getFlatness(): Double

    Definition Classes
    QuadCurve2D
  28. def getFlatnessSq(): Double

    Definition Classes
    QuadCurve2D
  29. 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

  30. def getLast: R2

    Get the last/end point of the quad curve.

  31. def getP1(): Point2D

    Definition Classes
    Double → QuadCurve2D
  32. def getP2(): Point2D

    Definition Classes
    Double → QuadCurve2D
  33. def getPathIterator(arg0: AffineTransform, arg1: Double): PathIterator

    Definition Classes
    QuadCurve2D → Shape
  34. def getPathIterator(arg0: AffineTransform): PathIterator

    Definition Classes
    QuadCurve2D → Shape
  35. def getX1(): Double

    Definition Classes
    Double → QuadCurve2D
  36. def getX2(): Double

    Definition Classes
    Double → QuadCurve2D
  37. def getY1(): Double

    Definition Classes
    Double → QuadCurve2D
  38. def getY2(): Double

    Definition Classes
    Double → QuadCurve2D
  39. def intersects(arg0: Rectangle2D): Boolean

    Definition Classes
    QuadCurve2D → Shape
  40. def intersects(arg0: Double, arg1: Double, arg2: Double, arg3: Double): Boolean

    Definition Classes
    QuadCurve2D → Shape
  41. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  42. def isSame(x: Double, y: Double, xe: Double, ye: Double, step: Double): Boolean

    Are (x, y) and (xe, ye) essentially the same?

  43. def length: Double

    Return the length of this QCurve

  44. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  45. 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. (i.e., past end point).

    width

    the width of object traversing the curve

    height

    the height of object traversing the curve

    Definition Classes
    QCurveCurvilinearShape
  46. 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. (i.e., past end point).

  47. final def notify(): Unit

    Definition Classes
    AnyRef
  48. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  49. var p1: R2

    the starting point for the quad curve

  50. var p2: R2

    the ending point for the quad curve

  51. var pc: R2

    the control point for the quad curve

  52. def setCurve(arg0: Double, arg1: Double, arg2: Double, arg3: Double, arg4: Double, arg5: Double): Unit

    Definition Classes
    Double → QuadCurve2D
  53. def setCurve(arg0: QuadCurve2D): Unit

    Definition Classes
    QuadCurve2D
  54. def setCurve(arg0: Array[Point2D], arg1: Int): Unit

    Definition Classes
    QuadCurve2D
  55. def setCurve(arg0: Point2D, arg1: Point2D, arg2: Point2D): Unit

    Definition Classes
    QuadCurve2D
  56. def setCurve(arg0: Array[Double], arg1: Int): Unit

    Definition Classes
    QuadCurve2D
  57. 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
  58. 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
  59. 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
  60. def setSteps(_steps: Int): Unit

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

  61. def setTrajectory(traj: Double): Unit

    Set the trajectory (t) to a new value.

    Set the trajectory (t) to a new value.

    traj

    the new trajectory for the curve

  62. var straight: Boolean

    whether the quad curve is straight (i.

    whether the quad curve is straight (i.e., a line)

  63. def subdivide(arg0: QuadCurve2D, arg1: QuadCurve2D): Unit

    Definition Classes
    QuadCurve2D
  64. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  65. 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
  66. def trajectory: Double

    Return the current trajectory (t) of the curve.

  67. final def wait(): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  69. 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