go
Class GoVertex

java.lang.Object
  |
  +--go.GoVertex
Direct Known Subclasses:
GoLineLoop, GoLines, GoLineStrip, GoPoints, GoTriangleFan, GoTriangles, GoTriangleStrip

public abstract class GoVertex
extends java.lang.Object


Constructor Summary
GoVertex(int vertexNumber)
          Abstract constructor for primitive vertex data (see render).
GoVertex(int vertexNumber, int flags)
          Abstract constructor for primitive vertex data (see render).
 
Method Summary
 boolean append(int vertexNumber)
          Append more vertices after the current last vertex index.
 double b(int index)
          Returns the b value of the color at the specified vertex index.
 void b(int index, double b)
          Sets the b value of the color at the specified vertex index.
 int flags()
          Returns the flags' bits indicating the inclusion/absence of color and normal information.
 double g(int index)
          Returns the g value of the color at the specified vertex index.
 void g(int index, double g)
          Sets the g value of the color at the specified vertex index.
 double i(int index)
          Returns the i value of the normal at the specified vertex index.
 void i(int index, double i)
          Sets the i value of the normal at the specified vertex index.
 void ijk(int index, double i, double j, double k)
          Sets the normal at the specified vertex index.
 boolean insert(int index, int vertexNumber)
          Insert more vertices before the specified vertex index.
 double j(int index)
          Returns the j value of the normal at the specified vertex index.
 void j(int index, double j)
          Sets the j value of the normal at the specified vertex index.
 double k(int index)
          Returns the k value of the normal at the specified vertex index.
 void k(int index, double k)
          Sets the k value of the normal at the specified vertex index.
 double r(int index)
          Returns the r value of the color at the specified vertex index.
 void r(int index, double r)
          Sets the r value of the color at the specified vertex index.
 boolean remove(int index, int vertexNumber)
          Remove specified vertices.
 void rgb(int index, double r, double g, double b)
          Sets the color at the specified vertex index.
 int vertexNumber()
          Returns the number of vertices included in this set.
 double x(int index)
          Returns the x value of the coordinate at the specified vertex index.
 void x(int index, double x)
          Sets the x value of the coordinate at the specified vertex index.
 void xyz(int index, double x, double y, double z)
          Sets the coordinate at the specified vertex index.
 double y(int index)
          Returns the y value of the coordinate at the specified vertex index.
 void y(int index, double y)
          Sets the y value of the coordinate at the specified vertex index.
 double z(int index)
          Returns the z value of the coordinate at the specified vertex index.
 void z(int index, double z)
          Sets the z value of the coordinate at the specified vertex index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GoVertex

public GoVertex(int vertexNumber)
Abstract constructor for primitive vertex data (see render).

Equivalent to:

GoVertex(vertexNumber, Go.NONE)

GoVertex

public GoVertex(int vertexNumber,
                int flags)
Abstract constructor for primitive vertex data (see render).

The number of vertices to be created is indicated with vertexNumber.

Color and normal information can also be included for each vertex as indicated with flags.

Possible values for flags are any or'ed combination of:

COLOR
Include per vertex color information. If this flag is not set, the current color (see color) will be used at each vertex instead.
NORMAL
Include per vertex normal information to apply lighting (see light(number, enabled) and light(number, light) for information on enabling and setting up lights).
AUTO_NORMAL
Automatically calculate per vertex normals to apply lighting (see light(number, enabled) and light(number, light) for information on enabling and setting up lights). This will cause flat shading and is mostly used for prototyping. If smoother shading is desired, user defined normals should be supplied (i.e. use the Go.NORMAL flag rather than this Go.AUTO_NORMAL flag).

This flag is only recognized with GoTriangles, GoTriangleStrip and GoTriangleFan primitives.

Go.NONE
No per vertex color or normal information.
Method Detail

vertexNumber

public int vertexNumber()
Returns the number of vertices included in this set.

flags

public int flags()
Returns the flags' bits indicating the inclusion/absence of color and normal information.

The return value can be used to check for the following:

Go.COLOR
If included then (flags() & COLOR) > 0 must yield true.
Go.NORMAL
If included then (flags() & NORMAL) > 0 must yield true.
Go.AUTO_NORMAL
If included then (flags() & AUTO_NORMAL) > 0 must yield true.

append

public boolean append(int vertexNumber)
Append more vertices after the current last vertex index.

The number of vertices to append is specified with vertexNumber.


insert

public boolean insert(int index,
                      int vertexNumber)
Insert more vertices before the specified vertex index.

The new vertices are inserted before index.

The number of vertices to insert is specified with vertexNumber.


remove

public boolean remove(int index,
                      int vertexNumber)
Remove specified vertices.

Vertex removal starts at index.

The number of vertices to be removed is specified with vertexNumber


xyz

public final void xyz(int index,
                      double x,
                      double y,
                      double z)
Sets the coordinate at the specified vertex index.

The coordinate at index is set to (x, y, z).


x

public final void x(int index,
                    double x)
Sets the x value of the coordinate at the specified vertex index.

The x value of the coordinate at index is set to x.


y

public final void y(int index,
                    double y)
Sets the y value of the coordinate at the specified vertex index.

The y value of the coordinate at index is set to y.


z

public final void z(int index,
                    double z)
Sets the z value of the coordinate at the specified vertex index.

The z value of the coordinate at index is set to z.


x

public final double x(int index)
Returns the x value of the coordinate at the specified vertex index.

The x value of the coordinate at index is returned.


y

public final double y(int index)
Returns the y value of the coordinate at the specified vertex index.

The y value of the coordinate at index is returned.


z

public final double z(int index)
Returns the z value of the coordinate at the specified vertex index.

The z value of the coordinate at index is returned.


rgb

public final void rgb(int index,
                      double r,
                      double g,
                      double b)
Sets the color at the specified vertex index.

The color at index is set to (r, g, b).


r

public final void r(int index,
                    double r)
Sets the r value of the color at the specified vertex index.

The r value of the color at index is set to r.


g

public final void g(int index,
                    double g)
Sets the g value of the color at the specified vertex index.

The g value of the color at index is set to g.


b

public final void b(int index,
                    double b)
Sets the b value of the color at the specified vertex index.

The b value of the color at index is set to b.


r

public final double r(int index)
Returns the r value of the color at the specified vertex index.

The r value of the color at index is returned.


g

public final double g(int index)
Returns the g value of the color at the specified vertex index.

The g value of the color at index is returned.


b

public final double b(int index)
Returns the b value of the color at the specified vertex index.

The b value of the color at index is returned.


ijk

public final void ijk(int index,
                      double i,
                      double j,
                      double k)
Sets the normal at the specified vertex index.

The normal at index is set to (i, j, k).


i

public final void i(int index,
                    double i)
Sets the i value of the normal at the specified vertex index.

The i value of the normal at index is set to i.


j

public final void j(int index,
                    double j)
Sets the j value of the normal at the specified vertex index.

The j value of the normal at index is set to j.


k

public final void k(int index,
                    double k)
Sets the k value of the normal at the specified vertex index.

The k value of the normal at index is set to k.


i

public final double i(int index)
Returns the i value of the normal at the specified vertex index.

The i value of the normal at index is returned.


j

public final double j(int index)
Returns the j value of the normal at the specified vertex index.

The j value of the normal at index is returned.


k

public final double k(int index)
Returns the k value of the normal at the specified vertex index.

The k value of the normal at index is returned.