|
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 for specifying the location where an edge enters or exits a
partition cell
.
PathSearch
Constructor Summary | |
---|---|
OrthogonalInterval(double from,
double to,
double location,
boolean isVertical)
Creates a new OrthogonalInterval instance using the from and to value as
interval bounds. |
|
OrthogonalInterval(Interval range,
double location,
boolean isVertical)
Creates a new OrthogonalInterval instance with the given 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 whether or not this orthogonal interval is fully covered by the given
orthogonal interval . |
boolean |
crosses(OrthogonalInterval other)
Determines whether or not this orthogonal interval crosses the given one. |
double |
distanceTo(OrthogonalInterval other)
Returns the distance of the ranges 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 whether or not this orthogonal interval and the given
orthogonal interval cover the same range. |
boolean |
intersects(OrthogonalInterval other)
Checks whether or not this orthogonal interval intersects the given
orthogonal interval . |
boolean |
intersects(OrthogonalInterval other,
double minIntersection)
Checks whether or not this orthogonal interval intersects the given
orthogonal interval and the intersection has a given minimum intersection size. |
boolean |
isVertical()
Determines whether or not the orthogonal interval is oriented vertically. |
double |
manhattanDistanceTo(OrthogonalInterval other)
Returns the Manhattan distance of this orthogonal interval and the given
orthogonal interval . |
java.lang.String |
toString()
Returns a string representation of this OrthogonalInterval object. |
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)
OrthogonalInterval
instance using the from
and to
value as
interval bounds.
from
- the start of the interval boundsto
- the end of the interval boundslocation
- the location in the two-dimensional coordinate systemisVertical
- true
if the orthogonal interval is vertical, false
if it is
horizontal
java.lang.IllegalArgumentException
- if the given range is null
public OrthogonalInterval(Interval range, double location, boolean isVertical)
OrthogonalInterval
instance with the given interval bounds.
range
- the given rangelocation
- the location in the two-dimensional coordinate systemisVertical
- true
if the orthogonal interval is vertical, false
if it is
horizontal
java.lang.IllegalArgumentException
- if the given range is null
Method Detail |
---|
public boolean isVertical()
orthogonal interval
is oriented vertically.
true
if the orthogonal interval is oriented vertically, false
otherwisepublic double getMin()
orthogonal interval
.
public double getMax()
orthogonal interval
.
public double getSize()
orthogonal interval
.
Interval.getSize()
public Interval getRange()
orthogonal interval
.
public double getLocation()
public YPoint getCenter()
orthogonal interval
in the 2D-coordinate system.
public boolean crosses(OrthogonalInterval other)
orthogonal interval
crosses the given one.
The orthogonal intervals must have different orientations.
other
- the other orthogonal interval
true
if this orthogonal interval crosses the given one, false
otherwise
java.lang.IllegalArgumentException
- if the given orthogonal intervals have the same orientationpublic double distanceTo(OrthogonalInterval other)
ranges
of this orthogonal interval
and
the given orthogonal interval
.
The orthogonal intervals must have the same orientation.
other
- the other orthogonal interval
0
if the orthogonal intervals intersect
each other, otherwise the
minimal distance between the orthogonal intervals is returned
java.lang.IllegalArgumentException
- if the orthogonal intervals have different orientationspublic double manhattanDistanceTo(OrthogonalInterval other)
orthogonal interval
and the given
orthogonal interval
.
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 and the other interval's location.
other
- the other orthogonal interval
public boolean intersects(OrthogonalInterval other)
orthogonal interval
intersects the given
orthogonal interval
.
Orthogonal intervals intersect each other, if their ranges intersect each other. The location of both orthogonal intervals is ignored. The orthogonal intervals must have the same orientation.
other
- the other orthogonal interval
true
if this interval intersects the given other orthogonal interval, false
otherwise
java.lang.IllegalArgumentException
- if the orthogonal intervals have different orientationsPartitionCell
public boolean intersects(OrthogonalInterval other, double minIntersection)
orthogonal interval
intersects the given
orthogonal interval
and the intersection has a given minimum intersection size.
Orthogonal intervals intersect each other, if their ranges intersect each other by at least the given minimum intersection size. The location of both orthogonal intervals is ignored. The orthogonal intervals must have the same orientation.
other
- the other orthogonal intervalminIntersection
- the minimum size of the intersection
true
if this interval intersects the given other orthogonal interval, false
otherwise
java.lang.IllegalArgumentException
- if the orthogonal intervals have different orientationsPartitionCell
public boolean coveredBy(OrthogonalInterval other)
orthogonal interval
is fully covered by the given
orthogonal interval
.
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 the same orientation.
other
- the other orthogonal interval
true
if this orthogonal interval is fully covered by the other orthogonal interval,
false
otherwise
java.lang.IllegalArgumentException
- if the orthogonal intervals have different orientationsPartitionCell
public boolean hasSameRange(OrthogonalInterval other)
orthogonal interval
and the given
orthogonal interval
cover the same range.
If both orthogonal intervals cover the same range, they are considered the same. The location of both orthogonal intervals is ignored. The orthogonal intervals must have the same orientation.
other
- the other orthogonal interval
true
if the orthogonal intervals cover the same range, false
otherwise
java.lang.IllegalArgumentException
- if the orthogonal intervals have different orientationsPartitionCell
public static OrthogonalInterval calculateIntersection(OrthogonalInterval i1, OrthogonalInterval i2)
orthogonal intervals
.
If the returned 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.
i1
- the first orthogonal intervali2
- the second orthogonal interval
java.lang.IllegalArgumentException
- if the orthogonal intervals have different orientationsintersects(OrthogonalInterval, double)
public static OrthogonalInterval calculateUnion(OrthogonalInterval i1, OrthogonalInterval i2)
orthogonal intervals
.
If the returned 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.
i1
- the first orthogonal intervali2
- the second orthogonal interval
java.lang.IllegalArgumentException
- if the orthogonal intervals have different orientationsintersects(OrthogonalInterval, double)
public java.lang.String toString()
OrthogonalInterval
object.
toString
in class java.lang.Object
OrthogonalInterval
object
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |