Foxit PDF SDK
FSRectF类 参考

继承自 NSObject .

构造函数

(BOOL) - contains:
 检查当前矩形是否完全包含其他提供的矩形。 即检查其他矩形是否完全在当前矩形内部。
更多...
 
(BOOL) - containsPointF:
 检查当前矩形是否完全包含提供的点。 即检查提供的点是否在当前矩形内部。
更多...
 
(void) - defalteWithValues:y:
 减少矩形的宽度和高度。
更多...
 
(void) - deflate:
 减少矩形的宽度和高度。
更多...
 
(FSRectI *) - getClosestRect
 获取最接近的整数矩形。
更多...
 
(FSRectI *) - getInnerRect
 转换为内部整数矩形。
更多...
 
(FSRectI *) - getOuterRect
 转换为外部整数矩形。
更多...
 
(float) - height
 获取矩形的高度。
更多...
 
(void) - inflate:
 增加矩形的宽度和高度。
更多...
 
(void) - inflateWithValues:y:
 增加矩形的宽度和高度。
更多...
 
(id) - init
 构造一个空矩形。

 
(void) - initRect:y:
 将矩形初始化为单个点。
更多...
 
(id) - initWithLeft1:bottom1:right1:top1:
 用左下角和右上角构造矩形。
更多...
 
(id) - initWithRect:
 用rectangle对象构造矩形。
更多...
 
(void) - intersect:
 与矩形求交集。
更多...
 
(BOOL) - isEmpty
 验证矩形是否为空。
更多...
 
(void) - normalize
 规范化矩形。确保left <= right,以及bottom <= top。
更多...
 
(void) - reset
 重置矩形,将坐标设置为0。
更多...
 
(void) - transform:
 变换矩形。结果矩形总是规范化的。
更多...
 
(void) - translate:f:
 平移矩形。
更多...
 
(void) - union:
 与矩形求并集。
更多...
 
(void) - updateRect:y:
 更新矩形以包含指定的点。
更多...
 
(float) - width
 获取矩形的宽度。
更多...
 

类方法

(FSRectF *) + getBBox:nPoints:
 获取输入点数组的边界框。
更多...
 
(BOOL) + IsRectAdjacent:rect2:alignmentTolerance:distanceTolerance:direction:
 检查一个矩形是否在水平或垂直方向上与另一个矩形相邻。
更多...
 

属性

float bottom
 底部边界。

 
float left
 左边界。

 
float right
 右边界。

 
float top
 顶部边界。

 

详细描述

浮点坐标矩形。 规范化的浮点矩形始终具有大于bottom的top,这与Windows矩形相反。

函数文档

◆ contains:()

- (BOOL) contains: (FSRectF*)  other_rect

检查当前矩形是否完全包含其他提供的矩形。 即检查其他矩形是否完全在当前矩形内部。

参数
[in]other_rect其他提供的矩形。
返回
YES表示当前矩形完全包含其他矩形,NO表示不包含。

◆ containsPointF:()

- (int) containsPointF: (FSPointF*)  point

检查当前矩形是否完全包含提供的点。 即检查提供的点是否在当前矩形内部。

返回
YES表示当前矩形包含提供的点,NO表示不包含。

◆ defalteWithValues:y:()

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

减少矩形的宽度和高度。

参数
[in]x用于减少矩形左边和右边的数值。
[in]y用于减少矩形顶部和底部的数值。
返回
无。

◆ deflate:()

- (void) deflate: (FSRectF*)  rt

减少矩形的宽度和高度。

参数
[in]rt用于减少各边的矩形。
返回
无。

◆ getBBox:nPoints:()

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

获取输入点数组的边界框。

参数
[in]pPoints输入的点数组。
[in]nPoints数组中点的数量。
返回
浮点坐标矩形。

◆ getClosestRect()

- (FSRectI *) getClosestRect

获取最接近的整数矩形。

返回
最接近的整数矩形。

◆ getInnerRect()

- (FSRectI *) getInnerRect

转换为内部整数矩形。

返回
内部整数矩形。

◆ getOuterRect()

- (FSRectI *) getOuterRect

转换为外部整数矩形。

返回
外部整数矩形。

◆ height()

- (float) height

获取矩形的高度。

返回
矩形的高度。

◆ inflate:()

- (void) inflate: (FSRectF*)  rt

增加矩形的宽度和高度。

参数
[in]rt用于扩展各边的矩形。
返回
无。

◆ inflateWithValues:y:()

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

增加矩形的宽度和高度。

参数
[in]x用于扩展矩形左边和右边的数值。
[in]y用于扩展矩形顶部和底部的数值。
返回
无。

◆ initRect:y:()

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

将矩形初始化为单个点。

参数
[in]x输入点的x坐标。
[in]y输入点的y坐标。
返回
无。

◆ initWithLeft1:bottom1:right1:top1:()

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

用左下角和右上角构造矩形。

参数
[in]left1输入左下角的x坐标。
[in]bottom1输入左下角的y坐标。
[in]right1输入右上角的x坐标。
[in]top1输入右上角的y坐标。

◆ initWithRect:()

- (id) initWithRect: (FSRectI*)  rect

用rectangle对象构造矩形。

参数
[in]rect输入的rectangle对象。

◆ intersect:()

- (void) intersect: (FSRectF*)  other_rect

与矩形求交集。

参数
[in]other_rect要求交集的矩形。
返回
无。

◆ isEmpty()

- (BOOL) isEmpty

验证矩形是否为空。

返回
YES表示当前矩形为空,NO表示不为空。

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

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

检查一个矩形是否在水平或垂直方向上与另一个矩形相邻。

参数
[in]rect1要检查是否与参数 rect2 相邻的矩形。
[in]rect2另一个矩形。
[in]alignmentTolerance两个矩形之间允许的对齐容差。以坐标单位测量,应为非负值。
[in]distanceTolerance两个矩形之间允许的距离容差。以坐标单位测量,应为非负值。
[in]direction指定判断两个矩形之间相邻状态的方向:
  • 0 表示水平方向。
  • 1 表示垂直方向。

返回
YES 表示指定的矩形在指定方向上与另一个指定的矩形相邻, 而 NO 表示指定的矩形在指定方向上与另一个指定的矩形不相邻。

◆ normalize()

- (void) normalize

规范化矩形。确保left <= right,以及bottom <= top。

返回
无。

◆ reset()

- (void) reset

重置矩形,将坐标设置为0。

返回
无。

◆ transform:()

- (void) transform: (FSMatrix2D*)  pMatrix

变换矩形。结果矩形总是规范化的。

参数
[in]pMatrix变换矩阵。
返回
无。

◆ translate:f:()

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

平移矩形。

参数
[in]eX轴上的偏移量。
[in]fY轴上的偏移量。
返回
无。

◆ union:()

- (void) union: (FSRectF*)  other_rect

与矩形求并集。

参数
[in]other_rect要求并集的矩形。
返回
无。

◆ updateRect:y:()

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

更新矩形以包含指定的点。

参数
[in]x输入点的x坐标。
[in]y输入点的y坐标。
返回
无。

◆ width()

- (float) width

获取矩形的宽度。

返回
矩形的宽度。