|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfig.objects.FigPolyline jfig.objects.FigArc
xfig-style arcs specified by three points.
FigArc: a class to manage and draw circular arcs specified by three control points (two end-points, one additional point on the diameter). Because the AWT supports only 1-pixel wide arcs, we construct a polyline approximation for drawing the arc.
Field Summary | |
(package private) double |
alpha0
|
(package private) double |
alpha1
|
(package private) double |
alpha2
|
static int |
ccw
|
(package private) double |
center_x
|
(package private) double |
center_y
|
static int |
cw
|
(package private) double |
dalpha10
|
(package private) double |
dalpha21
|
protected int |
direction
|
static int |
OPEN_ARC
|
static int |
PIE_WEDGE
|
(package private) java.awt.Point[] |
pp
|
static double |
r
|
protected int |
radius
|
protected int |
type
|
protected java.awt.Point[] |
wcp_arc
|
Fields inherited from class jfig.objects.FigPolyline |
attribs, bbox, comment, debug, is_closed, min_i, min_num_points, painter, renderer, selected, showPoints, syncRedrawFlag, trafo, visible, wcp |
Constructor Summary | |
FigArc()
|
|
FigArc(java.awt.Point P1,
java.awt.Point P2,
java.awt.Point P3,
FigAttribs attribs,
FigTrafo2D trafo)
FigArc(): construct an arc object that starts in point P1, runs through p2 and ends in P3. |
Method Summary | |
void |
appendPoint(java.awt.Point wp)
does nothing; we cannot append a point to a three-point arc. |
protected boolean |
build_arc()
Given the three control points, calculate the arc center point and the direction (clockwise or counter-clockwise). |
FigObject |
copy()
build a copy of this FigArc |
void |
createRenderer()
|
java.awt.Point |
deletePoint(java.awt.Point wp)
returns null; we cannot delete single points from a three-point arc. |
java.awt.Point |
getCenter()
|
int |
getDirection()
|
java.awt.Point[] |
getInterpolatedArcPoints()
return the array with the interpolated arc points |
void |
insertPoint(java.awt.Point prev,
java.awt.Point wp)
does nothing; we cannot insert new points to a three-point arc. |
void |
rebuild()
rebuild all internal data-structures for this polyline. |
void |
setPoints(java.awt.Point[] pp)
set a new array of world-coordinate Points for this polyline. |
java.lang.String |
toString()
toString() for debug purposes. |
void |
update_bbox()
calculate the bounding box of this arc object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.awt.Point[] wcp_arc
protected int radius
protected int direction
protected int type
public static final double r
public static final int ccw
public static final int cw
public static final int PIE_WEDGE
public static final int OPEN_ARC
double alpha0
double alpha1
double alpha2
double dalpha21
double dalpha10
double center_x
double center_y
java.awt.Point[] pp
Constructor Detail |
public FigArc()
public FigArc(java.awt.Point P1, java.awt.Point P2, java.awt.Point P3, FigAttribs attribs, FigTrafo2D trafo)
If all points are linearly dependent, a straight line results.
Method Detail |
public void createRenderer()
createRenderer
in class FigPolyline
public void rebuild()
FigPolyline
rebuild
in interface FigObject
rebuild
in class FigPolyline
public void update_bbox()
FIXME: In degenerated cases, it might even be better to calculate the bounding box from the full interpolated points array...
update_bbox
in class FigPolyline
public java.awt.Point getCenter()
public int getDirection()
public java.awt.Point[] getInterpolatedArcPoints()
public void setPoints(java.awt.Point[] pp)
FigPolyline
setPoints
in interface FigObject
setPoints
in class FigPolyline
protected boolean build_arc()
public java.lang.String toString()
FigPolyline
toString
in interface FigObject
toString
in class FigPolyline
public FigObject copy()
copy
in interface FigObject
copy
in class FigPolyline
public void appendPoint(java.awt.Point wp)
appendPoint
in interface FigObject
appendPoint
in class FigPolyline
public void insertPoint(java.awt.Point prev, java.awt.Point wp)
insertPoint
in interface FigObject
insertPoint
in class FigPolyline
public java.awt.Point deletePoint(java.awt.Point wp)
deletePoint
in interface FigObject
deletePoint
in class FigPolyline
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |