Foxit PDF RDK

Public Member Functions | Static Public Attributes | List of all members
Path Class Reference

## Public Member Functions
| AppendEllipse (rect)
| Add an ellipse figure to the end of current path. More...
| AppendRect (rect)
| Add a rectangle figure to the end of current path. More...
| Clear ()
| Clear all points. More...
| CloseFigure ()
| Close current figure (which is also the last figure in current path). More...
| constructor ()
| Constructor.
| CubicBezierTo (point1, point2, point3)
| Add a cubic bezier spline to the end of current figure, by three points: two control points and one target point. More...
| GetPoint (index)
| Get a point specified by index. More...
| GetPointCount ()
| Get the count of points. More...
| GetPointType (index)
| Get the type of a point specified by index. More...
| IncreasePointCount (count)
| Increase the point count and prepare adequate memory for these new points. More...
| IsEmpty ()
| Check whether current object is empty or not. More...
| LineTo (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...
| MoveTo (point)
| Add a point to the end of current path, to start a new figure. More...
| RemovePoint (index)
| Remove a point specified by index. More...
| SetPoint (index, point, type)
| Change the value and type of a point specified by index. More...
| Transform (matrix)
| Transform all points in current path with a given matrix. More...

## Static Public Attributes
static | e_TypeBezierTo
| Indicates that this point is a control point or ending point for a Bezier spline.
static | 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.
static | e_TypeLineTo
| Indicates that a line is drawn from the previous point to this point.
static | 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.
static | e_TypeMoveTo
| Enumeration for point type in path. More...

## Detailed Description

This class represents a path which contains one or more figures.

## Member Function Documentation

## ◆ AppendEllipse()

Path.AppendEllipse | ( | rect |  | ) |

Add an ellipse figure to the end of current path.

Parameters

  [in] | rect | The enclosing rectangle of an ellipse figure.

Returns
  true means success, while false means failure.

## ◆ AppendRect()

Path.AppendRect | ( | rect |  | ) |

Add a rectangle figure to the end of current path.

Parameters

  [in] | rect | A rectangle which specifies a rectangle figure.

Returns
  true means success, while false means failure.

## ◆ Clear()

Path.Clear | ( |  | ) |

Clear all points.

Returns
  None.

## ◆ CloseFigure()

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:

- If the last point's type is Path.e_TypeMoveTo, that means the last figure just has one point and cannot be closed and current function will return false.
- If the last point's type is Path.e_TypeLineTo, the type will be changed to Path.e_TypeLineToCloseFigure.
- If the last point's type is Path.e_TypeLineTo, the type will be changed to Path.e_TypeBezierToCloseFigure.
- If the last point's type is already Path.e_TypeLineToCloseFigure or Path.e_TypeBezierToCloseFigure, that means the last figure has been closed. The type will not be changed and function will still return true.

Returns
  true means success, while false means failure.

## ◆ CubicBezierTo()

Path.CubicBezierTo | ( | point1 | ,
|  | point2 | ,
|  | 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".

Parameters

  [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.

Returns
  true means success, while false means failure.

## ◆ GetPoint()

Path.GetPoint | ( | index |  | ) |

Get a point specified by index.

Parameters

  [in] | index | The index of the point. Valid range: 0 to (count-1). count is returned by function Path.GetPointCount.

Returns
  The specified point.

## ◆ GetPointCount()

Path.GetPointCount | ( |  | ) |

Get the count of points.

Returns
  The count of points.

## ◆ GetPointType()

Path.GetPointType | ( | index |  | ) |

Get the type of a point specified by index.

Parameters

  [in] | index | The index of the point. Valid range: 0 to (count-1). count is returned by function Path.GetPointCount.

Returns
  The type of specified point. Please refer to values starting from Path.e_TypeMoveTo and this would be one of these values.

## ◆ IncreasePointCount()

Path.IncreasePointCount | ( | count |  | ) |

Increase the point count and prepare adequate memory for these new points.

This function will allocate more memory for given point count and initialize these new points with point (0, 0) and type Path.e_TypeMoveTo by default. After calling this function successfully, user can use function Path.SetPoint to set these new points.

Parameters

  [in] | count | The new point count. It should not be negative.

Returns
  None.

## ◆ IsEmpty()

Path.IsEmpty | ( |  | ) |

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

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

## ◆ LineTo()

Path.LineTo | ( | 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".

Parameters

  [in] | point | New point, in PDF coordinate system.

Returns
  true means success, while false means failure.

## ◆ MoveTo()

Path.MoveTo | ( | 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".

Parameters

  [in] | point | New point, in PDF coordinate system.

Returns
  true means success, while false means failure.

## ◆ RemovePoint()

Path.RemovePoint | ( | index |  | ) |

Remove a point specified by index.

Parameters

  [in] | index | The index of the point to be removed. Valid range: 0 to (count-1). count is returned by function Path.GetPointCount.

Returns
  true means success, while false means failure.

## ◆ SetPoint()

Path.SetPoint | ( | index | ,
|  | point | ,
|  | type |
| ) |  |

Change the value and type of a point specified by index.

Parameters

  [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.

Returns
  true means success, while false means failure.

## ◆ Transform()

Path.Transform | ( | matrix |  | ) |

Transform all points in current path with a given matrix.

Parameters

  [in] | matrix | A matrix used for transforming.

Returns
  None.

## Member Data Documentation

## ◆ e_TypeMoveTo

Path.e_TypeMoveTo
| static

Enumeration for point type in path.

Values of this enumeration should be used alone.

Indicates that the point is the first point of a figure.