Package | com.yworks.yfiles.geom |
Class | public class LineSegment |
Inheritance | LineSegment YObject Object |
Implements | PlaneObject |
Property | Defined By | ||
---|---|---|---|
boundingBox : YRectangle [read-only]
Returns the smallest Rectangle which contains the object. | LineSegment | ||
deltaX : Number [read-only]
Returns the distance from start to end point in x-coordinates. | LineSegment | ||
deltaY : Number [read-only]
Returns the distance from start to end point in y-coordinates. | LineSegment | ||
firstEndPoint : YPoint [read-only]
Returns the first end point of the line segment. | LineSegment | ||
horizontal : Boolean [read-only]
Determines if the interval is horizontal. | LineSegment | ||
scope : Number [read-only]
Returns the slope of the line segment. | LineSegment | ||
secondEndPoint : YPoint [read-only]
Returns the second end point of the line segment. | LineSegment | ||
vertical : Boolean [read-only]
Returns if this segment is considered vertical, i.e. | LineSegment | ||
xOffset : Number [read-only]
Returns the y value of the line on x coordinate 0. | LineSegment |
Method | Defined By | ||
---|---|---|---|
Returns a new LineSegment. | LineSegment | ||
[static]
Checks whether a line segment intersects a box. | LineSegment | ||
boxIntersectsSegment2(box:YRectangle, x1:Number, y1:Number, x2:Number, y2:Number):Boolean [static]
Checks whether a line segment intersects a box. | LineSegment | ||
boxIntersectsSegment3(boxX1:Number, boxY1:Number, boxX2:Number, boxY2:Number, sX1:Number, sY1:Number, sX2:Number, sY2:Number):Boolean [static]
Checks whether a line segment intersects a paraxial box. | LineSegment | ||
Checks whether a given point lies on this line segment. | LineSegment | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | LineSegment | ||
[static]
Returns intersection point between the two line segments, if there is one or null if the two line segments do not intersect. | LineSegment | ||
hashCode():int | YObject | ||
intersectsPoint(p:YPoint):Boolean
Checks whether the line segment intersects a point. | LineSegment | ||
intersectsRectangle(box:YRectangle):Boolean
Checks whether the line segment intersects a box. | LineSegment | ||
isInXIntervall(x:Number):Boolean
Returns if the projection on the X axis of the line segment covers a certain point on the X Axis. | LineSegment | ||
isInYIntervall(y:Number):Boolean
Returns if the projection on the Y axis of the line segment covers a certain point on the Y Axis. | LineSegment | ||
length():Number
Returns the length of the line segment, this is the value of the Euclidean norm. | LineSegment | ||
[static]
Returns a new LineSegment. | LineSegment | ||
Returns the affine line defined by the end points of the line segment. | LineSegment | ||
toString():String
String representation of the line. | LineSegment | ||
Returns the vector pointing from the first end point to the second end point of the line segment. | LineSegment |
Method | Defined By | ||
---|---|---|---|
Initializes this object. | LineSegment |
boundingBox | property |
boundingBox:YRectangle
[read-only] Returns the smallest Rectangle which contains the object.
public function get boundingBox():YRectangle
deltaX | property |
deltaX:Number
[read-only] Returns the distance from start to end point in x-coordinates.
public function get deltaX():Number
deltaY | property |
deltaY:Number
[read-only] Returns the distance from start to end point in y-coordinates.
public function get deltaY():Number
firstEndPoint | property |
firstEndPoint:YPoint
[read-only] Returns the first end point of the line segment.
public function get firstEndPoint():YPoint
horizontal | property |
horizontal:Boolean
[read-only] Determines if the interval is horizontal.
public function get horizontal():Boolean
scope | property |
scope:Number
[read-only] Returns the slope of the line segment.
public function get scope():Number
secondEndPoint | property |
secondEndPoint:YPoint
[read-only] Returns the second end point of the line segment.
public function get secondEndPoint():YPoint
vertical | property |
vertical:Boolean
[read-only] Returns if this segment is considered vertical, i.e. the x values of the end point differ less then 0.00000001
public function get vertical():Boolean
xOffset | property |
xOffset:Number
[read-only] Returns the y value of the line on x coordinate 0.
public function get xOffset():Number
LineSegment | () | Constructor |
public function LineSegment(p1:YPoint, p2:YPoint, init:Boolean = true)
Returns a new LineSegment.
Parametersp1:YPoint — the first end point of the line segment.
| |
p2:YPoint — the second end point of the line segment.
| |
init:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
boxIntersectsSegment | () | method |
public static function boxIntersectsSegment(box:YRectangle, s:YPoint, t:YPoint):Boolean
Checks whether a line segment intersects a box.
Parameters
box:YRectangle — A rectangle.
| |
s:YPoint — first end point of the line segment.
| |
t:YPoint — second end point of the line segment.
|
Boolean — true if the line segments intersects the box, false otherwise.
|
boxIntersectsSegment2 | () | method |
public static function boxIntersectsSegment2(box:YRectangle, x1:Number, y1:Number, x2:Number, y2:Number):Boolean
Checks whether a line segment intersects a box. Implemented using the Cohen-Sutherland algorithm.
Parameters
box:YRectangle — A rectangle
| |
x1:Number — x-coordinate of the first end point of the line segment
| |
y1:Number — y-coordinate of the first end point of the line segment
| |
x2:Number — x-coordinate of the second end point of the line segment
| |
y2:Number — y-coordinate of the second end point of the line segment
|
Boolean — true if the line segment intersects the box, false otherwise.
|
boxIntersectsSegment3 | () | method |
public static function boxIntersectsSegment3(boxX1:Number, boxY1:Number, boxX2:Number, boxY2:Number, sX1:Number, sY1:Number, sX2:Number, sY2:Number):Boolean
Checks whether a line segment intersects a paraxial box. Implemented using the Cohen-Sutherland algorithm.
Parameters
boxX1:Number — x-coordinate of the upper left corner of the box
| |
boxY1:Number — y-coordinate of the upper left corner of the box
| |
boxX2:Number — x-coordinate of the lower right corner of the box
| |
boxY2:Number — y-coordinate of the lower right corner of the box
| |
sX1:Number — x-coordinate of the first end point of the line segment
| |
sY1:Number — y-coordinate of the first end point of the line segment
| |
sX2:Number — x-coordinate of the second end point of the line segment
| |
sY2:Number — y-coordinate of the second end point of the line segment
|
Boolean — true if the line segment intersects the box, false otherwise.
|
contains | () | method |
public function contains(point:YPoint):Boolean
Checks whether a given point lies on this line segment.
Parameters
point:YPoint — an arbitrary point.
|
Boolean — true if the line segments intersects the box, false otherwise.
|
getClass | () | method |
override public function getClass():Class
ReturnsClass |
getIntersection | () | method |
public static function getIntersection(s1:LineSegment, s2:LineSegment):YPoint
Returns intersection point between the two line segments, if there is one or null
if the two line segments do not intersect.
Parameters
s1:LineSegment — first line segment
| |
s2:LineSegment — second line segment
|
YPoint |
initLineSegment | () | method |
protected final function initLineSegment(p1:YPoint, p2:YPoint):void
Initializes this object. See the documentation of the corresponding factory method newLineSegment()
for details.
Parameters
p1:YPoint | |
p2:YPoint |
See also
intersectsPoint | () | method |
public function intersectsPoint(p:YPoint):Boolean
Checks whether the line segment intersects a point.
Parameters
p:YPoint — a point
|
Boolean — true if the line segments intersects the given point, false otherwise.
|
intersectsRectangle | () | method |
public function intersectsRectangle(box:YRectangle):Boolean
Checks whether the line segment intersects a box.
Parameters
box:YRectangle — A rectangle.
|
Boolean — true if the line segments intersects the box, false otherwise.
|
isInXIntervall | () | method |
public function isInXIntervall(x:Number):Boolean
Returns if the projection on the X axis of the line segment covers a certain point on the X Axis.
Parameters
x:Number |
Boolean |
isInYIntervall | () | method |
public function isInYIntervall(y:Number):Boolean
Returns if the projection on the Y axis of the line segment covers a certain point on the Y Axis.
Parameters
y:Number |
Boolean |
length | () | method |
public function length():Number
Returns the length of the line segment, this is the value of the Euclidean norm.
ReturnsNumber — an value > 0.
|
newLineSegment | () | method |
public static function newLineSegment(p1:YPoint, p2:YPoint):LineSegment
Returns a new LineSegment.
Parameters
p1:YPoint — the first end point of the line segment.
| |
p2:YPoint — the second end point of the line segment.
|
LineSegment |
toAffineLine | () | method |
public function toAffineLine():AffineLine
Returns the affine line defined by the end points of the line segment.
ReturnsAffineLine |
toString | () | method |
public function toString():String
String representation of the line.
ReturnsString |
toYVector | () | method |
public function toYVector():YVector
Returns the vector pointing from the first end point to the second end point of the line segment.
ReturnsYVector |