LineSegment
The LineSegment class represents a line segment in 2D space. It contains two Point objects, which represent the start point and end point of the line segment.
Definition
Package: com.dynamsoft.core.basic_structures
class LineSegment
Constructors
| Constructor | Description |
|---|---|
LineSegment() |
Initializes a new instance of the LineSegment class. |
LineSegment(Point start, Point end) |
Initializes a new instance with start and end points. |
LineSegment(Point start, Point end, int lineId) |
Initializes a new instance with start point, end point, and line ID. |
LineSegment(LineSegment line) |
Copy constructor. |
Methods
| Method | Description |
|---|---|
getStartPoint |
Gets the start point of the line segment. |
getEndPoint |
Gets the end point of the line segment. |
setStartPoint |
Sets the start point of the line segment. |
setEndPoint |
Sets the end point of the line segment. |
getId |
Gets the ID of the line segment. |
setId |
Sets the ID of the line segment. |
Constructors
LineSegment
Initializes a new instance of the LineSegment class.
LineSegment()
LineSegment
Initializes a new instance of the LineSegment class with start and end points.
LineSegment(Point start, Point end)
Parameters
start The start point of the line segment.
end The end point of the line segment.
LineSegment
Initializes a new instance of the LineSegment class with start point, end point, and line ID.
LineSegment(Point start, Point end, int lineId)
Parameters
start The start point of the line segment.
end The end point of the line segment.
lineId The ID of the line segment.
LineSegment
Copy constructor. Initializes a new instance of the LineSegment class by copying another LineSegment.
LineSegment(LineSegment line)
Parameters
line The LineSegment object to copy.
Methods
getStartPoint
Gets the start point of the line segment.
Point getStartPoint()
Return Value
Returns the start point of the line segment.
See Also
getEndPoint
Gets the end point of the line segment.
Point getEndPoint()
Return Value
Returns the end point of the line segment.
See Also
setStartPoint
Sets the start point of the line segment.
void setStartPoint(Point point)
Parameters
point The start point to set.
setEndPoint
Sets the end point of the line segment.
void setEndPoint(Point point)
Parameters
point The end point to set.
getId
Gets the ID of the line segment.
int getId()
Return Value
Returns the ID of the line segment.
setId
Sets the ID of the line segment.
void setId(int lineId)
Parameters
lineId The ID to set for the line segment.