edu.neu.ccs.gui
Interface Tangent.Strategy

Enclosing interface:
Tangent

public static interface Tangent.Strategy

The Strategy interface requires methods that return the tangent array for a closed or open Bezier curve from its vertex array and, if needed, its end tangent data.


Method Summary
 float[][] makeTangents(float[][] vertex)
          Returns the tangent array for a closed Bezier curve corresponding to the given vertex array using the encapsulated vertex-to-tangent strategy.
 float[][] makeTangents(float[][] vertex, float[][] endTangent)
          Returns the tangent array for an open Bezier curve corresponding to the given vertex array and the given endTangent data using the encapsulated vertex-to-tangent strategy.
 

Method Detail

makeTangents

public float[][] makeTangents(float[][] vertex)

Returns the tangent array for a closed Bezier curve corresponding to the given vertex array using the encapsulated vertex-to-tangent strategy.

Precondition: For some integer N >= 0:

Postcondition: For the same integer N:

If the vertex array fails its precondition then the method should return float[0][2].

Parameters:
vertex - the vertex array of a closed curve
Returns:
the associated tangent array constructed using the strategy

makeTangents

public float[][] makeTangents(float[][] vertex,
                              float[][] endTangent)

Returns the tangent array for an open Bezier curve corresponding to the given vertex array and the given endTangent data using the encapsulated vertex-to-tangent strategy.

Precondition 1. For some integer N >= 0:

Precondition 2.

Postcondition 1. For the same integer N:

Postcondition 2: If the endTangent array is null, then the function should return makeTangents(vertex).

Postcondition 3: If the endTangent array is non-null:

If the vertex array fails its precondition then the method should return float[0][2].

If the endTangent array fails its precondition then it should be treated as if it were null.

Parameters:
vertex - the vertex array of an open curve
endTangent - the tangent data for the ends of the open curve
Returns:
the associated tangent array constructed using the strategy