|
||||||||||
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 FormField 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 Segment
public double[] getParameters()
getParameters
in class Segment
public void setParams(int[] ux)
setParams
in class Segment
public int[] getParams()
getParams
in class Segment
public 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 Segment
Segment.swapPerimeter
public void adjustPerimeter(Node n, int index)
Segment
adjustPerimeter
in class Segment
Segment.adjustPerimeter
public Node getCartesianCoords(double t)
Segment
getCartesianCoords
in class Segment
t
- parameter value
Segment.getCartesianCoords
public boolean isOnBoundary(int tx, int ty)
Segment
isOnBoundary
in class Segment
Segment.isOnBoundary
public double getParameterValue(Node n)
Segment
getParameterValue
in class Segment
Segment.getParameterValue
public void draw(java.awt.Graphics g)
draw
in class Segment
g
- - the graphics context to paint topublic boolean isInside(int[] topleft, int[] bottomright)
isInside
in class Segment
topleft
- - the topleft corner of the rectanglebottomright
- - the bottom right corner of the rectangle
public boolean isHit(int xx, int yy)
isHit
in class Segment
public void updateInnerData()
updateInnerData
in class Segment
public java.awt.Rectangle getPerimeter()
getPerimeter
in class Segment
public void performTransformation(GridTransformation trafo)
performTransformation
in class Segment
public void performMirror(double nx, double ny, double px, double py)
performMirror
in class Segment
public java.lang.Object clone()
clone
in class Segment
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |