Click or drag to resize
DigitalRuneCurve2F Class
Represents a 2-dimensional curve that is used to define a function y = f(x) (single-precision).
Inheritance Hierarchy
SystemObject
  System.Collections.ObjectModelCollectionCurveKey2F
    DigitalRune.Mathematics.InterpolationPiecewiseCurveSingle, Vector2F, CurveKey2F
      DigitalRune.Mathematics.InterpolationPiecewiseCurveFVector2F, CurveKey2F
        DigitalRune.Mathematics.InterpolationCurve2F

Namespace: DigitalRune.Mathematics.Interpolation
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
[SerializableAttribute]
public class Curve2F : PiecewiseCurveF<Vector2F, CurveKey2F>, 
	IXmlSerializable

The Curve2F type exposes the following members.

Constructors
  NameDescription
Public methodCurve2F
Initializes a new instance of the Curve2F class
Top
Methods
  NameDescription
Public methodAdd (Inherited from CollectionCurveKey2F.)
Public methodClear (Inherited from CollectionCurveKey2F.)
Protected methodClearItems (Inherited from CollectionCurveKey2F.)
Public methodContains (Inherited from CollectionCurveKey2F.)
Public methodCopyTo (Inherited from CollectionCurveKey2F.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFlatten
Not supported.
(Overrides PiecewiseCurveTParam, TPoint, TCurveKeyFlatten(ICollectionTPoint, Int32, TParam).)
Public methodGetEnumerator (Inherited from PiecewiseCurveTParam, TPoint, TCurveKey.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetKeyIndex
Gets the index of the curve key before or at the given parameter value.
(Inherited from PiecewiseCurveFTPoint, TCurveKey.)
Public methodGetLength
Not supported.
(Overrides PiecewiseCurveTParam, TPoint, TCurveKeyGetLength(TParam, TParam, Int32, TParam).)
Public methodGetPoint
Computes a point on the curve.
(Overrides PiecewiseCurveTParam, TPoint, TCurveKeyGetPoint(TParam).)
Public methodGetTangent
Computes the tangent for a point on the curve.
(Overrides PiecewiseCurveTParam, TPoint, TCurveKeyGetTangent(TParam).)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf (Inherited from CollectionCurveKey2F.)
Public methodInsert (Inherited from CollectionCurveKey2F.)
Protected methodInsertItem (Inherited from PiecewiseCurveTParam, TPoint, TCurveKey.)
Public methodIsInMirroredOscillation
Determines whether the given parameter corresponds to a mirrored oscillation loop.
(Inherited from PiecewiseCurveFTPoint, TCurveKey.)
Public methodLoopParameter
Handles pre- and post-looping by changing the given parameter so that it lies on the curve.
(Inherited from PiecewiseCurveFTPoint, TCurveKey.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodReadXml
Generates an object from its XML representation.
(Inherited from PiecewiseCurveTParam, TPoint, TCurveKey.)
Public methodRemove (Inherited from CollectionCurveKey2F.)
Public methodRemoveAt (Inherited from CollectionCurveKey2F.)
Protected methodRemoveItem (Inherited from CollectionCurveKey2F.)
Protected methodSetItem
Replaces the element at the specified index.
(Inherited from PiecewiseCurveTParam, TPoint, TCurveKey.)
Public methodSort
Sorts the curve keys in the collection by their parameter (see Parameter).
(Inherited from PiecewiseCurveTParam, TPoint, TCurveKey.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodWriteXml
Converts an object into its XML representation.
(Inherited from PiecewiseCurveTParam, TPoint, TCurveKey.)
Top
Properties
  NameDescription
Public propertyCount (Inherited from CollectionCurveKey2F.)
Public propertyItem
Gets or sets the element at the specified index.
(Inherited from CollectionCurveKey2F.)
Protected propertyItems (Inherited from CollectionCurveKey2F.)
Public propertyPostLoop
Gets or sets a value that defines how the curve looks after the last curve key.
(Inherited from PiecewiseCurveTParam, TPoint, TCurveKey.)
Public propertyPreLoop
Gets or sets a value that defines how the curve looks before the first path key.
(Inherited from PiecewiseCurveTParam, TPoint, TCurveKey.)
Public propertySmoothEnds
Gets or sets a value indicating whether the curve ends are smoothed.
(Inherited from PiecewiseCurveTParam, TPoint, TCurveKey.)
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate methodIXmlSerializableGetSchema
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return from this method, and instead, if specifying a custom schema is required, apply the XmlSchemaProviderAttribute to the class.
Explicit interface implementationPrivate methodIXmlSerializableReadXml
Generates an object from its XML representation.
Explicit interface implementationPrivate methodIXmlSerializableWriteXml
Converts an object into its XML representation.
Explicit interface implementationPrivate methodIListAdd
Adds an item to the IList.
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate methodIListContains
Determines whether the IList contains a specific value.
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate methodICollectionCopyTo
Copies the elements of the ICollection to an Array, starting at a particular Array index.
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate methodIEnumerableGetEnumerator
Returns an enumerator that iterates through a collection.
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate methodIListIndexOf
Determines the index of a specific item in the IList.
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate methodIListInsert
Inserts an item into the IList at the specified index.
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate propertyIListIsFixedSize
Gets a value indicating whether the IList has a fixed size.
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate propertyICollectionTIsReadOnly (Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate propertyIListIsReadOnly
Gets a value indicating whether the IList is read-only.
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate propertyICollectionIsSynchronized
Gets a value indicating whether access to the ICollection is synchronized (thread safe).
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate propertyIListItem
Gets or sets the element at the specified index.
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate methodIListRemove
Removes the first occurrence of a specific object from the IList.
(Inherited from CollectionCurveKey2F.)
Explicit interface implementationPrivate propertyICollectionSyncRoot
Gets an object that can be used to synchronize access to the ICollection.
(Inherited from CollectionCurveKey2F.)
Top
Remarks

In contrast to general curves, the Curve2F is a specialized type of curve that is used to define a function y = f(x).

A general curve is function of the form p = C(u). The curve parameter u is a scalar. The result of C(u) is a point p on the curve. In the 2-dimensional case (see Path2F) the function can be written as (x, y) = C(u).

The Curve2F is a special type of curve where the curve parameter and the x-component of the resulting points are identical: (x, y) = C(x).

Application: A Curve2F can be used to define an animation curve. An animation curve describes how a quantity y (size, offset, etc.) evolves over time. the curve parameter is typically time. These curves must be monotonic in the parameter axis (x-axis). There can only be one valid y value for each curve parameter x.

Curve Keys: The curve keys (CurveKey2F) define the control points of the curve. The parameter of the curve keys (see Parameter) are always identical to the x-component of the points (see Point). Therefore, it is not necessary to set the curve parameter manually.

The curve keys are interpolated using spline interpolation. Each curve key defines the type of spline interpolation that is used from this curve key to the next (see Interpolation). Some types of interpolation require additional information: Bezier requires additional control points and Hermite requires tangents. These values are stored in the properties TangentIn and TangentOut of the curve keys.

It is possible to specify invalid control points or tangents. Neither Curve2F nor CurveKey2F checks whether the values in TangentIn or TangentOut are a valid. In general, the results are undefined if a curve contains invalid tangents.

See Also