Public Types | |
enum | PointType { e_TypeMoveTo = 1, e_TypeLineTo = 2, e_TypeLineToCloseFigure = 3, e_TypeBezierTo = 4, e_TypeBezierToCloseFigure = 5 } |
Enumeration for point type in path. More... | |
Public Member Functions | |
Path () | |
Constructor. | |
Path (const Path &other) | |
Constructor, with another Path object. More... | |
~Path () | |
Destructor. | |
bool | AppendEllipse (const RectF &rect) |
Add an ellipse figure to the end of current path. More... | |
bool | AppendRect (const RectF &rect) |
Add a rectangle figure to the end of current path. More... | |
void | Clear () |
Clear all points. More... | |
bool | CloseFigure () |
Close current figure (which is also the last figure in current path). More... | |
bool | CubicBezierTo (const PointF &point1, const PointF &point2, const PointF &point3) |
Add a cubic bezier spline to the end of current figure, by three points: two control points and one target point. More... | |
PointF | GetPoint (int index) |
Get a point specified by index. More... | |
int | GetPointCount () |
Get the count of points. More... | |
PointType | GetPointType (int index) |
Get the type of a point specified by index. More... | |
bool | IsEmpty () const |
Check whether current object is empty or not. More... | |
bool | LineTo (const PointF &point) |
Add a point to the end of current figure, and a line is to be drawn from current point to the new point. More... | |
bool | MoveTo (const PointF &point) |
Add a point to the end of current path, to start a new figure. More... | |
bool | operator!= (const Path &other) const |
Not equal operator. More... | |
Path & | operator= (const Path &other) |
Assign operator. More... | |
bool | operator== (const Path &other) const |
Equal operator. More... | |
bool | RemovePoint (int index) |
Remove a point specified by index. More... | |
bool | SetPoint (int index, const PointF &point, PointType type) |
Change the value and type of a point specified by index. More... | |
void | Transform (const Matrix &matrix) |
Transform all points in current path with a given matrix. More... | |
![]() | |
FS_HANDLE | Handle () const |
Get the handle of current object. More... | |
This class represents a path which contains one or more figures.
Enumeration for point type in path.
Values of this enumeration should be used alone.
Enumerator | |
---|---|
e_TypeMoveTo | Indicates that the point is the first point of a figure. |
e_TypeLineTo | Indicates that a line is drawn from the previous point to this point. |
e_TypeLineToCloseFigure | Indicates that a line is drawn from the previous point to this point, and this point will also be connected to the nearest Path::e_TypeMoveTo point before this point, in order to close current figure. |
e_TypeBezierTo | Indicates that this point is a control point or ending point for a Bezier spline. |
e_TypeBezierToCloseFigure | Indicates that this point is the ending point for a Bezier spline, and this point will also be connected to the nearest Path::e_TypeMoveTo point before this point, in order to close current figure. |
foxit::common::Path::Path | ( | const Path & | other | ) |
bool foxit::common::Path::AppendEllipse | ( | const RectF & | rect | ) |
Add an ellipse figure to the end of current path.
[in] | rect | The enclosing rectangle of an ellipse figure. |
bool foxit::common::Path::AppendRect | ( | const RectF & | rect | ) |
Add a rectangle figure to the end of current path.
[in] | rect | A rectangle which specifies a rectangle figure. |
void foxit::common::Path::Clear | ( | ) |
Clear all points.
bool foxit::common::Path::CloseFigure | ( | ) |
Close current figure (which is also the last figure in current path).
When closing current figure, the last point's type may be changed:
bool foxit::common::Path::CubicBezierTo | ( | const PointF & | point1, |
const PointF & | point2, | ||
const PointF & | point3 | ||
) |
Add a cubic bezier spline to the end of current figure, by three points: two control points and one target point.
If this function succeeds, parameter point3 will become the new "current point".
[in] | point1 | New point as the first control point for cubic bezier, in PDF coordinate system. |
[in] | point2 | New point as the second control point for cubic bezier, in PDF coordinate system. |
[in] | point3 | New point as target point for cubic bezier, in PDF coordinate system. |
PointF foxit::common::Path::GetPoint | ( | int | index | ) |
Get a point specified by index.
[in] | index | The index of the point. Valid range: 0 to (count-1). count is returned by function Path::GetPointCount. |
int foxit::common::Path::GetPointCount | ( | ) |
Get the count of points.
PointType foxit::common::Path::GetPointType | ( | int | index | ) |
Get the type of a point specified by index.
[in] | index | The index of the point. Valid range: 0 to (count-1). count is returned by function Path::GetPointCount. |
bool foxit::common::Path::IsEmpty | ( | ) | const |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
bool foxit::common::Path::LineTo | ( | const PointF & | point | ) |
Add a point to the end of current figure, and a line is to be drawn from current point to the new point.
If this function succeeds, the new point will become the new "current point".
[in] | point | New point, in PDF coordinate system. |
bool foxit::common::Path::MoveTo | ( | const PointF & | point | ) |
Add a point to the end of current path, to start a new figure.
If this function succeeds, the new point will become the new "current point", and the new figure will become the new "current figure".
[in] | point | New point, in PDF coordinate system. |
bool foxit::common::Path::operator!= | ( | const Path & | other | ) | const |
Not equal operator.
[in] | other | Another Path object. This function will check if current object is not equal to this one. |
Assign operator.
[in] | other | Another Path object, whose value would be assigned to current object. |
bool foxit::common::Path::operator== | ( | const Path & | other | ) | const |
Equal operator.
[in] | other | Another Path object. This function will check if current object is equal to this one. |
bool foxit::common::Path::RemovePoint | ( | int | index | ) |
Remove a point specified by index.
[in] | index | The index of the point to be removed. Valid range: 0 to (count-1). count is returned by function Path::GetPointCount. |
Change the value and type of a point specified by index.
[in] | index | The index of the point. Valid range: 0 to (count-1). count is returned by function Path::GetPointCount. |
[in] | point | The new point to set, in PDF coordinate system. |
[in] | type | The type used to set to the new point. Please refer to values starting from Path::e_TypeMoveTo and this should be one of these values. |
void foxit::common::Path::Transform | ( | const Matrix & | matrix | ) |
Transform all points in current path with a given matrix.
[in] | matrix | A matrix used for transforming. |