com.motorola.iden.micro3d
Class Line

java.lang.Object
  |
  +--com.motorola.iden.micro3d.Object3D
        |
        +--com.motorola.iden.micro3d.Primitive
              |
              +--com.motorola.iden.micro3d.Line

public class Line
extends Primitive

Line primitive. The Line primitive is a line connecting two points with a single pixel width. Only the color and the blending type can be specified for a line. If a texture or a sphere texture is assigned to a Line object, it will be ignored and will not affect rendering. Line also will not be affected by the lighting parameters. Color key transparency is not applicable to a line.

A line is defined by two Vector3D objects which contain the coordinates of the start point and end point of the line. Therefore the only valid vertex IDs for the Line are Primitive.VERTEX_A and Primitive.VERTEX_B, where the vertex A is the start point and vertex B is the end point of the line. It is not possible to assign a vertex normal or a face normal to a point.


MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
© COPYRIGHT 2003-2004 MOTOROLA, Inc. All Rights Reserved.


Fields inherited from class com.motorola.iden.micro3d.Primitive
BLENDING_ADD, BLENDING_HALF, BLENDING_NONE, BLENDING_SUB, FACE_NORMAL, NORMAL, VERTEX_A, VERTEX_B, VERTEX_C, VERTEX_D
 
Constructor Summary
Line(Vector3D vertexA, Vector3D vertexB, Layout3D layout, int color)
          Creates a Line primitive starting at the position described by vertexA and ending at the position described by vertexB.
 
Method Summary
 Vector3D getVector(int vectorID)
          Returns the Vector3D for the specified vector.
 void setVector(int vectorID, Vector3D vector)
          Sets the specified vertex to the Vector3D provided.
 
Methods inherited from class com.motorola.iden.micro3d.Primitive
enableColorKeyTransparency, getBlendingType, getColor, hasColorKeyTransparency, setBlendingType, setColor
 
Methods inherited from class com.motorola.iden.micro3d.Object3D
getLayout, getSphereTexture, getTexture, setLayout, setSphereTexture, setTexture
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Line

public Line(Vector3D vertexA,
            Vector3D vertexB,
            Layout3D layout,
            int color)
     throws java.lang.NullPointerException
Creates a Line primitive starting at the position described by vertexA and ending at the position described by vertexB. The Line will be rendered using the color and Layout3D provided. If the Layout3D is null the line will not be rendered. The specified vertices cannot be null. See Graphics for information on specifying RGB values.

Parameters:
vertexA - the starting vertex for the line.
vertexB - the ending vertex for the line.
layout - the Layout3D to use to render this Line.
color - the color to render this line with.
Throws:
java.lang.NullPointerException - if any of the specified vertices is null.
See Also:
Graphics
Method Detail

getVector

public Vector3D getVector(int vectorID)
                   throws java.lang.IllegalArgumentException
Returns the Vector3D for the specified vector. Line only supports the Primitive.VERTEX_A and Primitive.VERTEX_B vector identifiers.

Overrides:
getVector in class Primitive
Parameters:
vectorID - the ID of the vector to return.
Returns:
the Vector3D for the specified vertex.
Throws:
java.lang.IllegalArgumentException - if an invalid vectorID is specified.
See Also:
Primitive.VERTEX_A, Primitive.VERTEX_B

setVector

public void setVector(int vectorID,
                      Vector3D vector)
               throws java.lang.NullPointerException,
                      java.lang.IllegalArgumentException
Sets the specified vertex to the Vector3D provided. Line only supports the Primitive.VERTEX_A and Primitive.VERTEX_B vector identifiers. It is not possible to assign a normal or a face normal to a line.

Overrides:
setVector in class Primitive
Parameters:
vectorID - the ID of the vector being set.
vector - the Vector3D to set.
Throws:
java.lang.IllegalArgumentException - if an invalid vectorID is specified.
java.lang.NullPointerException - if the vector is null.
See Also:
Primitive.VERTEX_A, Primitive.VERTEX_B