C# Class Gearset.Components.CurveEditorControl.KeyWrapper

Wraps a CurveKey, giving it an ID and a reference to it's owner curve.
Datei anzeigen Open project: juancampa/Gearset Class Usage Examples

Public Properties

Property Type Description
latestId long

Public Methods

Method Description
ComputeTangentIfAuto ( ) : void

Computes the tangent of this key (if set to some automatic mode). It will also recomute the tangents of adjacent keys if they're also auto.

GetPosition ( ) : System.Windows.Point

Returns the position of the key in curve coords.

GetPrevAndNextDistance ( float &prev, float &next ) : void

Get distance between given index key position and previous/next key. Based on XNA's curve editor method.

GetTangentHandleScreenPositions ( System &inHandle, System &outHandle ) : void

Gets the positions of the tangent handles in screen coords.

IsTangentModeAuto ( KeyTangentMode tangentMode ) : bool

Returns true if the passed KeyTangentMode is automatically, i.e. it is supposed to be calculated everytime the key is moved.

KeyWrapper ( CurveKey curveKey, Gearset.Components.CurveEditorControl.CurveWrapper curve, KeyTangentMode tangentMode, long id = -1 ) : System

Initializes a KeyWrapper

MoveKey ( float positionOffset, float valueOffset ) : void

Moves the key by the given offset. It will actually remove the old key from the curve and add a new offseted curve.

Private Methods

Method Description
GetIndex ( ) : int
SetInTangent ( float tangent, bool computeTangents = true ) : void
SetOutTangent ( float tangent, bool computeTangents = true ) : void

Method Details

ComputeTangentIfAuto() public method

Computes the tangent of this key (if set to some automatic mode). It will also recomute the tangents of adjacent keys if they're also auto.
public ComputeTangentIfAuto ( ) : void
return void

GetPosition() public method

Returns the position of the key in curve coords.
public GetPosition ( ) : System.Windows.Point
return System.Windows.Point

GetPrevAndNextDistance() public method

Get distance between given index key position and previous/next key. Based on XNA's curve editor method.
public GetPrevAndNextDistance ( float &prev, float &next ) : void
prev float
next float
return void

GetTangentHandleScreenPositions() public method

Gets the positions of the tangent handles in screen coords.
public GetTangentHandleScreenPositions ( System &inHandle, System &outHandle ) : void
inHandle System
outHandle System
return void

IsTangentModeAuto() public method

Returns true if the passed KeyTangentMode is automatically, i.e. it is supposed to be calculated everytime the key is moved.
public IsTangentModeAuto ( KeyTangentMode tangentMode ) : bool
tangentMode KeyTangentMode
return bool

KeyWrapper() public method

Initializes a KeyWrapper
public KeyWrapper ( CurveKey curveKey, Gearset.Components.CurveEditorControl.CurveWrapper curve, KeyTangentMode tangentMode, long id = -1 ) : System
curveKey CurveKey The key to wrap
curve Gearset.Components.CurveEditorControl.CurveWrapper The curve that owns curveKey
tangentMode KeyTangentMode
id long Pass -1 to autogenerate a new id
return System

MoveKey() public method

Moves the key by the given offset. It will actually remove the old key from the curve and add a new offseted curve.
public MoveKey ( float positionOffset, float valueOffset ) : void
positionOffset float
valueOffset float
return void

Property Details

latestId public_oe static_oe property

public static long latestId
return long