This interface represents a rotatable rectangle(LRect object) More...
Public Member Functions | |
ILRect * | Adjust (double dtop, double dbottom, double dleft, double dright) |
void | Draw (BOOL bFill, HDC hdc, double zoomX, double zoomY, double panX, double panY) |
void | FromRectRegion (ILRectRegion *val) |
void | FromRotRectRegion (ILRotRectRegion *val) |
double | GetArea () |
ILLine * | GetBottom () |
ILPoint * | GetBottomLeft () |
ILPoint * | GetBottomRight () |
ILRect * | GetBoundingRect () |
ILPoint * | GetCenter () |
ILLine * | GetLeft () |
double | GetPerimeter () |
ILPoints * | GetPoints () |
ILLine * | GetRight () |
ILLine * | GetTop () |
ILPoint * | GetTopLeft () |
ILPoint * | GetTopRight () |
LPVPointTestResult | PointTest (ILPoint *point) |
ILPolygon * | Resample (int num) |
ILPolygon * | ResampleByStep (double step, double stepThreshold) |
void | Set (double x, double y, double w, double h, double a) |
ILRectRegion * | ToRectRegion () |
ILRotRectRegion * | ToRotRectRegion () |
ILRect * | Transform (ILTransform *tf) |
ILRect * | 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 | Angle [get, set] |
The angle of the rectangle, if this is a rotated rectangle. | |
double | Height [get, set] |
The height of the rectangle. | |
double | Width [get, set] |
The width of the rectangle. | |
double | X [get, set] |
The x-coordinate of the rectangle's center. | |
double | Y [get, set] |
The y-coordinate of the rectangle's center. | |
This interface represents a rotatable rectangle(LRect object)
ILRect* Adjust | ( | double | dtop, |
double | dbottom, | ||
double | dleft, | ||
double | dright | ||
) |
Adds dtop, dbottom, dleft and dright respectively to the existing coordinates of the rectangle and return a new rectangle
[in] | dtop | The top border adjustment |
[in] | dbottom | The bottom border adjustment |
[in] | dleft | The left border adjustment |
[in] | dright | The right border adjustment |
result | Return the new rectangle |
void Draw | ( | BOOL | bFill, |
HDC | hdc, | ||
double | zoomX, | ||
double | zoomY, | ||
double | panX, | ||
double | panY | ||
) |
Draw the rectangle on HDC.
[in] | bFill | Whether to fill the circle using current brush. |
void FromRectRegion | ( | ILRectRegion * | val | ) |
Set placement of the rectangle from the input rectangle region, the angle is fixed to 0.
void FromRotRectRegion | ( | ILRotRectRegion * | val | ) |
Set placement of the rectangle from the input rotated rectangle region.
double GetArea | ( | ) |
Get the area of the rectangle
val | Return the area value |
ILLine* GetBottom | ( | ) |
Get the button segment line of the rectangle from the bottom-left to the bottom-right corner
ILPoint* GetBottomLeft | ( | ) |
Get the bottom-left corner point of the rectangle
ILPoint* GetBottomRight | ( | ) |
Get the bottom-right corner point of the rectangle
ILRect* GetBoundingRect | ( | ) |
Get the bounding rectangle of the rectangle. For not-rotated rectangle, the bounding rectangle should be exactly the same as itself.
ILPoint* GetCenter | ( | ) |
Get the center point of the rectangle
ILLine* GetLeft | ( | ) |
Get the left segment line of the rectangle from the top-left to the bottom-left corner
double GetPerimeter | ( | ) |
Get the perimeter of the rectangle
val | Return the perimeter value |
ILPoints* GetPoints | ( | ) |
Get all corner points of the rectangle for further calculation, like generate bounding shape, fitting. It's in the following order: bottom-left, top-left, top-right, bottom-right.
val | Return the collection of points. |
ILLine* GetRight | ( | ) |
Get the right segment line of the rectangle from the top-right to bottom-right corner
ILLine* GetTop | ( | ) |
Get the top segment line of the rectangle from the top-left to the top-right corner
ILPoint* GetTopLeft | ( | ) |
Get the top-left corner point of the rectangle
ILPoint* GetTopRight | ( | ) |
Get the top-right corner point of the rectangle
LPVPointTestResult PointTest | ( | ILPoint * | point | ) |
Determines whether the point is inside this rectangle, outside, or lies on the edge.
[in] | point | The input point |
val | Return the test result |
ILPolygon* Resample | ( | int | num | ) |
Resample the rectangle object into a closed polygon of the specified vertex count. The 4 corner points are always kept in the resampled result.
[in] | num | The count of the resampled vertexes. Should be an even number, and at least 4. |
result | Return the resampling result polygon |
ILPolygon* ResampleByStep | ( | double | step, |
double | stepThreshold | ||
) |
Resample the rectangle object into a closed polygon, based on the given fixed interval step. The 4 corner points are always kept in the resampled result.
[in] | step | The interval step. |
[in] | stepThreshold | The last resampling vertex of a segment should be omitted if the remaining length to the rectangle corner is smaller than the threshold. By default, it's 0 means \( Step / 4 \). |
result | Return the resampling result polygon |
void Set | ( | double | x, |
double | y, | ||
double | w, | ||
double | h, | ||
double | a | ||
) |
Set placement of the rectangle
[in] | x | The x-coordinate of the rectangle's center |
[in] | y | The x-coordinate of the rectangle's center |
[in] | w | The width of the rectangle |
[in] | h | The height of the rectangle |
[in] | a | The angle of the rectangle, by default, it's 0 means a non-rotated rectangle. |
ILRectRegion* ToRectRegion | ( | ) |
Generate a rectangle region use the rectangle object
val | Return the rectangle region |
ILRotRectRegion* ToRotRectRegion | ( | ) |
Generate a rotated rectangle region use the rectangle object
Return | the rotated rectangle region |
ILRect* Transform | ( | ILTransform * | tf | ) |
Transform the rectangle via the given transformation and return a new rectangle. Note that for an affine or perspective transformation, the result rectangle is the bounding rotated rectangle of the mapping result points of the rectangle's corners. For the transformation result of a rectangle can be any quadrangle.
[in] | tf | The transformation. |
Return | the new rectangle |
ILRect* Translate | ( | double | offsetX, |
double | offsetY | ||
) |
Translate the rectangle by the given offset and return a new rectangle
[in] | offsetX | The x-coordinate of the offset |
[in] | offsetY | The y-coordinate of the offset |
result | Return the new rectangle |