org.vizzini.ui.graphics.shape
Class Ellipse

java.lang.Object
  extended by org.vizzini.ui.graphics.shape.AbstractShape
      extended by org.vizzini.ui.graphics.shape.Ellipse
All Implemented Interfaces:
Comparable, IStateful, IShape

public class Ellipse
extends AbstractShape

Provides an ellipse shape.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Field Summary
static int X_Y_PLANE
          Constant indicating the ellipse is in the X-Y plane.
static int X_Z_PLANE
          Constant indicating the ellipse is in the X-Z plane.
static int Y_Z_PLANE
          Constant indicating the ellipse is in the Y-Z plane.
 
Fields inherited from class org.vizzini.ui.graphics.shape.AbstractShape
_isWireframe, _points, _screenCenter, _screenPoints, _shapeGroup, _zNormal
 
Constructor Summary
Ellipse(int segments, double width, double height)
          Construct this object with the given parameters.
Ellipse(int segments, double width, double height, boolean isFrontDrawn, boolean isBackDrawn)
          Construct this object with the given parameters.
Ellipse(int segments, double width, double height, boolean isFrontDrawn, boolean isBackDrawn, int plane)
          Construct this object with the given parameters.
 
Method Summary
protected  Vector computeScreenCenter(Quaternion q, Vector v, double magnify, int offsetX, int offsetY)
          Compute the center in screen coordinates.
protected  void drawOnSolid(Graphics g, double magnify)
          Draw a solid representation of this shape on the given graphics with the given magnification.
protected  void drawOnWireframe(Graphics g, double magnify)
          Draw a wireframe representation of this shape on the given graphics with the given magnification.
 
Methods inherited from class org.vizzini.ui.graphics.shape.AbstractShape
add, clear, compareTo, computeCenteredScreenPoints, computeNormalZComponent, computeScreenPoints, contains, createState, createStatefulSupport, drawOn, drawOn, getAbsoluteState, getBounds, getChildren, getColor, getColorForIntensity, getDepth, getDimensions, getHeight, getMinDimension, getName, getScreenCenter, getShapeGroup, getState, getStatefulParent, getTextureFilepath, getWidth, isInFrontOf, isLightSource, isTextureFilepathSet, isVisible, isWireframe, remove, setColor, setLightSource, setName, setStatefulParent, setTextureFilepath, setVisible, setWireframe, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

X_Y_PLANE

public static final int X_Y_PLANE
Constant indicating the ellipse is in the X-Y plane.

See Also:
Constant Field Values

X_Z_PLANE

public static final int X_Z_PLANE
Constant indicating the ellipse is in the X-Z plane.

See Also:
Constant Field Values

Y_Z_PLANE

public static final int Y_Z_PLANE
Constant indicating the ellipse is in the Y-Z plane.

See Also:
Constant Field Values
Constructor Detail

Ellipse

public Ellipse(int segments,
               double width,
               double height)
Construct this object with the given parameters.

Parameters:
segments - Number of segments in the ellipse.
width - Width.
height - Height.
Since:
v0.3

Ellipse

public Ellipse(int segments,
               double width,
               double height,
               boolean isFrontDrawn,
               boolean isBackDrawn)
Construct this object with the given parameters.

Parameters:
segments - Number of segments in the ellipse.
width - Width.
height - Height.
isFrontDrawn - Flag indicating whether the front portion of the ellipse is drawn.
isBackDrawn - Flag indicating whether the back portion of the ellipse is drawn.
Since:
v0.3

Ellipse

public Ellipse(int segments,
               double width,
               double height,
               boolean isFrontDrawn,
               boolean isBackDrawn,
               int plane)
Construct this object with the given parameters.

Parameters:
segments - Number of segments in the ellipse.
width - Width.
height - Height.
isFrontDrawn - Flag indicating whether the front portion of the ellipse is drawn.
isBackDrawn - Flag indicating whether the back portion of the ellipse is drawn.
Since:
v0.3
Method Detail

computeScreenCenter

protected Vector computeScreenCenter(Quaternion q,
                                     Vector v,
                                     double magnify,
                                     int offsetX,
                                     int offsetY)
Compute the center in screen coordinates. Extends the super method to bias this screen center relative to other shapes.

Overrides:
computeScreenCenter in class AbstractShape
Parameters:
q - The parent quaternion.
v - The parent center.
magnify - The magnification.
offsetX - The offset X coordinate.
offsetY - The offset Y coordinate.
Since:
v0.3

drawOnSolid

protected void drawOnSolid(Graphics g,
                           double magnify)
Draw a solid representation of this shape on the given graphics with the given magnification.

Overrides:
drawOnSolid in class AbstractShape
Parameters:
g - The graphics.
magnify - The magnification.
Since:
v0.3

drawOnWireframe

protected void drawOnWireframe(Graphics g,
                               double magnify)
Draw a wireframe representation of this shape on the given graphics with the given magnification.

Overrides:
drawOnWireframe in class AbstractShape
Parameters:
g - The graphics.
magnify - The magnification.
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02