|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.router.polyline.OrthogonalInterval
public class OrthogonalInterval
A horizontal or vertical Interval
that additionally stores a y- (in the horizontal case) or x-coordinate (in
the vertical case).
During a PathSearch
, orthogonal intervals are used to describe where an edge enters or leaves a
PartitionCell
.
PathSearch
Constructor Summary | |
---|---|
OrthogonalInterval(double from,
double to,
double location,
boolean isVertical)
Creates a new instance using the from and to value as interval bounds. |
|
OrthogonalInterval(Interval range,
double location,
boolean isVertical)
Creates a new instance using the range as interval bounds. |
Method Summary | |
---|---|
static OrthogonalInterval |
calculateIntersection(OrthogonalInterval i1,
OrthogonalInterval i2)
Calculates the intersection of the given orthogonal intervals. |
static OrthogonalInterval |
calculateUnion(OrthogonalInterval i1,
OrthogonalInterval i2)
Calculates the union of the given orthogonal intervals. |
boolean |
coveredBy(OrthogonalInterval other)
Checks if the given orthogonal interval covers this one fully. |
boolean |
crosses(OrthogonalInterval other)
Determines whether this orthogonal interval crosses the given one. |
double |
distanceTo(OrthogonalInterval other)
Returns the distance of the getRange() s of this orthogonal interval and the given orthogonal interval. |
YPoint |
getCenter()
Returns the center of this orthogonal interval in the 2d-coordinate system. |
double |
getLocation()
Returns the vertical coordinate for horizontal intervals or the horizontal coordinate for vertical intervals, respectively. |
double |
getMax()
Returns the upper bound of the orthogonal interval. |
double |
getMin()
Returns the lower bound of the orthogonal interval. |
Interval |
getRange()
Returns the range of this orthogonal interval. |
double |
getSize()
Returns the length of the orthogonal interval. |
boolean |
hasSameRange(OrthogonalInterval other)
Checks if this orthogonal interval and the given orthogonal interval cover the same range. |
boolean |
intersects(OrthogonalInterval other)
Checks if this orthogonal interval intersects the given orthogonal interval. |
boolean |
intersects(OrthogonalInterval other,
double minIntersection)
Checks if this orthogonal interval intersects the given orthogonal interval and the intersection has a minimal size of minIntersection . |
boolean |
isVertical()
Determines whether the orthogonal interval is oriented vertically. |
double |
manhattanDistanceTo(OrthogonalInterval other)
Returns the manhattan distance of this orthogonal interval and the given orthogonal interval. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OrthogonalInterval(double from, double to, double location, boolean isVertical)
from
and to
value as interval bounds.
from
- the start of the interval boundsto
- the end of the interval boundslocation
- the location in the 2D coordinate systemisVertical
- true
, if the orthogonal interval is vertical; false
, if it is
horizontal vertical.public OrthogonalInterval(Interval range, double location, boolean isVertical)
range
as interval bounds.
IllegalArgumentException
- if range is null
range
- the rangelocation
- the location in the 2D coordinate systemisVertical
- true
, if the orthogonal interval is vertical; false
, if it is
horizontal.Method Detail |
---|
public boolean isVertical()
true
if the orthogonal interval is oriented vertically, false
otherwise.public double getMin()
public double getMax()
public double getSize()
Interval.getSize()
public Interval getRange()
public double getLocation()
public YPoint getCenter()
public boolean crosses(OrthogonalInterval other)
The orthogonal intervals must have different orientations.
IllegalArgumentException
- if orthogonal intervals have same orientationother
- The other orthogonal interval.
true
if this orthogonal interval crosses the given one, false
otherwise.public double distanceTo(OrthogonalInterval other)
getRange()
s of this orthogonal interval and the given orthogonal interval.
The orthogonal intervals must have same orientation.
IllegalArgumentException
- if the orthogonal intervals have different orientationsother
- The second orthogonal interval.
0
if the orthogonal intervals intersects(OrthogonalInterval)
, otherwise the
minimal distance between the orthogonal intervals.public double manhattanDistanceTo(OrthogonalInterval other)
If both intervals have the same orientation, the manhattan distance is the sum of the distance between the intervals' ranges and the distance between the intervals' locations.
If the intervals have different orientations, the manhattan distance is the sum of the distances between one interval's range with the other interval's location.
other
- The second orthogonal interval.
public boolean intersects(OrthogonalInterval other)
Orthogonal intervals intersect each other, if their ranges intersect each other. The location of both orthogonal intervals is ignored. The orthogonal intervals must have same orientation.
IllegalArgumentException
- if the orthogonal intervals have different orientationsother
- the second orthogonal interval.
true
if both orthogonal intervals intersect, false
otherwise.PartitionCell
public boolean intersects(OrthogonalInterval other, double minIntersection)
minIntersection
.
Orthogonal intervals intersect each other, if their ranges intersect each other by at least
minIntersection
. The location of both orthogonal intervals is ignored. The orthogonal intervals must
have same orientation.
IllegalArgumentException
- if the orthogonal intervals have different orientationsother
- the second orthogonal interval.minIntersection
- The minimal size of the intersection.
true
if both orthogonal intervals intersect, false
otherwise.PartitionCell
public boolean coveredBy(OrthogonalInterval other)
The given orthogonal interval covers this orthogonal interval, if this interval's range is covered by the given interval's range. The location of both orthogonal intervals is ignored. The orthogonal intervals must have same orientation.
IllegalArgumentException
- if the orthogonal intervals have different orientationsother
- The other orthogonal interval
true
, if this orthogonal interval is fully covered by the other orthogonal interval,
false
otherwise.PartitionCell
public boolean hasSameRange(OrthogonalInterval other)
If both orthogonal intervals cover the same range, they are considered same. The location of both orthogonal intervals is ignored. The orthogonal intervals must have same orientation.
IllegalArgumentException
- if the orthogonal intervals have different orientationsother
- The second orthogonal interval
true
, if the orthogonal intervals cover the same range, false
otherwise.PartitionCell
public static OrthogonalInterval calculateIntersection(OrthogonalInterval i1, OrthogonalInterval i2)
If the created orthogonal interval is vertical, it will have the same horizontal location as i2 and the shared vertical range of both intervals. If it is horizontal, it will have the same vertical location as i2 and the shared horizontal range of both intervals. The orthogonal intervals must have same orientation.
IllegalArgumentException
- if the orthogonal intervals have different orientationsi1
- The first orthogonal interval.i2
- The second orthogonal interval.
intersects(OrthogonalInterval, double)
public static OrthogonalInterval calculateUnion(OrthogonalInterval i1, OrthogonalInterval i2)
If the created orthogonal interval is vertical, it will have the same horizontal location as i2 and the shared vertical range of both orthogonal intervals. If it is horizontal, it will have the same vertical location as i2 and the shared vertical range of both orthogonal intervals. The orthogonal intervals must have same orientation.
IllegalArgumentException
- if the orthogonal intervals have different orientationsi1
- The first orthogonal interval.i2
- The second orthogonal interval.
intersects(OrthogonalInterval, double)
public String toString()
toString
in class Object
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |