vmm3d.planecurve
Class PlaneCurve
- java.lang.Object
-
- vmm3d.core.Exhibit
-
- vmm3d.planecurve.PlaneCurve
-
- All Implemented Interfaces:
- java.util.EventListener, javax.swing.event.ChangeListener, Decorateable, Parameterizable
- Direct Known Subclasses:
- PlaneCurveParametric
public abstract class PlaneCurve extends Exhibit
A PlaneCurve represents a curve in the xy-plane that is defined by an array of points. Since a null value in that array is interpreted as a break in the curve, the curve can in fact consist of multiple segments.
-
-
Constructor Summary
Constructors Constructor and Description PlaneCurve()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.geom.Point2D[]fillRandomSquare(int numPoints)public Point2D[] fillRandomSquare() puts numPoints random points into a square of edge length 2.java.awt.geom.Point2DgetPoint(int index)Get one of the points in the point array that defines this curve.intgetPointCount()Returns the number of points in the Point array for this curve (including any null values).java.awt.geom.Point2D[]initializeMovingSquare(int numPoints)initializeMovingSquare(numPoints) Initializes the array MovingSquare[] and its elements only once for each new call of a curve exhibit.-
Methods inherited from class vmm3d.core.Exhibit
addChangeListener, addDecoration, addExtraXML, addView, clearDecorations, forceRedraw, getActionsForView, getAdditionalAnimationsForView, getAlternativeViews, getBuildAnimation, getCreateAnimation, getDecorations, getDefaultBackground, getDefaultForeground, getDefaultTransform, getDefaultView, getDefaultWindow, getFramesForMorphing, getMorphingAnimation, getName, getParameterByName, getParameters, getSettingsCommandsForView, getTitle, getUseFilmstripForMorphing, getViews, parameterChanged, readExtraXML, removeChangeListener, removeDecoration, removeView, render, setDefaultBackground, setDefaultForeground, setDefaultWindow, setDefaultWindow, setFramesForMorphing, setName, setUseFilmstripForMorphing, stateChanged
-
-
-
-
Method Detail
-
getPointCount
public int getPointCount()
Returns the number of points in the Point array for this curve (including any null values). If the point array has not yet been created, because the curve has not yet been drawn, then the return value is zero.
-
getPoint
public java.awt.geom.Point2D getPoint(int index)
Get one of the points in the point array that defines this curve.- Parameters:
index- the index of the point in the point array. The value must be in the range from 0 to one less than the value returned bygetPointCount(), or an error of type NullPointerException or ArrayIndexOutOfBoundsError will occur.- Returns:
- the point at the specified index in the point array. This can be null if the specified position in the array holds a null value.
-
fillRandomSquare
public java.awt.geom.Point2D[] fillRandomSquare(int numPoints)
public Point2D[] fillRandomSquare() puts numPoints random points into a square of edge length 2.
-
initializeMovingSquare
public java.awt.geom.Point2D[] initializeMovingSquare(int numPoints)
initializeMovingSquare(numPoints) Initializes the array MovingSquare[] and its elements only once for each new call of a curve exhibit. Avoids garbage collection while the dotted square moves along a curve.
-
-
DMelt 3.0 © DataMelt by jWork.ORG