iText 8.0.2 API
iText.Kernel.Geom.LineSegment Class Reference

Represents a line segment in a particular coordinate system. More...

Public Member Functions

  LineSegment (Vector startPoint, Vector endPoint)
  Creates a new line segment. More...
 
virtual Vector  GetStartPoint ()
 
Returns
the start point

 
virtual Vector  GetEndPoint ()
 
Returns
the end point

 
virtual float  GetLength ()
 
Returns
the length of this line segment

 
virtual Rectangle  GetBoundingRectangle ()
  Computes the bounding rectangle for this line segment. More...
 
virtual iText.Kernel.Geom.LineSegment  TransformBy (Matrix m)
  Transforms the segment by the specified matrix More...
 
virtual bool  ContainsSegment (iText.Kernel.Geom.LineSegment other)
  Checks if a segment contains another segment in itself More...
 
virtual bool  ContainsPoint (Vector point)
  Checks if a segment contains a given point in itself More...
 

Detailed Description

Represents a line segment in a particular coordinate system.

Represents a line segment in a particular coordinate system. This class is immutable.

Constructor & Destructor Documentation

◆ LineSegment()

iText.Kernel.Geom.LineSegment.LineSegment ( Vector  startPoint,
Vector  endPoint 
)
inline

Creates a new line segment.

Parameters
startPoint the start point of a line segment.
endPoint the end point of a line segment.

Member Function Documentation

◆ ContainsPoint()

virtual bool iText.Kernel.Geom.LineSegment.ContainsPoint ( Vector  point )
inlinevirtual

Checks if a segment contains a given point in itself

Parameters
point a point to be checked
Returns
true if this segment contains given point, false otherwise

◆ ContainsSegment()

virtual bool iText.Kernel.Geom.LineSegment.ContainsSegment ( iText.Kernel.Geom.LineSegment  other )
inlinevirtual

Checks if a segment contains another segment in itself

Parameters
other a segment to be checked
Returns
true if this segment contains other one, false otherwise

◆ GetBoundingRectangle()

virtual Rectangle iText.Kernel.Geom.LineSegment.GetBoundingRectangle ( )
inlinevirtual

Computes the bounding rectangle for this line segment.

Computes the bounding rectangle for this line segment. The rectangle has a rotation 0 degrees with respect to the coordinate system that the line system is in. For example, if a line segment is 5 unit long and sits at a 37 degree angle from horizontal, the bounding rectangle will have origin of the lower left hand end point of the segment, with width = 4 and height = 3.

Returns
the bounding rectangle

◆ TransformBy()

virtual iText.Kernel.Geom.LineSegment iText.Kernel.Geom.LineSegment.TransformBy ( Matrix  m )
inlinevirtual

Transforms the segment by the specified matrix

Parameters
m the matrix for the transformation
Returns
the transformed segment