|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdevisor2.foundation.GridItem
devisor2.foundation.boundary.Segment
devisor2.foundation.boundary.SegmentCircle
This class represents the Segment type CIRCLE. As always, coordinates are all given in world space (the big ints). A circle is completely defined by the midpoints, its radius, and a start- and end angle of the arc. These angles are all measured in degrees against the three o'clock position.
Segment,
Serialized Form| Field Summary |
| Fields inherited from class devisor2.foundation.boundary.Segment |
boundary, orientation_marker_1, orientation_marker_2, orientation_marker_3, tmax |
| Fields inherited from class devisor2.foundation.GridItem |
cc, marked, transformed, xmax, xmin, ymax, ymin |
| Constructor Summary | |
SegmentCircle()
creates an empty SegmentCircle |
|
SegmentCircle(int tx,
int ty,
int tr,
double tsa,
double tsb)
creates the segment type circle |
|
| Method Summary | |
void |
adjustPerimeter(Node n,
int index)
change coordinates therefor, that at indes 0 that the beginning of this segment is at node 'n', else that the ending of this segment is at node 'n'. |
java.lang.Object |
clone()
creates a full clone of the SegmentCircle object, including boundary information |
void |
draw(java.awt.Graphics g)
draws the segment |
Node |
getCartesianCoords(double t)
gets the cartesian coordinates of the node according to parameter t |
double |
getEndAngle()
returns the end angle (in degrees) |
int[] |
getMidPoint()
returns the midpoint of the circle (WORLD COORDS) |
double[] |
getParameters()
gets the parameters of the circle |
double |
getParameterValue(Node n)
calculate parameter value of node 'n' from its x/y coordinates (note: only the relative parameter value is calculated, the boundary-wide value is not considered) |
int[] |
getParams()
gets the parameters of the circle |
java.awt.Rectangle |
getPerimeter()
returns the perimeter of the Circle element, that is the smallest bounding box completely containing the Circle |
int |
getRadius()
returns the radius of the circle (WORLD COORDS) |
double |
getStartAngle()
returns the start angle (in degrees) |
boolean |
isHit(int xx,
int yy)
Determines if the item has been hit by a click on the grid ALL IN WORLD COORDINATES to avoid the snap mechanism |
boolean |
isInside(int[] topleft,
int[] bottomright)
Is the item inside a given rectangular area? All in WORLD COORDINATES!!! |
boolean |
isOnBoundary(int tx,
int ty)
returns whether or not a point lies on a boundary segment |
void |
performMirror(double nx,
double ny,
double px,
double py)
This method mirrors the circle at the given line |
void |
performTransformation(GridTransformation trafo)
applies the given affine transformation to the circle |
void |
setEndAngle(double angle)
sets the end angle (in degrees) |
void |
setMidPoint(int xx,
int yy)
sets the midpoint to the given parameters (WORLD COORDS) |
void |
setParameters(double[] ux)
sets the parameters of the Circle |
void |
setParams(int[] ux)
sets the parameters of the Circle |
void |
setRadius(int newr)
sets the radius to the given value (WORLD COORDS) |
void |
setStartAngle(double angle)
sets the start angle (in degrees) |
void |
swapPerimeter()
inverts orientation of this segment without changing parameter values of related boundarynodes. |
void |
updateInnerData()
updates the inner variables xmin, xmax, ymin, ymax and the polygonal representation of the circle object |
| Methods inherited from class devisor2.foundation.boundary.Segment |
drawOrientationMarker, getBoundary, getBoundaryNumber, getSegmentNumber, getTMax, setBoundary, setTMax |
| Methods inherited from class devisor2.foundation.GridItem |
clearTransformedFlag, isMarked, setMarker, setMarker, unsetMarker |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SegmentCircle(int tx,
int ty,
int tr,
double tsa,
double tsb)
tr - radiuspublic SegmentCircle()
| Method Detail |
public void setParameters(double[] ux)
setParameters in class Segmentpublic double[] getParameters()
getParameters in class Segmentpublic void setParams(int[] ux)
setParams in class Segmentpublic int[] getParams()
getParams in class Segmentpublic int getRadius()
public void setRadius(int newr)
public int[] getMidPoint()
public void setMidPoint(int xx,
int yy)
public double getStartAngle()
public void setStartAngle(double angle)
public double getEndAngle()
public void setEndAngle(double angle)
public void swapPerimeter()
Segment
swapPerimeter in class SegmentSegment.swapPerimeter
public void adjustPerimeter(Node n,
int index)
Segment
adjustPerimeter in class SegmentSegment.adjustPerimeterpublic Node getCartesianCoords(double t)
Segment
getCartesianCoords in class Segmentt - parameter value
Segment.getCartesianCoords
public boolean isOnBoundary(int tx,
int ty)
Segment
isOnBoundary in class SegmentSegment.isOnBoundarypublic double getParameterValue(Node n)
Segment
getParameterValue in class SegmentSegment.getParameterValuepublic void draw(java.awt.Graphics g)
draw in class Segmentg - - the graphics context to paint to
public boolean isInside(int[] topleft,
int[] bottomright)
isInside in class Segmenttopleft - - the topleft corner of the rectanglebottomright - - the bottom right corner of the rectangle
public boolean isHit(int xx,
int yy)
isHit in class Segmentpublic void updateInnerData()
updateInnerData in class Segmentpublic java.awt.Rectangle getPerimeter()
getPerimeter in class Segmentpublic void performTransformation(GridTransformation trafo)
performTransformation in class Segment
public void performMirror(double nx,
double ny,
double px,
double py)
performMirror in class Segmentpublic java.lang.Object clone()
clone in class Segment
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||