Class Curve

  • All Implemented Interfaces:
    java.lang.Iterable<KeyFrame>

    public class Curve
    extends A3DObject
    implements java.lang.Iterable<KeyFrame>
    A curve is composed by several key-frames, it describes the transformation of a sampled value over time, so it's a 2D curve.
    • Constructor Summary

      Constructors 
      Constructor Description
      Curve()
      Initializes a new instance of the Curve class.
      Curve​(java.lang.String name)
      Initializes a new instance of the Curve class.
    • Method Summary

      Modifier and Type Method Description
      void add​(double time, float value)
      Create a new key frame with specified value
      void add​(double time, float value, Interpolation interpolation)
      Create a new key frame with specified value
      CurveMapping getCurveMapping()
      Gets the curve mapping which owns this curve
      java.util.List<KeyFrame> getKeyFrames()
      Gets the key frames of this curve.
      Extrapolation getPostBehavior()
      Gets the post behavior indicates what the sampled value should be after the last key frame.
      Extrapolation getPreBehavior()
      Gets the pre behavior indicates what the sampled value should be before the first key.
      java.util.Iterator<KeyFrame> iterator()
      Gets the enumerator to traverse all key frames.
      void reset()
      Removes all key frames and reset the post/pre behaviors.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • Curve

        public Curve​(java.lang.String name)
        Initializes a new instance of the Curve class.
        Parameters:
        name - Name
      • Curve

        public Curve()
        Initializes a new instance of the Curve class.
    • Method Detail

      • getCurveMapping

        public CurveMapping getCurveMapping()
        Gets the curve mapping which owns this curve
      • getKeyFrames

        public java.util.List<KeyFrame> getKeyFrames()
        Gets the key frames of this curve.
      • getPostBehavior

        public Extrapolation getPostBehavior()
        Gets the post behavior indicates what the sampled value should be after the last key frame.
      • getPreBehavior

        public Extrapolation getPreBehavior()
        Gets the pre behavior indicates what the sampled value should be before the first key.
      • add

        public void add​(double time,
                        float value)
        Create a new key frame with specified value
        Parameters:
        time - Time position(measured in seconds)
        value - The value at this time position
      • add

        public void add​(double time,
                        float value,
                        Interpolation interpolation)
        Create a new key frame with specified value
        Parameters:
        time - Time position(measured in seconds)
        value - The value at this time position
        interpolation - The interpolation type of this key frame
      • reset

        public void reset()
        Removes all key frames and reset the post/pre behaviors.
      • iterator

        public java.util.Iterator<KeyFrame> iterator()
        Gets the enumerator to traverse all key frames.
        Specified by:
        iterator in interface java.lang.Iterable<KeyFrame>