This interface represents a single straight line(LLine object). More...
Public Member Functions | |
double | AcuteAngle (ILLine *line) |
double | AngleTo (ILLine *line) |
ILLine * | BisectLine (ILLine *line) |
double | Distance (ILLine *line) |
void | Draw (HDC hdc, double zoomX, double zoomY, double panX, double panY) |
void | FromRotRectRegion (ILRotRectRegion *val) |
double | GetAngle () |
ILPoint * | GetEndPoint () |
double | GetLength () |
ILPoint * | GetMidPoint () |
ILPoint * | GetStartPoint () |
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) |
ILPolygon * | Resample (int num) |
ILPolygon * | ResampleByStep (double step, double stepThreshold) |
void | Set (double x1, double y1, double x2, double y2) |
void | Set2 (double midx, double midy, double lineAngle, double length) |
ILRotRectRegion * | ToRotRectRegion (int exp) |
ILLine * | Transform (ILTransform *tf) |
ILLine * | Translate (double offsetX, double offsetY) |
Public Member Functions inherited from ILObject | |
ILObject * | Copy () |
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. | |
This interface represents a single straight line(LLine object).
double AcuteAngle | ( | ILLine * | line | ) |
Calculate the acute angle between this and the input line.
[in] | line | The input line |
result | Return the acute angle. |
double AngleTo | ( | ILLine * | line | ) |
Calculate the clockwise angle from the this line to the input line.
[in] | line | The input line |
result | Return the angle. |
Calculate the bisect line of this and the input line.
[in] | line | The input line |
result | Return the bisect line. |
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.
[in] | line | The input line |
result | Return the bisect line. |
void Draw | ( | HDC | hdc, |
double | zoomX, | ||
double | zoomY, | ||
double | panX, | ||
double | panY | ||
) |
Draw the line on HDC.
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.
double GetAngle | ( | ) |
Get the angle of the line
result | Return the angle. |
ILPoint* GetEndPoint | ( | ) |
Get the end point of the line \( (X2, Y2) \)
double GetLength | ( | ) |
Get the length of the line segment
result | Return the length. |
ILPoint* GetMidPoint | ( | ) |
Get the middle point of the line
ILPoint* GetStartPoint | ( | ) |
Get the start point of the line \( (X1, Y1) \)
double GetX | ( | double | y | ) |
Get the x-coordinate of a point on the line with the its y-coordinate
[in] | y | The y-coordinate of the point on the line |
x | Return the x-coordinate of the point on the line |
double GetY | ( | double | x | ) |
Get the y-coordinate of a point on the line with the its x-coordinate
[in] | x | The x-coordinate of the point on the line |
y | Return the y-coordinate of the point on the line |
LPVIntersectType IntersectCircle | ( | ILCircle * | circle, |
ILPoints ** | intersectPoints | ||
) |
Determines whether this line intersects with the given circle. Return the intersection points if they are intersected.
[in] | circle | The input circle |
[out] | intersectPoints | Output 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. |
type | Return the intersection type depends on the count of intersection points which is on the line segment, Bounded (2), Partial (1) or Unbounded (0). |
LPVIntersectType IntersectLine | ( | ILLine * | line, |
ILPoint ** | intersectPoint | ||
) |
Determines whether this line intersects with the given line. Return the intersection point if they are intersected.
[in] | line | The input line |
[out] | intersectPoint | Output the intersection point. |
type | Return the intersection type depends on whether the intersection point is on the two line segments, |
LPVIntersectType IntersectPoly | ( | ILPolygon * | polygon, |
ILPoints ** | intersectPoints | ||
) |
Determines whether this line intersects with the given polygon. Return the intersection points if they are intersected.
[in] | polygon | The input polygon |
[out] | intersectPoints | Output the intersection points, it should be an empty set for not-intersected case, 1 or more points for intersected case. |
type | Return the intersection type depends on the count of intersection points which is on the line segment, Bounded (all), Partial (part) or Unbounded (none). |
double Parallel | ( | ILLine * | line | ) |
Evaluate whether this and the input line are parallel
[in] | line | The input line |
result | Return the evaluation result, it's a value in (0, 1). For two perfect parallel lines, it's 1. |
Calculate the perpendicular distance and root from the given point to this line.
[in] | point | The input point |
[out] | rootPoint | Output the root point. |
distance | Return the distance. |
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.
[in] | num | The count of the resampled vertexes, at least 2 |
result | Return the resampling result polygon |
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.
[in] | step | The interval step. |
[in] | stepThreshold | The 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 \). |
result | Return the resampling result polygon |
void Set | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Set placement of the line use two end points
[in] | x1 | The x-coordinate of the start point of the line |
[in] | y1 | The y-coordinate of the start point of the line |
[in] | x2 | The x-coordinate of the end point of the line |
[in] | y2 | The y-coordinate of the end point of the line |
void Set2 | ( | double | midx, |
double | midy, | ||
double | lineAngle, | ||
double | length | ||
) |
Set placement of the line use the middle point and angle
[in] | midx | The x-coordinate of the middle point of the line |
[in] | midy | The y-coordinate of the middle point of the line |
[in] | lineAngle | The angle of the line |
[in] | length | The length of the line |
ILRotRectRegion* ToRotRectRegion | ( | int | exp | ) |
Generate a rotated rectangle region use the line object with the given expansion
[in] | exp | The expansion pixels on the both side of the line's placement |
val | Return the rotated rectangle region |
ILLine* Transform | ( | ILTransform * | tf | ) |
Transform the line via the given transformation and return a new line
[in] | tf | The transformation. |
Return | the new line |
ILLine* Translate | ( | double | offsetX, |
double | offsetY | ||
) |
Translate the line by the given offset and return a new line
[in] | offsetX | The x-coordinate of the offset |
[in] | offsetY | The y-coordinate of the offset |
result | Return the new line |