![]() |
SignDoc SDK (Java)
5.0.0
|
Coordinates of a rectangle (document coordinates). More...
Public Member Functions | |
Rect () | |
Constructor. More... | |
Rect (double aX1, double aY1, double aX2, double aY2) | |
Constructor. More... | |
void | set (double aX1, double aY1, double aX2, double aY2) |
Set the coordinates of the rectangle. More... | |
double | height () |
Get the height of the rectangle. More... | |
double | width () |
Get the width of the rectangle. More... | |
void | normalize () |
Normalize the rectangle. More... | |
void | scale (double aFactor) |
scale the rectangle. More... | |
double | getWidth () |
Get the width of the rectangle. More... | |
double | getHeight () |
Get the height of the rectangle. More... | |
boolean | isEmpty () |
Check if the rectangle is empty. More... | |
void | intersectWith (Rect aOther) |
Intersect this rectangle with another one. More... | |
void | uniteWith (Rect aOther) |
Unite this rectangle with another one. More... | |
String | toString () |
Public Attributes | |
double | mX1 |
double | mY1 |
double | mX2 |
double | mY2 |
Coordinates of a rectangle (document coordinates).
If coordinates are given in pixels (this is true for TIFF documents), the right and top coordinates are exclusive.
The edges of the rectangle are parallel to the axes.
See Coordinate Systems.
Rect | ( | ) |
Constructor.
All coordinates are set to 0.
Rect | ( | double | aX1, |
double | aY1, | ||
double | aX2, | ||
double | aY2 | ||
) |
Constructor.
[in] | aX1 | The first X coordinate. |
[in] | aY1 | The first Y coordinate. |
[in] | aX2 | The second X coordinate. |
[in] | aY2 | The second Y coordinate. |
double getHeight | ( | ) |
Get the height of the rectangle.
double getWidth | ( | ) |
Get the width of the rectangle.
double height | ( | ) |
Get the height of the rectangle.
void intersectWith | ( | Rect | aOther | ) |
Intersect this rectangle with another one.
If either rectangle is empty, this rectangle will be empty. The resulting rectangle will be normalized.
[in] | aOther | The other rectangle. |
boolean isEmpty | ( | ) |
Check if the rectangle is empty.
A rectangle is empty if the two X coordinates are equal or if the two Y coordinates are equal.
void normalize | ( | ) |
Normalize the rectangle.
Normalize the rectangle to the one with lower-left and upper-right corners assuming that the origin is in the lower-left corner of the page.
This function assumes that document coordinates are used, see Coordinate Systems).
void scale | ( | double | aFactor | ) |
scale the rectangle.
[in] | aFactor | The factor by which the rectangle is to be scaled. |
void set | ( | double | aX1, |
double | aY1, | ||
double | aX2, | ||
double | aY2 | ||
) |
Set the coordinates of the rectangle.
[in] | aX1 | The first X coordinate. |
[in] | aY1 | The first Y coordinate. |
[in] | aX2 | The second X coordinate. |
[in] | aY2 | The second Y coordinate. |
String toString | ( | ) |
void uniteWith | ( | Rect | aOther | ) |
Unite this rectangle with another one.
Replace this rectangle with the smallest rectangle that contains both retangles.
If this rectangle is empty, it will be set to aOther. If aOther is empty, this rectangle won't be modified. The resulting rectangle will be normalized.
[in] | aOther | The other rectangle. |
double width | ( | ) |
Get the width of the rectangle.
double mX1 |
double mX2 |
double mY1 |
double mY2 |