|
||||||||||
| 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.SegmentLine
This class represents the segment type LINE, a straight line between two given points. As it can be messed with on the grid, it indirectly extends the GridItem class
| Field Summary | |
static boolean |
GRADIENT
constant to indicate that a SegmentLine is initialised via startpoint and gradient vector |
static boolean |
TWOPOINT
constant to indicate that a SegmentLine is initialised via startpoint and end point coordinates |
| 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 | |
SegmentLine()
creates an empty SegmentLine |
|
SegmentLine(int tx,
int ty,
int tsx,
int tsy,
boolean mode)
creates the segment type Line |
|
| 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 SegmentLine object, including boundary information |
void |
draw(java.awt.Graphics g)
draw the segment. |
Node |
getCartesianCoords(double t)
returns the cartesian coordinates according to the parameter value t |
int[] |
getEndPoint()
returns the endpoint coordinates |
int[] |
getIntersection(int[] xx)
|
double[] |
getParameters()
gets the parameters of the line |
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 line |
java.awt.Rectangle |
getPerimeter()
returns the perimeter of the Line element, that is the smallest bounding box completely containing the Line |
int[] |
getStartPoint()
returns the startpoint coordinates |
boolean |
isHit(int cx,
int cy)
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 x,
int y)
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 line at the given line by mirroring the two endpoints |
void |
performTransformation(GridTransformation trf)
transforms the line segment by transforming the two endpoints |
void |
setEndPoint(int x2,
int y2)
sets the endpoint of the line |
void |
setParameters(double[] ux)
sets the parameters of the line |
void |
setParams(int[] ux)
sets the parameters of the line |
void |
setStartPoint(int x1,
int y1)
sets the startpoint of the line |
void |
swapPerimeter()
inverts orientation of this segment without changing parameter values of related boundarynodes. |
java.lang.String |
toString()
|
void |
updateInnerData()
updates the inner variables xmin, xmax, ymin, ymax and the polygonal representation of the line object including the orientation marker |
| 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, wait, wait, wait |
| Field Detail |
public static final boolean GRADIENT
public static final boolean TWOPOINT
| Constructor Detail |
public SegmentLine(int tx,
int ty,
int tsx,
int tsy,
boolean mode)
mode - GRADIENT or TWOPOINTpublic SegmentLine()
| 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 Segment
public void setStartPoint(int x1,
int y1)
public void setEndPoint(int x2,
int y2)
public int[] getStartPoint()
public int[] getEndPoint()
public boolean isOnBoundary(int x,
int y)
Segment
isOnBoundary in class SegmentSegment.isOnBoundarypublic int[] getIntersection(int[] xx)
DomainBoundary.getIntersectionpublic double getParameterValue(Node n)
Segment
getParameterValue in class SegmentSegment.getParameterValuepublic Node getCartesianCoords(double t)
getCartesianCoords in class Segmentt - parameter value
public void swapPerimeter()
Segment
swapPerimeter in class SegmentSegment.swapPerimeter
public void adjustPerimeter(Node n,
int index)
Segment
adjustPerimeter in class SegmentSegment.adjustPerimeter
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 cx,
int cy)
isHit in class Segmentpublic void updateInnerData()
updateInnerData in class Segmentpublic void draw(java.awt.Graphics g)
draw in class Segmentg - - the graphics context to paint topublic java.awt.Rectangle getPerimeter()
getPerimeter in class Segmentpublic void performTransformation(GridTransformation trf)
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 Segmentpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||