public class

Curve

extends Element
java.lang.Object
   ↳ casmi.graphics.element.Element
     ↳ casmi.graphics.element.Curve

Class Overview

Curve class. Wrap JOGL and make it easy to use.

Summary

Nested Classes
enum Curve.XYZ  
[Expand]
Inherited Fields
From class casmi.graphics.element.Element
Public Constructors
Curve(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
Creates a new Curve object using coordinates for the anchor and control points.
Curve(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
Creates a new Curve object using coordinates for the anchor and control points.
Curve(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)
Creates a new Curve object using coordinates for the anchor and control points.
Curve(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4)
Creates a new Curve object using coordinates for the anchor and control points.
Curve(Vector3D v1, Vector3D v2, Vector3D v3, Vector3D v4)
Creates a new Curve object using coordinates for the anchor and control points.
Public Methods
double curvePoint(Curve.XYZ vec, float t)
Evaluates the curve at point t.
int getDetail()
Gets the detail of this Curve.
void render(GL2 gl, GLU glu, int width, int height, boolean selection)
void reset(GL2 gl)
void set(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
Sets coordinates for the anchor and control points.
void set(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
Sets coordinates for the anchor and control points.
void set(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)
Sets coordinates for the anchor and control points.
void set(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4)
Sets coordinates for the anchor and control points.
void set(Vector3D v1, Vector3D v2, Vector3D v3, Vector3D v4)
Sets coordinates for the anchor and control points.
void setAnchorColor(int index, ColorSet colorSet)
Sets the colorSet of the anchor point for gradation.
void setAnchorColor(int index, Color color)
Sets the color of the anchor point for gradation.
void setDetail(int detail)
Sets the detail of this Curve.
void setNode(int number, double x, double y, double z)
Sets x,y,z-coordinate of nodes of this Curve.
void setNode(int number, Vector3D v)
Sets coordinate of nodes of this Curve.
void setNode(int number, double x, double y)
Sets x,y,z-coordinate of nodes of this Curve.
[Expand]
Inherited Methods
From class casmi.graphics.element.Element
From class java.lang.Object
From interface casmi.graphics.object.Renderable
From interface casmi.graphics.object.Resettable

Public Constructors

public Curve (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)

Creates a new Curve object using coordinates for the anchor and control points.

Parameters
x1 The coordinate x for the first anchor point.
y1 The coordinate y for the first anchor point.
x2 The coordinate x for the first control point.
y2 The coordinate y for the first control point.
x3 The coordinate x for the second control point.
y3 The coordinate y for the second control point.
x4 The coordinate x for the second anchor point.
y4 The coordinate y for the second anchor point.

public Curve (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)

Creates a new Curve object using coordinates for the anchor and control points.

Parameters
x1 The coordinate x for the first anchor point.
y1 The coordinate y for the first anchor point.
x2 The coordinate x for the first control point.
y2 The coordinate y for the first control point.
x3 The coordinate x for the second control point.
y3 The coordinate y for the second control point.
x4 The coordinate x for the second anchor point.
y4 The coordinate y for the second anchor point.

public Curve (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)

Creates a new Curve object using coordinates for the anchor and control points.

Parameters
x1 The coordinate x for the first anchor point.
y1 The coordinate y for the first anchor point.
z1 The coordinate z for the first anchor point.
x2 The coordinate x for the first control point.
y2 The coordinate y for the first control point.
z2 The coordinate z for the first control point.
x3 The coordinate x for the second control point.
y3 The coordinate y for the second control point.
z3 The coordinate z for the second control point.
x4 The coordinate x for the second anchor point.
y4 The coordinate y for the second anchor point.
z4 The coordinate z for the second anchor point.

public Curve (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4)

Creates a new Curve object using coordinates for the anchor and control points.

Parameters
x1 The coordinate x for the first anchor point.
y1 The coordinate y for the first anchor point.
z1 The coordinate z for the first anchor point.
x2 The coordinate x for the first control point.
y2 The coordinate y for the first control point.
z2 The coordinate z for the first control point.
x3 The coordinate x for the second control point.
y3 The coordinate y for the second control point.
z3 The coordinate z for the second control point.
x4 The coordinate x for the second anchor point.
y4 The coordinate y for the second anchor point.
z4 The coordinate z for the second anchor point.

public Curve (Vector3D v1, Vector3D v2, Vector3D v3, Vector3D v4)

Creates a new Curve object using coordinates for the anchor and control points.

Parameters
v1 The coordinates for the first anchor point.
v2 The coordinates for the first control point.
v3 The coordinates for the second control point.
v4 The coordinates for the second ancor point.

Public Methods

public double curvePoint (Curve.XYZ vec, float t)

Evaluates the curve at point t.

Parameters
vec The coordinate to get the location of a curve at t.
t value between 0 and 1

public int getDetail ()

Gets the detail of this Curve.

Returns
  • The detail of the Curve.

public void render (GL2 gl, GLU glu, int width, int height, boolean selection)

public void reset (GL2 gl)

public void set (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)

Sets coordinates for the anchor and control points.

Parameters
x1 The coordinate x for the first anchor point.
y1 The coordinate y for the first anchor point.
x2 The coordinate x for the first control point.
y2 The coordinate y for the first control point.
x3 The coordinate x for the second control point.
y3 The coordinate y for the second control point.
x4 The coordinate x for the second anchor point.
y4 The coordinate y for the second anchor point.

public void set (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)

Sets coordinates for the anchor and control points.

Parameters
x1 The coordinate x for the first anchor point.
y1 The coordinate y for the first anchor point.
x2 The coordinate x for the first control point.
y2 The coordinate y for the first control point.
x3 The coordinate x for the second control point.
y3 The coordinate y for the second control point.
x4 The coordinate x for the second anchor point.
y4 The coordinate y for the second anchor point.

public void set (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)

Sets coordinates for the anchor and control points.

Parameters
x1 The coordinate x for the first anchor point.
y1 The coordinate y for the first anchor point.
z1 The coordinate z for the first anchor point.
x2 The coordinate x for the first control point.
y2 The coordinate y for the first control point.
z2 The coordinate z for the first control point.
x3 The coordinate x for the second control point.
y3 The coordinate y for the second control point.
z3 The coordinate z for the second control point.
x4 The coordinate x for the second anchor point.
y4 The coordinate y for the second anchor point.
z4 The coordinate z for the second anchor point.

public void set (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4)

Sets coordinates for the anchor and control points.

Parameters
x1 The coordinate x for the first anchor point.
y1 The coordinate y for the first anchor point.
z1 The coordinate z for the first anchor point.
x2 The coordinate x for the first control point.
y2 The coordinate y for the first control point.
z2 The coordinate z for the first control point.
x3 The coordinate x for the second control point.
y3 The coordinate y for the second control point.
z3 The coordinate z for the second control point.
x4 The coordinate x for the second anchor point.
y4 The coordinate y for the second anchor point.
z4 The coordinate z for the second anchor point.

public void set (Vector3D v1, Vector3D v2, Vector3D v3, Vector3D v4)

Sets coordinates for the anchor and control points.

Parameters
v1 The coordinates for the first anchor point.
v2 The coordinates for the first control point.
v3 The coordinates for the second control point.
v4 The coordinates for the second ancor point.

public void setAnchorColor (int index, ColorSet colorSet)

Sets the colorSet of the anchor point for gradation.

Parameters
index The index of anchors. The index of the start anchor point is 0, the index of the end anchor point is 1.
colorSet The colorSet of the anchor point.

public void setAnchorColor (int index, Color color)

Sets the color of the anchor point for gradation.

Parameters
index The index of anchors. The index of the start anchor point is 0, the index of the end anchor point is 1.
color The color of the anchor point.

public void setDetail (int detail)

Sets the detail of this Curve.

Parameters
detail The detail of the Curve.

public void setNode (int number, double x, double y, double z)

Sets x,y,z-coordinate of nodes of this Curve.

Parameters
number The number of a node. The node whose number is 0 or 3 is a anchor point, and the node whose number is 1 or 2 is a control point.
x The x-coordinate of this node.
y The y-coordinate of this node.
z The y-coordinate of this node.

public void setNode (int number, Vector3D v)

Sets coordinate of nodes of this Curve.

Parameters
number The number of a node. The node whose number is 0 or 3 is a anchor point, and the node whose number is 1 or 2 is a control point.
v The coordinates of this node.

public void setNode (int number, double x, double y)

Sets x,y,z-coordinate of nodes of this Curve.

Parameters
number The number of a node. The node whose number is 0 or 3 is a anchor point, and the node whose number is 1 or 2 is a control point.
x The x-coordinate of this node.
y The y-coordinate of this node.