scalation.scala2d

QCurve

case class QCurve(p1: R2, pc: R2, p2: R2, straight: Boolean) 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. Hide All
  2. Show all
  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
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 = new scalation.scala2d.R2(0.0, 0.0), pc: R2 = new scalation.scala2d.R2(0.0, 0.0), p2: R2 = new scalation.scala2d.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: 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 canEqual(arg0: Any): Boolean

    Definition Classes
    QCurve → Equals
  8. def clone(): AnyRef

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

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

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

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

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

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    QCurve → Equals → AnyRef → Any
  15. 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

  16. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  17. 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
  18. def getBounds(): Rectangle

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

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

    Definition Classes
    AnyRef → Any
  23. def getControl: R2

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Get the control point of the quad curve.

  24. def getCtrlPt(): Point2D

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

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

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

  28. def getFirst: R2

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Get the first/start point of the quad curve.

  29. def getFlatness(): Double

    Definition Classes
    QuadCurve2D
  30. def getFlatnessSq(): Double

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

  32. def getLast: R2

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

  33. def getP1(): Point2D

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

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

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

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

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

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

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

    Definition Classes
    Double → QuadCurve2D
  41. def hashCode(): Int

    Definition Classes
    QCurve → AnyRef → Any
  42. def intersects(arg0: Rectangle2D): Boolean

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

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

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

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

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

    Definition Classes
    AnyRef
  47. 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
  48. 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).

  49. final def notify(): Unit

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

    Definition Classes
    AnyRef
  51. var p1: R2

    the starting point for the quad curve

  52. var p2: R2

    the ending point for the quad curve

  53. var pc: R2

    the control point for the quad curve

  54. def productArity: Int

    Definition Classes
    QCurve → Product
  55. def productElement(arg0: Int): Any

    Definition Classes
    QCurve → Product
  56. def productIterator: Iterator[Any]

    Definition Classes
    Product
  57. def productPrefix: String

    Definition Classes
    QCurve → Product
  58. def setCurve(arg0: Double, arg1: Double, arg2: Double, arg3: Double, arg4: Double, arg5: Double): Unit

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

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

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

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

    Definition Classes
    QuadCurve2D
  63. 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
  64. def setLine(_p1: R2, _p2: R2, bend: Double): Unit

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Set (or reset) the location for the QCurve as a curve using bend to compute the control point.

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Set (or reset) the location for the QCurve as a curve using bend to compute the control point.

    _p1

    the starting point

    _p2

    the ending point

    bend

    the bend or curvature (1. => line-length)

    Definition Classes
    QCurveCurvilinearShape
  65. 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
  66. def setSteps(_steps: Int): Unit

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

  67. var straight: Boolean

    whether the quad curve is straight (i.

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

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

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

    Definition Classes
    AnyRef
  70. 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
  71. final def wait(): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  73. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def productElements: Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    (Since version 2.8.0) use productIterator instead

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