Foxit PDF SDK

Public Member Functions | Public Attributes | List of all members
FX_RECT Struct Reference
FXCRT

## Public Member Functions
| FX_RECT ()
| Construct a rect not initialized.
| FX_RECT (int left1, int top1, int right1, int bottom1)
| Construct a rect with left-top and right bottom corners. More...
FX_BOOL | Contains (const FX_RECT &other_rect) const
| Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one. More...
FX_BOOL | Contains (int x, int y) const
| Check if current rectangle contains the provided point. That means to check if the provided point is inside current one. More...
int | Height () const
| Get the height of the rect. More...
void | Intersect (const FX_RECT &src)
| Intersect with a rect. More...
void | Intersect (int left1, int top1, int right1, int bottom1)
| Intersect with a rect. More...
FX_BOOL | IsEmpty () const
| Verify whether the rect is empty. More...
void | Normalize ()
| Normalize the rect. Make sure left <= right, top <= bottom. More...
void | Offset (int dx, int dy)
| Shift the coordinates by delta value of x and y directions. More...
FX_BOOL | operator != (const FX_RECT &src) const
| Compare(!=) operator overload. Compare two rectangles. Please make sure they are normalized first. More...
FX_BOOL | operator== (const FX_RECT &src) const
| Compare(==) operator overload. Compare two rectangles. Please make sure they are normalized first. More...
void | Union (const FX_RECT &other_rect)
| Union with a rect. More...
FX_BOOL | Valid () const
| Check if current rectangle is valid. More...
int | Width () const
| Get the width of the rect. More...

## Public Attributes
int | bottom
| The bottom.
int | left
| The left.
int | right
| The right.
int | top
| The top.

## Detailed Description

The struct represents integer rectangle for Windows coordinates. Defined as equivalent of Windows RECT structure, with some convenient function members. This structure use Windows space where Y axis runs from top to bottom.

## Constructor & Destructor Documentation

## ◆ FX_RECT()

FX_RECT::FX_RECT | ( | int | left1,
|  | int | top1,
|  | int | right1,
|  | int | bottom1
| ) |  |
| inline

Construct a rect with left-top and right bottom corners.

Parameters

  [in] | left1 | The left.
  [in] | top1 | The top.
  [in] | right1 | The right.
  [in] | bottom1 | The bottom.

## Member Function Documentation

## ◆ Contains() [1/2]

FX_BOOL FX_RECT::Contains | ( | const FX_RECT & | other_rect | ) | const
| inline

Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one.

Parameters

  [in] | other_rect | The other provided rect.

Returns
  true means current rect fully contains the other rectangle, while false means not.

## ◆ Contains() [2/2]

FX_BOOL FX_RECT::Contains | ( | int | x,
|  | int | y
| ) |  | const
| inline

Check if current rectangle contains the provided point. That means to check if the provided point is inside current one.

Parameters

  [in] | x | The x coordinate of the provided point.
  [in] | y | The y coordinate of the provided point.

Returns
  true means current rect contains the provided point, while false means not.

## ◆ Height()

int FX_RECT::Height | ( |  | ) | const
| inline

Get the height of the rect.

Returns
  The height of the rect.

## ◆ Intersect() [1/2]

void FX_RECT::Intersect | ( | const FX_RECT & | src | ) |

Intersect with a rect.

Parameters

  [in] | src | The rect to intersect with.

Returns
  None.

## ◆ Intersect() [2/2]

void FX_RECT::Intersect | ( | int | left1,
|  | int | top1,
|  | int | right1,
|  | int | bottom1
| ) |  |
| inline

Intersect with a rect.

Parameters

  [in] | left1 | The left of the rect to intersect with.
  [in] | top1 | The top of the rect to intersect with.
  [in] | right1 | The right of the rect to intersect with.
  [in] | bottom1 | The bottom of the rect to intersect with.

Returns
  None.

## ◆ IsEmpty()

FX_BOOL FX_RECT::IsEmpty | ( |  | ) | const
| inline

Verify whether the rect is empty.

Returns
  true means current rect is empty, while false means not.

## ◆ Normalize()

void FX_RECT::Normalize | ( |  | ) |

Normalize the rect. Make sure left <= right, top <= bottom.

Returns
  None.

## ◆ Offset()

void FX_RECT::Offset | ( | int | dx,
|  | int | dy
| ) |  |
| inline

Shift the coordinates by delta value of x and y directions.

Parameters

  [in] | dx | The delta value of x-direction.
  [in] | dy | The delta value of y-direction.

Returns
  None.

## ◆ operator !=()

FX_BOOL FX_RECT::operator != | ( | const FX_RECT & | src | ) | const
| inline

Compare(!=) operator overload. Compare two rectangles. Please make sure they are normalized first.

Parameters

  [in] | src | The rect to compare.

Returns
  true means not equal, while false means equal.

## ◆ operator==()

FX_BOOL FX_RECT::operator== | ( | const FX_RECT & | src | ) | const
| inline

Compare(==) operator overload. Compare two rectangles. Please make sure they are normalized first.

Parameters

  [in] | src | The rect to compare.

Returns
  true means equal, while false means not equal.

## ◆ Union()

void FX_RECT::Union | ( | const FX_RECT & | other_rect | ) |

Union with a rect.

Parameters

  [in] | other_rect | The rect to union with.

Returns
  None.

## ◆ Valid()

FX_BOOL FX_RECT::Valid | ( |  | ) | const

Check if current rectangle is valid.

Returns
  true means valid, while false means invalid.

## ◆ Width()

int FX_RECT::Width | ( |  | ) | const
| inline

Get the width of the rect.

Returns
  The width of the rect.