Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit::pdf::SnapPointMgr Class Reference
Inheritance diagram for foxit::pdf::SnapPointMgr:

## Public Types
enum | SnapPointFlags { e_FlagEndpoint = 0x0001, e_FlagMidpoint = 0x0002, e_FlagIntersectionPoint = 0x0004, e_FlagNearestPoint = 0x0008 }
| Enumeration for snapping point flags which are used to specify what kind of point in a path is to be snapped. More...

## Public Member Functions
| SnapPointMgr (const PDFPage &page)
| Constructor, from a parsed PDF page object. More...
| SnapPointMgr (const SnapPointMgr &other)
| Constructor, with another snap point manager object. More...
| ~SnapPointMgr ()
| Destructor.
SnappedPoint | GetSnappedPointAtPos (const PointF &position, foxit::uint32 flags)
| Get the snapped point information at/around a specified position in PDF coordinate system. More...
bool | IsEmpty () const
| Check whether current object is empty or not. More...
bool | operator!= (const SnapPointMgr &other) const
| Not equal operator. More...
SnapPointMgr & | operator= (const SnapPointMgr &other)
| Assign operator. More...
bool | operator== (const SnapPointMgr &other) const
| Equal operator. More...
void | Reload ()
| Reload current manager. More...
Public Member Functions inherited from foxit::Base
FS_HANDLE | Handle () const
| Get the handle of current object. More...

## Detailed Description

This class represents a manager for snapping point. This class can be used to snap point in a path with specified snapping flags.

## Member Enumeration Documentation

## ◆ SnapPointFlags

enum foxit::pdf::SnapPointMgr::SnapPointFlags

Enumeration for snapping point flags which are used to specify what kind of point in a path is to be snapped.

Values of this enumeration can be used alone or in combination.

Enumerator
e_FlagEndpoint | If set, that means to get the endpoint of a path.
e_FlagMidpoint | If set, that means to get the midpoint for two endpoints of a path.
e_FlagIntersectionPoint | If set, that means to get the intersection of two intersecting paths.
e_FlagNearestPoint | If set, that means to get the nearest point (which is in a path) to the specified point.

## Constructor & Destructor Documentation

## ◆ SnapPointMgr() [1/2]

foxit::pdf::SnapPointMgr::SnapPointMgr | ( | const PDFPage & | page | ) |
| explicit

Constructor, from a parsed PDF page object.

Parameters

  [in] | page | A valid PDF page object. This page should has been parsed.

## ◆ SnapPointMgr() [2/2]

foxit::pdf::SnapPointMgr::SnapPointMgr | ( | const SnapPointMgr & | other | ) |

Constructor, with another snap point manager object.

Parameters

  [in] | other | Another snap point manager object.

## Member Function Documentation

## ◆ GetSnappedPointAtPos()

SnappedPoint foxit::pdf::SnapPointMgr::GetSnappedPointAtPos | ( | const PointF & | position,
|  | foxit::uint32 | flags
| ) |  |

Get the snapped point information at/around a specified position in PDF coordinate system.

Parameters

  [in] | position | A specified position, in PDF coordinate system.
  [in] | flags | Flags for snapping point. Please refer to values starting from SnapPointMgr::e_FlagEndpoint and this should be one or a combination of these values.

Returns
  Information for a snapped point. If the return value of function SnappedPoint::IsEmpty for the returned snapped point object is true, that means no suitable point can be snapped.

## ◆ IsEmpty()

bool foxit::pdf::SnapPointMgr::IsEmpty | ( |  | ) | const

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.

## ◆ operator!=()

bool foxit::pdf::SnapPointMgr::operator!= | ( | const SnapPointMgr & | other | ) | const

Not equal operator.

Parameters

  [in] | other | Another snap point manager object. This function will check if current object is not equal to this one.

Returns
  true means not equal, while false means equal.

## ◆ operator=()

SnapPointMgr& foxit::pdf::SnapPointMgr::operator= | ( | const SnapPointMgr & | other | ) |

Assign operator.

Parameters

  [in] | other | Another snap point manager object, whose value would be assigned to current object.

Returns
  Reference to current object itself.

## ◆ operator==()

bool foxit::pdf::SnapPointMgr::operator== | ( | const SnapPointMgr & | other | ) | const

Equal operator.

Parameters

  [in] | other | Another snap point manager object. This function will check if current object is equal to this one.

Returns
  true means equal, while false means not equal.

## ◆ Reload()

void foxit::pdf::SnapPointMgr::Reload | ( |  | ) |

Reload current manager.

This function should be called after any path in related PDF page has been modified.

Returns
  None.