|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.Exhibit vmm.core3D.Exhibit3D vmm.spacecurve.SpaceCurve
public abstract class SpaceCurve
Represents a curve, or set of curve segments, in three-space. The curve is defined by an array of 3D points.
Field Summary | |
---|---|
protected Vector3D[] |
points
The array of 3D points that define the curve. |
Fields inherited from class vmm.core3D.Exhibit3D |
---|
defaultViewpoint, defaultViewUp, previousTransform3D |
Fields inherited from class vmm.core.Exhibit |
---|
decorations, exhibitNeedsRedraw, isMorphing, morphingView, parameters, previousTransform |
Constructor Summary | |
---|---|
SpaceCurve()
|
Method Summary | |
---|---|
protected void |
computeDrawData3D(View3D view,
boolean exhibitNeedsRedraw,
Transform3D previousTransform,
Transform3D newTransform)
Computes the array of points. |
protected void |
doDraw3D(java.awt.Graphics2D g,
View3D view,
Transform3D transform)
Draws the curve. |
View |
getDefaultView()
Returns a SpaceCurveView with antialiasing turned on. |
Vector3D |
getPoint(int i)
Get one of the points from the array that defines the curve. |
int |
getPointCount()
Get the size of the array of points that define this curve. |
protected abstract void |
makePoints()
Subclasses must override this method to compute the array of points that define the curve. |
Methods inherited from class vmm.core3D.Exhibit3D |
---|
computeDrawDataHook, doDrawHook, getDefaultTransform, getDefaultViewpoint, getDefaultViewUp, setDefaultViewpoint, setDefaultViewUp |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Vector3D[] points
makePoints()
.
method. The curve is formed by connecting the points in the array with line segments. Null values
are allowed in the array. A null value effectively breaks the curve into two segments.
Constructor Detail |
---|
public SpaceCurve()
Method Detail |
---|
protected abstract void makePoints()
points
.
public View getDefaultView()
SpaceCurveView
with antialiasing turned on.
getDefaultView
in class Exhibit3D
public int getPointCount()
public Vector3D getPoint(int i)
i
- The index of the point in the array. This must be in the range 0 to getPointCount()-1
,
or an error will occur.
protected void computeDrawData3D(View3D view, boolean exhibitNeedsRedraw, Transform3D previousTransform, Transform3D newTransform)
computeDrawData3D
in class Exhibit3D
view
- the 3D View where the Exhibit is about to be drawn.exhibitNeedsRedraw
- if true, then something about the Exhibit has changed that probably requires
recomputation of cached data. For example, this is set to true when one of the Parameters of the Exhibit
has changed since the previous redraw.previousTransform
- the Transform3D that was used the last time this exhibit was drawn. This can be null, if
this is the first time that the Exhibit is being drawn (in 3D).newTransform
- the transform that will be used to draw the Exhibit during the current drawing operation.
This parameter and the previousTransform3D parameter are provided so that the Exhbit can detect those rare
cases where cached data exists that depends on the transform. Most Exhibits will just ignore the
transform parameters.protected void doDraw3D(java.awt.Graphics2D g, View3D view, Transform3D transform)
doDraw3D
in class Exhibit3D
g
- the graphics context where the exhibit is being drawn.view
- The View3D in which the exhibit is being drawn. In general, it is advisable to use the view for
all drawing operations.transform
- The transform that is being used to draw the exhibit.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |