|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.ui.graphics.shape.AbstractShape
org.vizzini.ui.graphics.shape.ExtrudedShape
public abstract class ExtrudedShape
Provides a shape model for an extruded shape. An extruded shape has a spine
with multiple stations. Each station can have a symetric cross-section and
orientation. Subclasses should call initPoints() in their
constructors.
| Field Summary | |
|---|---|
protected boolean |
_beginCap
Flag indicating whether to use a begin cap. |
protected boolean |
_endCap
Flag indicating whether to use an end cap. |
protected boolean |
_isHighlighted
Flag indicating whether to highlight. |
protected ShapeGroup |
_polygons
Shape group of generated polygons. |
protected int |
_spineLength
The length of the spine. |
| Fields inherited from class org.vizzini.ui.graphics.shape.AbstractShape |
|---|
_isWireframe, _points, _screenCenter, _screenPoints, _shapeGroup, _zNormal |
| Constructor Summary | |
|---|---|
ExtrudedShape(double width,
double height,
double depth)
Construct this object with the given parameters. |
|
| Method Summary | |
|---|---|
protected void |
computePolygonShapes()
Compute the polygons from the screen points. |
void |
computeScreenPoints(Quaternion q,
Vector v,
double magnify,
int offsetX,
int offsetY,
double d)
Compute the points of this shape in screen coordinates. |
boolean |
contains(Point point)
Return true if the given point is within this shape. |
void |
drawOn(Graphics g,
double magnify)
Draw this shape on the given graphics with the given magnification. |
protected void |
initPoints(double width,
double height,
double depth,
Vector[] spine,
double[] crossSection,
double[] scale,
double[] orientation)
Calculate the points from the given description of an extruded object. |
protected PolygonShape |
processPolygonShape(Color color,
List vector)
Process a polygon using the given parameters. |
protected void |
releasePolygonShapes()
Release all the polygon shapes. |
void |
setBeginCap(boolean flag)
Set the begin cap flag. |
void |
setEndCap(boolean flag)
Set the end cap flag. |
void |
setHighlightColor(Color color)
Set the highlight color. |
void |
setHighlighted(boolean isHighlighted)
Set the flag indicating whether highlights are used. |
| Methods inherited from class org.vizzini.ui.graphics.shape.AbstractShape |
|---|
add, clear, compareTo, computeCenteredScreenPoints, computeNormalZComponent, computeScreenCenter, createState, createStatefulSupport, drawOn, drawOnSolid, drawOnWireframe, 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 |
|---|
protected boolean _beginCap
protected boolean _endCap
protected boolean _isHighlighted
protected ShapeGroup _polygons
protected int _spineLength
| Constructor Detail |
|---|
public ExtrudedShape(double width,
double height,
double depth)
width - Width.height - Height.depth - Depth.| Method Detail |
|---|
public void computeScreenPoints(Quaternion q,
Vector v,
double magnify,
int offsetX,
int offsetY,
double d)
computeScreenPoints in interface IShapecomputeScreenPoints in class AbstractShapeq - The parent quaternion.magnify - The magnification.offsetX - The offset X coordinate.offsetY - The offset Y coordinate.d - Perspective constant.v - The parent position in world coordinates..public boolean contains(Point point)
contains in interface IShapecontains in class AbstractShape
public void drawOn(Graphics g,
double magnify)
drawOn in interface IShapedrawOn in class AbstractShapeg - The graphics.magnify - The magnification.public void setBeginCap(boolean flag)
flag - The new flag.public void setEndCap(boolean flag)
flag - The new flag.public void setHighlightColor(Color color)
public void setHighlighted(boolean isHighlighted)
protected void computePolygonShapes()
protected void initPoints(double width,
double height,
double depth,
Vector[] spine,
double[] crossSection,
double[] scale,
double[] orientation)
width - The width.height - The height.depth - The depth.spine - Array describing the spine, typically in Y.crossSection - Array describing the cross section in X-Z.scale - Array describing the scaling factors in X-Z at
stations of the spine.orientation - Array describing the orientation of the cross
section at stations of the spine.
protected PolygonShape processPolygonShape(Color color,
List vector)
color - The polygon color.vector - Vector of screen points.protected void releasePolygonShapes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |