|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnodebox.graphics.AbstractTransformable
nodebox.graphics.AbstractGeometry
nodebox.graphics.Contour
public class Contour
| Field Summary |
|---|
| Fields inherited from interface nodebox.graphics.IGeometry |
|---|
DEFAULT_POINT_AMOUNT |
| Constructor Summary | |
|---|---|
Contour()
|
|
Contour(Contour other)
|
|
Contour(Iterable<Point> points,
boolean closed)
|
|
| Method Summary | |
|---|---|
void |
addPoint(double x,
double y)
Add a new point to the geometry specified by its x and y coordinates. |
void |
addPoint(Point pt)
Add the given point to the geometry. |
Contour |
clone()
Clone the geometry, returning a new copy that is totally independent from the original. |
void |
close()
|
void |
draw(Graphics2D g)
|
void |
flatten()
Flatten the geometry. |
IGeometry |
flattened()
Make a flattened copy of the geometry. |
Rect |
getBounds()
|
double |
getLength()
Calculate the length of the contour. |
int |
getPointCount()
|
List<Point> |
getPoints()
Get the points for this geometry. |
void |
invalidate()
Invalidates the cache. |
boolean |
isClosed()
|
boolean |
isEmpty()
|
Point[] |
makePoints(int amount)
Make new points along the contours of the existing path. |
Point[] |
makePoints(int amount,
boolean perContour)
Make new points along the contours of the existing path. |
AbstractGeometry |
mapPoints(com.google.common.base.Function<Point,Point> pointFunction)
Change all points in the geometry and return a mutated copy. |
Point |
point(double t)
Same as pointAt(t). |
Point |
pointAt(double t)
Returns coordinates for point at t on the path. |
Contour |
resampleByAmount(int amount)
Generate new geometry with the given amount of points along the shape of the original geometry. |
Contour |
resampleByAmount(int amount,
boolean perContour)
Generate new geometry with the given amount of points along the shape of the original geometry. |
Contour |
resampleByLength(double segmentLength)
Generate new geometry with points along the shape of the original geometry, spaced at the given length. |
void |
setClosed(boolean closed)
|
Path |
toPath()
|
void |
transform(Transform t)
|
double |
updateSegmentLengths()
|
| Methods inherited from class nodebox.graphics.AbstractGeometry |
|---|
extend, extend, makePoints, pointDelta |
| Methods inherited from class nodebox.graphics.AbstractTransformable |
|---|
getTransformDelegate, rotate, rotateRadians, scale, scale, setTransformDelegate, skew, skew, translate |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface nodebox.graphics.Grob |
|---|
getTransformDelegate, rotate, rotateRadians, scale, scale, setTransformDelegate, skew, skew, translate |
| Constructor Detail |
|---|
public Contour()
public Contour(Contour other)
public Contour(Iterable<Point> points,
boolean closed)
| Method Detail |
|---|
public int getPointCount()
public List<Point> getPoints()
IGeometry
public void addPoint(Point pt)
IGeometry
pt - the point to add.
public void addPoint(double x,
double y)
IGeometry
x - the X coordinate.y - the Y coordinate.public boolean isClosed()
public void setClosed(boolean closed)
public void close()
public boolean isEmpty()
public Rect getBounds()
public void invalidate()
public double updateSegmentLengths()
public double getLength()
public Point pointAt(double t)
pointAt in class AbstractGeometryt - relative coordinate of the point (between 0.0 and 1.0)
Results outside of this range are undefined.
public Point point(double t)
t - relative coordinate of the point.
pointAt(double)public Point[] makePoints(int amount)
makePoints in interface IGeometrymakePoints in class AbstractGeometryamount - the number of points to create.
public Point[] makePoints(int amount,
boolean perContour)
amount - the amount of points to distribute.perContour - this port was added to comply with the IGeometry interface, but is ignored since
we're at the contour level.
public Contour resampleByAmount(int amount,
boolean perContour)
amount - the number of points to generate.perContour - this port is ignored since we're at the contour level.
public Contour resampleByAmount(int amount)
amount - the number of points to generate.
public Contour resampleByLength(double segmentLength)
segmentLength - the maximum length of each resampled segment.
public void flatten()
IGeometry
public IGeometry flattened()
IGeometry
public void draw(Graphics2D g)
public void transform(Transform t)
public Path toPath()
public AbstractGeometry mapPoints(com.google.common.base.Function<Point,Point> pointFunction)
AbstractGeometry
mapPoints in class AbstractGeometrypointFunction - The function to apply to each point.
public Contour clone()
IGeometry
clone in interface Grobclone in interface IGeometryclone in class AbstractGeometry
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||