|
||||||||||
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
This class Segment builds the super class for the boundary segments. A segment is an atomic unit of the boundary curve.
Field Summary | |
protected Boundary |
boundary
link to boundary to which this segment belongs |
protected int[] |
orientation_marker_1
first point (world coords) of the orientation marker triangle |
protected int[] |
orientation_marker_2
second point (world coords) of the orientation marker triangle |
protected int[] |
orientation_marker_3
third point (world coords) of the orientation marker triangle |
protected double |
tmax
length of the segment |
Fields inherited from class devisor2.foundation.GridItem |
cc, marked, transformed, xmax, xmin, ymax, ymin |
Constructor Summary | |
Segment()
default constructor |
|
Segment(double stmax)
creates a segment with length stmax |
Method Summary | |
abstract 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'. |
abstract java.lang.Object |
clone()
creates a shallow clone of this segment |
abstract void |
draw(java.awt.Graphics g)
draws the segment |
void |
drawOrientationMarker(java.awt.Graphics g)
draws the orientation marker triangle using the coordinates in the three orientation_marker local attributes. |
Boundary |
getBoundary()
|
int |
getBoundaryNumber()
return internally saved boundary number |
abstract Node |
getCartesianCoords(double t)
gets the cartesian coordinates of the node according to parameter t |
abstract double[] |
getParameters()
gets the parameters of the segment |
abstract 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) |
abstract int[] |
getParams()
gets the parameters of the segment |
abstract java.awt.Rectangle |
getPerimeter()
gets the perimeter of the segment |
int |
getSegmentNumber()
|
double |
getTMax()
|
abstract boolean |
isHit(int x,
int y)
Determines if the item has been hit by a click on the grid ALL IN WORLD COORDINATES to avoid the snap mechanism |
abstract boolean |
isInside(int[] topleft,
int[] bottomright)
Is the item inside a given rectangular area? All in WORLD COORDINATES!!! |
abstract boolean |
isOnBoundary(int x,
int y)
returns whether or not a point lies on a boundary segment |
abstract void |
performMirror(double nx,
double ny,
double px,
double py)
This method mirrors the grid item at the given line |
abstract void |
performTransformation(GridTransformation trafo)
applies the Transformation to the Segment and calls updateInnerData |
void |
setBoundary(Boundary b)
sets the boundary of this segment |
abstract void |
setParameters(double[] ux)
sets the parameters of the segment |
abstract void |
setParams(int[] ux)
sets the parameters of the segment |
void |
setTMax(double value)
sets the maximal parameter value to the given value |
abstract void |
swapPerimeter()
inverts orientation of this segment without changing parameter values of related boundarynodes. |
abstract void |
updateInnerData()
updates the inner data used for hit detection etc. |
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 |
Field Detail |
protected double tmax
protected int[] orientation_marker_1
protected int[] orientation_marker_2
protected int[] orientation_marker_3
protected Boundary boundary
Constructor Detail |
public Segment(double stmax)
public Segment()
Method Detail |
public void setTMax(double value)
public double getTMax()
public int getBoundaryNumber()
public Boundary getBoundary()
public void setBoundary(Boundary b)
public int getSegmentNumber()
public abstract Node getCartesianCoords(double t)
t
- parameter value
public abstract void draw(java.awt.Graphics g)
draw
in class GridItem
g
- - the graphics context to paint topublic abstract java.awt.Rectangle getPerimeter()
getPerimeter
in class GridItem
public abstract boolean isOnBoundary(int x, int y)
public abstract double getParameterValue(Node n)
public abstract void swapPerimeter()
public abstract void adjustPerimeter(Node n, int index)
public abstract boolean isInside(int[] topleft, int[] bottomright)
isInside
in class GridItem
topleft
- - the topleft corner of the rectanglebottomright
- - the bottom right corner of the rectangle
public abstract boolean isHit(int x, int y)
isHit
in class GridItem
public abstract void updateInnerData()
public abstract void performTransformation(GridTransformation trafo)
performTransformation
in class GridItem
trafo
- - a GridTransform instance representing the transformationpublic abstract void performMirror(double nx, double ny, double px, double py)
performMirror
in class GridItem
public abstract java.lang.Object clone()
public abstract void setParameters(double[] ux)
setParameters
in class GridItem
public abstract double[] getParameters()
getParameters
in class GridItem
public abstract void setParams(int[] ux)
public abstract int[] getParams()
public void drawOrientationMarker(java.awt.Graphics g)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |