Foxit PDF SDK

Instance Methods | Class Methods | Properties | List of all members
FSRectF Class Reference

Inherits NSObject.

## Instance Methods
(BOOL) | - contains:
| Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one. More...
(BOOL) | - containsPointF:
| Check if current rectangle fully contains the provided point. That means to check if the provided point is inside current rectangle. More...
(void) | - defalteWithValues:y:
| Decreases the width and height of the rectangle. More...
(void) | - deflate:
| Decreases the width and height of the rectangle. More...
(FSRectI *) | - getClosestRect
| Get a closest integer rectangle. More...
(FSRectI *) | - getInnerRect
| Convert to an inner integer rectangle. More...
(FSRectI *) | - getOuterRect
| Convert to an outer integer rectangle. More...
(float) | - height
| Get the height of the rectangle. More...
(void) | - inflate:
| Increases the width and height of the rectangle. More...
(void) | - inflateWithValues:y:
| Increases the width and height of the rectangle. More...
(id) | - init
| Construct an empty rectangle.
(void) | - initRect:y:
| Initialize the rectangle to a single point. More...
(id) | - initWithLeft1:bottom1:right1:top1:
| Construct a rectangle with left-bottom and right-top corners. More...
(id) | - initWithRect:
| Construct a rectangle with a rectangle object. More...
(void) | - intersect:
| Intersect with a rect. More...
(BOOL) | - isEmpty
| Verify whether the rect is empty. More...
(void) | - normalize
| Normalize the rect. Make sure left <= right, and bottom <= top. More...
(void) | - reset
| Reset rectangle, set coordinates to 0. More...
(void) | - transform:
| Transform a rectangle. The result rectangle is always normalized. More...
(void) | - translate:f:
| Translate rectangle. More...
(void) | - union:
| Union with a rect. More...
(void) | - updateRect:y:
| Update the rectangle to contain the specified point. More...
(float) | - width
| Get the width of the rectangle. More...

## Class Methods
(FSRectF *) | + getBBox:nPoints:
| Get the bounding box of input points array. More...
(BOOL) | + IsRectAdjacent:rect2:alignmentTolerance:distanceTolerance:direction:
| Check if a rectangle is adjacent to the other rectangle in the horizontal or vertical direction. More...

## Properties
float | bottom
| The bottom.
float | left
| The left.
float | right
| The right.
float | top
| The top.

## Detailed Description

A float-point coordination rectangle. A normalized float-point rectangle always has top larger than bottom, which is the opposite of Windows rectangle.

## Method Documentation

## ◆ contains:()

- (BOOL) contains: |  | (FSRectF*) | other_rect |

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
  YES means current rectangle fully contains the other one, while NO means not.

## ◆ containsPointF:()

- (int) containsPointF: |  | (FSPointF*) | point |

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

Returns
  YES means current rectangle contains the provided point, while NO means not.

## ◆ defalteWithValues:y:()

- (void) defalteWithValues: |  | (float) | x
y: |  | (float) | y

Decreases the width and height of the rectangle.

Parameters

  [in] | x | The number to deflate the left and right of the rectangle.
  [in] | y | The number to deflate the top and bottom of the rectangle.

Returns
  None.

## ◆ deflate:()

- (void) deflate: |  | (FSRectF*) | rt |

Decreases the width and height of the rectangle.

Parameters

  [in] | rt | The rectangle to deflate each side.

Returns
  None.

## ◆ getBBox:nPoints:()

+ (FSRectF *) getBBox: |  | (FSPointF*) | pPoints
nPoints: |  | (int) | nPoints

Get the bounding box of input points array.

Parameters

  [in] | pPoints | The input points array.
  [in] | nPoints | The number of points in the array.

Returns
  A floating-point coordination rectangle.

## ◆ getClosestRect()

- (FSRectI *) getClosestRect |  |  |

Get a closest integer rectangle.

Returns
  The closest integer rectangle.

## ◆ getInnerRect()

- (FSRectI *) getInnerRect |  |  |

Convert to an inner integer rectangle.

Returns
  The inner integer rectangle.

## ◆ getOuterRect()

- (FSRectI *) getOuterRect |  |  |

Convert to an outer integer rectangle.

Returns
  The outer integer rectangle.

## ◆ height()

- (float) height |  |  |

Get the height of the rectangle.

Returns
  Height of the rectangle.

## ◆ inflate:()

- (void) inflate: |  | (FSRectF*) | rt |

Increases the width and height of the rectangle.

Parameters

  [in] | rt | The rectangle to inflate each side.

Returns
  None.

## ◆ inflateWithValues:y:()

- (void) inflateWithValues: |  | (float) | x
y: |  | (float) | y

Increases the width and height of the rectangle.

Parameters

  [in] | x | The number to inflate the left and right of the rectangle.
  [in] | y | The number to inflate the top and bottom of the rectangle.

Returns
  None.

## ◆ initRect:y:()

- (void) initRect: |  | (float) | x
y: |  | (float) | y

Initialize the rectangle to a single point.

Parameters

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

Returns
  None.

## ◆ initWithLeft1:bottom1:right1:top1:()

- (id) initWithLeft1: |  | (float) | left1
bottom1: |  | (float) | bottom1
right1: |  | (float) | right1
top1: |  | (float) | top1

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

Parameters

  [in] | left1 | The x-coordinate of the input left-bottom corner.
  [in] | bottom1 | The y-coordinate of the input left-bottom corner.
  [in] | right1 | The x-coordinate of the input right-top corner.
  [in] | top1 | The y-coordinate of the input right-top corner.

## ◆ initWithRect:()

- (id) initWithRect: |  | (FSRectI*) | rect |

Construct a rectangle with a rectangle object.

Parameters

  [in] | rect | The input rectangle object.

## ◆ intersect:()

- (void) intersect: |  | (FSRectF*) | other_rect |

Intersect with a rect.

Parameters

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

Returns
  None.

## ◆ isEmpty()

- (BOOL) isEmpty |  |  |

Verify whether the rect is empty.

Returns
  YES meanas current rect is empty, while NO means not.

## ◆ IsRectAdjacent:rect2:alignmentTolerance:distanceTolerance:direction:()

+ (BOOL) IsRectAdjacent: |  | (FSRectF*) | rect1
rect2: |  | (FSRectF*) | rect2
alignmentTolerance: |  | (float) | alignmentTolerance
distanceTolerance: |  | (float) | distanceTolerance
direction: |  | (int) | direction

Check if a rectangle is adjacent to the other rectangle in the horizontal or vertical direction.

Parameters

  [in] | rect1 | A rectangle which is to be check if adjacent to parameter rect2.
  [in] | rect2 | The other rectangle.
  [in] | alignmentTolerance | Alignment tolerance to be allowed between two rectangles. Measured in coordinate units, and should be non-negative value.
  [in] | distanceTolerance | Distance tolerance to be allowed between two rectangles. Measured in coordinate units, and should be non-negative value.
  [in] | direction | Specify a direction to judge adjacent state between two rectangles: 0 means horizontal direction. 1 means vertical direction.

Returns
  YES means the specified rectangle is adjacent to the other specified rectangle in specified direction, while NO means the specified rectangle is not adjacent to the other specified rectangle in specified direction.

## ◆ normalize()

- (void) normalize |  |  |

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

Returns
  None.

## ◆ reset()

- (void) reset |  |  |

Reset rectangle, set coordinates to 0.

Returns
  None.

## ◆ transform:()

- (void) transform: |  | (FSMatrix2D*) | pMatrix |

Transform a rectangle. The result rectangle is always normalized.

Parameters

  [in] | pMatrix | The transformation matrix.

Returns
  None.

## ◆ translate:f:()

- (void) translate: |  | (float) | e
f: |  | (float) | f

Translate rectangle.

Parameters

  [in] | e | Offset in X-axis.
  [in] | f | Offset in Y-axis.

Returns
  None.

## ◆ union:()

- (void) union: |  | (FSRectF*) | other_rect |

Union with a rect.

Parameters

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

Returns
  None.

## ◆ updateRect:y:()

- (void) updateRect: |  | (float) | x
y: |  | (float) | y

Update the rectangle to contain the specified point.

Parameters

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

Returns
  None.

## ◆ width()

- (float) width |  |  |

Get the width of the rectangle.

Returns
  Width of the rectangle.