Leaper Vision Toolkit
中文 / English 2.x
Public Member Functions | Properties
ILLine Interface Reference

This interface represents a single straight line(LLine object). More...

Inheritance diagram for ILLine:
ILObject LLine

Public Member Functions

double AcuteAngle (ILLine *line)
 
double AngleTo (ILLine *line)
 
ILLineBisectLine (ILLine *line)
 
double Distance (ILLine *line)
 
void Draw (HDC hdc, double zoomX, double zoomY, double panX, double panY)
 
void FromRotRectRegion (ILRotRectRegion *val)
 
double GetAngle ()
 
ILPointGetEndPoint ()
 
double GetLength ()
 
ILPointGetMidPoint ()
 
ILPointGetStartPoint ()
 
double GetX (double y)
 
double GetY (double x)
 
LPVIntersectType IntersectCircle (ILCircle *circle, ILPoints **intersectPoints)
 
LPVIntersectType IntersectLine (ILLine *line, ILPoint **intersectPoint)
 
LPVIntersectType IntersectPoly (ILPolygon *polygon, ILPoints **intersectPoints)
 
double Parallel (ILLine *line)
 
double Perpendicular (ILPoint *point, ILPoint **rootPoint)
 
ILPolygonResample (int num)
 
ILPolygonResampleByStep (double step, double stepThreshold)
 
void Set (double x1, double y1, double x2, double y2)
 
void Set2 (double midx, double midy, double lineAngle, double length)
 
ILRotRectRegionToRotRectRegion (int exp)
 
ILLineTransform (ILTransform *tf)
 
ILLineTranslate (double offsetX, double offsetY)
 
- Public Member Functions inherited from ILObject
ILObjectCopy ()
 
LPVErrorCode Load (LString filename)
 
void Reset ()
 
LPVErrorCode Save (LString filename)
 
BOOL Valid ()
 

Properties

double X1 [get, set]
 The x-coordinate of the start point of the line.
 
double X2 [get, set]
 The x-coordinate of the end point of the line.
 
double Y1 [get, set]
 The y-coordinate of the start point of the line.
 
double Y2 [get, set]
 The y-coordinate of the end point of the line.
 

Detailed Description

This interface represents a single straight line(LLine object).

Member Function Documentation

◆ AcuteAngle()

double AcuteAngle ( ILLine line)

Calculate the acute angle between this and the input line.

Parameters
[in]lineThe input line
Return values
resultReturn the acute angle.

◆ AngleTo()

double AngleTo ( ILLine line)

Calculate the clockwise angle from the this line to the input line.

Parameters
[in]lineThe input line
Return values
resultReturn the angle.

◆ BisectLine()

ILLine* BisectLine ( ILLine line)

Calculate the bisect line of this and the input line.

Parameters
[in]lineThe input line
Return values
resultReturn the bisect line.

◆ Distance()

double Distance ( ILLine line)

Calculate the distance between this and the input line. For non-parallel lines, the result is calculated as the average perpendicular distance between the middle point of one line to the other.

Parameters
[in]lineThe input line
Return values
resultReturn the bisect line.

◆ Draw()

void Draw ( HDC  hdc,
double  zoomX,
double  zoomY,
double  panX,
double  panY 
)

Draw the line on HDC.

See also
Use Draw Functions
Remarks
This function is currently not available on Linux / MacOS platform.

◆ FromRotRectRegion()

void FromRotRectRegion ( ILRotRectRegion val)

Set placement of the line from the input rotated rectangle region. The angle is the same as the rotated rectangle region, the length is the same as the region's width.

◆ GetAngle()

double GetAngle ( )

Get the angle of the line

Return values
resultReturn the angle.

◆ GetEndPoint()

ILPoint* GetEndPoint ( )

Get the end point of the line \( (X2, Y2) \)

Since
2.1.0

◆ GetLength()

double GetLength ( )

Get the length of the line segment

Return values
resultReturn the length.

◆ GetMidPoint()

ILPoint* GetMidPoint ( )

Get the middle point of the line

◆ GetStartPoint()

ILPoint* GetStartPoint ( )

Get the start point of the line \( (X1, Y1) \)

Since
2.1.0

◆ GetX()

double GetX ( double  y)

Get the x-coordinate of a point on the line with the its y-coordinate

Parameters
[in]yThe y-coordinate of the point on the line
Return values
xReturn the x-coordinate of the point on the line

◆ GetY()

double GetY ( double  x)

Get the y-coordinate of a point on the line with the its x-coordinate

Parameters
[in]xThe x-coordinate of the point on the line
Return values
yReturn the y-coordinate of the point on the line

◆ IntersectCircle()

LPVIntersectType IntersectCircle ( ILCircle circle,
ILPoints **  intersectPoints 
)

Determines whether this line intersects with the given circle. Return the intersection points if they are intersected.

Parameters
[in]circleThe input circle
[out]intersectPointsOutput the intersection points, it should be an empty set for not-intersected case, or 1 point for tangent case, or 2 points for intersected case.
Return values
typeReturn the intersection type depends on the count of intersection points which is on the line segment, Bounded (2), Partial (1) or Unbounded (0).
See also
ILCircle::IntersectLine().

◆ IntersectLine()

LPVIntersectType IntersectLine ( ILLine line,
ILPoint **  intersectPoint 
)

Determines whether this line intersects with the given line. Return the intersection point if they are intersected.

Parameters
[in]lineThe input line
[out]intersectPointOutput the intersection point.
Return values
typeReturn the intersection type depends on whether the intersection point is on the two line segments,

◆ IntersectPoly()

LPVIntersectType IntersectPoly ( ILPolygon polygon,
ILPoints **  intersectPoints 
)

Determines whether this line intersects with the given polygon. Return the intersection points if they are intersected.

Parameters
[in]polygonThe input polygon
[out]intersectPointsOutput the intersection points, it should be an empty set for not-intersected case, 1 or more points for intersected case.
Return values
typeReturn the intersection type depends on the count of intersection points which is on the line segment, Bounded (all), Partial (part) or Unbounded (none).
See also
ILPolygon::IntersectLine().

◆ Parallel()

double Parallel ( ILLine line)

Evaluate whether this and the input line are parallel

Parameters
[in]lineThe input line
Return values
resultReturn the evaluation result, it's a value in (0, 1). For two perfect parallel lines, it's 1.

◆ Perpendicular()

double Perpendicular ( ILPoint point,
ILPoint **  rootPoint 
)

Calculate the perpendicular distance and root from the given point to this line.

Parameters
[in]pointThe input point
[out]rootPointOutput the root point.
Return values
distanceReturn the distance.

◆ Resample()

ILPolygon* Resample ( int  num)

Resample the line object into an open polygon of the specified vertex count. The start and end point is always kept in the resampled result.

Parameters
[in]numThe count of the resampled vertexes, at least 2
Return values
resultReturn the resampling result polygon
See also
ResampleByStep()

◆ ResampleByStep()

ILPolygon* ResampleByStep ( double  step,
double  stepThreshold 
)

Resample the line object into an open polygon, based on the given fixed interval step. The start and end point is always kept in the resampled result.

Parameters
[in]stepThe interval step.
[in]stepThresholdThe last resampling vertex (near the end point of the line) should be omitted if the remaining length is smaller than the threshold. By default, it's 0 means \( Step / 4 \).
Return values
resultReturn the resampling result polygon
See also
Resample()

◆ Set()

void Set ( double  x1,
double  y1,
double  x2,
double  y2 
)

Set placement of the line use two end points

Parameters
[in]x1The x-coordinate of the start point of the line
[in]y1The y-coordinate of the start point of the line
[in]x2The x-coordinate of the end point of the line
[in]y2The y-coordinate of the end point of the line

◆ Set2()

void Set2 ( double  midx,
double  midy,
double  lineAngle,
double  length 
)

Set placement of the line use the middle point and angle

Parameters
[in]midxThe x-coordinate of the middle point of the line
[in]midyThe y-coordinate of the middle point of the line
[in]lineAngleThe angle of the line
[in]lengthThe length of the line

◆ ToRotRectRegion()

ILRotRectRegion* ToRotRectRegion ( int  exp)

Generate a rotated rectangle region use the line object with the given expansion

Parameters
[in]expThe expansion pixels on the both side of the line's placement
Return values
valReturn the rotated rectangle region

◆ Transform()

ILLine* Transform ( ILTransform tf)

Transform the line via the given transformation and return a new line

Parameters
[in]tfThe transformation.
Return values
Returnthe new line

◆ Translate()

ILLine* Translate ( double  offsetX,
double  offsetY 
)

Translate the line by the given offset and return a new line

Parameters
[in]offsetXThe x-coordinate of the offset
[in]offsetYThe y-coordinate of the offset
Return values
resultReturn the new line