Foxit PDF SDK
foxit::common::Path类 参考
类 foxit::common::Path 继承关系图:
foxit::Base

Public 类型

enum  PointType {
  e_TypeMoveTo = 1, e_TypeLineTo = 2, e_TypeLineToCloseFigure = 3, e_TypeBezierTo = 4,
  e_TypeBezierToCloseFigure = 5
}
 路径中点类型枚举。 更多...
 

Public 成员函数

 Path ()
 构造函数。
 
 Path (const Path &other)
 使用另一个路径对象的构造函数。 更多...
 
 ~Path ()
 析构函数。
 
bool AppendEllipse (const RectF &rect)
 向当前路径的末尾添加椭圆图形。 更多...
 
bool AppendRect (const RectF &rect)
 向当前路径的末尾添加矩形图形。 更多...
 
void Clear ()
 清除所有点。 更多...
 
bool CloseFigure ()
 关闭当前图形(也是当前路径中的最后一个图形)。 更多...
 
bool CubicBezierTo (const PointF &point1, const PointF &point2, const PointF &point3)
 通过三个点向当前图形的末尾添加三次贝塞尔样条: 两个控制点和一个目标点。 更多...
 
PointF GetPoint (int index)
 获取由索引指定的点。 更多...
 
int GetPointCount ()
 获取点的数量。 更多...
 
PointType GetPointType (int index)
 获取由索引指定的点的类型。 更多...
 
void IncreasePointCount (int count)
 增加点数量并为这些新点准备足够的内存。 更多...
 
bool IsEmpty () const
 检查当前对象是否为空。 更多...
 
bool LineTo (const PointF &point)
 向当前图形的末尾添加一个点,并从当前点到新点绘制一条线。 更多...
 
bool MoveTo (const PointF &point)
 向当前路径的末尾添加一个点,以开始新的图形。 更多...
 
bool operator != (const Path &other) const
 不相等操作符。 更多...
 
Pathoperator= (const Path &other)
 赋值操作符。 更多...
 
bool operator== (const Path &other) const
 相等操作符。 更多...
 
bool RemovePoint (int index)
 移除由索引指定的点。 更多...
 
bool SetPoint (int index, const PointF &point, PointType type)
 更改由索引指定的点的值和类型。 更多...
 
void Transform (const Matrix &matrix)
 使用给定矩阵变换当前路径中的所有点。 更多...
 
- Public 成员函数 继承自 foxit::Base
FS_HANDLE Handle () const
 获取当前对象的句柄。 更多...
 

详细描述

此类表示包含一个或多个图形的路径。

成员枚举类型说明

◆ PointType

路径中点类型枚举。

此枚举的值应单独使用。

枚举值
e_TypeMoveTo 

表示该点是图形的第一个点。

e_TypeLineTo 

表示从前一个点到当前点绘制一条直线。

e_TypeLineToCloseFigure 

表示从前一个点到当前点绘制一条直线, 并且该点还将连接到此点之前最近的 Path::e_TypeMoveTo 点,以便闭合当前图形。

e_TypeBezierTo 

表示该点是贝塞尔样条的控制点或结束点。

e_TypeBezierToCloseFigure 

表示该点是贝塞尔样条的结束点, 并且该点还将连接到此点之前最近的 Path::e_TypeMoveTo 点,以便闭合当前图形。

构造及析构函数说明

◆ Path()

foxit::common::Path::Path ( const Path other)

使用另一个路径对象的构造函数。

参数
[in]other另一个路径对象。

成员函数说明

◆ AppendEllipse()

bool foxit::common::Path::AppendEllipse ( const RectF rect)

向当前路径的末尾添加椭圆图形。

参数
[in]rect椭圆图形的外接矩形。
返回
true 表示成功,false 表示失败。

◆ AppendRect()

bool foxit::common::Path::AppendRect ( const RectF rect)

向当前路径的末尾添加矩形图形。

参数
[in]rect指定矩形图形的矩形。
返回
true 表示成功,false 表示失败。

◆ Clear()

void foxit::common::Path::Clear ( )

清除所有点。

返回
无。

◆ CloseFigure()

bool foxit::common::Path::CloseFigure ( )

关闭当前图形(也是当前路径中的最后一个图形)。

关闭当前图形时,最后一点的类型可能会改变:

返回
true 表示成功,false 表示失败。

◆ CubicBezierTo()

bool foxit::common::Path::CubicBezierTo ( const PointF point1,
const PointF point2,
const PointF point3 
)

通过三个点向当前图形的末尾添加三次贝塞尔样条: 两个控制点和一个目标点。

如果此函数成功,参数 point3 将成为新的"当前点"。

参数
[in]point1新点作为三次贝塞尔的第一个控制点,在PDF坐标系中。
[in]point2新点作为三次贝塞尔的第二个控制点,在PDF坐标系中。
[in]point3新点作为三次贝塞尔的目标点,在PDF坐标系中。
返回
true 表示成功,false 表示失败。

◆ GetPoint()

PointF foxit::common::Path::GetPoint ( int  index)

获取由索引指定的点。

参数
[in]index点的索引。有效范围:0到(count-1)。 count由函数 Path::GetPointCount 返回。
返回
指定的点。

◆ GetPointCount()

int foxit::common::Path::GetPointCount ( )

获取点的数量。

返回
点的数量。

◆ GetPointType()

PointType foxit::common::Path::GetPointType ( int  index)

获取由索引指定的点的类型。

参数
[in]index点的索引。有效范围:0到(count-1)。 count由函数 Path::GetPointCount 返回。
返回
指定点的类型。请参考从 Path::e_TypeMoveTo 开始的值, 这将是这些值中的一个。

◆ IncreasePointCount()

void foxit::common::Path::IncreasePointCount ( int  count)

增加点数量并为这些新点准备足够的内存。

此函数将为给定的点数量分配更多内存,并默认使用点(0, 0)和类型 Path::e_TypeMoveTo 初始化这些新点。 成功调用此函数后,用户可以使用函数 Path::SetPoint 来 设置这些新点。

参数
[in]count新的点数量。它不应为负数。
返回
无。

◆ IsEmpty()

bool foxit::common::Path::IsEmpty ( ) const

检查当前对象是否为空。

当当前对象为空时,意味着当前对象无用。

返回
true 表示当前对象为空,false 表示不为空。

◆ LineTo()

bool foxit::common::Path::LineTo ( const PointF point)

向当前图形的末尾添加一个点,并从当前点到新点绘制一条线。

如果此函数成功,新点将成为新的"当前点"。

参数
[in]point新点,在PDF坐标系中。
返回
true 表示成功,false 表示失败。

◆ MoveTo()

bool foxit::common::Path::MoveTo ( const PointF point)

向当前路径的末尾添加一个点,以开始新的图形。

如果此函数成功,新点将成为新的"当前点",新图形将 成为新的"当前图形"。

参数
[in]point新点,在PDF坐标系中。
返回
true 表示成功,false 表示失败。

◆ operator !=()

bool foxit::common::Path::operator != ( const Path other) const

不相等操作符。

参数
[in]other另一个路径对象。此函数将检查当前对象是否不等于此对象。
返回
true 表示不相等,false 表示相等。

◆ operator=()

Path& foxit::common::Path::operator= ( const Path other)

赋值操作符。

参数
[in]other另一个路径对象,其值将被赋给当前对象。
返回
对当前对象本身的引用。

◆ operator==()

bool foxit::common::Path::operator== ( const Path other) const

相等操作符。

参数
[in]other另一个路径对象。此函数将检查当前对象是否等于此对象。
返回
true 表示相等,false 表示不相等。

◆ RemovePoint()

bool foxit::common::Path::RemovePoint ( int  index)

移除由索引指定的点。

参数
[in]index要移除的点的索引。有效范围:0到(count-1)。 count由函数 Path::GetPointCount 返回。
返回
true 表示成功,false 表示失败。

◆ SetPoint()

bool foxit::common::Path::SetPoint ( int  index,
const PointF point,
PointType  type 
)

更改由索引指定的点的值和类型。

参数
[in]index点的索引。有效范围:0到(count-1)。 count由函数 Path::GetPointCount 返回。
[in]point要设置的新点,在PDF坐标系中。
[in]type用于设置新点的类型。请参考从 Path::e_TypeMoveTo 开始的值,应该是这些值中的一个。
返回
true 表示成功,false 表示失败。

◆ Transform()

void foxit::common::Path::Transform ( const Matrix matrix)

使用给定矩阵变换当前路径中的所有点。

参数
[in]matrix用于变换的矩阵。
返回
无。